···2070 The <literal>installManPage</literal> function takes one or more paths to manpages to install. The manpages must have a section suffix, and may optionally be compressed (with <literal>.gz</literal> suffix). This function will place them into the correct directory.
2071 </para>
2072 <para>
2073- The <literal>installShellCompletion</literal> function takes one or more paths to shell completion files. By default it will autodetect the shell type from the completion file extension, but you may also specify it by passing one of <literal>--bash</literal>, <literal>--fish</literal>, or <literal>--zsh</literal>. These flags apply to all paths listed after them (up until another shell flag is given). Each path may also have a custom installation name provided by providing a flag <literal>--name NAME</literal> before the path. If this flag is not provided, zsh completions will be renamed automatically such that <literal>foobar.zsh</literal> becomes <literal>_foobar</literal>.
2074<programlisting>
2075nativeBuildInputs = [ installShellFiles ];
2076postInstall = ''
···2081 installShellCompletion --zsh --name _foobar share/completions.zsh
2082 # implicit behavior
2083 installShellCompletion share/completions/foobar.{bash,fish,zsh}
000002084'';
2085</programlisting>
2086 </para>
···2070 The <literal>installManPage</literal> function takes one or more paths to manpages to install. The manpages must have a section suffix, and may optionally be compressed (with <literal>.gz</literal> suffix). This function will place them into the correct directory.
2071 </para>
2072 <para>
2073+ The <literal>installShellCompletion</literal> function takes one or more paths to shell completion files. By default it will autodetect the shell type from the completion file extension, but you may also specify it by passing one of <literal>--bash</literal>, <literal>--fish</literal>, or <literal>--zsh</literal>. These flags apply to all paths listed after them (up until another shell flag is given). Each path may also have a custom installation name provided by providing a flag <literal>--name NAME</literal> before the path. If this flag is not provided, zsh completions will be renamed automatically such that <literal>foobar.zsh</literal> becomes <literal>_foobar</literal>. A root name may be provided for all paths using the flag <literal>--cmd NAME</literal>; this synthesizes the appropriate name depending on the shell (e.g. <literal>--cmd foo</literal> will synthesize the name <literal>foo.bash</literal> for bash and <literal>_foo</literal> for zsh). The path may also be a fifo or named fd (such as produced by <literal><(cmd)</literal>), in which case the shell and name must be provided.
2074<programlisting>
2075nativeBuildInputs = [ installShellFiles ];
2076postInstall = ''
···2081 installShellCompletion --zsh --name _foobar share/completions.zsh
2082 # implicit behavior
2083 installShellCompletion share/completions/foobar.{bash,fish,zsh}
2084+ # using named fd
2085+ installShellCompletion --cmd foobar \
2086+ --bash <($out/bin/foobar --bash-completion) \
2087+ --fish <($out/bin/foobar --fish-completion) \
2088+ --zsh <($out/bin/foobar --zsh-completion)
2089'';
2090</programlisting>
2091 </para>
···1-{ makeSetupHook }:
23# See the header comment in ../setup-hooks/install-shell-files.sh for example usage.
4-makeSetupHook { name = "install-shell-files"; } ../setup-hooks/install-shell-files.sh
00000000
···1+{ makeSetupHook, tests }:
23# See the header comment in ../setup-hooks/install-shell-files.sh for example usage.
4+let
5+ setupHook = makeSetupHook { name = "install-shell-files"; } ../setup-hooks/install-shell-files.sh;
6+in
7+8+setupHook.overrideAttrs (oldAttrs: {
9+ passthru = (oldAttrs.passthru or {}) // {
10+ tests = tests.install-shell-files;
11+ };
12+})
···1-#!/bin/bash
2# Setup hook for the `installShellFiles` package.
3#
4# Example usage in a derivation:
···19# installManPage <path> [...<path>]
20#
21# Each argument is checked for its man section suffix and installed into the appropriate
22-# share/man<n>/ directory. The function returns an error if any paths don't have the man section
23-# suffix (with optional .gz compression).
24installManPage() {
25 local path
26 for path in "$@"; do
···49 done
50}
5152-# installShellCompletion [--bash|--fish|--zsh] ([--name <name>] <path>)...
53#
54# Each path is installed into the appropriate directory for shell completions for the given shell.
55# If one of `--bash`, `--fish`, or `--zsh` is given the path is assumed to belong to that shell.
···61# If the shell completion needs to be renamed before installing the optional `--name <name>` flag
62# may be given. Any name provided with this flag only applies to the next path.
63#
0000064# For zsh completions, if the `--name` flag is not given, the path will be automatically renamed
65# such that `foobar.zsh` becomes `_foobar`.
66#
00000067# This command accepts multiple shell flags in conjunction with multiple paths if you wish to
68# install them all in one command:
69#
···76# installShellCompletion --fish --name foobar.fish share/completions.fish
77# installShellCompletion --zsh --name _foobar share/completions.zsh
78#
000000079# If any argument is `--` the remaining arguments will be treated as paths.
80installShellCompletion() {
81- local shell='' name='' retval=0 parseArgs=1 arg
82 while { arg=$1; shift; }; do
83 # Parse arguments
84 if (( parseArgs )); then
···97 # treat `--name=foo` the same as `--name foo`
98 name=${arg#--name=}
99 continue;;
00000000000100 --?*)
101 echo "installShellCompletion: warning: unknown flag ${arg%%=*}" >&2
102 retval=2
···110 if (( "${NIX_DEBUG:-0}" >= 1 )); then
111 echo "installShellCompletion: installing $arg${name:+ as $name}"
112 fi
113- # if we get here, this is a path
114- # Identify shell
115- local basename
116- basename=$(stripHash "$arg")
117 local curShell=$shell
118- if [[ -z "$curShell" ]]; then
119- # auto-detect the shell
120- case "$basename" in
121- ?*.bash) curShell=bash;;
122- ?*.fish) curShell=fish;;
123- ?*.zsh) curShell=zsh;;
00000000000000000000000000000000000000124 *)
125- if [[ "$basename" = _* && "$basename" != *.* ]]; then
126- # probably zsh
127- echo "installShellCompletion: warning: assuming path \`$arg' is zsh; please specify with --zsh" >&2
128- curShell=zsh
129- else
130- echo "installShellCompletion: warning: unknown shell for path: $arg" >&2
131- retval=2
132- continue
133- fi;;
134 esac
135 fi
136- # Identify output path
137- local outName sharePath
138- outName=${name:-$basename}
139 case "$curShell" in
140 bash) sharePath=bash-completion/completions;;
141 fish) sharePath=fish/vendor_completions.d;;
142 zsh)
143 sharePath=zsh/site-functions
144 # only apply automatic renaming if we didn't have a manual rename
145- if test -z "$name"; then
146 # convert a name like `foo.zsh` into `_foo`
147 outName=${outName%.zsh}
148 outName=_${outName#_}
···153 return 1;;
154 esac
155 # Install file
156- install -Dm644 -T "$arg" "${!outputBin:?}/share/$sharePath/$outName" || return
157- # Clear the name, it only applies to one path
00000000158 name=
159 done
160 if [[ -n "$name" ]]; then
···1+# shellcheck shell=bash
2# Setup hook for the `installShellFiles` package.
3#
4# Example usage in a derivation:
···19# installManPage <path> [...<path>]
20#
21# Each argument is checked for its man section suffix and installed into the appropriate
22+# share/man/man<n>/ directory. The function returns an error if any paths don't have the man
23+# section suffix (with optional .gz compression).
24installManPage() {
25 local path
26 for path in "$@"; do
···49 done
50}
5152+# installShellCompletion [--cmd <name>] ([--bash|--fish|--zsh] [--name <name>] <path>)...
53#
54# Each path is installed into the appropriate directory for shell completions for the given shell.
55# If one of `--bash`, `--fish`, or `--zsh` is given the path is assumed to belong to that shell.
···61# If the shell completion needs to be renamed before installing the optional `--name <name>` flag
62# may be given. Any name provided with this flag only applies to the next path.
63#
64+# If all shell completions need to be renamed before installing the optional `--cmd <name>` flag
65+# may be given. This will synthesize a name for each file, unless overridden with an explicit
66+# `--name` flag. For example, `--cmd foobar` will synthesize the name `_foobar` for zsh and
67+# `foobar.bash` for bash.
68+#
69# For zsh completions, if the `--name` flag is not given, the path will be automatically renamed
70# such that `foobar.zsh` becomes `_foobar`.
71#
72+# A path may be a named fd, such as produced by the bash construct `<(cmd)`. When using a named fd,
73+# the shell type flag must be provided, and either the `--name` or `--cmd` flag must be provided.
74+# This might look something like:
75+#
76+# installShellCompletion --zsh --name _foobar <($out/bin/foobar --zsh-completion)
77+#
78# This command accepts multiple shell flags in conjunction with multiple paths if you wish to
79# install them all in one command:
80#
···87# installShellCompletion --fish --name foobar.fish share/completions.fish
88# installShellCompletion --zsh --name _foobar share/completions.zsh
89#
90+# Or to use shell newline escaping to split a single invocation across multiple lines:
91+#
92+# installShellCompletion --cmd foobar \
93+# --bash <($out/bin/foobar --bash-completion) \
94+# --fish <($out/bin/foobar --fish-completion) \
95+# --zsh <($out/bin/foobar --zsh-completion)
96+#
97# If any argument is `--` the remaining arguments will be treated as paths.
98installShellCompletion() {
99+ local shell='' name='' cmdname='' retval=0 parseArgs=1 arg
100 while { arg=$1; shift; }; do
101 # Parse arguments
102 if (( parseArgs )); then
···115 # treat `--name=foo` the same as `--name foo`
116 name=${arg#--name=}
117 continue;;
118+ --cmd)
119+ cmdname=$1
120+ shift || {
121+ echo 'installShellCompletion: error: --cmd flag expected an argument' >&2
122+ return 1
123+ }
124+ continue;;
125+ --cmd=*)
126+ # treat `--cmd=foo` the same as `--cmd foo`
127+ cmdname=${arg#--cmd=}
128+ continue;;
129 --?*)
130 echo "installShellCompletion: warning: unknown flag ${arg%%=*}" >&2
131 retval=2
···139 if (( "${NIX_DEBUG:-0}" >= 1 )); then
140 echo "installShellCompletion: installing $arg${name:+ as $name}"
141 fi
142+ # if we get here, this is a path or named pipe
143+ # Identify shell and output name
00144 local curShell=$shell
145+ local outName=''
146+ if [[ -z "$arg" ]]; then
147+ echo "installShellCompletion: error: empty path is not allowed" >&2
148+ return 1
149+ elif [[ -p "$arg" ]]; then
150+ # this is a named fd or fifo
151+ if [[ -z "$curShell" ]]; then
152+ echo "installShellCompletion: error: named pipe requires one of --bash, --fish, or --zsh" >&2
153+ return 1
154+ elif [[ -z "$name" && -z "$cmdname" ]]; then
155+ echo "installShellCompletion: error: named pipe requires one of --cmd or --name" >&2
156+ return 1
157+ fi
158+ else
159+ # this is a path
160+ local argbase
161+ argbase=$(stripHash "$arg")
162+ if [[ -z "$curShell" ]]; then
163+ # auto-detect the shell
164+ case "$argbase" in
165+ ?*.bash) curShell=bash;;
166+ ?*.fish) curShell=fish;;
167+ ?*.zsh) curShell=zsh;;
168+ *)
169+ if [[ "$argbase" = _* && "$argbase" != *.* ]]; then
170+ # probably zsh
171+ echo "installShellCompletion: warning: assuming path \`$arg' is zsh; please specify with --zsh" >&2
172+ curShell=zsh
173+ else
174+ echo "installShellCompletion: warning: unknown shell for path: $arg" >&2
175+ retval=2
176+ continue
177+ fi;;
178+ esac
179+ fi
180+ outName=$argbase
181+ fi
182+ # Identify output path
183+ if [[ -n "$name" ]]; then
184+ outName=$name
185+ elif [[ -n "$cmdname" ]]; then
186+ case "$curShell" in
187+ bash|fish) outName=$cmdname.$curShell;;
188+ zsh) outName=_$cmdname;;
189 *)
190+ # Our list of shells is out of sync with the flags we accept or extensions we detect.
191+ echo 'installShellCompletion: internal error' >&2
192+ return 1;;
000000193 esac
194 fi
195+ local sharePath
00196 case "$curShell" in
197 bash) sharePath=bash-completion/completions;;
198 fish) sharePath=fish/vendor_completions.d;;
199 zsh)
200 sharePath=zsh/site-functions
201 # only apply automatic renaming if we didn't have a manual rename
202+ if [[ -z "$name" && -z "$cmdname" ]]; then
203 # convert a name like `foo.zsh` into `_foo`
204 outName=${outName%.zsh}
205 outName=_${outName#_}
···210 return 1;;
211 esac
212 # Install file
213+ local outDir="${!outputBin:?}/share/$sharePath"
214+ local outPath="$outDir/$outName"
215+ if [[ -p "$arg" ]]; then
216+ # install handles named pipes on NixOS but not on macOS
217+ mkdir -p "$outDir" \
218+ && cat "$arg" > "$outPath"
219+ else
220+ install -Dm644 -T "$arg" "$outPath"
221+ fi || return
222+ # Clear the per-path flags
223 name=
224 done
225 if [[ -n "$name" ]]; then
···287 done
288289 # Two identical man pages are shipped (moving and compressing is done later)
290- ln -sf gcc.1 "$out"/share/man/man1/g++.1
00000291}
292293genericBuild
···287 done
288289 # Two identical man pages are shipped (moving and compressing is done later)
290+ for i in "$out"/share/man/man1/*g++.1; do
291+ if test -e "$i"; then
292+ man_prefix=`echo "$i" | sed "s,.*/\(.*\)g++.1,\1,"`
293+ ln -sf "$man_prefix"gcc.1 "$i"
294+ fi
295+ done
296}
297298genericBuild
+64-11
pkgs/development/compilers/ghc/8.10.2-binary.nix
···2, fetchurl, perl, gcc
3, ncurses6, gmp, glibc, libiconv, numactl
4, llvmPackages
000000005}:
67# Prebuilt only does native
···82 patchShebangs ghc-${version}/utils/
83 patchShebangs ghc-${version}/configure
84 '' +
85-86 # We have to patch the GMP paths for the integer-gmp package.
87 ''
88 find . -name integer-gmp.buildinfo \
···90 '' + stdenv.lib.optionalString stdenv.isDarwin ''
91 find . -name base.buildinfo \
92 -exec sed -i "s@extra-lib-dirs: @extra-lib-dirs: ${libiconv}/lib@" {} \;
00000093 '' +
94 # Rename needed libraries and binaries, fix interpreter
95 stdenv.lib.optionalString stdenv.isLinux ''
···128129 # On Linux, use patchelf to modify the executables so that they can
130 # find editline/gmp.
131- postFixup = stdenv.lib.optionalString stdenv.isLinux ''
132- for p in $(find "$out" -type f -executable); do
133- if isELF "$p"; then
134- echo "Patchelfing $p"
135- patchelf --set-rpath "${libPath}:$(patchelf --print-rpath $p)" $p
136- fi
137- done
138- '' + stdenv.lib.optionalString stdenv.isDarwin ''
000000000000000000000139 # not enough room in the object files for the full path to libiconv :(
140 for exe in $(find "$out" -type f -executable); do
141 isScript $exe && continue
···146 for file in $(find "$out" -name setup-config); do
147 substituteInPlace $file --replace /usr/bin/ranlib "$(type -P ranlib)"
148 done
0000000149 '';
150151 doInstallCheck = true;
···169 enableShared = true;
170 };
171172- meta.license = stdenv.lib.licenses.bsd3;
173- meta.platforms = ["x86_64-linux" "armv7l-linux" "aarch64-linux" "i686-linux" "x86_64-darwin"];
000000000000174}
···2, fetchurl, perl, gcc
3, ncurses6, gmp, glibc, libiconv, numactl
4, llvmPackages
5+6+ # minimal = true; will remove files that aren't strictly necessary for
7+ # regular builds and GHC bootstrapping.
8+ # This is "useful" for staying within hydra's output limits for at least the
9+ # aarch64-linux architecture.
10+ # Examples of unnecessary files are the bundled documentation and files that
11+ # are only needed for profiling builds.
12+, minimal ? false
13}:
1415# Prebuilt only does native
···90 patchShebangs ghc-${version}/utils/
91 patchShebangs ghc-${version}/configure
92 '' +
093 # We have to patch the GMP paths for the integer-gmp package.
94 ''
95 find . -name integer-gmp.buildinfo \
···97 '' + stdenv.lib.optionalString stdenv.isDarwin ''
98 find . -name base.buildinfo \
99 -exec sed -i "s@extra-lib-dirs: @extra-lib-dirs: ${libiconv}/lib@" {} \;
100+ '' +
101+ # aarch64 does HAVE_NUMA so -lnuma requires it in library-dirs in rts/package.conf.in
102+ # FFI_LIB_DIR is a good indication of places it must be needed.
103+ stdenv.lib.optionalString stdenv.hostPlatform.isAarch64 ''
104+ find . -name package.conf.in \
105+ -exec sed -i "s@FFI_LIB_DIR@FFI_LIB_DIR ${numactl.out}/lib@g" {} \;
106 '' +
107 # Rename needed libraries and binaries, fix interpreter
108 stdenv.lib.optionalString stdenv.isLinux ''
···141142 # On Linux, use patchelf to modify the executables so that they can
143 # find editline/gmp.
144+ postFixup = stdenv.lib.optionalString stdenv.isLinux
145+ (if stdenv.hostPlatform.isAarch64 then
146+ # Keep rpath as small as possible on aarch64 for patchelf#244. All Elfs
147+ # are 2 directories deep from $out/lib, so pooling symlinks there makes
148+ # a short rpath.
149+ ''
150+ (cd $out/lib; ln -s ${ncurses6.out}/lib/libtinfo.so.6)
151+ (cd $out/lib; ln -s ${gmp.out}/lib/libgmp.so.10)
152+ (cd $out/lib; ln -s ${numactl.out}/lib/libnuma.so.1)
153+ for p in $(find "$out/lib" -type f -name "*\.so*"); do
154+ (cd $out/lib; ln -s $p)
155+ done
156+157+ for p in $(find "$out/lib" -type f -executable); do
158+ if isELF "$p"; then
159+ echo "Patchelfing $p"
160+ patchelf --set-rpath "\$ORIGIN:\$ORIGIN/../.." $p
161+ fi
162+ done
163+ ''
164+ else
165+ ''
166+ for p in $(find "$out" -type f -executable); do
167+ if isELF "$p"; then
168+ echo "Patchelfing $p"
169+ patchelf --set-rpath "${libPath}:$(patchelf --print-rpath $p)" $p
170+ fi
171+ done
172+ '') + stdenv.lib.optionalString stdenv.isDarwin ''
173 # not enough room in the object files for the full path to libiconv :(
174 for exe in $(find "$out" -type f -executable); do
175 isScript $exe && continue
···180 for file in $(find "$out" -name setup-config); do
181 substituteInPlace $file --replace /usr/bin/ranlib "$(type -P ranlib)"
182 done
183+ '' +
184+ stdenv.lib.optionalString minimal ''
185+ # Remove profiling objects
186+ find $out -type f -name '*.p_o' -delete
187+ rm $out/lib/ghc-*/bin/ghc-iserv-prof
188+ # Remove docs
189+ rm -r $out/share/{doc,man}
190 '';
191192 doInstallCheck = true;
···210 enableShared = true;
211 };
212213+ meta = let
214+ platforms = ["x86_64-linux" "armv7l-linux" "aarch64-linux" "i686-linux" "x86_64-darwin"];
215+ in {
216+ homepage = "http://haskell.org/ghc";
217+ description = "The Glasgow Haskell Compiler";
218+ license = stdenv.lib.licenses.bsd3;
219+220+ # The minimal variation can not be distributed because it removes the
221+ # documentation, including licensing information that is required for
222+ # distribution.
223+ inherit platforms;
224+ hydraPlatforms = stdenv.lib.optionals (!minimal) platforms;
225+ maintainers = with stdenv.lib.maintainers; [ lostnet ];
226+ };
227}
+5-1
pkgs/development/compilers/ghc/8.8.4.nix
···119 postPatch = "patchShebangs .";
120121 # GHC is a bit confused on its cross terminology.
122- preConfigure = ''
0000123 for env in $(env | grep '^TARGET_' | sed -E 's|\+?=.*||'); do
124 export "''${env#TARGET_}=''${!env}"
125 done
···119 postPatch = "patchShebangs .";
120121 # GHC is a bit confused on its cross terminology.
122+ preConfigure = stdenv.lib.optionalString stdenv.isAarch64 ''
123+ # Aarch64 allow backward bootstrapping since earlier versions are unstable.
124+ find . -name \*\.cabal\* -exec sed -i -e 's/\(base.*\)4.14/\14.16/' {} \; \
125+ -exec sed -i -e 's/\(prim.*\)0.6/\10.8/' {} \;
126+ '' + ''
127 for env in $(env | grep '^TARGET_' | sed -E 's|\+?=.*||'); do
128 export "''${env#TARGET_}=''${!env}"
129 done
+2-9
pkgs/development/compilers/go/1.4.nix
···43 cd go
44 patchShebangs ./ # replace /bin/bash
450046 # Disabling the 'os/http/net' tests (they want files not available in
47 # chroot builds)
48 rm src/net/{multicast_test.go,parse_test.go,port_test.go}
···56 sed -i '/TestDialTimeout/areturn' src/net/dial_test.go
57 # Disable the hostname test
58 sed -i '/TestHostname/areturn' src/os/os_test.go
59- # ParseInLocation fails the test
60- sed -i '/TestParseInSydney/areturn' src/time/format_test.go
6162 sed -i 's,/etc/protocols,${iana-etc}/etc/protocols,' src/net/lookup_unix.go
63 '' + lib.optionalString stdenv.isLinux ''
···119 patches = [
120 ./remove-tools-1.4.patch
121 ./creds-test-1.4.patch
122-123- # This test checks for the wrong thing with recent tzdata. It's been fixed in master but the patch
124- # actually works on old versions too.
125- (fetchpatch {
126- url = "https://github.com/golang/go/commit/91563ced5897faf729a34be7081568efcfedda31.patch";
127- sha256 = "1ny5l3f8a9dpjjrnjnsplb66308a0x13sa0wwr4j6yrkc8j4qxqi";
128- })
129 ];
130131 GOOS = if stdenv.isDarwin then "darwin" else "linux";
···43 cd go
44 patchShebangs ./ # replace /bin/bash
4546+ # Disable timezone tests (these fail when `tzdata` is updated)
47+ rm src/time/{example,format}_test.go
48 # Disabling the 'os/http/net' tests (they want files not available in
49 # chroot builds)
50 rm src/net/{multicast_test.go,parse_test.go,port_test.go}
···58 sed -i '/TestDialTimeout/areturn' src/net/dial_test.go
59 # Disable the hostname test
60 sed -i '/TestHostname/areturn' src/os/os_test.go
006162 sed -i 's,/etc/protocols,${iana-etc}/etc/protocols,' src/net/lookup_unix.go
63 '' + lib.optionalString stdenv.isLinux ''
···119 patches = [
120 ./remove-tools-1.4.patch
121 ./creds-test-1.4.patch
0000000122 ];
123124 GOOS = if stdenv.isDarwin then "darwin" else "linux";
···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-, llvmPackages
17-, pkgsBuildTarget, pkgsBuildBuild
18-, makeRustPlatform
19-} @ args:
20-21-import ./default.nix {
22- rustcVersion = "1.46.0";
23- rustcSha256 = "0a17jby2pd050s24cy4dfc0gzvgcl585v3vvyfilniyvjrqknsid";
24-25- # Note: the version MUST be one version prior to the version we're
26- # building
27- bootstrapVersion = "1.45.2";
28-29- # fetch hashes by running `print-hashes.sh 1.45.2`
30- bootstrapHashes = {
31- i686-unknown-linux-gnu = "5b2050dde23152750de89f7e59acaab6bf088d0beb5854c69c9a545fd254b936";
32- x86_64-unknown-linux-gnu = "860feed955726a4d96ffe40758a110053326b9ae11c9e1ee059e9c6222f25643";
33- arm-unknown-linux-gnueabihf = "ddb5f59bbdef84e0b7c83049461e003ed031dd881a4622365c3d475102535c60";
34- armv7-unknown-linux-gnueabihf = "7a556581f87602705f9c89b04cce621cfbba9050b6fbe478166e91d164567531";
35- aarch64-unknown-linux-gnu = "151fad66442d28a4e4786753d1afb559c4a3d359081c64769273a31c2f0f4d30";
36- x86_64-apple-darwin = "6e8067624ede10aa23081d62e0086c6f42f7228cc0d00fb5ff24d4dac65249d6";
37- };
38-39- selectRustPackage = pkgs: pkgs.rust_1_46;
40-41- rustcPatches = [
42- ];
43-}
44-45-(builtins.removeAttrs args [ "fetchpatch" ])
···000000000000000000000000000000000000000000000
+45
pkgs/development/compilers/rust/1_47.nix
···000000000000000000000000000000000000000000000
···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+, llvmPackages
17+, pkgsBuildTarget, pkgsBuildBuild
18+, makeRustPlatform
19+} @ args:
20+21+import ./default.nix {
22+ rustcVersion = "1.47.0";
23+ rustcSha256 = "sha256-MYXfBkxHR/LIubuMRGjt1Y/0rW0HiAyHmsGxc7do2B0=";
24+25+ # Note: the version MUST be one version prior to the version we're
26+ # building
27+ bootstrapVersion = "1.46.0";
28+29+ # fetch hashes by running `print-hashes.sh 1.45.2`
30+ bootstrapHashes = {
31+ i686-unknown-linux-gnu = "6ebd7e04dc18a36d08b9731cdb42d5caf8460e1eb41b75f3a8596c39f5e71206";
32+ x86_64-unknown-linux-gnu = "e3b98bc3440fe92817881933f9564389eccb396f5f431f33d48b979fa2fbdcf5";
33+ arm-unknown-linux-gnueabihf = "bb8af68565321f54608e918597083eb016ed0f9f4f3cc23f7cc5f467b934ce7f";
34+ armv7-unknown-linux-gnueabihf = "7c0640879d7f2c38db60352e3c0f09e3fc6fa3bac6ca8f22cbccb1eb5e950121";
35+ aarch64-unknown-linux-gnu = "f0c6d630f3dedb3db69d69ed9f833aa6b472363096f5164f1068c7001ca42aeb";
36+ x86_64-apple-darwin = "82d61582a3772932432a99789c3b3bd4abe6baca339e355048ca9efb9ea5b4db";
37+ };
38+39+ selectRustPackage = pkgs: pkgs.rust_1_47;
40+41+ rustcPatches = [
42+ ];
43+}
44+45+(builtins.removeAttrs args [ "fetchpatch" ])
+9-3
pkgs/development/compilers/rust/binary.nix
···1-{ stdenv, makeWrapper, bash, curl, darwin
2, version
3, src
4, platform
···42 ./install.sh --prefix=$out \
43 --components=${installComponents}
4445- ${optionalString (stdenv.isLinux && bootstrapping) ''
46 patchelf \
47 --set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) \
48 "$out/bin/rustc"
00000049 patchelf \
50 --set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) \
51 "$out/bin/rustdoc"
52 patchelf \
53 --set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) \
54 "$out/bin/cargo"
55- ''}
5657 # Do NOT, I repeat, DO NOT use `wrapProgram` on $out/bin/rustc
58 # (or similar) here. It causes strange effects where rustc loads
···1-{ stdenv, fetchurl }:
23# Note: this package is used for bootstrapping fetchurl, and thus
4# cannot use fetchpatch! All mutable patches (generated by GitHub or
5# cgit) that are needed here should be included directly in Nixpkgs as
6# files.
78-stdenv.mkDerivation rec {
9- name = "expat-2.2.8";
001011 src = fetchurl {
12- url = "https://github.com/libexpat/libexpat/releases/download/R_2_2_8/${name}.tar.xz";
13- sha256 = "16vpj5mk3lps3x7fr8cs03rffx3ir4jilyqw0frayn6q94daijk1";
14 };
1516 outputs = [ "out" "dev" ]; # TODO: fix referrers
···1+{ stdenv, fetchurl, lib }:
23# Note: this package is used for bootstrapping fetchurl, and thus
4# cannot use fetchpatch! All mutable patches (generated by GitHub or
5# cgit) that are needed here should be included directly in Nixpkgs as
6# files.
78+let
9+ version = "2.2.10";
10+in stdenv.mkDerivation rec {
11+ name = "expat-${version}";
1213 src = fetchurl {
14+ url = "https://github.com/libexpat/libexpat/releases/download/R_${lib.replaceStrings ["."] ["_"] version}/${name}.tar.xz";
15+ sha256 = "sha256-Xf5Tj4tbY/A+mO2sUg19mmpNIuSC5cltTQb8xUhcJfI=";
16 };
1718 outputs = [ "out" "dev" ]; # TODO: fix referrers
+2-2
pkgs/development/libraries/freetype/default.nix
···1415in stdenv.mkDerivation rec {
16 pname = "freetype";
17- version = "2.10.2";
1819 meta = with stdenv.lib; {
20 description = "A font rendering engine";
···3334 src = fetchurl {
35 url = "mirror://savannah/${pname}/${pname}-${version}.tar.xz";
36- sha256 = "12rd181yzz6952cyjqaa4253f5szam93cmhw18p33rnj4l8dchqm";
37 };
3839 propagatedBuildInputs = [ zlib bzip2 libpng ]; # needed when linking against freetype
···1415in stdenv.mkDerivation rec {
16 pname = "freetype";
17+ version = "2.10.4";
1819 meta = with stdenv.lib; {
20 description = "A font rendering engine";
···3334 src = fetchurl {
35 url = "mirror://savannah/${pname}/${pname}-${version}.tar.xz";
36+ sha256 = "112pyy215chg7f7fmp2l9374chhhpihbh8wgpj5nj6avj3c59a46";
37 };
3839 propagatedBuildInputs = [ zlib bzip2 libpng ]; # needed when linking against freetype
···52 # cut-in-half-by-\0 store path references.
53 # Let’s just clear the whole rpath and hope for the best.
54 ./clear-old-rpath.patch
0000055 ];
5657 setupHook = ./setup-hook.sh;
···52 # cut-in-half-by-\0 store path references.
53 # Let’s just clear the whole rpath and hope for the best.
54 ./clear-old-rpath.patch
55+56+ # Patch out default boost search paths to avoid impure builds on
57+ # unsandboxed non-NixOS builds, see:
58+ # https://github.com/NixOS/nixpkgs/issues/86131#issuecomment-711051774
59+ ./boost-Do-not-add-system-paths-on-nix.patch
60 ];
6162 setupHook = ./setup-hook.sh;
···1+From 4a071afbd056282746a5bc9362e87f579a56402d Mon Sep 17 00:00:00 2001
2+From: Tom Lane <tgl@sss.pgh.pa.us>
3+Date: Thu, 29 Oct 2020 15:28:14 -0400
4+Subject: [PATCH 1/1] Stabilize timetz test across DST transitions.
5+6+The timetz test cases I added in commit a9632830b were unintentionally
7+sensitive to whether or not DST is active in the PST8PDT time zone.
8+Thus, they'll start failing this coming weekend, as reported by
9+Bernhard M. Wiedemann in bug #16689. Fortunately, DST-awareness is
10+not significant to the purpose of these test cases, so we can just
11+force them all to PDT (DST hours) to preserve stability of the
12+results.
13+14+Back-patch to v10, as the prior patch was.
15+16+Discussion: https://postgr.es/m/16689-57701daa23b377bf@postgresql.org
17+Git viewer: https://git.postgresql.org/gitweb/?p=postgresql.git;a=commitdiff;h=4a071afbd056282746a5bc9362e87f579a56402d;hp=f90149e6285aaae6b48559afce1bd638ee26c33e
18+---
19+ src/test/regress/expected/timetz.out | 32 ++++++++++++++--------------
20+ src/test/regress/sql/timetz.sql | 16 +++++++-------
21+ 2 files changed, 24 insertions(+), 24 deletions(-)
22+23+diff --git a/src/test/regress/expected/timetz.out b/src/test/regress/expected/timetz.out
24+index 038bb5fa09..1ab5ed5105 100644
25+--- a/src/test/regress/expected/timetz.out
26++++ b/src/test/regress/expected/timetz.out
27+@@ -91,45 +91,45 @@ SELECT f1 AS "Ten" FROM TIMETZ_TBL WHERE f1 >= '00:00-07';
28+ (12 rows)
29+30+ -- Check edge cases
31+-SELECT '23:59:59.999999'::timetz;
32++SELECT '23:59:59.999999 PDT'::timetz;
33+ timetz
34+ --------------------
35+ 23:59:59.999999-07
36+ (1 row)
37+38+-SELECT '23:59:59.9999999'::timetz; -- rounds up
39++SELECT '23:59:59.9999999 PDT'::timetz; -- rounds up
40+ timetz
41+ -------------
42+ 24:00:00-07
43+ (1 row)
44+45+-SELECT '23:59:60'::timetz; -- rounds up
46++SELECT '23:59:60 PDT'::timetz; -- rounds up
47+ timetz
48+ -------------
49+ 24:00:00-07
50+ (1 row)
51+52+-SELECT '24:00:00'::timetz; -- allowed
53++SELECT '24:00:00 PDT'::timetz; -- allowed
54+ timetz
55+ -------------
56+ 24:00:00-07
57+ (1 row)
58+59+-SELECT '24:00:00.01'::timetz; -- not allowed
60+-ERROR: date/time field value out of range: "24:00:00.01"
61+-LINE 1: SELECT '24:00:00.01'::timetz;
62++SELECT '24:00:00.01 PDT'::timetz; -- not allowed
63++ERROR: date/time field value out of range: "24:00:00.01 PDT"
64++LINE 1: SELECT '24:00:00.01 PDT'::timetz;
65+ ^
66+-SELECT '23:59:60.01'::timetz; -- not allowed
67+-ERROR: date/time field value out of range: "23:59:60.01"
68+-LINE 1: SELECT '23:59:60.01'::timetz;
69++SELECT '23:59:60.01 PDT'::timetz; -- not allowed
70++ERROR: date/time field value out of range: "23:59:60.01 PDT"
71++LINE 1: SELECT '23:59:60.01 PDT'::timetz;
72+ ^
73+-SELECT '24:01:00'::timetz; -- not allowed
74+-ERROR: date/time field value out of range: "24:01:00"
75+-LINE 1: SELECT '24:01:00'::timetz;
76++SELECT '24:01:00 PDT'::timetz; -- not allowed
77++ERROR: date/time field value out of range: "24:01:00 PDT"
78++LINE 1: SELECT '24:01:00 PDT'::timetz;
79+ ^
80+-SELECT '25:00:00'::timetz; -- not allowed
81+-ERROR: date/time field value out of range: "25:00:00"
82+-LINE 1: SELECT '25:00:00'::timetz;
83++SELECT '25:00:00 PDT'::timetz; -- not allowed
84++ERROR: date/time field value out of range: "25:00:00 PDT"
85++LINE 1: SELECT '25:00:00 PDT'::timetz;
86+ ^
87+ --
88+ -- TIME simple math
89+diff --git a/src/test/regress/sql/timetz.sql b/src/test/regress/sql/timetz.sql
90+index b699e4b03c..ce763d89e8 100644
91+--- a/src/test/regress/sql/timetz.sql
92++++ b/src/test/regress/sql/timetz.sql
93+@@ -36,14 +36,14 @@ SELECT f1 AS "None" FROM TIMETZ_TBL WHERE f1 < '00:00-07';
94+ SELECT f1 AS "Ten" FROM TIMETZ_TBL WHERE f1 >= '00:00-07';
95+96+ -- Check edge cases
97+-SELECT '23:59:59.999999'::timetz;
98+-SELECT '23:59:59.9999999'::timetz; -- rounds up
99+-SELECT '23:59:60'::timetz; -- rounds up
100+-SELECT '24:00:00'::timetz; -- allowed
101+-SELECT '24:00:00.01'::timetz; -- not allowed
102+-SELECT '23:59:60.01'::timetz; -- not allowed
103+-SELECT '24:01:00'::timetz; -- not allowed
104+-SELECT '25:00:00'::timetz; -- not allowed
105++SELECT '23:59:59.999999 PDT'::timetz;
106++SELECT '23:59:59.9999999 PDT'::timetz; -- rounds up
107++SELECT '23:59:60 PDT'::timetz; -- rounds up
108++SELECT '24:00:00 PDT'::timetz; -- allowed
109++SELECT '24:00:00.01 PDT'::timetz; -- not allowed
110++SELECT '23:59:60.01 PDT'::timetz; -- not allowed
111++SELECT '24:01:00 PDT'::timetz; -- not allowed
112++SELECT '25:00:00 PDT'::timetz; -- not allowed
113+114+ --
115+ -- TIME simple math
116+--
117+2.20.1
···45stdenv.mkDerivation rec {
6 pname = "brotli";
7- version = "1.0.7";
89 src = fetchFromGitHub {
10 owner = "google";
11 repo = "brotli";
12 rev = "v" + version;
13- sha256 = "1811b55wdfg4kbsjcgh1kc938g118jpvif97ilgrmbls25dfpvvw";
14 };
1516 nativeBuildInputs = [ cmake ];
···3233 # This breaks on Darwin because our cmake hook tries to make a build folder
34 # and the wonderful bazel BUILD file is already there (yay case-insensitivity?)
35- prePatch = "rm BUILD";
00000003637 # Don't bother with "man" output for now,
38 # it currently only makes the manpages hard to use.
···45stdenv.mkDerivation rec {
6 pname = "brotli";
7+ version = "1.0.9";
89 src = fetchFromGitHub {
10 owner = "google";
11 repo = "brotli";
12 rev = "v" + version;
13+ sha256 = "z6Dhrabav1MDQ4rAcXaDv0aN+qOoh9cvoXZqEWBB13c=";
14 };
1516 nativeBuildInputs = [ cmake ];
···3233 # This breaks on Darwin because our cmake hook tries to make a build folder
34 # and the wonderful bazel BUILD file is already there (yay case-insensitivity?)
35+ prePatch = ''
36+ rm BUILD
37+38+ # Upstream fixed this reference to runtime-path after the release
39+ # and with this references g++ complains about invalid option -R
40+ sed -i 's/ -R''${libdir}//' scripts/libbrotli*.pc.in
41+ cat scripts/libbrotli*.pc.in
42+ '';
4344 # Don't bother with "man" output for now,
45 # it currently only makes the manpages hard to use.
···1-From 0251229bfd9617e8a35cf9dd7d338d63fff74a0c Mon Sep 17 00:00:00 2001
2-From: Assaf Gordon <assafgordon@gmail.com>
3-Date: Mon, 13 May 2019 16:37:40 -0600
4-Subject: [PATCH] tests: avoid false-positive in date-debug test
5-MIME-Version: 1.0
6-Content-Type: text/plain; charset=UTF-8
7-Content-Transfer-Encoding: 8bit
8-9-When debugging an invalid date due to DST switching, the intermediate
10-'normalized time' should not be checked - its value can differ between
11-systems (e.g. glibc vs musl).
12-13-Reported by Niklas Hambüchen in
14-https://lists.gnu.org/r/coreutils/2019-05/msg00031.html
15-Analyzed by Rich Felker in
16-https://lists.gnu.org/r/coreutils/2019-05/msg00039.html
17-18-* tests/misc/date-debug.sh: Replace the exact normalized time
19-with 'XX:XX:XX' so different values would not trigger test failure.
20----
21- tests/misc/date-debug.sh | 11 +++++++++--
22- 1 file changed, 9 insertions(+), 2 deletions(-)
23-24-diff --git a/tests/misc/date-debug.sh b/tests/misc/date-debug.sh
25-index aa47f1abb..2ce6f4ce8 100755
26---- a/tests/misc/date-debug.sh
27-+++ b/tests/misc/date-debug.sh
28-@@ -71,7 +71,7 @@ date: input timezone: TZ="America/Edmonton" in date string
29- date: using specified time as starting value: '02:30:00'
30- date: error: invalid date/time value:
31- date: user provided time: '(Y-M-D) 2006-04-02 02:30:00'
32--date: normalized time: '(Y-M-D) 2006-04-02 03:30:00'
33-+date: normalized time: '(Y-M-D) 2006-04-02 XX:XX:XX'
34- date: --
35- date: possible reasons:
36- date: non-existing due to daylight-saving time;
37-@@ -81,7 +81,14 @@ date: invalid date 'TZ="America/Edmonton" 2006-04-02 02:30:00'
38- EOF
39-40- # date should return 1 (error) for invalid date
41--returns_ 1 date --debug -d "$in2" >out2 2>&1 || fail=1
42-+returns_ 1 date --debug -d "$in2" >out2-t 2>&1 || fail=1
43-+
44-+# The output line of "normalized time" can differ between systems
45-+# (e.g. glibc vs musl) and should not be checked.
46-+# See: https://lists.gnu.org/archive/html/coreutils/2019-05/msg00039.html
47-+sed '/normalized time:/s/ [0-9][0-9]:[0-9][0-9]:[0-9][0-9]/ XX:XX:XX/' \
48-+ out2-t > out2 || framework_failure_
49-+
50- compare exp2 out2 || fail=1
51-52- ##
···1-From 3bd82a82cf4ba693d2c31c7b95aaec4e56dc92a4 Mon Sep 17 00:00:00 2001
2-From: Paul Eggert <eggert@cs.ucla.edu>
3-Date: Mon, 11 Mar 2019 16:40:29 -0700
4-Subject: [PATCH 1/1] strtod: fix clash with strtold
5-6-Problem reported for RHEL 5 by Jesse Caldwell (Bug#34817).
7-* lib/strtod.c (compute_minus_zero, minus_zero):
8-Simplify by remving the macro / external variable,
9-and having just a function. User changed. This avoids
10-the need for an external variable that might clash.
11----
12- ChangeLog | 9 +++++++++
13- lib/strtod.c | 11 +++++------
14- 2 files changed, 14 insertions(+), 6 deletions(-)
15-16-diff --git a/lib/strtod.c b/lib/strtod.c
17-index b9eaa51..69b1564 100644
18---- a/lib/strtod.c
19-+++ b/lib/strtod.c
20-@@ -294,16 +294,15 @@ parse_number (const char *nptr,
21- ICC 10.0 has a bug when optimizing the expression -zero.
22- The expression -MIN * MIN does not work when cross-compiling
23- to PowerPC on Mac OS X 10.5. */
24--#if defined __hpux || defined __sgi || defined __ICC
25- static DOUBLE
26--compute_minus_zero (void)
27-+minus_zero (void)
28- {
29-+#if defined __hpux || defined __sgi || defined __ICC
30- return -MIN * MIN;
31--}
32--# define minus_zero compute_minus_zero ()
33- #else
34--DOUBLE minus_zero = -0.0;
35-+ return -0.0;
36- #endif
37-+}
38-39- /* Convert NPTR to a DOUBLE. If ENDPTR is not NULL, a pointer to the
40- character after the last one used in the number is put in *ENDPTR. */
41-@@ -479,6 +478,6 @@ STRTOD (const char *nptr, char **endptr)
42- /* Special case -0.0, since at least ICC miscompiles negation. We
43- can't use copysign(), as that drags in -lm on some platforms. */
44- if (!num && negative)
45-- return minus_zero;
46-+ return minus_zero ();
47- return negative ? -num : num;
48- }
49---
50-1.9.1
51-
···2223stdenv.mkDerivation (rec {
24 pname = "coreutils";
25- version = "8.31";
2627 src = fetchurl {
28 url = "mirror://gnu/${pname}/${pname}-${version}.tar.xz";
29- sha256 = "1zg9m79x1i2nifj4kb0waf9x3i5h6ydkypkjnbsb9rnwis8rqypz";
30 };
3132 patches = optional stdenv.hostPlatform.isCygwin ./coreutils-8.23-4.cygwin.patch
33- # Fix failing test with musl. See https://lists.gnu.org/r/coreutils/2019-05/msg00031.html
34- # To be removed in coreutils-8.32.
35- ++ optional stdenv.hostPlatform.isMusl ./avoid-false-positive-in-date-debug-test.patch
36- # Fix compilation in musl-cross environments. To be removed in coreutils-8.32.
37- ++ optional stdenv.hostPlatform.isMusl ./coreutils-8.31-musl-cross.patch
38- # Fix compilation in android-cross environments. To be removed in coreutils-8.32.
39- ++ [ ./coreutils-8.31-android-cross.patch ];
4041 postPatch = ''
42 # The test tends to fail on btrfs,f2fs and maybe other unusual filesystems.
···2223stdenv.mkDerivation (rec {
24 pname = "coreutils";
25+ version = "8.32";
2627 src = fetchurl {
28 url = "mirror://gnu/${pname}/${pname}-${version}.tar.xz";
29+ sha256 = "sha256-RFjY3nhJ30TMqxXhaxVIsoUiTbul8I+sBwwcDgvMTPo=";
30 };
3132 patches = optional stdenv.hostPlatform.isCygwin ./coreutils-8.23-4.cygwin.patch
33+ # included on coreutils master; TODO: apply unconditionally, I guess
34+ ++ optional stdenv.hostPlatform.isAarch64 ./sys-getdents-undeclared.patch;
000003536 postPatch = ''
37 # The test tends to fail on btrfs,f2fs and maybe other unusual filesystems.