···57 </listitem>
58 <listitem>
59 <para>
000000000060 Pantheon desktop has been updated to version 6. Due to changes
61 of screen locker, if locking doesn’t work for you, please try
62 <literal>gsettings set org.gnome.desktop.lockdown disable-lock-screen false</literal>.
···57 </listitem>
58 <listitem>
59 <para>
60+ bash now defaults to major version 5.
61+ </para>
62+ </listitem>
63+ <listitem>
64+ <para>
65+ Systemd was updated to version 249 (from 247).
66+ </para>
67+ </listitem>
68+ <listitem>
69+ <para>
70 Pantheon desktop has been updated to version 6. Due to changes
71 of screen locker, if locking doesn’t work for you, please try
72 <literal>gsettings set org.gnome.desktop.lockdown disable-lock-screen false</literal>.
+65-53
nixos/doc/manual/release-notes/rl-2111.section.md
···20 This allows activation scripts to output what they would change if the activation was really run.
21 The users/modules activation script supports this and outputs some of is actions.
22000023- Pantheon desktop has been updated to version 6. Due to changes of screen locker, if locking doesn't work for you, please try `gsettings set org.gnome.desktop.lockdown disable-lock-screen false`.
2425- `kubernetes-helm` now defaults to 3.7.0, which introduced some breaking changes to the experimental OCI manifest format. See [HIP 6](https://github.com/helm/community/blob/main/hips/hip-0006.md) for more details.
···29- [btrbk](https://digint.ch/btrbk/index.html), a backup tool for btrfs subvolumes, taking advantage of btrfs specific capabilities to create atomic snapshots and transfer them incrementally to your backup locations. Available as [services.btrbk](options.html#opt-services.brtbk.instances).
3031- [clipcat](https://github.com/xrelkd/clipcat/), an X11 clipboard manager written in Rust. Available at [services.clipcat](options.html#o
32-pt-services.clipcat.enable).
3334- [geoipupdate](https://github.com/maxmind/geoipupdate), a GeoIP database updater from MaxMind. Available as [services.geoipupdate](options.html#opt-services.geoipupdate.enable).
35···67 Available as [isso](#opt-services.isso.enable)
6869- [navidrome](https://www.navidrome.org/), a personal music streaming server with
70-subsonic-compatible api. Available as [navidrome](#opt-services.navidrome.enable).
7172- [fluidd](https://docs.fluidd.xyz/), a Klipper web interface for managing 3d printers using moonraker. Available as [fluidd](#opt-services.fluidd.enable).
73···103 and advises all users to use `paperless-ng` instead.
104105 Users can use the `services.paperless-ng` module as a replacement while noting the following incompatibilities:
106- - `services.paperless.ocrLanguages` has no replacement. Users should migrate to [`services.paperless-ng.extraConfig`](options.html#opt-services.paperless-ng.extraConfig) instead:
107- ```nix
108- {
109- services.paperless-ng.extraConfig = {
110- # Provide languages as ISO 639-2 codes
111- # separated by a plus (+) sign.
112- # https://en.wikipedia.org/wiki/List_of_ISO_639-2_codes
113- PAPERLESS_OCR_LANGUAGE = "deu+eng+jpn"; # German & English & Japanse
114- };
115- }
116- ```
117118- - If you previously specified `PAPERLESS_CONSUME_MAIL_*` settings in
119- `services.paperless.extraConfig` you should remove those options now. You
120- now *must* define those settings in the admin interface of paperless-ng.
121122- - Option `services.paperless.manage` no longer exists.
123- Use the script at `${services.paperless-ng.dataDir}/paperless-ng-manage` instead.
124- Note that this script only exists after the `paperless-ng` service has been
125- started at least once.
000000126127- - After switching to the new system configuration you should run the Django
128- management command to reindex your documents and optionally create a user,
129- if you don't have one already.
130131- To do so, enter the data directory (the value of
132- `services.paperless-ng.dataDir`, `/var/lib/paperless` by default), switch
133- to the paperless user and execute the management command like below:
134- ```
135- $ cd /var/lib/paperless
136- $ su paperless -s /bin/sh
137- $ ./paperless-ng-manage document_index reindex
138- # if not already done create a user account, paperless-ng requires a login
139- $ ./paperless-ng-manage createsuperuser
140- Username (leave blank to use 'paperless'): my-user-name
141- Email address: me@example.com
142- Password: **********
143- Password (again): **********
144- Superuser created successfully.
145- ```
0000000000146147- The `staticjinja` package has been upgraded from 1.0.4 to 4.1.0
148···239* The `bitwarden_rs` packages and modules were renamed to `vaultwarden`
240 [following upstream](https://github.com/dani-garcia/vaultwarden/discussions/1642). More specifically,
241242- * `pkgs.bitwarden_rs`, `pkgs.bitwarden_rs-sqlite`, `pkgs.bitwarden_rs-mysql` and
243 `pkgs.bitwarden_rs-postgresql` were renamed to `pkgs.vaultwarden`, `pkgs.vaultwarden-sqlite`,
244 `pkgs.vaultwarden-mysql` and `pkgs.vaultwarden-postgresql`, respectively.
245- * Old names are preserved as aliases for backwards compatibility, but may be removed in the future.
246- * The `bitwarden_rs` executable was also renamed to `vaultwarden` in all packages.
247248- * `pkgs.bitwarden_rs-vault` was renamed to `pkgs.vaultwarden-vault`.
249- * `pkgs.bitwarden_rs-vault` is preserved as an alias for backwards compatibility, but may be removed in the future.
250- * The static files were moved from `/usr/share/bitwarden_rs` to `/usr/share/vaultwarden`.
251252- * The `services.bitwarden_rs` config module was renamed to `services.vaultwarden`.
253- * `services.bitwarden_rs` is preserved as an alias for backwards compatibility, but may be removed in the future.
000000254255- * `systemd.services.bitwarden_rs`, `systemd.services.backup-bitwarden_rs` and `systemd.timers.backup-bitwarden_rs`
256 were renamed to `systemd.services.vaultwarden`, `systemd.services.backup-vaultwarden` and
257 `systemd.timers.backup-vaultwarden`, respectively.
258- * Old names are preserved as aliases for backwards compatibility, but may be removed in the future.
0259260- * `users.users.bitwarden_rs` and `users.groups.bitwarden_rs` were renamed to `users.users.vaultwarden` and
261 `users.groups.vaultwarden`, respectively.
262263- * The data directory remains located at `/var/lib/bitwarden_rs`, for backwards compatibility.
264265- `yggdrasil` was upgraded to a new major release with breaking changes, see [upstream changelog](https://github.com/yggdrasil-network/yggdrasil-go/releases/tag/v0.4.0).
266···273- `tt-rss` was upgraded to the commit on 2021-06-21, which has breaking changes. If you use `services.tt-rss.extraConfig` you should migrate to the `putenv`-style configuration. See [this Discourse post](https://community.tt-rss.org/t/rip-config-php-hello-classes-config-php/4337) in the tt-rss forums for more details.
274275- The following Visual Studio Code extensions were renamed to keep the naming convention uniform.
0276 - `bbenoist.Nix` -> `bbenoist.nix`
277 - `CoenraadS.bracket-pair-colorizer` -> `coenraads.bracket-pair-colorizer`
278 - `golang.Go` -> `golang.go`
···292- The `yambar` package has been split into `yambar` and `yambar-wayland`, corresponding to the xorg and wayland backend respectively. Please switch to `yambar-wayland` if you are on wayland.
293294- The `services.minio` module gained an additional option `consoleAddress`, that
295-configures the address and port the web UI is listening, it defaults to `:9001`.
296-To be able to access the web UI this port needs to be opened in the firewall.
297298- The `varnish` package was upgraded from 6.3.x to 6.5.x. `varnish60` for the last LTS release is also still available.
299300-- The `kubernetes` package was upgraded to 1.22. The `kubernetes.apiserver.kubeletHttps` option was removed and HTTPS is always used.
301302- The attribute `linuxPackages_latest_hardened` was dropped because the hardened patches
303 lag behind the upstream kernel which made version bumps harder. If you want to use
···20 This allows activation scripts to output what they would change if the activation was really run.
21 The users/modules activation script supports this and outputs some of is actions.
2223+- bash now defaults to major version 5.
24+25+- Systemd was updated to version 249 (from 247).
26+27- Pantheon desktop has been updated to version 6. Due to changes of screen locker, if locking doesn't work for you, please try `gsettings set org.gnome.desktop.lockdown disable-lock-screen false`.
2829- `kubernetes-helm` now defaults to 3.7.0, which introduced some breaking changes to the experimental OCI manifest format. See [HIP 6](https://github.com/helm/community/blob/main/hips/hip-0006.md) for more details.
···33- [btrbk](https://digint.ch/btrbk/index.html), a backup tool for btrfs subvolumes, taking advantage of btrfs specific capabilities to create atomic snapshots and transfer them incrementally to your backup locations. Available as [services.btrbk](options.html#opt-services.brtbk.instances).
3435- [clipcat](https://github.com/xrelkd/clipcat/), an X11 clipboard manager written in Rust. Available at [services.clipcat](options.html#o
36+ pt-services.clipcat.enable).
3738- [geoipupdate](https://github.com/maxmind/geoipupdate), a GeoIP database updater from MaxMind. Available as [services.geoipupdate](options.html#opt-services.geoipupdate.enable).
39···71 Available as [isso](#opt-services.isso.enable)
7273- [navidrome](https://www.navidrome.org/), a personal music streaming server with
74+ subsonic-compatible api. Available as [navidrome](#opt-services.navidrome.enable).
7576- [fluidd](https://docs.fluidd.xyz/), a Klipper web interface for managing 3d printers using moonraker. Available as [fluidd](#opt-services.fluidd.enable).
77···107 and advises all users to use `paperless-ng` instead.
108109 Users can use the `services.paperless-ng` module as a replacement while noting the following incompatibilities:
00000000000110111+ - `services.paperless.ocrLanguages` has no replacement. Users should migrate to [`services.paperless-ng.extraConfig`](options.html#opt-services.paperless-ng.extraConfig) instead:
00112113+ ```nix
114+ {
115+ services.paperless-ng.extraConfig = {
116+ # Provide languages as ISO 639-2 codes
117+ # separated by a plus (+) sign.
118+ # https://en.wikipedia.org/wiki/List_of_ISO_639-2_codes
119+ PAPERLESS_OCR_LANGUAGE = "deu+eng+jpn"; # German & English & Japanse
120+ };
121+ }
122+ ```
123124+ - If you previously specified `PAPERLESS_CONSUME_MAIL_*` settings in
125+ `services.paperless.extraConfig` you should remove those options now. You
126+ now _must_ define those settings in the admin interface of paperless-ng.
127128+ - Option `services.paperless.manage` no longer exists.
129+ Use the script at `${services.paperless-ng.dataDir}/paperless-ng-manage` instead.
130+ Note that this script only exists after the `paperless-ng` service has been
131+ started at least once.
132+133+ - After switching to the new system configuration you should run the Django
134+ management command to reindex your documents and optionally create a user,
135+ if you don't have one already.
136+137+ To do so, enter the data directory (the value of
138+ `services.paperless-ng.dataDir`, `/var/lib/paperless` by default), switch
139+ to the paperless user and execute the management command like below:
140+141+ ```
142+ $ cd /var/lib/paperless
143+ $ su paperless -s /bin/sh
144+ $ ./paperless-ng-manage document_index reindex
145+ # if not already done create a user account, paperless-ng requires a login
146+ $ ./paperless-ng-manage createsuperuser
147+ Username (leave blank to use 'paperless'): my-user-name
148+ Email address: me@example.com
149+ Password: **********
150+ Password (again): **********
151+ Superuser created successfully.
152+ ```
153154- The `staticjinja` package has been upgraded from 1.0.4 to 4.1.0
155···246* The `bitwarden_rs` packages and modules were renamed to `vaultwarden`
247 [following upstream](https://github.com/dani-garcia/vaultwarden/discussions/1642). More specifically,
248249+ - `pkgs.bitwarden_rs`, `pkgs.bitwarden_rs-sqlite`, `pkgs.bitwarden_rs-mysql` and
250 `pkgs.bitwarden_rs-postgresql` were renamed to `pkgs.vaultwarden`, `pkgs.vaultwarden-sqlite`,
251 `pkgs.vaultwarden-mysql` and `pkgs.vaultwarden-postgresql`, respectively.
00252253+ - Old names are preserved as aliases for backwards compatibility, but may be removed in the future.
254+ - The `bitwarden_rs` executable was also renamed to `vaultwarden` in all packages.
0255256+ - `pkgs.bitwarden_rs-vault` was renamed to `pkgs.vaultwarden-vault`.
257+258+ - `pkgs.bitwarden_rs-vault` is preserved as an alias for backwards compatibility, but may be removed in the future.
259+ - The static files were moved from `/usr/share/bitwarden_rs` to `/usr/share/vaultwarden`.
260+261+ - The `services.bitwarden_rs` config module was renamed to `services.vaultwarden`.
262+263+ - `services.bitwarden_rs` is preserved as an alias for backwards compatibility, but may be removed in the future.
264265+ - `systemd.services.bitwarden_rs`, `systemd.services.backup-bitwarden_rs` and `systemd.timers.backup-bitwarden_rs`
266 were renamed to `systemd.services.vaultwarden`, `systemd.services.backup-vaultwarden` and
267 `systemd.timers.backup-vaultwarden`, respectively.
268+269+ - Old names are preserved as aliases for backwards compatibility, but may be removed in the future.
270271+ - `users.users.bitwarden_rs` and `users.groups.bitwarden_rs` were renamed to `users.users.vaultwarden` and
272 `users.groups.vaultwarden`, respectively.
273274+ - The data directory remains located at `/var/lib/bitwarden_rs`, for backwards compatibility.
275276- `yggdrasil` was upgraded to a new major release with breaking changes, see [upstream changelog](https://github.com/yggdrasil-network/yggdrasil-go/releases/tag/v0.4.0).
277···284- `tt-rss` was upgraded to the commit on 2021-06-21, which has breaking changes. If you use `services.tt-rss.extraConfig` you should migrate to the `putenv`-style configuration. See [this Discourse post](https://community.tt-rss.org/t/rip-config-php-hello-classes-config-php/4337) in the tt-rss forums for more details.
285286- The following Visual Studio Code extensions were renamed to keep the naming convention uniform.
287+288 - `bbenoist.Nix` -> `bbenoist.nix`
289 - `CoenraadS.bracket-pair-colorizer` -> `coenraads.bracket-pair-colorizer`
290 - `golang.Go` -> `golang.go`
···304- The `yambar` package has been split into `yambar` and `yambar-wayland`, corresponding to the xorg and wayland backend respectively. Please switch to `yambar-wayland` if you are on wayland.
305306- The `services.minio` module gained an additional option `consoleAddress`, that
307+ configures the address and port the web UI is listening, it defaults to `:9001`.
308+ To be able to access the web UI this port needs to be opened in the firewall.
309310- The `varnish` package was upgraded from 6.3.x to 6.5.x. `varnish60` for the last LTS release is also still available.
311312+- The `kubernetes` package was upgraded to 1.22. The `kubernetes.apiserver.kubeletHttps` option was removed and HTTPS is always used.
313314- The attribute `linuxPackages_latest_hardened` was dropped because the hardened patches
315 lag behind the upstream kernel which made version bumps harder. If you want to use
···65 # Fix references to gettext introduced by ./git-sh-i18n.patch
66 substituteInPlace git-sh-i18n.sh \
67 --subst-var-by gettext ${gettext}
00068 '';
6970 nativeBuildInputs = [ gettext perlPackages.perl makeWrapper ]
···318319 # Flaky tests:
320 disable_test t5319-multi-pack-index
0321322 ${lib.optionalString (!perlSupport) ''
323 # request-pull is a Bash script that invokes Perl, so it is not available
···65 # Fix references to gettext introduced by ./git-sh-i18n.patch
66 substituteInPlace git-sh-i18n.sh \
67 --subst-var-by gettext ${gettext}
68+69+ # ensure we are using the correct shell when executing the test scripts
70+ patchShebangs t/*.sh
71 '';
7273 nativeBuildInputs = [ gettext perlPackages.perl makeWrapper ]
···321322 # Flaky tests:
323 disable_test t5319-multi-pack-index
324+ disable_test t6421-merge-partial-clone
325326 ${lib.optionalString (!perlSupport) ''
327 # request-pull is a Bash script that invokes Perl, so it is not available
···9 echo "gzipping man pages under $dir/share/man/"
1011 # Compress all uncompressed manpages. Don't follow symlinks, etc.
12- find "$dir"/share/man/ -type f -a '!' -regex '.*\.\(bz2\|gz\)$' -print0 \
13 | while IFS= read -r -d $'\0' f
14 do
15 if gzip -c -n "$f" > "$f".gz; then
···20 done
2122 # Point symlinks to compressed manpages.
23- find "$dir"/share/man/ -type l -a '!' -regex '.*\.\(bz2\|gz\)$' -print0 \
24 | sort -z \
25 | while IFS= read -r -d $'\0' f
26 do
···9 echo "gzipping man pages under $dir/share/man/"
1011 # Compress all uncompressed manpages. Don't follow symlinks, etc.
12+ find "$dir"/share/man/ -type f -a '!' -regex '.*\.\(bz2\|gz\|xz\)$' -print0 \
13 | while IFS= read -r -d $'\0' f
14 do
15 if gzip -c -n "$f" > "$f".gz; then
···20 done
2122 # Point symlinks to compressed manpages.
23+ find "$dir"/share/man/ -type l -a '!' -regex '.*\.\(bz2\|gz\|xz\)$' -print0 \
24 | sort -z \
25 | while IFS= read -r -d $'\0' f
26 do
+1-1
pkgs/build-support/setup-hooks/move-docs.sh
···67_moveToShare() {
8 forceShare=${forceShare:=man doc info}
9- if [ -z "$forceShare" -o -z "$out" ]; then return; fi
1011 for d in $forceShare; do
12 if [ -d "$out/$d" ]; then
···67_moveToShare() {
8 forceShare=${forceShare:=man doc info}
9+ if [[ -z "$out" ]]; then return; fi
1011 for d in $forceShare; do
12 if [ -d "$out/$d" ]; then
···1-# New rust versions should first go to staging.
2-# Things to check after updating:
3-# 1. Rustc should produce rust binaries on x86_64-linux, aarch64-linux and x86_64-darwin:
4-# i.e. nix-shell -p fd or @GrahamcOfBorg build fd on github
5-# This testing can be also done by other volunteers as part of the pull
6-# request review, in case platforms cannot be covered.
7-# 2. The LLVM version used for building should match with rust upstream.
8-# Check the version number in the src/llvm-project git submodule in:
9-# https://github.com/rust-lang/rust/blob/<version-tag>/.gitmodules
10-# 3. Firefox and Thunderbird should still build on x86_64-linux.
11-12-{ stdenv, lib
13-, buildPackages
14-, newScope, callPackage
15-, CoreFoundation, Security
16-, pkgsBuildTarget, pkgsBuildBuild, pkgsBuildHost
17-, makeRustPlatform
18-, llvmPackages_11
19-, llvmPackages_12, llvm_12
20-} @ args:
21-22-import ./default.nix {
23- rustcVersion = "1.54.0";
24- rustcSha256 = "0xk9dhfff16caambmwij67zgshd8v9djw6ha0fnnanlv7rii31dc";
25-26- llvmSharedForBuild = pkgsBuildBuild.llvmPackages_12.libllvm.override { enableSharedLibraries = true; };
27- llvmSharedForHost = pkgsBuildHost.llvmPackages_12.libllvm.override { enableSharedLibraries = true; };
28- llvmSharedForTarget = pkgsBuildTarget.llvmPackages_12.libllvm.override { enableSharedLibraries = true; };
29-30- llvmBootstrapForDarwin = llvmPackages_11;
31-32- # For use at runtime
33- llvmShared = llvm_12.override { enableSharedLibraries = true; };
34-35- # Note: the version MUST be one version prior to the version we're
36- # building
37- bootstrapVersion = "1.53.0";
38-39- # fetch hashes by running `print-hashes.sh ${bootstrapVersion}`
40- bootstrapHashes = {
41- i686-unknown-linux-gnu = "4ebeeba05448b9484bb2845dba2ff4c0e2b7208fa8b08bef2b2ca3b171d0db99";
42- x86_64-unknown-linux-gnu = "5e9e556d2ccce27aa8f01a528f1348bf8cdd34496c35ec2abf131660b9792fed";
43- x86_64-unknown-linux-musl = "908b6163b62660f289bcd1eda1a0eb6d849b4b29da12546d24a033e5718e93ff";
44- arm-unknown-linux-gnueabihf = "6ae3108f4a0b0478c76f5dbaf1827c9e4a983fa78a9f973b24d501e693cfdcab";
45- armv7-unknown-linux-gnueabihf = "886e78f7c5bd92e16322ca3af70d1899c064837343cdfeb9a216b76edfd18157";
46- aarch64-unknown-linux-gnu = "cba81d5c3d16deee04098ea18af8636bc7415315a44c9e44734fd669aa778040";
47- aarch64-unknown-linux-musl = "a0065a6313bf370f2844af6f3b47fe292360e9cca3da31b5f6cb32db311ba686";
48- x86_64-apple-darwin = "940a4488f907b871f9fb1be309086509e4a48efb19303f8b5fe115c6f12abf43";
49- aarch64-apple-darwin = "c519da905514c05240a8fe39e459de2c4ef5943535e3655502e8fb756070aee1";
50- powerpc64le-unknown-linux-gnu = "9f6c17427d1023b10694e4ba60d6d9deec0aeb07d051f99763789ed18e07e2e6";
51- riscv64gc-unknown-linux-gnu = "6ae23ac00269df72b0790f10f2d9a98d03acf542c6090f4d30a87365fafd14ed";
52- };
53-54- selectRustPackage = pkgs: pkgs.rust_1_54;
55-56- rustcPatches = [
57- ];
58-}
59-60-(builtins.removeAttrs args [ "fetchpatch" "pkgsBuildHost" "llvmPackages_11" "llvmPackages_12" "llvm_12"])
···1+# New rust versions should first go to staging.
2+# Things to check after updating:
3+# 1. Rustc should produce rust binaries on x86_64-linux, aarch64-linux and x86_64-darwin:
4+# i.e. nix-shell -p fd or @GrahamcOfBorg build fd on github
5+# This testing can be also done by other volunteers as part of the pull
6+# request review, in case platforms cannot be covered.
7+# 2. The LLVM version used for building should match with rust upstream.
8+# Check the version number in the src/llvm-project git submodule in:
9+# https://github.com/rust-lang/rust/blob/<version-tag>/.gitmodules
10+# 3. Firefox and Thunderbird should still build on x86_64-linux.
11+12+{ stdenv, lib
13+, buildPackages
14+, newScope, callPackage
15+, CoreFoundation, Security
16+, pkgsBuildTarget, pkgsBuildBuild, pkgsBuildHost
17+, makeRustPlatform
18+, llvmPackages_11
19+, llvmPackages_12, llvm_12
20+} @ args:
21+22+import ./default.nix {
23+ rustcVersion = "1.55.0";
24+ rustcSha256 = "07l28f7grdmi65naq71pbmvdd61hwcpi40ry7kp7dy7m233rldxj";
25+26+ llvmSharedForBuild = pkgsBuildBuild.llvmPackages_12.libllvm.override { enableSharedLibraries = true; };
27+ llvmSharedForHost = pkgsBuildHost.llvmPackages_12.libllvm.override { enableSharedLibraries = true; };
28+ llvmSharedForTarget = pkgsBuildTarget.llvmPackages_12.libllvm.override { enableSharedLibraries = true; };
29+30+ llvmBootstrapForDarwin = llvmPackages_11;
31+32+ # For use at runtime
33+ llvmShared = llvm_12.override { enableSharedLibraries = true; };
34+35+ # Note: the version MUST be one version prior to the version we're
36+ # building
37+ bootstrapVersion = "1.54.0";
38+39+ # fetch hashes by running `print-hashes.sh ${bootstrapVersion}`
40+ bootstrapHashes = {
41+ i686-unknown-linux-gnu = "1cd06090463711d50d98374ef52c1a84b9f4e3e35febaaef4890fb10536ceb3a";
42+ x86_64-unknown-linux-gnu = "350354495b1d4b6dd2ec7cf96aa9bc61d031951cf667a31e8cf401dc508639e6";
43+ x86_64-unknown-linux-musl = "3571db0018fcd32f3b579a32b2301826dbd1cce44b373aed8e8a31c2a6f52fe8";
44+ arm-unknown-linux-gnueabihf = "77f4e4c2195f75466c6de0b1d8fd7fb8cef3d12666e3aae777dcfd0d71d080ca";
45+ armv7-unknown-linux-gnueabihf = "dd01ccb6a53d5e895a6755a78c213ae601a347366688941d5c543b5af5835d6d";
46+ aarch64-unknown-linux-gnu = "33a50c5366a57aaab43c1c19e4a49ab7d8ffcd99a72925c315fb1f9389139e6f";
47+ aarch64-unknown-linux-musl = "49d94116a357ea13f5a3231de2472f59210028c3cf81f158b8a367c3155ac544";
48+ x86_64-apple-darwin = "5eb27a4f5f7a4699bc70cf1848e340ddd74e151488bfcb26853fd584958e3d33";
49+ aarch64-apple-darwin = "801b3b15b992b0321261de8b8ea2728e9a74822c6cb99bf978b34e217c7825ba";
50+ powerpc64le-unknown-linux-gnu = "67cadf7ac5bd2e3d5fb4baede69846059f17c4e099f771329b266d08b875ed71";
51+ riscv64gc-unknown-linux-gnu = "6113a6cce3500033d0dc0d170b54c5f22562ef3025fd58d804c822a2499c74d7";
52+ };
53+54+ selectRustPackage = pkgs: pkgs.rust_1_55;
55+56+ rustcPatches = [
57+ ];
58+}
59+60+(builtins.removeAttrs args [ "fetchpatch" "pkgsBuildHost" "llvmPackages_11" "llvmPackages_12" "llvm_12"])
···416 # This allows build Python to import host Python's sysconfigdata
417 mkdir -p "$out/${sitePackages}"
418 ln -s "$out/lib/${libPrefix}/"_sysconfigdata*.py "$out/${sitePackages}/"
419+420+ # debug info can't be separated from a static library and would otherwise be
421+ # left in place by a separateDebugInfo build. force its removal here to save
422+ # space in output.
423+ $STRIP -S $out/lib/${libPrefix}/config-*/libpython*.a || true
424 '' + optionalString stripConfig ''
425 rm -R $out/bin/python*-config $out/lib/python*/config-*
426 '' + optionalString stripIdlelib ''
···450 find $out -name "*.py" | ${pythonForBuildInterpreter} -m compileall -q -f -x "lib2to3" -i -
451 find $out -name "*.py" | ${pythonForBuildInterpreter} -O -m compileall -q -f -x "lib2to3" -i -
452 find $out -name "*.py" | ${pythonForBuildInterpreter} -OO -m compileall -q -f -x "lib2to3" -i -
453+ '' + ''
454+ # *strip* shebang from libpython gdb script - it should be dual-syntax and
455+ # interpretable by whatever python the gdb in question is using, which may
456+ # not even match the major version of this python. doing this after the
457+ # bytecode compilations for the same reason - we don't want bytecode generated.
458+ mkdir -p $out/share/gdb
459+ sed '/^#!/d' Tools/gdb/libpython.py > $out/share/gdb/libpython.py
460 '';
461462 preFixup = lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) ''
···481 # These typically end up in shebangs.
482 pythonForBuild buildPackages.bash
483 ];
484+485+ separateDebugInfo = true;
486487 inherit passthru;
488
+12-6
pkgs/development/interpreters/python/tests.nix
···9495 # Integration tests involving the package set.
96 # All PyPy package builds are broken at the moment
97- integrationTests = lib.optionalAttrs (python.pythonAtLeast "3.7" && (!python.isPyPy)) rec {
98- # Before the addition of NIX_PYTHONPREFIX mypy was broken with typed packages
99- nix-pythonprefix-mypy = callPackage ./tests/test_nix_pythonprefix {
100- interpreter = python;
101- };
102- };
000000103104 # Tests to ensure overriding works as expected.
105 overrideTests = let
···9495 # Integration tests involving the package set.
96 # All PyPy package builds are broken at the moment
97+ integrationTests = lib.optionalAttrs (!python.isPyPy) (
98+ lib.optionalAttrs (python.isPy3k && !stdenv.isDarwin) { # darwin has no split-debug
99+ cpython-gdb = callPackage ./tests/test_cpython_gdb {
100+ interpreter = python;
101+ };
102+ } // lib.optionalAttrs (python.pythonAtLeast "3.7") rec {
103+ # Before the addition of NIX_PYTHONPREFIX mypy was broken with typed packages
104+ nix-pythonprefix-mypy = callPackage ./tests/test_nix_pythonprefix {
105+ interpreter = python;
106+ };
107+ }
108+ );
109110 # Tests to ensure overriding works as expected.
111 overrideTests = let
···4 release = "8.5";
5 version = "${release}.18";
67+ # Note: when updating, the hash in pkgs/development/libraries/tk/8.5.nix must also be updated!
8+9 src = fetchurl {
10 url = "mirror://sourceforge/tcl/tcl${version}-src.tar.gz";
11 sha256 = "1jfkqp2fr0xh6xvaqx134hkfa5kh7agaqbxm6lhjbpvvc1xfaaq3";
···4 release = "8.6";
5 version = "${release}.11";
67+ # Note: when updating, the hash in pkgs/development/libraries/tk/8.6.nix must also be updated!
8+9 src = fetchurl {
10 url = "mirror://sourceforge/tcl/tcl${version}-src.tar.gz";
11 sha256 = "0n4211j80mxr6ql0xx52rig8r885rcbminfpjdb2qrw6hmk8c14c";
···1{ lib, stdenv
2, fetchFromGitHub
03, cmake, pkg-config, unzip, zlib, pcre, hdf5
4, glog, boost, gflags, protobuf
5, config
···154 # Ensures that we use the system OpenEXR rather than the vendored copy of the source included with OpenCV.
155 patches = [
156 ./cmake-don-t-use-OpenCVFindOpenEXR.patch
00000157 ];
158159 # This prevents cmake from using libraries in impure paths (which
···1{ lib, stdenv
2, fetchFromGitHub
3+, fetchpatch
4, cmake, pkg-config, unzip, zlib, pcre, hdf5
5, glog, boost, gflags, protobuf
6, config
···155 # Ensures that we use the system OpenEXR rather than the vendored copy of the source included with OpenCV.
156 patches = [
157 ./cmake-don-t-use-OpenCVFindOpenEXR.patch
158+ # Fix usage of deprecated version of protobuf' SetTotalBytesLimit. Remove with the next release.
159+ (fetchpatch {
160+ url = "https://github.com/opencv/opencv/commit/384875f4fcf1782b10699a379aa245a03cb27a04.patch";
161+ sha256 = "1agwd0pm07m2dy8a62vmfl4n73dsmsdll2a73q6kara9wm3jlp41";
162+ })
163 ];
164165 # This prevents cmake from using libraries in impure paths (which
+6
pkgs/development/libraries/opencv/4.x.nix
···1{ lib
2, stdenv
3, fetchurl
04, fetchFromGitHub
5, cmake
6, pkg-config
···217 # Ensures that we use the system OpenEXR rather than the vendored copy of the source included with OpenCV.
218 patches = [
219 ./cmake-don-t-use-OpenCVFindOpenEXR.patch
00000220 ] ++ lib.optional enableCuda ./cuda_opt_flow.patch;
221222 # This prevents cmake from using libraries in impure paths (which
···1{ lib
2, stdenv
3, fetchurl
4+, fetchpatch
5, fetchFromGitHub
6, cmake
7, pkg-config
···218 # Ensures that we use the system OpenEXR rather than the vendored copy of the source included with OpenCV.
219 patches = [
220 ./cmake-don-t-use-OpenCVFindOpenEXR.patch
221+ # Fix usage of deprecated version of protobuf' SetTotalBytesLimit. Remove with the next release.
222+ (fetchpatch {
223+ url = "https://github.com/opencv/opencv/commit/384875f4fcf1782b10699a379aa245a03cb27a04.patch";
224+ sha256 = "1agwd0pm07m2dy8a62vmfl4n73dsmsdll2a73q6kara9wm3jlp41";
225+ })
226 ] ++ lib.optional enableCuda ./cuda_opt_flow.patch;
227228 # This prevents cmake from using libraries in impure paths (which
···4243 installTargets = lib.optionals stdenv.isDarwin [ "install-staticlib" "install-shlib" ];
4445- buildInputs = [ gfortran ];
46-47- nativeBuildInputs = [ which ];
4849 meta = with lib; {
50 description = "Library for fast updating of qr and cholesky decompositions";
···4243 installTargets = lib.optionals stdenv.isDarwin [ "install-staticlib" "install-shlib" ];
4445+ nativeBuildInputs = [ which gfortran ];
004647 meta = with lib; {
48 description = "Library for fast updating of qr and cholesky decompositions";
···1-{lib, stdenv, fetchurl, audiofile, libtiff}:
2stdenv.mkDerivation rec {
3 version = "0.0.6";
4 pname = "spandsp";
···8 };
910 outputs = [ "out" "dev" ];
0001100000000012 propagatedBuildInputs = [audiofile libtiff];
13 meta = {
14 description = "A portable and modular SIP User-Agent with audio and video support";
···1+{ lib, stdenv, fetchurl, audiofile, libtiff, buildPackages }:
2stdenv.mkDerivation rec {
3 version = "0.0.6";
4 pname = "spandsp";
···8 };
910 outputs = [ "out" "dev" ];
11+ makeFlags = [
12+ "CC=${stdenv.cc.targetPrefix}cc"
13+ ];
1415+ configureFlags = [
16+ # This flag is required to prevent linking error in the cross-compilation case.
17+ # I think it's fair to assume that realloc(NULL, size) will return a valid memory
18+ # block for most libc implementation, so let's just assume that and hope for the best.
19+ "ac_cv_func_malloc_0_nonnull=yes"
20+ ];
21+22+ strictDeps = true;
23+ depsBuildBuild = [ buildPackages.stdenv.cc ];
24 propagatedBuildInputs = [audiofile libtiff];
25 meta = {
26 description = "A portable and modular SIP User-Agent with audio and video support";
+2-2
pkgs/development/libraries/sqlite/default.nix
···1314stdenv.mkDerivation rec {
15 pname = "sqlite";
16- version = "3.35.5";
1718 # NB! Make sure to update ./tools.nix src (in the same directory).
19 src = fetchurl {
20 url = "https://sqlite.org/2021/sqlite-autoconf-${archiveVersion version}.tar.gz";
21- sha256 = "9StypcMZw+UW7XqS4SMTmm6Hrwii3EPXdXck9hMubbA=";
22 };
2324 outputs = [ "bin" "dev" "out" ];
···1314stdenv.mkDerivation rec {
15 pname = "sqlite";
16+ version = "3.36.0";
1718 # NB! Make sure to update ./tools.nix src (in the same directory).
19 src = fetchurl {
20 url = "https://sqlite.org/2021/sqlite-autoconf-${archiveVersion version}.tar.gz";
21+ sha256 = "sha256-vZDD65a+6ZYga4O+cGXJzhmu84w/T7Uwc62g0LabvOM=";
22 };
2324 outputs = [ "bin" "dev" "out" ];
···3, openssl, json_c, curl, libgcrypt
4, cmocka, uthash, ibm-sw-tpm2, iproute2, procps, which
5}:
6+let
7+ # Avoid a circular dependency on Linux systems (systemd depends on tpm2-tss,
8+ # tpm2-tss tests depend on procps, procps depends on systemd by default). This
9+ # needs to be conditional based on isLinux because procps for other systems
10+ # might not support the withSystemd option.
11+ procpsWithoutSystemd = procps.override { withSystemd = false; };
12+ procps_pkg = if stdenv.isLinux then procpsWithoutSystemd else procps;
13+in
1415stdenv.mkDerivation rec {
16 pname = "tpm2-tss";
···28 ];
29 buildInputs = [ openssl json_c curl libgcrypt ];
30 checkInputs = [
31+ cmocka uthash ibm-sw-tpm2 iproute2 procps_pkg which
32 ];
3334 preAutoreconf = "./bootstrap";
···1-{ lib, buildPythonPackage, fetchPypi, toml, tomli }:
00000023buildPythonPackage rec {
4 pname = "setuptools-scm";
5- # don't update to 6.1.0 or 6.2.0, releases were pulled because of regression
6- # https://github.com/pypa/setuptools_scm/issues/615
7- version = "6.0.1";
89 src = fetchPypi {
10 pname = "setuptools_scm";
11 inherit version;
12- sha256 = "sha256-0ZJaacsH6bKUFqJ1ufrbAJojwUis6QWy+yIGSabBjpI=";
13 };
1415- postPatch = ''
16- substituteInPlace setup.cfg \
17- --replace "tomli~=1.0.0" "tomli>=1.0.0"
18- '';
1920- # TODO: figure out why both toml and tomli are needed when only tomli is listed in setuptools-scm
21- # if not both are listed some packages like zipp silently fallback to a 0.0.0 version number and break version pins in other packages
22- propagatedBuildInputs = [ toml tomli ];
2324- # Requires pytest, circular dependency
25 doCheck = false;
26- pythonImportsCheck = [ "setuptools_scm" ];
0002728 meta = with lib; {
29 homepage = "https://github.com/pypa/setuptools_scm/";
···1-Fails to build with glibc 2.12.1 without this patch.
2-3-http://lists.gnu.org/archive/html/bug-m4/2010-05/msg00002.html
4-5---- a/src/path.c
6-+++ b/src/path.c
7-@@ -22,6 +22,7 @@
8- /* Handling of path search of included files via the builtins "include"
9- and "sinclude". */
10-11- #include "m4.h"
12-+#include "sys/stat.h"
13-14- struct includes
···1+mergeNetBSDSourceDir() {
2+ # merge together all extra paths
3+ # there should be a better way to do this
4+ chmod -R u+w $BSDSRCDIR
5+ for path in $extraPaths; do
6+ rsync -Er --chmod u+w $path/ $BSDSRCDIR/
7+ done
8+}
9+10+addNetBSDMakeFlags() {
11+ makeFlags="INCSDIR=${!outputDev}/include $makeFlags"
12+}
13+14+postUnpackHooks+=(mergeNetBSDSourceDir)
15+preConfigureHooks+=(addNetBSDMakeFlags)
···1-From 7a6529ee27028860b93bc539e8bbf3f2374d712f Mon Sep 17 00:00:00 2001
2From: Eelco Dolstra <eelco.dolstra@logicblox.com>
3Date: Mon, 11 May 2015 15:39:38 +0200
4Subject: [PATCH 06/19] Get rid of a useless message in user sessions
···910in containers.
11---
12- src/core/unit.c | 3 ++-
13 1 file changed, 2 insertions(+), 1 deletion(-)
1415-diff --git a/src/core/unit.c b/src/core/unit.c
16-index 45a417a090..8af3cb08d6 100644
17---- a/src/core/unit.c
18-+++ b/src/core/unit.c
19-@@ -2163,7 +2163,8 @@ static void unit_check_binds_to(Unit *u) {
20- }
02122- assert(other);
23-- log_unit_info(u, "Unit is bound to inactive unit %s. Stopping, too.", other->id);
24-+ if (u->type != UNIT_MOUNT || detect_container() <= 0)
25-+ log_unit_info(u, "Unit is bound to inactive unit %s. Stopping, too.", other->id);
2627- /* A unit we need to run is gone. Sniff. Let's stop this. */
28- r = manager_add_job(u->manager, JOB_STOP, u, JOB_FAIL, NULL, &error, NULL);
29--
30-2.30.1
31
···1+From e2a8db60ebfb1e0477ce989f6c3d4a95f2e08120 Mon Sep 17 00:00:00 2001
2From: Eelco Dolstra <eelco.dolstra@logicblox.com>
3Date: Mon, 11 May 2015 15:39:38 +0200
4Subject: [PATCH 06/19] Get rid of a useless message in user sessions
···910in containers.
11---
12+ src/core/manager.c | 3 ++-
13 1 file changed, 2 insertions(+), 1 deletion(-)
1415+diff --git a/src/core/manager.c b/src/core/manager.c
16+index 8884437347..e23d47b4a4 100644
17+--- a/src/core/manager.c
18++++ b/src/core/manager.c
19+@@ -1375,7 +1375,8 @@ static unsigned manager_dispatch_stop_when_bound_queue(Manager *m) {
20+ if (!unit_is_bound_by_inactive(u, &culprit))
21+ continue;
2223+- log_unit_debug(u, "Unit is stopped because bound to inactive unit %s.", culprit->id);
24++ if (u->type != UNIT_MOUNT || detect_container() <= 0)
25++ log_unit_debug(u, "Unit is stopped because bound to inactive unit %s.", culprit->id);
02627+ /* If stopping a unit fails continuously we might enter a stop loop here, hence stop acting on the
28+ * service being unnecessary after a while. */
29--
30+2.32.0
31
···1-From 63777e7f690b67952bf4571f8e09e5d8e769d3c0 Mon Sep 17 00:00:00 2001
2From: Andreas Rammhold <andreas@rammhold.de>
3Date: Fri, 2 Nov 2018 21:15:42 +0100
4Subject: [PATCH 12/19] inherit systemd environment when calling generators.
···12"environment-generators" and then seems to pass that on to all the other
13executables that are being called from managers.
14---
15- src/core/manager.c | 11 ++++++++---
16- 1 file changed, 8 insertions(+), 3 deletions(-)
1718diff --git a/src/core/manager.c b/src/core/manager.c
19-index 6858950107..07a599ede7 100644
20--- a/src/core/manager.c
21+++ b/src/core/manager.c
22-@@ -4142,9 +4142,14 @@ static int manager_run_generators(Manager *m) {
23 argv[4] = NULL;
2425 RUN_WITH_UMASK(0022)
26- (void) execute_directories((const char* const*) paths, DEFAULT_TIMEOUT_USEC, NULL, NULL,
27-- (char**) argv, m->transient_environment, EXEC_DIR_PARALLEL | EXEC_DIR_IGNORE_ERRORS);
028-
29+ (void) execute_directories((const char* const*) paths, DEFAULT_TIMEOUT_USEC,
30+ // On NixOS we must propagate PATH to generators so they are
···33+ // function (envp) is set to NULL. This propagates systemd's
34+ // environment (e.g. PATH) that was setup
35+ // before calling systemd from stage-2-init.sh.
36-+ NULL, NULL, (char**) argv, /* NixOS: use inherited env */ NULL, EXEC_DIR_PARALLEL | EXEC_DIR_IGNORE_ERRORS);
037 r = 0;
3839 finish:
40--
41-2.30.1
42
···1+From 40a5df71e7af5feefacae9fc95bf94e72c6c12f4 Mon Sep 17 00:00:00 2001
2From: Andreas Rammhold <andreas@rammhold.de>
3Date: Fri, 2 Nov 2018 21:15:42 +0100
4Subject: [PATCH 12/19] inherit systemd environment when calling generators.
···12"environment-generators" and then seems to pass that on to all the other
13executables that are being called from managers.
14---
15+ src/core/manager.c | 13 +++++++++----
16+ 1 file changed, 9 insertions(+), 4 deletions(-)
1718diff --git a/src/core/manager.c b/src/core/manager.c
19+index e23d47b4a4..1047aadebc 100644
20--- a/src/core/manager.c
21+++ b/src/core/manager.c
22+@@ -4145,10 +4145,15 @@ static int manager_run_generators(Manager *m) {
23 argv[4] = NULL;
2425 RUN_WITH_UMASK(0022)
26- (void) execute_directories((const char* const*) paths, DEFAULT_TIMEOUT_USEC, NULL, NULL,
27+- (char**) argv, m->transient_environment,
28+- EXEC_DIR_PARALLEL | EXEC_DIR_IGNORE_ERRORS | EXEC_DIR_SET_SYSTEMD_EXEC_PID);
29-
30+ (void) execute_directories((const char* const*) paths, DEFAULT_TIMEOUT_USEC,
31+ // On NixOS we must propagate PATH to generators so they are
···34+ // function (envp) is set to NULL. This propagates systemd's
35+ // environment (e.g. PATH) that was setup
36+ // before calling systemd from stage-2-init.sh.
37++ NULL, NULL, (char**) argv, /* NixOS: use inherited env */ NULL,
38++ EXEC_DIR_PARALLEL | EXEC_DIR_IGNORE_ERRORS | EXEC_DIR_SET_SYSTEMD_EXEC_PID);
39 r = 0;
4041 finish:
42--
43+2.32.0
44
···1-From 8f619304804b02f4e9d7a340ca90359f96adc6e8 Mon Sep 17 00:00:00 2001
2From: Nikolay Amiantov <ab@fmap.me>
3Date: Thu, 25 Jul 2019 20:45:55 +0300
4Subject: [PATCH 14/19] systemd-shutdown: execute scripts in
···10 1 file changed, 1 insertion(+), 1 deletion(-)
1112diff --git a/src/shutdown/shutdown.c b/src/shutdown/shutdown.c
13-index 0d07865542..26d974ef73 100644
14--- a/src/shutdown/shutdown.c
15+++ b/src/shutdown/shutdown.c
16@@ -312,7 +312,7 @@ int main(int argc, char *argv[]) {
···23 /* The log target defaults to console, but the original systemd process will pass its log target in through a
24 * command line argument, which will override this default. Also, ensure we'll never log to the journal or
25--
26-2.30.1
27
···1+From 31732478745f7a200004fb8ec013f54dbc536f2e Mon Sep 17 00:00:00 2001
2From: Nikolay Amiantov <ab@fmap.me>
3Date: Thu, 25 Jul 2019 20:45:55 +0300
4Subject: [PATCH 14/19] systemd-shutdown: execute scripts in
···10 1 file changed, 1 insertion(+), 1 deletion(-)
1112diff --git a/src/shutdown/shutdown.c b/src/shutdown/shutdown.c
13+index a98cfc4d8a..b0b34edda7 100644
14--- a/src/shutdown/shutdown.c
15+++ b/src/shutdown/shutdown.c
16@@ -312,7 +312,7 @@ int main(int argc, char *argv[]) {
···23 /* The log target defaults to console, but the original systemd process will pass its log target in through a
24 * command line argument, which will override this default. Also, ensure we'll never log to the journal or
25--
26+2.32.0
27
···1+From 5f17b65d30480e489e135b403a072b38535b2911 Mon Sep 17 00:00:00 2001
2+From: Andreas Rammhold <andreas@rammhold.de>
3+Date: Wed, 18 Aug 2021 19:10:08 +0200
4+Subject: [PATCH] core: handle lookup paths being symlinks
5+6+With a recent change paths leaving the statically known lookup paths
7+would be treated differently then those that remained within those. That
8+was done (AFAIK) to consistently handle alias names. Unfortunately that
9+means that on some distributions, especially those where /etc/ consists
10+mostly of symlinks, would trigger that new detection for every single
11+unit in /etc/systemd/system. The reason for that is that the units
12+directory itself is already a symlink.
13+---
14+ src/basic/unit-file.c | 33 +++++++++++++++++++++++++++++++--
15+ 1 file changed, 31 insertions(+), 2 deletions(-)
16+17+diff --git a/src/basic/unit-file.c b/src/basic/unit-file.c
18+index 884a0674a9..3ae2a115d0 100644
19+--- a/src/basic/unit-file.c
20++++ b/src/basic/unit-file.c
21+@@ -254,6 +254,7 @@ int unit_file_build_name_map(
22+23+ _cleanup_hashmap_free_ Hashmap *ids = NULL, *names = NULL;
24+ _cleanup_set_free_free_ Set *paths = NULL;
25++ _cleanup_strv_free_ char **expanded_search_paths = NULL;
26+ uint64_t timestamp_hash;
27+ char **dir;
28+ int r;
29+@@ -273,6 +274,34 @@ int unit_file_build_name_map(
30+ return log_oom();
31+ }
32+33++ /* Go over all our search paths, chase their symlinks and store the
34++ * result in the expanded_search_paths list.
35++ *
36++ * This is important for cases where any of the unit directories itself
37++ * are symlinks into other directories and would therefore cause all of
38++ * the unit files to be recognized as linked units.
39++ *
40++ * This is important for distributions such as NixOS where most paths
41++ * in /etc/ are symlinks to some other location on the filesystem (e.g.
42++ * into /nix/store/).
43++ */
44++ STRV_FOREACH(dir, (char**) lp->search_path) {
45++ _cleanup_free_ char *resolved_dir = NULL;
46++ r = strv_extend(&expanded_search_paths, *dir);
47++ if (r < 0)
48++ return log_oom();
49++
50++ r = chase_symlinks(*dir, NULL, 0, &resolved_dir, NULL);
51++ if (r < 0) {
52++ if (r != -ENOENT)
53++ log_warning_errno(r, "Failed to resolve symlink %s, ignoring: %m", *dir);
54++ continue;
55++ }
56++
57++ if (strv_consume(&expanded_search_paths, TAKE_PTR(resolved_dir)) < 0)
58++ return log_oom();
59++ }
60++
61+ STRV_FOREACH(dir, (char**) lp->search_path) {
62+ struct dirent *de;
63+ _cleanup_closedir_ DIR *d = NULL;
64+@@ -351,11 +380,11 @@ int unit_file_build_name_map(
65+ continue;
66+ }
67+68+- /* Check if the symlink goes outside of our search path.
69++ /* Check if the symlink goes outside of our (expanded) search path.
70+ * If yes, it's a linked unit file or mask, and we don't care about the target name.
71+ * Let's just store the link source directly.
72+ * If not, let's verify that it's a good symlink. */
73+- char *tail = path_startswith_strv(simplified, lp->search_path);
74++ char *tail = path_startswith_strv(simplified, expanded_search_paths);
75+ if (!tail) {
76+ log_debug("%s: linked unit file: %s → %s",
77+ __func__, filename, simplified);
78+--
79+2.32.0
80+
···1+From 93413acd3ef3a637a0f31a1d133b103e1dc81fd6 Mon Sep 17 00:00:00 2001
2+From: Yu Watanabe <watanabe.yu+github@gmail.com>
3+Date: Mon, 23 Aug 2021 06:16:48 +0900
4+Subject: [PATCH] path-util: make find_executable() work without /proc mounted
5+6+Follow-up for 888f65ace6296ed61285d31db846babf1c11885e.
7+8+Hopefully fixes #20514.
9+---
10+ src/basic/path-util.c | 6 +++++-
11+ 1 file changed, 5 insertions(+), 1 deletion(-)
12+13+diff --git a/src/basic/path-util.c b/src/basic/path-util.c
14+index d11f254a9f6a..a21981616b59 100644
15+--- a/src/basic/path-util.c
16++++ b/src/basic/path-util.c
17+@@ -630,7 +630,11 @@ static int check_x_access(const char *path, int *ret_fd) {
18+ return r;
19+20+ r = access_fd(fd, X_OK);
21+- if (r < 0)
22++ if (r == -ENOSYS) {
23++ /* /proc is not mounted. Fallback to access(). */
24++ if (access(path, X_OK) < 0)
25++ return -errno;
26++ } else if (r < 0)
27+ return r;
28+29+ if (ret_fd)
+147-97
pkgs/os-specific/linux/systemd/default.nix
···39, gnupg
40, zlib
41, xz
042, libuuid
43, libapparmor
44, intltool
···57, bashInteractive
58, libmicrohttpd
5900000060, withAnalyze ? true
61, withApparmor ? true
62, withCompression ? true # adds bzip2, lz4 and xz
···64, withCryptsetup ? true
65, withDocumentation ? true
66, withEfi ? stdenv.hostPlatform.isEfi
067, withHomed ? false
68, withHostnamed ? true
69, withHwdb ? true
70, withImportd ? true
071, withLocaled ? true
72, withLogind ? true
73, withMachined ? true
···82, withShellCompletions ? true
83, withTimedated ? true
84, withTimesyncd ? true
085, withUserDb ? true
86, libfido2
87, p11-kit
···106107assert withHomed -> withCryptsetup;
108109-assert withCryptsetup ->
110-(cryptsetup != null);
111let
112 wantCurl = withRemote || withImportd;
113-114in
115-stdenv.mkDerivation rec {
116- inherit pname;
117- version = "247.6";
118119 # We use systemd/systemd-stable for src, and ship NixOS-specific patches inside nixpkgs directly
120 # This has proven to be less error-prone than the previous systemd fork.
···122 owner = "systemd";
123 repo = "systemd-stable";
124 rev = "v${version}";
125- sha256 = "sha256-7XYEq3Qw25suwjbtPzx9lVPHUu9ZY/1bADXl2wQbkJc=";
126 };
127128 # If these need to be regenerated, `git am path/to/00*.patch` them into a
···150 ./0018-logind-seat-debus-show-CanMultiSession-again.patch
151 ./0019-pkg-config-derive-prefix-from-prefix.patch
152153- # Fix -Werror=format.
154- (fetchpatch {
155- url = "https://github.com/systemd/systemd/commit/ab1aa6368a883bce88e3162fee2bea14aacedf23.patch";
156- sha256 = "1b280l5jrjsg8qhsang199mpqjhkpix4c8bm3blknjnq9iv43add";
157- })
0000000158159- # Fix CVE-2021-33910, disclosed 2021-07-20
160- (fetchpatch {
161- name = "CVE-2021-33910.patch";
162- url = "https://github.com/systemd/systemd/commit/441e0115646d54f080e5c3bb0ba477c892861ab9.patch";
163- sha256 = "1g1lk95igaadg67kah9bpi4zsc01rg398sd1247ghjsvl5hxn4v4";
164- })
0165 ];
166167 postPatch = ''
···175 "find_program('${stdenv.cc.bintools.targetPrefix}objcopy'"
176 '' + (
177 let
178- # The folllowing dlopen patches ensure that all the features that are
179- # implemented via dlopen(3) are available (or explicitly deactivated) by
180- # pointing dlopen to the absolute store path instead of relying on the
181- # linkers runtime lookup code.
182 #
183- # All of the dlopen calls have to be handled. When new ones are introduced
184- # by upstream (or one of our patches) they must be explicitly declared,
185- # otherwise the build will fail.
186 #
187 # As of systemd version 247 we've seen a few errors like `libpcre2.… not
188 # found` when using e.g. --grep with journalctl. Those errors should
···201 # path location).
202 #
203 # To get a list of dynamically loaded libraries issue something like
204- # `grep -ri 'dlopen("lib' $src` and update the below list.
205- dlopenLibs = [
206- # We did never provide support for libxkbcommon & qrencode
207- { name = "libxkbcommon.so.0"; pkg = null; }
208- { name = "libqrencode.so.4"; pkg = null; }
0000000209210- # We did not provide libpwquality before so it is safe to disable it for
211- # now.
212- { name = "libpwquality.so.1"; pkg = null; }
213214- # Only include cryptsetup if it is enabled. We might not be able to
215- # provide it during "bootstrap" in e.g. the minimal systemd build as
216- # cryptsetup has udev (aka systemd) in it's dependencies.
217- { name = "libcryptsetup.so.12"; pkg = if withCryptsetup then cryptsetup else null; }
218219- # We are using libidn2 so we only provide that and ignore the others.
220- # Systemd does this decision during configure time and uses ifdef's to
221- # enable specific branches. We can safely ignore (nuke) the libidn "v1"
222- # libraries.
223- { name = "libidn2.so.0"; pkg = libidn2; }
224- { name = "libidn.so.12"; pkg = null; }
225- { name = "libidn.so.11"; pkg = null; }
226227- # journalctl --grep requires libpcre so lets provide it
228- { name = "libpcre2-8.so.0"; pkg = pcre2; }
229- ];
000000230231 patchDlOpen = dl:
232 let
···234 in
235 if dl.pkg == null then ''
236 # remove the dependency on the library by replacing it with an invalid path
237- for file in $(grep -lr 'dlopen("${dl.name}"' src); do
238 echo "patching dlopen(\"${dl.name}\", …) in $file to an invalid store path ("/nix/store/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-not-implemented/${dl.name}")…"
239- substituteInPlace "$file" --replace 'dlopen("${dl.name}"' 'dlopen("/nix/store/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-not-implemented/${dl.name}"'
240 done
241 '' else ''
242 # ensure that the library we provide actually exists
···245 exit 1
246 fi
247 # make the path to the dependency explicit
248- for file in $(grep -lr 'dlopen("${dl.name}"' src); do
249 echo "patching dlopen(\"${dl.name}\", …) in $file to ${library}…"
250- substituteInPlace "$file" --replace 'dlopen("${dl.name}"' 'dlopen("${library}"'
251 done
0252 '';
253 in
254 # patch all the dlopen calls to contain absolute paths to the libraries
255 lib.concatMapStringsSep "\n" patchDlOpen dlopenLibs
256 )
257- # finally ensure that there are no left-over dlopen calls that we didn't handle
258 + ''
259- if grep -qr 'dlopen("[^/]' src; then
260- echo "Found unhandled dlopen calls: "
261- grep -r 'dlopen("[^/]' src
262 exit 1
263 fi
000000264 '';
265266 outputs = [ "out" "man" "dev" ];
267268- nativeBuildInputs = [
269- pkg-config
270- gperf
271- ninja
272- meson
273- glibcLocales
274- getent
275- m4
0276277- intltool
278- gettext
279280- libxslt
281- docbook_xsl
282- docbook_xml_dtd_42
283- docbook_xml_dtd_45
284- (buildPackages.python3Packages.python.withPackages (ps: with ps; [ python3Packages.lxml ]))
285- ];
000000286287- buildInputs = [
288- acl
289- audit
290- glib
291- kmod
292- libcap
293- libgcrypt
294- libidn2
295- libuuid
296- linuxHeaders
297- pam
298- ]
0299300- ++ lib.optional withApparmor libapparmor
301- ++ lib.optional wantCurl (lib.getDev curl)
302- ++ lib.optionals withCompression [ bzip2 lz4 xz ]
303- ++ lib.optional withCryptsetup (lib.getDev cryptsetup.dev)
304- ++ lib.optional withEfi gnu-efi
305- ++ lib.optional withKexectools kexec-tools
306- ++ lib.optional withLibseccomp libseccomp
307- ++ lib.optional withNetworkd iptables
308- ++ lib.optional withPCRE2 pcre2
309- ++ lib.optional withResolved libgpgerror
310- ++ lib.optional withSelinux libselinux
311- ++ lib.optional withRemote libmicrohttpd
312- ++ lib.optionals withHomed [ p11-kit libfido2 ]
00313 ;
314315 #dontAddPrefix = true;
316317 mesonFlags = [
0318 "-Ddbuspolicydir=${placeholder "out"}/share/dbus-1/system.d"
319 "-Ddbussessionservicedir=${placeholder "out"}/share/dbus-1/services"
320 "-Ddbussystemservicedir=${placeholder "out"}/share/dbus-1/system-services"
···405 "-Dnss-mymachines=false"
406 "-Dnss-resolve=false"
407 "-Dnss-systemd=false"
00408 ];
409410 preConfigure = ''
···453 --replace '"tar"' '"${gnutar}/bin/tar"'
454 done
455456- substituteInPlace src/journal/catalog.c \
0457 --replace /usr/lib/systemd/catalog/ $out/lib/systemd/catalog/
458 '';
459
···39, gnupg
40, zlib
41, xz
42+, tpm2-tss
43, libuuid
44, libapparmor
45, intltool
···58, bashInteractive
59, libmicrohttpd
6061+ # the (optional) BPF feature requires bpftool, libbpf, clang and llmv-strip to be avilable during build time.
62+ # Only libbpf should be a runtime dependency.
63+, bpftools
64+, libbpf
65+, llvmPackages
66+67, withAnalyze ? true
68, withApparmor ? true
69, withCompression ? true # adds bzip2, lz4 and xz
···71, withCryptsetup ? true
72, withDocumentation ? true
73, withEfi ? stdenv.hostPlatform.isEfi
74+, withFido2 ? true
75, withHomed ? false
76, withHostnamed ? true
77, withHwdb ? true
78, withImportd ? true
79+, withLibBPF ? false # currently fails while generating BPF objects
80, withLocaled ? true
81, withLogind ? true
82, withMachined ? true
···91, withShellCompletions ? true
92, withTimedated ? true
93, withTimesyncd ? true
94+, withTpm2Tss ? true
95, withUserDb ? true
96, libfido2
97, p11-kit
···116117assert withHomed -> withCryptsetup;
118119+assert withCryptsetup -> (cryptsetup != null);
0120let
121 wantCurl = withRemote || withImportd;
122+ version = "249.4";
123in
124+stdenv.mkDerivation {
125+ inherit pname version;
0126127 # We use systemd/systemd-stable for src, and ship NixOS-specific patches inside nixpkgs directly
128 # This has proven to be less error-prone than the previous systemd fork.
···130 owner = "systemd";
131 repo = "systemd-stable";
132 rev = "v${version}";
133+ sha256 = "0pqi9gbk9kgwvd0idf13ybxz7s4h5przn01bwj6fna44jr0wy41c";
134 };
135136 # If these need to be regenerated, `git am path/to/00*.patch` them into a
···158 ./0018-logind-seat-debus-show-CanMultiSession-again.patch
159 ./0019-pkg-config-derive-prefix-from-prefix.patch
160161+ # In v249 a bunch of meson files had been touched as part of the migration to
162+ # jinja2 for templating. Unfortunately some of those files lost the `install_sysconfdir_samples` check.
163+ # The following two patches are part of a PR that was filed to fix those cases.
164+ # https://github.com/systemd/systemd/pull/20303
165+ ./0020-core-respect-install_sysconfdir_samples-in-meson-fil.patch
166+ ./0021-login-respect-install_sysconfdir_samples-in-meson-fi.patch
167+168+ # In v248 or v249 we started to get in trouble due to our /etc/systemd/sytem being
169+ # a symlink and thus being treated differently by systemd. With the below
170+ # patch we mitigate that effect by special casing all our root unit dirs
171+ # if they are symlinks. This does exactly what we need (AFAICT).
172+ ./0022-core-Handle-lookup-paths-being-symlinks.patch
173174+ # The way files are being tested for being executable changed in v248/v249
175+ # which caused our confinement setup to fail as we do not mount /proc by
176+ # default.
177+ # The issue has been reported upstream and this patch carries the upstream
178+ # fix for the same. Upstream now has a test for this scenario.
179+ # https://github.com/systemd/systemd/issues/20514
180+ ./0023-path-util-make-find_executable-work-without-proc-mounted.patch
181 ];
182183 postPatch = ''
···191 "find_program('${stdenv.cc.bintools.targetPrefix}objcopy'"
192 '' + (
193 let
194+ # The folllowing patches references to dynamic libraries to ensure that
195+ # all the features that are implemented via dlopen(3) are available (or
196+ # explicitly deactivated) by pointing dlopen to the absolute store path
197+ # instead of relying on the linkers runtime lookup code.
198 #
199+ # All of the shared library references have to be handled. When new ones
200+ # are introduced by upstream (or one of our patches) they must be
201+ # explicitly declared, otherwise the build will fail.
202 #
203 # As of systemd version 247 we've seen a few errors like `libpcre2.… not
204 # found` when using e.g. --grep with journalctl. Those errors should
···217 # path location).
218 #
219 # To get a list of dynamically loaded libraries issue something like
220+ # `grep -ri '"lib[a-zA-Z0-9-]*\.so[\.0-9a-zA-z]*"'' $src` and update the below list.
221+ dlopenLibs =
222+ let
223+ opt = condition: pkg: if condition then pkg else null;
224+ in
225+ [
226+ # bpf compilation support
227+ { name = "libbpf.so.0"; pkg = opt withLibBPF libbpf; }
228+229+ # We did never provide support for libxkbcommon & qrencode
230+ { name = "libxkbcommon.so.0"; pkg = null; }
231+ { name = "libqrencode.so.4"; pkg = null; }
232233+ # We did not provide libpwquality before so it is safe to disable it for
234+ # now.
235+ { name = "libpwquality.so.1"; pkg = null; }
236237+ # Only include cryptsetup if it is enabled. We might not be able to
238+ # provide it during "bootstrap" in e.g. the minimal systemd build as
239+ # cryptsetup has udev (aka systemd) in it's dependencies.
240+ { name = "libcryptsetup.so.12"; pkg = opt withCryptsetup cryptsetup; }
241242+ # We are using libidn2 so we only provide that and ignore the others.
243+ # Systemd does this decision during configure time and uses ifdef's to
244+ # enable specific branches. We can safely ignore (nuke) the libidn "v1"
245+ # libraries.
246+ { name = "libidn2.so.0"; pkg = libidn2; }
247+ { name = "libidn.so.12"; pkg = null; }
248+ { name = "libidn.so.11"; pkg = null; }
249250+ # journalctl --grep requires libpcre so lets provide it
251+ { name = "libpcre2-8.so.0"; pkg = pcre2; }
252+253+ # Support for TPM2 in systemd-cryptsetup, systemd-repart and systemd-cryptenroll
254+ { name = "libtss2-esys.so.0"; pkg = opt withTpm2Tss tpm2-tss; }
255+ { name = "libtss2-rc.so.0"; pkg = opt withTpm2Tss tpm2-tss; }
256+ { name = "libtss2-mu.so.0"; pkg = opt withTpm2Tss tpm2-tss; }
257+ { name = "libfido2.so.1"; pkg = opt withFido2 libfido2; }
258+ ];
259260 patchDlOpen = dl:
261 let
···263 in
264 if dl.pkg == null then ''
265 # remove the dependency on the library by replacing it with an invalid path
266+ for file in $(grep -lr '"${dl.name}"' src); do
267 echo "patching dlopen(\"${dl.name}\", …) in $file to an invalid store path ("/nix/store/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-not-implemented/${dl.name}")…"
268+ substituteInPlace "$file" --replace '"${dl.name}"' '"/nix/store/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-not-implemented/${dl.name}"'
269 done
270 '' else ''
271 # ensure that the library we provide actually exists
···274 exit 1
275 fi
276 # make the path to the dependency explicit
277+ for file in $(grep -lr '"${dl.name}"' src); do
278 echo "patching dlopen(\"${dl.name}\", …) in $file to ${library}…"
279+ substituteInPlace "$file" --replace '"${dl.name}"' '"${library}"'
280 done
281+282 '';
283 in
284 # patch all the dlopen calls to contain absolute paths to the libraries
285 lib.concatMapStringsSep "\n" patchDlOpen dlopenLibs
286 )
287+ # finally ensure that there are no left-over dlopen calls (or rather strings pointing to shared libraries) that we didn't handle
288 + ''
289+ if grep -qr '"lib[a-zA-Z0-9-]*\.so[\.0-9a-zA-z]*"' src; then
290+ echo "Found unhandled dynamic library calls: "
291+ grep -r '"lib[a-zA-Z0-9-]*\.so[\.0-9a-zA-z]*"' src
292 exit 1
293 fi
294+ ''
295+ # Finally patch shebangs that might need patching.
296+ # Should no longer be necessary with v250.
297+ # https://github.com/systemd/systemd/pull/19638
298+ + ''
299+ patchShebangs .
300 '';
301302 outputs = [ "out" "man" "dev" ];
303304+ nativeBuildInputs =
305+ [
306+ pkg-config
307+ gperf
308+ ninja
309+ meson
310+ glibcLocales
311+ getent
312+ m4
313314+ intltool
315+ gettext
316317+ libxslt
318+ docbook_xsl
319+ docbook_xml_dtd_42
320+ docbook_xml_dtd_45
321+ (buildPackages.python3Packages.python.withPackages (ps: with ps; [ lxml jinja2 ]))
322+ ]
323+ ++ lib.optional withLibBPF [
324+ bpftools
325+ llvmPackages.clang
326+ llvmPackages.libllvm
327+ ]
328+ ;
329330+ buildInputs =
331+ [
332+ acl
333+ audit
334+ glib
335+ kmod
336+ libcap
337+ libgcrypt
338+ libidn2
339+ libuuid
340+ linuxHeaders
341+ pam
342+ ]
343344+ ++ lib.optional withApparmor libapparmor
345+ ++ lib.optional wantCurl (lib.getDev curl)
346+ ++ lib.optionals withCompression [ bzip2 lz4 xz ]
347+ ++ lib.optional withCryptsetup (lib.getDev cryptsetup.dev)
348+ ++ lib.optional withEfi gnu-efi
349+ ++ lib.optional withKexectools kexec-tools
350+ ++ lib.optional withLibseccomp libseccomp
351+ ++ lib.optional withNetworkd iptables
352+ ++ lib.optional withPCRE2 pcre2
353+ ++ lib.optional withResolved libgpgerror
354+ ++ lib.optional withSelinux libselinux
355+ ++ lib.optional withRemote libmicrohttpd
356+ ++ lib.optionals withHomed [ p11-kit ]
357+ ++ lib.optionals (withHomed || withCryptsetup) [ libfido2 ]
358+ ++ lib.optionals withLibBPF [ libbpf ]
359 ;
360361 #dontAddPrefix = true;
362363 mesonFlags = [
364+ "-Dversion-tag=${version}"
365 "-Ddbuspolicydir=${placeholder "out"}/share/dbus-1/system.d"
366 "-Ddbussessionservicedir=${placeholder "out"}/share/dbus-1/services"
367 "-Ddbussystemservicedir=${placeholder "out"}/share/dbus-1/system-services"
···452 "-Dnss-mymachines=false"
453 "-Dnss-resolve=false"
454 "-Dnss-systemd=false"
455+ ] ++ lib.optionals withLibBPF [
456+ "-Dbpf-framework=true"
457 ];
458459 preConfigure = ''
···502 --replace '"tar"' '"${gnutar}/bin/tar"'
503 done
504505+506+ substituteInPlace src/libsystemd/sd-journal/catalog.c \
507 --replace /usr/lib/systemd/catalog/ $out/lib/systemd/catalog/
508 '';
509
+2-1
pkgs/os-specific/linux/tbs/default.nix
···18 };
1920in stdenv.mkDerivation {
21- name = "tbs-2018.04.18-${kernel.version}";
02223 srcs = [ media build ];
24 sourceRoot = build.name;
···67mkdir $out
89-echo "export SHELL=$shell" > $out/setup
10-echo "initialPath=\"$initialPath\"" >> $out/setup
11-echo "defaultNativeBuildInputs=\"$defaultNativeBuildInputs\"" >> $out/setup
12-echo "defaultBuildInputs=\"$defaultBuildInputs\"" >> $out/setup
13-echo "$preHook" >> $out/setup
14-cat "$setup" >> $out/setup
001516# Allow the user to install stdenv using nix-env and get the packages
17# in stdenv.
···67mkdir $out
89+{
10+ echo "export SHELL=$shell"
11+ echo "initialPath=\"$initialPath\""
12+ echo "defaultNativeBuildInputs=\"$defaultNativeBuildInputs\""
13+ echo "defaultBuildInputs=\"$defaultBuildInputs\""
14+ echo "$preHook"
15+ cat "$setup"
16+} > "$out/setup"
1718# Allow the user to install stdenv using nix-env and get the packages
19# in stdenv.
+77-71
pkgs/stdenv/generic/setup.sh
···1set -eu
2set -o pipefail
34-if [ -n "${BASH_VERSINFO-}" ] && [ "${BASH_VERSINFO-}" -lt 4 ]; then
5 echo "Detected Bash version that isn't supported by Nixpkgs (${BASH_VERSION})"
6 echo "Please install Bash 4 or greater to continue."
7 exit 1
···121 set +e
122123 if [ -n "${showBuildStats:-}" ]; then
124- times > "$NIX_BUILD_TOP/.times"
125- local -a times=($(cat "$NIX_BUILD_TOP/.times"))
126- # Print the following statistics:
127- # - user time for the shell
128- # - system time for the shell
129- # - user time for all child processes
130- # - system time for all child processes
131- echo "build time elapsed: " "${times[@]}"
132 fi
133134 if (( "$exitCode" != 0 )); then
···207 exec {fd}< "$fn"
208 read -r -n 4 -u "$fd" magic
209 exec {fd}<&-
00000210 # https://opensource.apple.com/source/lldb/lldb-310.2.36/examples/python/mach_o.py.auto.html
211- if [[ "$magic" = $'\xfe\xed\xfa\xcf' || "$magic" = $'\xcf\xfa\xed\xfe' ]]; then
212 # MH_MAGIC_64 || MH_CIGAM_64
213 return 0;
214- elif [[ "$magic" = $'\xfe\xed\xfa\xce' || "$magic" = $'\xce\xfa\xed\xfe' ]]; then
215 # MH_MAGIC || MH_CIGAM
216 return 0;
217- elif [[ "$magic" = $'\xca\xfe\xba\xbe' || "$magic" = $'\xbe\xba\xfe\xca' ]]; then
218 # FAT_MAGIC || FAT_CIGAM
219 return 0;
220 else
···329330declare -a pkgHookVarVars=(pkgBuildHookVars pkgHostHookVars pkgTargetHookVars)
3310000332# Add env hooks for all sorts of deps with the specified host offset.
333addEnvHooks() {
334 local depHostOffset="$1"
···370# implements.
371findInputs() {
372 local -r pkg="$1"
373- local -ri hostOffset="$2"
374- local -ri targetOffset="$3"
375376 # Sanity check
377- (( "$hostOffset" <= "$targetOffset" )) || exit -1
378379- local varVar="${pkgAccumVarVars[$hostOffset + 1]}"
380- local varRef="$varVar[\$targetOffset - \$hostOffset]"
381 local var="${!varRef}"
382 unset -v varVar varRef
383···404 # offsets to current offset
405 local -i mapOffsetResult
406 function mapOffset() {
407- local -ri inputOffset="$1"
408- if (( "$inputOffset" <= 0 )); then
409- local -ri outputOffset="$inputOffset + $hostOffset"
410 else
411- local -ri outputOffset="$inputOffset - 1 + $targetOffset"
412 fi
413 mapOffsetResult="$outputOffset"
414 }
415416 # Host offset relative to that of the package whose immediate
417 # dependencies we are currently exploring.
418- local -i relHostOffset
419 for relHostOffset in "${allPlatOffsets[@]}"; do
420 # `+ 1` so we start at 0 for valid index
421- local files="${propagatedDepFilesVars[$relHostOffset + 1]}"
422423 # Host offset relative to the package currently being
424 # built---as absolute an offset as will be used.
···496# Add package to the future PATH and run setup hooks
497activatePackage() {
498 local pkg="$1"
499- local -ri hostOffset="$2"
500- local -ri targetOffset="$3"
501502 # Sanity check
503- (( "$hostOffset" <= "$targetOffset" )) || exit -1
504505 if [ -f "$pkg" ]; then
506 source "$pkg"
···517 addToSearchPath _PATH "$pkg/bin"
518 fi
519520- if [[ "$hostOffset" -le -1 ]]; then
521 addToSearchPath _XDG_DATA_DIRS "$pkg/share"
522 fi
523···531}
532533_activatePkgs() {
534- local -i hostOffset targetOffset
535 local pkg
536537 for hostOffset in "${allPlatOffsets[@]}"; do
538- local pkgsVar="${pkgAccumVarVars[$hostOffset + 1]}"
539 for targetOffset in "${allPlatOffsets[@]}"; do
540- (( "$hostOffset" <= "$targetOffset" )) || continue
541 local pkgsRef="${pkgsVar}[$targetOffset - $hostOffset]"
542 local pkgsSlice="${!pkgsRef}[@]"
543 for pkg in ${!pkgsSlice+"${!pkgsSlice}"}; do
···559# with this information to the relevant env hook array, but bash
560# doesn't have closures, so it's easier to just pass this in.
561_addToEnv() {
562- local -i depHostOffset depTargetOffset
563 local pkg
564565 for depHostOffset in "${allPlatOffsets[@]}"; do
566- local hookVar="${pkgHookVarVars[$depHostOffset + 1]}"
567- local pkgsVar="${pkgAccumVarVars[$depHostOffset + 1]}"
568 for depTargetOffset in "${allPlatOffsets[@]}"; do
569- (( "$depHostOffset" <= "$depTargetOffset" )) || continue
570 local hookRef="${hookVar}[$depTargetOffset - $depHostOffset]"
571 if [[ -z "${strictDeps-}" ]]; then
572···578 #
579 # TODO(@Ericson2314): Don't special-case native compilation
580 for pkg in \
581- ${pkgsBuildBuild+"${pkgsBuildBuild[@]}"} \
582- ${pkgsBuildHost+"${pkgsBuildHost[@]}"} \
583- ${pkgsBuildTarget+"${pkgsBuildTarget[@]}"} \
584- ${pkgsHostHost+"${pkgsHostHost[@]}"} \
585- ${pkgsHostTarget+"${pkgsHostTarget[@]}"} \
586- ${pkgsTargetTarget+"${pkgsTargetTarget[@]}"}
587 do
588 if [[ "$visitedPkgs" = *"$pkg"* ]]; then
589 continue
···656# means that we're supposed to try and auto-detect the number of
657# available CPU cores at run-time.
658659-if [ -z "${NIX_BUILD_CORES:-}" ]; then
660- NIX_BUILD_CORES="1"
661-elif [ "$NIX_BUILD_CORES" -le 0 ]; then
662- NIX_BUILD_CORES=$(nproc 2>/dev/null || true)
663- if expr >/dev/null 2>&1 "$NIX_BUILD_CORES" : "^[0-9][0-9]*$"; then
664- :
665- else
666- NIX_BUILD_CORES="1"
667- fi
668fi
669export NIX_BUILD_CORES
670671672# Prevent SSL libraries from using certificates in /etc/ssl, unless set explicitly.
673# Leave it in impure shells for convenience.
674-if [ -z "${NIX_SSL_CERT_FILE:-}" ] && [ "${IN_NIX_SHELL:-}" != "impure" ]; then
675 export NIX_SSL_CERT_FILE=/no-cert-file.crt
676fi
677# Another variant left for compatibility.
678-if [ -z "${SSL_CERT_FILE:-}" ] && [ "${IN_NIX_SHELL:-}" != "impure" ]; then
679 export SSL_CERT_FILE=/no-cert-file.crt
680fi
681···739 printf "%s" "${!var}"
740}
74100742consumeEntire() {
743 # read returns non-0 on EOF, so we want read to fail
744- if IFS='' read -r -N 0 $1; then
745 echo "consumeEntire(): ERROR: Input null bytes, won't process" >&2
746 return 1
747 fi
···1010 configureFlags="${prefixKey:---prefix=}$prefix $configureFlags"
1011 fi
10121013- # Add --disable-dependency-tracking to speed up some builds.
1014- if [ -z "${dontAddDisableDepTrack:-}" ]; then
1015- if [ -f "$configureScript" ] && grep -q dependency-tracking "$configureScript"; then
1016- configureFlags="--disable-dependency-tracking $configureFlags"
001017 fi
1018- fi
10191020- # By default, disable static builds.
1021- if [ -z "${dontDisableStatic:-}" ]; then
1022- if [ -f "$configureScript" ] && grep -q enable-static "$configureScript"; then
1023- configureFlags="--disable-static $configureFlags"
01024 fi
1025 fi
1026···1028 # Old bash empty array hack
1029 # shellcheck disable=SC2086
1030 local flagsArray=(
1031- $configureFlags ${configureFlagsArray+"${configureFlagsArray[@]}"}
1032 )
1033 echoCmd 'configure flags' "${flagsArray[@]}"
1034 # shellcheck disable=SC2086
···1058 local flagsArray=(
1059 ${enableParallelBuilding:+-j${NIX_BUILD_CORES} -l${NIX_BUILD_CORES}}
1060 SHELL=$SHELL
1061- $makeFlags ${makeFlagsArray+"${makeFlagsArray[@]}"}
1062- $buildFlags ${buildFlagsArray+"${buildFlagsArray[@]}"}
1063 )
10641065 echoCmd 'build flags' "${flagsArray[@]}"
···1097 local flagsArray=(
1098 ${enableParallelChecking:+-j${NIX_BUILD_CORES} -l${NIX_BUILD_CORES}}
1099 SHELL=$SHELL
1100- $makeFlags ${makeFlagsArray+"${makeFlagsArray[@]}"}
1101- ${checkFlags:-VERBOSE=y} ${checkFlagsArray+"${checkFlagsArray[@]}"}
1102 ${checkTarget}
1103 )
1104···1123 # shellcheck disable=SC2086
1124 local flagsArray=(
1125 SHELL=$SHELL
1126- $makeFlags ${makeFlagsArray+"${makeFlagsArray[@]}"}
1127- $installFlags ${installFlagsArray+"${installFlagsArray[@]}"}
1128 ${installTargets:-install}
1129 )
1130···1231 local flagsArray=(
1232 ${enableParallelChecking:+-j${NIX_BUILD_CORES} -l${NIX_BUILD_CORES}}
1233 SHELL=$SHELL
1234- $makeFlags ${makeFlagsArray+"${makeFlagsArray[@]}"}
1235- $installCheckFlags ${installCheckFlagsArray+"${installCheckFlagsArray[@]}"}
1236 ${installCheckTarget:-installcheck}
1237 )
1238···1251 # Old bash empty array hack
1252 # shellcheck disable=SC2086
1253 local flagsArray=(
1254- $distFlags ${distFlagsArray+"${distFlagsArray[@]}"} ${distTarget:-dist}
1255 )
12561257 echo 'dist flags: %q' "${flagsArray[@]}"
···1set -eu
2set -o pipefail
34+if [[ -n "${BASH_VERSINFO-}" && "${BASH_VERSINFO-}" -lt 4 ]]; then
5 echo "Detected Bash version that isn't supported by Nixpkgs (${BASH_VERSION})"
6 echo "Please install Bash 4 or greater to continue."
7 exit 1
···121 set +e
122123 if [ -n "${showBuildStats:-}" ]; then
124+ read -r -d '' -a buildTimes < <(times)
125+ echo "build times:"
126+ echo "user time for the shell ${buildTimes[0]}"
127+ echo "system time for the shell ${buildTimes[1]}"
128+ echo "user time for all child processes ${buildTimes[2]}"
129+ echo "system time for all child processes ${buildTimes[3]}"
00130 fi
131132 if (( "$exitCode" != 0 )); then
···205 exec {fd}< "$fn"
206 read -r -n 4 -u "$fd" magic
207 exec {fd}<&-
208+209+ # nix uses 'declare -F' in get-env.sh to retrieve the loaded functions.
210+ # If we use the $'string' syntax instead of 'echo -ne' then 'declare' will print the raw characters and break nix.
211+ # See https://github.com/NixOS/nixpkgs/pull/138334 and https://github.com/NixOS/nix/issues/5262.
212+213 # https://opensource.apple.com/source/lldb/lldb-310.2.36/examples/python/mach_o.py.auto.html
214+ if [[ "$magic" = $(echo -ne "\xfe\xed\xfa\xcf") || "$magic" = $(echo -ne "\xcf\xfa\xed\xfe") ]]; then
215 # MH_MAGIC_64 || MH_CIGAM_64
216 return 0;
217+ elif [[ "$magic" = $(echo -ne "\xfe\xed\xfa\xce") || "$magic" = $(echo -ne "\xce\xfa\xed\xfe") ]]; then
218 # MH_MAGIC || MH_CIGAM
219 return 0;
220+ elif [[ "$magic" = $(echo -ne "\xca\xfe\xba\xbe") || "$magic" = $(echo -ne "\xbe\xba\xfe\xca") ]]; then
221 # FAT_MAGIC || FAT_CIGAM
222 return 0;
223 else
···332333declare -a pkgHookVarVars=(pkgBuildHookVars pkgHostHookVars pkgTargetHookVars)
334335+# those variables are declared here, since where and if they are used varies
336+# shellcheck disable=SC2034
337+declare -a preFixupHooks fixupOutputHooks preConfigureHooks postFixupHooks postUnpackHooks unpackCmdHooks
338+339# Add env hooks for all sorts of deps with the specified host offset.
340addEnvHooks() {
341 local depHostOffset="$1"
···377# implements.
378findInputs() {
379 local -r pkg="$1"
380+ local -r hostOffset="$2"
381+ local -r targetOffset="$3"
382383 # Sanity check
384+ (( hostOffset <= targetOffset )) || exit -1
385386+ local varVar="${pkgAccumVarVars[hostOffset + 1]}"
387+ local varRef="$varVar[$((targetOffset - hostOffset))]"
388 local var="${!varRef}"
389 unset -v varVar varRef
390···411 # offsets to current offset
412 local -i mapOffsetResult
413 function mapOffset() {
414+ local -r inputOffset="$1"
415+ if (( inputOffset <= 0 )); then
416+ local -r outputOffset=$((inputOffset + hostOffset))
417 else
418+ local -r outputOffset=$((inputOffset - 1 + targetOffset))
419 fi
420 mapOffsetResult="$outputOffset"
421 }
422423 # Host offset relative to that of the package whose immediate
424 # dependencies we are currently exploring.
425+ local relHostOffset
426 for relHostOffset in "${allPlatOffsets[@]}"; do
427 # `+ 1` so we start at 0 for valid index
428+ local files="${propagatedDepFilesVars[relHostOffset + 1]}"
429430 # Host offset relative to the package currently being
431 # built---as absolute an offset as will be used.
···503# Add package to the future PATH and run setup hooks
504activatePackage() {
505 local pkg="$1"
506+ local -r hostOffset="$2"
507+ local -r targetOffset="$3"
508509 # Sanity check
510+ (( hostOffset <= targetOffset )) || exit -1
511512 if [ -f "$pkg" ]; then
513 source "$pkg"
···524 addToSearchPath _PATH "$pkg/bin"
525 fi
526527+ if (( hostOffset <= -1 )); then
528 addToSearchPath _XDG_DATA_DIRS "$pkg/share"
529 fi
530···538}
539540_activatePkgs() {
541+ local hostOffset targetOffset
542 local pkg
543544 for hostOffset in "${allPlatOffsets[@]}"; do
545+ local pkgsVar="${pkgAccumVarVars[hostOffset + 1]}"
546 for targetOffset in "${allPlatOffsets[@]}"; do
547+ (( hostOffset <= targetOffset )) || continue
548 local pkgsRef="${pkgsVar}[$targetOffset - $hostOffset]"
549 local pkgsSlice="${!pkgsRef}[@]"
550 for pkg in ${!pkgsSlice+"${!pkgsSlice}"}; do
···566# with this information to the relevant env hook array, but bash
567# doesn't have closures, so it's easier to just pass this in.
568_addToEnv() {
569+ local depHostOffset depTargetOffset
570 local pkg
571572 for depHostOffset in "${allPlatOffsets[@]}"; do
573+ local hookVar="${pkgHookVarVars[depHostOffset + 1]}"
574+ local pkgsVar="${pkgAccumVarVars[depHostOffset + 1]}"
575 for depTargetOffset in "${allPlatOffsets[@]}"; do
576+ (( depHostOffset <= depTargetOffset )) || continue
577 local hookRef="${hookVar}[$depTargetOffset - $depHostOffset]"
578 if [[ -z "${strictDeps-}" ]]; then
579···585 #
586 # TODO(@Ericson2314): Don't special-case native compilation
587 for pkg in \
588+ "${pkgsBuildBuild[@]}" \
589+ "${pkgsBuildHost[@]}" \
590+ "${pkgsBuildTarget[@]}" \
591+ "${pkgsHostHost[@]}" \
592+ "${pkgsHostTarget[@]}" \
593+ "${pkgsTargetTarget[@]}"
594 do
595 if [[ "$visitedPkgs" = *"$pkg"* ]]; then
596 continue
···663# means that we're supposed to try and auto-detect the number of
664# available CPU cores at run-time.
665666+NIX_BUILD_CORES="${NIX_BUILD_CORES:-1}"
667+if ((NIX_BUILD_CORES <= 0)); then
668+ guess=$(nproc 2>/dev/null || true)
669+ ((NIX_BUILD_CORES = guess <= 0 ? 1 : guess))
00000670fi
671export NIX_BUILD_CORES
672673674# Prevent SSL libraries from using certificates in /etc/ssl, unless set explicitly.
675# Leave it in impure shells for convenience.
676+if [[ -z "${NIX_SSL_CERT_FILE:-}" && "${IN_NIX_SHELL:-}" != "impure" ]]; then
677 export NIX_SSL_CERT_FILE=/no-cert-file.crt
678fi
679# Another variant left for compatibility.
680+if [[ -z "${SSL_CERT_FILE:-}" && "${IN_NIX_SHELL:-}" != "impure" ]]; then
681 export SSL_CERT_FILE=/no-cert-file.crt
682fi
683···741 printf "%s" "${!var}"
742}
743744+# put the content of a file in a variable
745+# fail loudly if provided with a binary (containing null bytes)
746consumeEntire() {
747 # read returns non-0 on EOF, so we want read to fail
748+ if IFS='' read -r -d '' $1 ; then
749 echo "consumeEntire(): ERROR: Input null bytes, won't process" >&2
750 return 1
751 fi
···1014 configureFlags="${prefixKey:---prefix=}$prefix $configureFlags"
1015 fi
10161017+ if [[ -f "$configureScript" ]]; then
1018+ # Add --disable-dependency-tracking to speed up some builds.
1019+ if [ -z "${dontAddDisableDepTrack:-}" ]; then
1020+ if grep -q dependency-tracking "$configureScript"; then
1021+ configureFlags="--disable-dependency-tracking $configureFlags"
1022+ fi
1023 fi
010241025+ # By default, disable static builds.
1026+ if [ -z "${dontDisableStatic:-}" ]; then
1027+ if grep -q enable-static "$configureScript"; then
1028+ configureFlags="--disable-static $configureFlags"
1029+ fi
1030 fi
1031 fi
1032···1034 # Old bash empty array hack
1035 # shellcheck disable=SC2086
1036 local flagsArray=(
1037+ $configureFlags "${configureFlagsArray[@]}"
1038 )
1039 echoCmd 'configure flags' "${flagsArray[@]}"
1040 # shellcheck disable=SC2086
···1064 local flagsArray=(
1065 ${enableParallelBuilding:+-j${NIX_BUILD_CORES} -l${NIX_BUILD_CORES}}
1066 SHELL=$SHELL
1067+ $makeFlags "${makeFlagsArray[@]}"
1068+ $buildFlags "${buildFlagsArray[@]}"
1069 )
10701071 echoCmd 'build flags' "${flagsArray[@]}"
···1103 local flagsArray=(
1104 ${enableParallelChecking:+-j${NIX_BUILD_CORES} -l${NIX_BUILD_CORES}}
1105 SHELL=$SHELL
1106+ $makeFlags "${makeFlagsArray[@]}"
1107+ ${checkFlags:-VERBOSE=y} "${checkFlagsArray[@]}"
1108 ${checkTarget}
1109 )
1110···1129 # shellcheck disable=SC2086
1130 local flagsArray=(
1131 SHELL=$SHELL
1132+ $makeFlags "${makeFlagsArray[@]}"
1133+ $installFlags "${installFlagsArray[@]}"
1134 ${installTargets:-install}
1135 )
1136···1237 local flagsArray=(
1238 ${enableParallelChecking:+-j${NIX_BUILD_CORES} -l${NIX_BUILD_CORES}}
1239 SHELL=$SHELL
1240+ $makeFlags "${makeFlagsArray[@]}"
1241+ $installCheckFlags "${installCheckFlagsArray[@]}"
1242 ${installCheckTarget:-installcheck}
1243 )
1244···1257 # Old bash empty array hack
1258 # shellcheck disable=SC2086
1259 local flagsArray=(
1260+ $distFlags "${distFlagsArray[@]}" ${distTarget:-dist}
1261 )
12621263 echo 'dist flags: %q' "${flagsArray[@]}"
+9-1
pkgs/tools/archivers/cpio/default.nix
···1-{ lib, stdenv, fetchurl }:
23let
4 version = "2.13";
···10 url = "mirror://gnu/cpio/${name}.tar.bz2";
11 sha256 = "0vbgnhkawdllgnkdn6zn1f56fczwk0518krakz2qbwhxmv2vvdga";
12 };
000000001314 preConfigure = if stdenv.isCygwin then ''
15 sed -i gnu/fpending.h -e 's,include <stdio_ext.h>,,'