diff options
Diffstat (limited to 'nixpkgs/pkgs/build-support')
25 files changed, 1079 insertions, 391 deletions
diff --git a/nixpkgs/pkgs/build-support/alternatives/blas/default.nix b/nixpkgs/pkgs/build-support/alternatives/blas/default.nix new file mode 100644 index 000000000000..36708ce8841a --- /dev/null +++ b/nixpkgs/pkgs/build-support/alternatives/blas/default.nix @@ -0,0 +1,137 @@ +{ lib, stdenv +, lapack-reference, openblasCompat, openblas +, is64bit ? false +, blasProvider ? if is64bit then openblas else openblasCompat }: + +let + blasFortranSymbols = [ + "caxpy" "ccopy" "cdotc" "cdotu" "cgbmv" "cgemm" "cgemv" "cgerc" "cgeru" + "chbmv" "chemm" "chemv" "cher" "cher2" "cher2k" "cherk" "chpmv" "chpr" + "chpr2" "crotg" "cscal" "csrot" "csscal" "cswap" "csymm" "csyr2k" "csyrk" + "ctbmv" "ctbsv" "ctpmv" "ctpsv" "ctrmm" "ctrmv" "ctrsm" "ctrsv" "dasum" + "daxpy" "dcabs1" "dcopy" "ddot" "dgbmv" "dgemm" "dgemv" "dger" "dnrm2" + "drot" "drotg" "drotm" "drotmg" "dsbmv" "dscal" "dsdot" "dspmv" "dspr" + "dspr2" "dswap" "dsymm" "dsymv" "dsyr" "dsyr2" "dsyr2k" "dsyrk" "dtbmv" + "dtbsv" "dtpmv" "dtpsv" "dtrmm" "dtrmv" "dtrsm" "dtrsv" "dzasum" "dznrm2" + "icamax" "idamax" "isamax" "izamax" "lsame" "sasum" "saxpy" "scabs1" + "scasum" "scnrm2" "scopy" "sdot" "sdsdot" "sgbmv" "sgemm" "sgemv" + "sger" "snrm2" "srot" "srotg" "srotm" "srotmg" "ssbmv" "sscal" "sspmv" + "sspr" "sspr2" "sswap" "ssymm" "ssymv" "ssyr" "ssyr2" "ssyr2k" "ssyrk" + "stbmv" "stbsv" "stpmv" "stpsv" "strmm" "strmv" "strsm" "strsv" "xerbla" + "xerbla_array" "zaxpy" "zcopy" "zdotc" "zdotu" "zdrot" "zdscal" "zgbmv" + "zgemm" "zgemv" "zgerc" "zgeru" "zhbmv" "zhemm" "zhemv" "zher" "zher2" + "zher2k" "zherk" "zhpmv" "zhpr" "zhpr2" "zrotg" "zscal" "zswap" "zsymm" + "zsyr2k" "zsyrk" "ztbmv" "ztbsv" "ztpmv" "ztpsv" "ztrmm" "ztrmv" "ztrsm" + "ztrsv" + ]; + + version = "3"; + canonicalExtension = if stdenv.hostPlatform.isLinux + then "${stdenv.hostPlatform.extensions.sharedLibrary}.${version}" + else stdenv.hostPlatform.extensions.sharedLibrary; + + + is64bit = blasProvider.blas64 or false; + blasImplementation = lib.getName blasProvider; + +in + +assert is64bit -> (blasImplementation == "openblas" && blasProvider.blas64) || blasImplementation == "mkl"; + +stdenv.mkDerivation { + pname = "blas"; + inherit version; + + outputs = [ "out" "dev" ]; + + meta = (blasProvider.meta or {}) // { + description = "${lib.getName blasProvider} with just the BLAS C and FORTRAN ABI"; + }; + + passthru = { + inherit is64bit; + provider = blasProvider; + implementation = blasImplementation; + }; + + dontBuild = true; + dontConfigure = true; + unpackPhase = "src=$PWD"; + + installPhase = ('' + mkdir -p $out/lib $dev/include $dev/lib/pkgconfig + + libblas="${lib.getLib blasProvider}/lib/libblas${stdenv.hostPlatform.extensions.sharedLibrary}" + + if ! [ -e "$libblas" ]; then + echo "$libblas does not exist, ${blasProvider.name} does not provide libblas." + exit 1 + fi + + nm -an "$libblas" | cut -f3 -d' ' > symbols + for symbol in ${toString blasFortranSymbols}; do + grep "^$symbol_$" symbols || { echo "$symbol" was not found in "$libblas"; exit 1; } + done + + cp -L "$libblas" $out/lib/libblas${canonicalExtension} + chmod +w $out/lib/libblas${canonicalExtension} + +'' + (if stdenv.hostPlatform.parsed.kernel.execFormat.name == "elf" then '' + patchelf --set-soname libblas${canonicalExtension} $out/lib/libblas${canonicalExtension} + patchelf --set-rpath "$(patchelf --print-rpath $out/lib/libblas${canonicalExtension}):${lib.getLib blasProvider}/lib" $out/lib/libblas${canonicalExtension} +'' else if stdenv.hostPlatform.isDarwin then '' + install_name_tool \ + -id libblas${canonicalExtension} \ + -add_rpath ${lib.getLib blasProvider}/lib \ + $out/lib/libblas${canonicalExtension} +'' else "") + '' + + if [ "$out/lib/libblas${canonicalExtension}" != "$out/lib/libblas${stdenv.hostPlatform.extensions.sharedLibrary}" ]; then + ln -s $out/lib/libblas${canonicalExtension} "$out/lib/libblas${stdenv.hostPlatform.extensions.sharedLibrary}" + fi + + cat <<EOF > $dev/lib/pkgconfig/blas.pc +Name: blas +Version: ${version} +Description: BLAS FORTRAN implementation +Libs: -L$out/lib -lblas +Cflags: -I$dev/include +EOF + + libcblas="${lib.getLib blasProvider}/lib/libcblas${stdenv.hostPlatform.extensions.sharedLibrary}" + + if ! [ -e "$libcblas" ]; then + echo "$libcblas does not exist, ${blasProvider.name} does not provide libcblas." + exit 1 + fi + + cp -L "$libcblas" $out/lib/libcblas${canonicalExtension} + chmod +w $out/lib/libcblas${canonicalExtension} + +'' + (if stdenv.hostPlatform.parsed.kernel.execFormat.name == "elf" then '' + patchelf --set-soname libcblas${canonicalExtension} $out/lib/libcblas${canonicalExtension} + patchelf --set-rpath "$(patchelf --print-rpath $out/lib/libcblas${canonicalExtension}):${lib.getLib blasProvider}/lib" $out/lib/libcblas${canonicalExtension} +'' else if stdenv.hostPlatform.isDarwin then '' + install_name_tool \ + -id libcblas${canonicalExtension} \ + -add_rpath ${lib.getLib blasProvider}/lib \ + $out/lib/libcblas${canonicalExtension} +'' else "") + '' + if [ "$out/lib/libcblas${canonicalExtension}" != "$out/lib/libcblas${stdenv.hostPlatform.extensions.sharedLibrary}" ]; then + ln -s $out/lib/libcblas${canonicalExtension} "$out/lib/libcblas${stdenv.hostPlatform.extensions.sharedLibrary}" + fi + + cp ${lib.getDev lapack-reference}/include/cblas{,_mangling}.h $dev/include + + cat <<EOF > $dev/lib/pkgconfig/cblas.pc +Name: cblas +Version: ${version} +Description: BLAS C implementation +Cflags: -I$dev/include +Libs: -L$out/lib -lcblas +EOF +'' + stdenv.lib.optionalString (blasImplementation == "mkl") '' + mkdir -p $out/nix-support + echo 'export MKL_INTERFACE_LAYER=${lib.optionalString is64bit "I"}LP64,GNU' > $out/nix-support/setup-hook +''); +} diff --git a/nixpkgs/pkgs/build-support/alternatives/lapack/default.nix b/nixpkgs/pkgs/build-support/alternatives/lapack/default.nix new file mode 100644 index 000000000000..24c339042a2f --- /dev/null +++ b/nixpkgs/pkgs/build-support/alternatives/lapack/default.nix @@ -0,0 +1,111 @@ +{ lib, stdenv +, lapack-reference, openblasCompat, openblas +, is64bit ? false +, lapackProvider ? if is64bit then openblas else openblasCompat }: + +let + + version = "3"; + canonicalExtension = if stdenv.hostPlatform.isLinux + then "${stdenv.hostPlatform.extensions.sharedLibrary}.${version}" + else stdenv.hostPlatform.extensions.sharedLibrary; + + lapackImplementation = lib.getName lapackProvider; + +in + +assert is64bit -> (lapackImplementation == "openblas" && lapackProvider.blas64) || lapackImplementation == "mkl"; + +stdenv.mkDerivation { + pname = "lapack"; + inherit version; + + outputs = [ "out" "dev" ]; + + meta = (lapackProvider.meta or {}) // { + description = "${lib.getName lapackProvider} with just the LAPACK C and FORTRAN ABI"; + }; + + passthru = { + inherit is64bit; + provider = lapackProvider; + implementation = lapackImplementation; + }; + + dontBuild = true; + dontConfigure = true; + unpackPhase = "src=$PWD"; + + installPhase = ('' + mkdir -p $out/lib $dev/include $dev/lib/pkgconfig + + liblapack="${lib.getLib lapackProvider}/lib/liblapack${stdenv.hostPlatform.extensions.sharedLibrary}" + + if ! [ -e "$liblapack" ]; then + echo "$liblapack does not exist, ${lapackProvider.name} does not provide liblapack." + exit 1 + fi + + cp -L "$liblapack" $out/lib/liblapack${canonicalExtension} + chmod +w $out/lib/liblapack${canonicalExtension} + +'' + (if stdenv.hostPlatform.parsed.kernel.execFormat.name == "elf" then '' + patchelf --set-soname liblapack${canonicalExtension} $out/lib/liblapack${canonicalExtension} + patchelf --set-rpath "$(patchelf --print-rpath $out/lib/liblapack${canonicalExtension}):${lapackProvider}/lib" $out/lib/liblapack${canonicalExtension} +'' else if stdenv.hostPlatform.isDarwin then '' + install_name_tool -id liblapack${canonicalExtension} \ + -add_rpath ${lib.getLib lapackProvider}/lib \ + $out/lib/liblapack${canonicalExtension} +'' else "") + '' + + if [ "$out/lib/liblapack${canonicalExtension}" != "$out/lib/liblapack${stdenv.hostPlatform.extensions.sharedLibrary}" ]; then + ln -s $out/lib/liblapack${canonicalExtension} "$out/lib/liblapack${stdenv.hostPlatform.extensions.sharedLibrary}" + fi + + install -D ${lib.getDev lapack-reference}/include/lapack.h $dev/include/lapack.h + + cat <<EOF > $dev/lib/pkgconfig/lapack.pc +Name: lapack +Version: ${version} +Description: LAPACK FORTRAN implementation +Cflags: -I$dev/include +Libs: -L$out/lib -llapack +EOF + + liblapacke="${lib.getLib lapackProvider}/lib/liblapacke${stdenv.hostPlatform.extensions.sharedLibrary}" + + if ! [ -e "$liblapacke" ]; then + echo "$liblapacke does not exist, ${lapackProvider.name} does not provide liblapacke." + exit 1 + fi + + cp -L "$liblapacke" $out/lib/liblapacke${canonicalExtension} + chmod +w $out/lib/liblapacke${canonicalExtension} + +'' + (if stdenv.hostPlatform.parsed.kernel.execFormat.name == "elf" then '' + patchelf --set-soname liblapacke${canonicalExtension} $out/lib/liblapacke${canonicalExtension} + patchelf --set-rpath "$(patchelf --print-rpath $out/lib/liblapacke${canonicalExtension}):${lib.getLib lapackProvider}/lib" $out/lib/liblapacke${canonicalExtension} +'' else if stdenv.hostPlatform.isDarwin then '' + install_name_tool -id liblapacke${canonicalExtension} \ + -add_rpath ${lib.getLib lapackProvider}/lib \ + $out/lib/liblapacke${canonicalExtension} +'' else "") + '' + + if [ -f "$out/lib/liblapacke.so.3" ]; then + ln -s $out/lib/liblapacke.so.3 $out/lib/liblapacke.so + fi + + cp ${lib.getDev lapack-reference}/include/lapacke{,_mangling,_config}.h $dev/include + + cat <<EOF > $dev/lib/pkgconfig/lapacke.pc +Name: lapacke +Version: ${version} +Description: LAPACK C implementation +Cflags: -I$dev/include +Libs: -L$out/lib -llapacke +EOF +'' + stdenv.lib.optionalString (lapackImplementation == "mkl") '' + mkdir -p $out/nix-support + echo 'export MKL_INTERFACE_LAYER=${lib.optionalString is64bit "I"}LP64,GNU' > $out/nix-support/setup-hook +''); +} diff --git a/nixpkgs/pkgs/build-support/build-bazel-package/default.nix b/nixpkgs/pkgs/build-support/build-bazel-package/default.nix index 47c72bf92602..9a64b84f076b 100644 --- a/nixpkgs/pkgs/build-support/build-bazel-package/default.nix +++ b/nixpkgs/pkgs/build-support/build-bazel-package/default.nix @@ -181,9 +181,9 @@ in stdenv.mkDerivation (fBuildAttrs // { done linkopts=() host_linkopts=() - for flag in $NIX_LD_FLAGS; do - linkopts+=( "--linkopt=$flag" ) - host_linkopts+=( "--host_linkopt=$flag" ) + for flag in $NIX_LDFLAGS; do + linkopts+=( "--linkopt=-Wl,$flag" ) + host_linkopts+=( "--host_linkopt=-Wl,$flag" ) done BAZEL_USE_CPP_ONLY_TOOLCHAIN=1 \ diff --git a/nixpkgs/pkgs/build-support/build-pecl.nix b/nixpkgs/pkgs/build-support/build-pecl.nix index a1030e3b34fa..f43205f24c5c 100644 --- a/nixpkgs/pkgs/build-support/build-pecl.nix +++ b/nixpkgs/pkgs/build-support/build-pecl.nix @@ -1,9 +1,11 @@ -{ stdenv, php, autoreconfHook, fetchurl, re2c }: +{ stdenv, lib, php, autoreconfHook, fetchurl, re2c }: { pname , version +, internalDeps ? [] , buildInputs ? [] , nativeBuildInputs ? [] +, postPhpize ? "" , makeFlags ? [] , src ? fetchurl { url = "http://pecl.php.net/get/${pname}-${version}.tgz"; @@ -22,5 +24,11 @@ stdenv.mkDerivation (args // { makeFlags = [ "EXTENSION_DIR=$(out)/lib/php/extensions" ] ++ makeFlags; - autoreconfPhase = "phpize"; + autoreconfPhase = '' + phpize + ${postPhpize} + ${lib.concatMapStringsSep "\n" + (dep: "mkdir -p ext; ln -s ${dep.dev}/include ext/${dep.extensionName}") + internalDeps} + ''; }) diff --git a/nixpkgs/pkgs/build-support/cc-wrapper/default.nix b/nixpkgs/pkgs/build-support/cc-wrapper/default.nix index 96d48ecbc79d..f6248335052c 100644 --- a/nixpkgs/pkgs/build-support/cc-wrapper/default.nix +++ b/nixpkgs/pkgs/build-support/cc-wrapper/default.nix @@ -48,7 +48,7 @@ let coreutils_bin = if nativeTools then "" else getBin coreutils; default_cxx_stdlib_compile = if (targetPlatform.isLinux && !(cc.isGNU or false) && !nativeTools && cc ? gcc) && !(targetPlatform.useLLVM or false) then - "-isystem $(echo -n ${cc.gcc}/include/c++/*) -isystem $(echo -n ${cc.gcc}/include/c++/*)/$(${cc.gcc}/bin/gcc -dumpmachine)" + "-isystem $(echo -n ${cc.gcc}/include/c++/*) -isystem $(echo -n ${cc.gcc}/include/c++/*)/${targetPlatform.config}" else if targetPlatform.isDarwin && (libcxx != null) && (cc.isClang or false) && !(targetPlatform.useLLVM or false) then "-isystem ${libcxx}/include/c++/v1" else ""; diff --git a/nixpkgs/pkgs/build-support/emacs/setup-hook.sh b/nixpkgs/pkgs/build-support/emacs/setup-hook.sh index 8f074e0b406c..83e995631b3e 100644 --- a/nixpkgs/pkgs/build-support/emacs/setup-hook.sh +++ b/nixpkgs/pkgs/build-support/emacs/setup-hook.sh @@ -1,15 +1,23 @@ +addToEmacsLoadPath() { + local lispDir="$1" + if [[ -d $lispDir && ${EMACSLOADPATH-} != *"$lispDir":* ]] ; then + # It turns out, that the trailing : is actually required + # see https://www.gnu.org/software/emacs/manual/html_node/elisp/Library-Search.html + export EMACSLOADPATH="$lispDir:${EMACSLOADPATH-}" + fi +} + addEmacsVars () { + addToEmacsLoadPath "$1/share/emacs/site-lisp" + + # Add sub paths to the Emacs load path if it is a directory + # containing .el files. This is necessary to build some packages, + # e.g., using trivialBuild. for lispDir in \ - "$1/share/emacs/site-lisp" \ "$1/share/emacs/site-lisp/"* \ "$1/share/emacs/site-lisp/elpa/"*; do - # Add the path to the Emacs load path if it is a directory - # containing .el files and it has not already been added to the - # load path. - if [[ -d $lispDir && "$(echo "$lispDir"/*.el)" && ${EMACSLOADPATH-} != *"$lispDir":* ]] ; then - # It turns out, that the trailing : is actually required - # see https://www.gnu.org/software/emacs/manual/html_node/elisp/Library-Search.html - export EMACSLOADPATH="$lispDir:${EMACSLOADPATH-}" + if [[ -d $lispDir && "$(echo "$lispDir"/*.el)" ]] ; then + addToEmacsLoadPath "$lispDir" fi done } diff --git a/nixpkgs/pkgs/build-support/fetchmavenartifact/default.nix b/nixpkgs/pkgs/build-support/fetchmavenartifact/default.nix index dc48a312fb37..d7ad406943be 100644 --- a/nixpkgs/pkgs/build-support/fetchmavenartifact/default.nix +++ b/nixpkgs/pkgs/build-support/fetchmavenartifact/default.nix @@ -3,10 +3,10 @@ { fetchurl, stdenv }: let defaultRepos = [ - http://central.maven.org/maven2 - http://oss.sonatype.org/content/repositories/releases - http://oss.sonatype.org/content/repositories/public - http://repo.typesafe.com/typesafe/releases + "http://central.maven.org/maven2" + "http://oss.sonatype.org/content/repositories/releases" + "http://oss.sonatype.org/content/repositories/public" + "http://repo.typesafe.com/typesafe/releases" ]; in diff --git a/nixpkgs/pkgs/build-support/fetchurl/mirrors.nix b/nixpkgs/pkgs/build-support/fetchurl/mirrors.nix index a0a61f7cc50b..4e8b0aa99a8f 100644 --- a/nixpkgs/pkgs/build-support/fetchurl/mirrors.nix +++ b/nixpkgs/pkgs/build-support/fetchurl/mirrors.nix @@ -2,316 +2,316 @@ # Content-addressable Nix mirrors. hashedMirrors = [ - http://tarballs.nixos.org + "http://tarballs.nixos.org" ]; # Mirrors for mirror://site/filename URIs, where "site" is # "sourceforge", "gnu", etc. luarocks = [ - https://luarocks.org - https://raw.githubusercontent.com/rocks-moonscript-org/moonrocks-mirror/master/ - http://luafr.org/moonrocks - http://luarocks.logiceditor.com/rocks + "https://luarocks.org" + "https://raw.githubusercontent.com/rocks-moonscript-org/moonrocks-mirror/master/" + "http://luafr.org/moonrocks" + "http://luarocks.logiceditor.com/rocks" ]; # SourceForge. sourceforge = [ - https://downloads.sourceforge.net/ - https://prdownloads.sourceforge.net/ - https://heanet.dl.sourceforge.net/sourceforge/ - https://surfnet.dl.sourceforge.net/sourceforge/ - https://dfn.dl.sourceforge.net/sourceforge/ - https://osdn.dl.sourceforge.net/sourceforge/ - https://kent.dl.sourceforge.net/sourceforge/ + "https://downloads.sourceforge.net/" + "https://prdownloads.sourceforge.net/" + "https://heanet.dl.sourceforge.net/sourceforge/" + "https://surfnet.dl.sourceforge.net/sourceforge/" + "https://dfn.dl.sourceforge.net/sourceforge/" + "https://osdn.dl.sourceforge.net/sourceforge/" + "https://kent.dl.sourceforge.net/sourceforge/" ]; # OSDN (formerly SourceForge.jp). osdn = [ - https://osdn.dl.osdn.jp/ - https://osdn.mirror.constant.com/ - https://mirrors.gigenet.com/OSDN/ - https://osdn.dl.sourceforge.jp/ - https://jaist.dl.sourceforge.jp/ + "https://osdn.dl.osdn.jp/" + "https://osdn.mirror.constant.com/" + "https://mirrors.gigenet.com/OSDN/" + "https://osdn.dl.sourceforge.jp/" + "https://jaist.dl.sourceforge.jp/" ]; # GNU (https://www.gnu.org/prep/ftp.html). gnu = [ # This one redirects to a (supposedly) nearby and (supposedly) up-to-date # mirror. - https://ftpmirror.gnu.org/ + "https://ftpmirror.gnu.org/" - http://ftp.nluug.nl/pub/gnu/ - http://mirrors.kernel.org/gnu/ - ftp://mirror.cict.fr/gnu/ - ftp://ftp.cs.tu-berlin.de/pub/gnu/ - ftp://ftp.chg.ru/pub/gnu/ - ftp://ftp.funet.fi/pub/mirrors/ftp.gnu.org/gnu/ + "http://ftp.nluug.nl/pub/gnu/" + "http://mirrors.kernel.org/gnu/" + "ftp://mirror.cict.fr/gnu/" + "ftp://ftp.cs.tu-berlin.de/pub/gnu/" + "ftp://ftp.chg.ru/pub/gnu/" + "ftp://ftp.funet.fi/pub/mirrors/ftp.gnu.org/gnu/" # This one is the master repository, and thus it's always up-to-date. - http://ftp.gnu.org/pub/gnu/ + "http://ftp.gnu.org/pub/gnu/" ]; # GCC. gcc = [ - https://bigsearcher.com/mirrors/gcc/ - http://mirror.koddos.net/gcc/ - ftp://ftp.nluug.nl/mirror/languages/gcc/ - ftp://ftp.fu-berlin.de/unix/languages/gcc/ - ftp://ftp.irisa.fr/pub/mirrors/gcc.gnu.org/gcc/ - ftp://gcc.gnu.org/pub/gcc/ + "https://bigsearcher.com/mirrors/gcc/" + "http://mirror.koddos.net/gcc/" + "ftp://ftp.nluug.nl/mirror/languages/gcc/" + "ftp://ftp.fu-berlin.de/unix/languages/gcc/" + "ftp://ftp.irisa.fr/pub/mirrors/gcc.gnu.org/gcc/" + "ftp://gcc.gnu.org/pub/gcc/" ]; # GnuPG. gnupg = [ - https://gnupg.org/ftp/gcrypt/ - http://www.ring.gr.jp/pub/net/ - http://gd.tuwien.ac.at/privacy/ - http://mirrors.dotsrc.org/gcrypt/ - http://ftp.heanet.ie/mirrors/ftp.gnupg.org/gcrypt/ - http://www.mirrorservice.org/sites/ftp.gnupg.org/gcrypt/ + "https://gnupg.org/ftp/gcrypt/" + "http://www.ring.gr.jp/pub/net/" + "http://gd.tuwien.ac.at/privacy/" + "http://mirrors.dotsrc.org/gcrypt/" + "http://ftp.heanet.ie/mirrors/ftp.gnupg.org/gcrypt/" + "http://www.mirrorservice.org/sites/ftp.gnupg.org/gcrypt/" ]; # kernel.org's /pub (/pub/{linux,software}) tree. kernel = [ - http://cdn.kernel.org/pub/ - http://www.all.kernel.org/pub/ - http://ramses.wh2.tu-dresden.de/pub/mirrors/kernel.org/ - http://linux-kernel.uio.no/pub/ - http://kernel.osuosl.org/pub/ - ftp://ftp.funet.fi/pub/mirrors/ftp.kernel.org/pub/ + "http://cdn.kernel.org/pub/" + "http://www.all.kernel.org/pub/" + "http://ramses.wh2.tu-dresden.de/pub/mirrors/kernel.org/" + "http://linux-kernel.uio.no/pub/" + "http://kernel.osuosl.org/pub/" + "ftp://ftp.funet.fi/pub/mirrors/ftp.kernel.org/pub/" ]; # Mirrors from https://download.kde.org/extra/download-mirrors.html kde = [ "https://download.kde.org/download.php?url=" - https://ftp.gwdg.de/pub/linux/kde/ - https://mirrors.ocf.berkeley.edu/kde/ - http://mirrors.mit.edu/kde/ - https://mirrors.ustc.edu.cn/kde/ - http://ftp.funet.fi/pub/mirrors/ftp.kde.org/pub/kde/ - ftp://ftp.kde.org/pub/kde/ + "https://ftp.gwdg.de/pub/linux/kde/" + "https://mirrors.ocf.berkeley.edu/kde/" + "http://mirrors.mit.edu/kde/" + "https://mirrors.ustc.edu.cn/kde/" + "http://ftp.funet.fi/pub/mirrors/ftp.kde.org/pub/kde/" + "ftp://ftp.kde.org/pub/kde/" ]; # Gentoo files. gentoo = [ - http://ftp.snt.utwente.nl/pub/os/linux/gentoo/ - http://distfiles.gentoo.org/ - ftp://mirrors.kernel.org/gentoo/ + "http://ftp.snt.utwente.nl/pub/os/linux/gentoo/" + "http://distfiles.gentoo.org/" + "ftp://mirrors.kernel.org/gentoo/" ]; savannah = [ # Mirrors from https://download-mirror.savannah.gnu.org/releases/00_MIRRORS.html - http://mirror.easyname.at/nongnu/ - http://mirror2.klaus-uwe.me/nongnu/ - http://savannah.c3sl.ufpr.br/ - http://mirror.csclub.uwaterloo.ca/nongnu/ - http://mirror.cedia.org.ec/nongnu/ - http://ftp.igh.cnrs.fr/pub/nongnu/ - http://mirror6.layerjet.com/nongnu - http://mirror.netcologne.de/savannah/ - http://ftp.cc.uoc.gr/mirrors/nongnu.org/ - http://nongnu.uib.no/ - http://mirrors.fe.up.pt/pub/nongnu/ - http://mirror.lihnidos.org/GNU/savannah/ - http://savannah.mirror.si/ - http://ftp.acc.umu.se/mirror/gnu.org/savannah/ - http://ftp.twaren.net/Unix/NonGNU/ - http://ftp.yzu.edu.tw/pub/nongnu/ - http://mirror.rackdc.com/savannah/ - http://savannah-nongnu-org.ip-connect.vn.ua/ - http://www.mirrorservice.org/sites/download.savannah.gnu.org/releases/ - http://savannah.spinellicreations.com/ - http://gnu.mirrors.pair.com/savannah/savannah/ - ftp://mirror.easyname.at/nongnu/ - ftp://mirror2.klaus-uwe.me/nongnu/ - ftp://savannah.c3sl.ufpr.br/savannah-nongnu/ - ftp://mirror.csclub.uwaterloo.ca/nongnu/ - ftp://mirror.cedia.org.ec/nongnu - ftp://ftp.igh.cnrs.fr/pub/nongnu/ - ftp://mirror6.layerjet.com/nongnu/ - ftp://mirror.netcologne.de/savannah/ - ftp://nongnu.uib.no/pub/nongnu/ - ftp://mirrors.fe.up.pt/pub/nongnu/ - ftp://savannah.mirror.si/savannah/ - ftp://ftp.twaren.net/Unix/NonGNU/ - ftp://ftp.yzu.edu.tw/pub/nongnu/ - ftp://savannah-nongnu-org.ip-connect.vn.ua/mirror/savannah.nongnu.org/ - ftp://ftp.mirrorservice.org/sites/download.savannah.gnu.org/releases/ - ftp://spinellicreations.com/gnu_dot_org_savannah_mirror/ + "http://mirror.easyname.at/nongnu/" + "http://mirror2.klaus-uwe.me/nongnu/" + "http://savannah.c3sl.ufpr.br/" + "http://mirror.csclub.uwaterloo.ca/nongnu/" + "http://mirror.cedia.org.ec/nongnu/" + "http://ftp.igh.cnrs.fr/pub/nongnu/" + "http://mirror6.layerjet.com/nongnu" + "http://mirror.netcologne.de/savannah/" + "http://ftp.cc.uoc.gr/mirrors/nongnu.org/" + "http://nongnu.uib.no/" + "http://mirrors.fe.up.pt/pub/nongnu/" + "http://mirror.lihnidos.org/GNU/savannah/" + "http://savannah.mirror.si/" + "http://ftp.acc.umu.se/mirror/gnu.org/savannah/" + "http://ftp.twaren.net/Unix/NonGNU/" + "http://ftp.yzu.edu.tw/pub/nongnu/" + "http://mirror.rackdc.com/savannah/" + "http://savannah-nongnu-org.ip-connect.vn.ua/" + "http://www.mirrorservice.org/sites/download.savannah.gnu.org/releases/" + "http://savannah.spinellicreations.com/" + "http://gnu.mirrors.pair.com/savannah/savannah/" + "ftp://mirror.easyname.at/nongnu/" + "ftp://mirror2.klaus-uwe.me/nongnu/" + "ftp://savannah.c3sl.ufpr.br/savannah-nongnu/" + "ftp://mirror.csclub.uwaterloo.ca/nongnu/" + "ftp://mirror.cedia.org.ec/nongnu" + "ftp://ftp.igh.cnrs.fr/pub/nongnu/" + "ftp://mirror6.layerjet.com/nongnu/" + "ftp://mirror.netcologne.de/savannah/" + "ftp://nongnu.uib.no/pub/nongnu/" + "ftp://mirrors.fe.up.pt/pub/nongnu/" + "ftp://savannah.mirror.si/savannah/" + "ftp://ftp.twaren.net/Unix/NonGNU/" + "ftp://ftp.yzu.edu.tw/pub/nongnu/" + "ftp://savannah-nongnu-org.ip-connect.vn.ua/mirror/savannah.nongnu.org/" + "ftp://ftp.mirrorservice.org/sites/download.savannah.gnu.org/releases/" + "ftp://spinellicreations.com/gnu_dot_org_savannah_mirror/" ]; samba = [ - https://www.samba.org/ftp/ - http://www.samba.org/ftp/ + "https://www.samba.org/ftp/" + "http://www.samba.org/ftp/" ]; # BitlBee mirrors, see https://www.bitlbee.org/main.php/mirrors.html . bitlbee = [ - http://get.bitlbee.org/ - http://get.bitlbee.be/ - http://get.us.bitlbee.org/ - http://ftp.snt.utwente.nl/pub/software/bitlbee/ - http://bitlbee.intergenia.de/ + "http://get.bitlbee.org/" + "http://get.bitlbee.be/" + "http://get.us.bitlbee.org/" + "http://ftp.snt.utwente.nl/pub/software/bitlbee/" + "http://bitlbee.intergenia.de/" ]; # ImageMagick mirrors, see https://www.imagemagick.org/script/mirror.php imagemagick = [ - https://www.imagemagick.org/download/ - https://mirror.checkdomain.de/imagemagick/ - https://ftp.nluug.nl/ImageMagick/ - ftp://ftp.sunet.se/pub/multimedia/graphics/ImageMagick/ # also contains older versions removed from most mirrors - http://ftp.sunet.se/pub/multimedia/graphics/ImageMagick/ - ftp://ftp.imagemagick.org/pub/ImageMagick/ - http://ftp.fifi.org/ImageMagick/ - ftp://ftp.fifi.org/ImageMagick/ - http://imagemagick.mirrorcatalogs.com/ - ftp://imagemagick.mirrorcatalogs.com/imagemagick + "https://www.imagemagick.org/download/" + "https://mirror.checkdomain.de/imagemagick/" + "https://ftp.nluug.nl/ImageMagick/" + "ftp://ftp.sunet.se/pub/multimedia/graphics/ImageMagick/" # also contains older versions removed from most mirrors + "http://ftp.sunet.se/pub/multimedia/graphics/ImageMagick/" + "ftp://ftp.imagemagick.org/pub/ImageMagick/" + "http://ftp.fifi.org/ImageMagick/" + "ftp://ftp.fifi.org/ImageMagick/" + "http://imagemagick.mirrorcatalogs.com/" + "ftp://imagemagick.mirrorcatalogs.com/imagemagick" ]; # CPAN mirrors. cpan = [ - https://cpan.metacpan.org/ - https://cpan.perl.org/ - http://backpan.perl.org/ # for old releases + "https://cpan.metacpan.org/" + "https://cpan.perl.org/" + "http://backpan.perl.org/" # for old releases ]; # CentOS. centos = [ - http://mirror.centos.org/centos/ + "http://mirror.centos.org/centos/" # For old releases - http://vault.centos.org/ - https://archive.kernel.org/centos-vault/ - http://ftp.jaist.ac.jp/pub/Linux/CentOS-vault/ - http://mirrors.aliyun.com/centos-vault/ - https://mirror.chpc.utah.edu/pub/vault.centos.org/ - https://mirror.its.sfu.ca/mirror/CentOS-vault/ - https://mirror.math.princeton.edu/pub/centos-vault/ - https://mirrors.tripadvisor.com/centos-vault/ + "http://vault.centos.org/" + "https://archive.kernel.org/centos-vault/" + "http://ftp.jaist.ac.jp/pub/Linux/CentOS-vault/" + "http://mirrors.aliyun.com/centos-vault/" + "https://mirror.chpc.utah.edu/pub/vault.centos.org/" + "https://mirror.its.sfu.ca/mirror/CentOS-vault/" + "https://mirror.math.princeton.edu/pub/centos-vault/" + "https://mirrors.tripadvisor.com/centos-vault/" ]; # Debian. debian = [ - http://httpredir.debian.org/debian/ - ftp://ftp.au.debian.org/debian/ - ftp://ftp.de.debian.org/debian/ - ftp://ftp.es.debian.org/debian/ - ftp://ftp.fr.debian.org/debian/ - ftp://ftp.it.debian.org/debian/ - ftp://ftp.nl.debian.org/debian/ - ftp://ftp.ru.debian.org/debian/ - ftp://ftp.debian.org/debian/ - http://ftp.debian.org/debian/ - http://archive.debian.org/debian-archive/debian/ - ftp://ftp.funet.fi/pub/mirrors/ftp.debian.org/debian/ + "http://httpredir.debian.org/debian/" + "ftp://ftp.au.debian.org/debian/" + "ftp://ftp.de.debian.org/debian/" + "ftp://ftp.es.debian.org/debian/" + "ftp://ftp.fr.debian.org/debian/" + "ftp://ftp.it.debian.org/debian/" + "ftp://ftp.nl.debian.org/debian/" + "ftp://ftp.ru.debian.org/debian/" + "ftp://ftp.debian.org/debian/" + "http://ftp.debian.org/debian/" + "http://archive.debian.org/debian-archive/debian/" + "ftp://ftp.funet.fi/pub/mirrors/ftp.debian.org/debian/" ]; # Ubuntu. ubuntu = [ - http://nl.archive.ubuntu.com/ubuntu/ - http://de.archive.ubuntu.com/ubuntu/ - http://archive.ubuntu.com/ubuntu/ - http://old-releases.ubuntu.com/ubuntu/ + "http://nl.archive.ubuntu.com/ubuntu/" + "http://de.archive.ubuntu.com/ubuntu/" + "http://archive.ubuntu.com/ubuntu/" + "http://old-releases.ubuntu.com/ubuntu/" ]; # Fedora (please only add full mirrors that carry old Fedora distributions as well). # See: https://mirrors.fedoraproject.org/publiclist (but not all carry old content). fedora = [ - http://archives.fedoraproject.org/pub/fedora/ - http://fedora.osuosl.org/ - http://ftp.nluug.nl/pub/os/Linux/distr/fedora/ - http://ftp.funet.fi/pub/mirrors/ftp.redhat.com/pub/fedora/ - http://fedora.bhs.mirrors.ovh.net/ - http://mirror.csclub.uwaterloo.ca/fedora/ - http://ftp.linux.cz/pub/linux/fedora/ - http://ftp.heanet.ie/pub/fedora/ - http://mirror.1000mbps.com/fedora/ - http://archives.fedoraproject.org/pub/archive/fedora/ + "http://archives.fedoraproject.org/pub/fedora/" + "http://fedora.osuosl.org/" + "http://ftp.nluug.nl/pub/os/Linux/distr/fedora/" + "http://ftp.funet.fi/pub/mirrors/ftp.redhat.com/pub/fedora/" + "http://fedora.bhs.mirrors.ovh.net/" + "http://mirror.csclub.uwaterloo.ca/fedora/" + "http://ftp.linux.cz/pub/linux/fedora/" + "http://ftp.heanet.ie/pub/fedora/" + "http://mirror.1000mbps.com/fedora/" + "http://archives.fedoraproject.org/pub/archive/fedora/" ]; # Old SUSE distributions. Unfortunately there is no master site, # since SUSE actually delete their old distributions (see # ftp://ftp.suse.com/pub/suse/discontinued/deleted-20070817/README.txt). oldsuse = [ - ftp://ftp.gmd.de/ftp.suse.com-discontinued/ + "ftp://ftp.gmd.de/ftp.suse.com-discontinued/" ]; # openSUSE. opensuse = [ - http://opensuse.hro.nl/opensuse/distribution/ - http://ftp.funet.fi/pub/linux/mirrors/opensuse/distribution/ - http://ftp.belnet.be/mirror/ftp.opensuse.org/distribution/ - http://ftp.uni-kassel.de/opensuse/distribution/ - http://ftp.opensuse.org/pub/opensuse/distribution/ - http://ftp5.gwdg.de/pub/opensuse/discontinued/distribution/ - http://ftp.hosteurope.de/mirror/ftp.opensuse.org/discontinued/ - http://opensuse.mirror.server4you.net/distribution/ - http://ftp.nsysu.edu.tw/Linux/OpenSuSE/distribution/ + "http://opensuse.hro.nl/opensuse/distribution/" + "http://ftp.funet.fi/pub/linux/mirrors/opensuse/distribution/" + "http://ftp.belnet.be/mirror/ftp.opensuse.org/distribution/" + "http://ftp.uni-kassel.de/opensuse/distribution/" + "http://ftp.opensuse.org/pub/opensuse/distribution/" + "http://ftp5.gwdg.de/pub/opensuse/discontinued/distribution/" + "http://ftp.hosteurope.de/mirror/ftp.opensuse.org/discontinued/" + "http://opensuse.mirror.server4you.net/distribution/" + "http://ftp.nsysu.edu.tw/Linux/OpenSuSE/distribution/" ]; # Gnome (see http://ftp.gnome.org/pub/GNOME/MIRRORS). gnome = [ # This one redirects to some mirror closeby, so it should be all you need. - http://download.gnome.org/ + "http://download.gnome.org/" - http://ftp.unina.it/pub/linux/GNOME/ - http://fr2.rpmfind.net/linux/gnome.org/ - ftp://ftp.dit.upm.es/pub/GNOME/ - ftp://ftp.no.gnome.org/pub/GNOME/ - http://ftp.acc.umu.se/pub/GNOME/ - http://ftp.belnet.be/mirror/ftp.gnome.org/ - http://ftp.df.lth.se/pub/gnome/ - http://linorg.usp.br/gnome/ - http://mirror.aarnet.edu.au/pub/GNOME/ - ftp://ftp.cse.buffalo.edu/pub/Gnome/ - ftp://ftp.nara.wide.ad.jp/pub/X11/GNOME/ + "http://ftp.unina.it/pub/linux/GNOME/" + "http://fr2.rpmfind.net/linux/gnome.org/" + "ftp://ftp.dit.upm.es/pub/GNOME/" + "ftp://ftp.no.gnome.org/pub/GNOME/" + "http://ftp.acc.umu.se/pub/GNOME/" + "http://ftp.belnet.be/mirror/ftp.gnome.org/" + "http://ftp.df.lth.se/pub/gnome/" + "http://linorg.usp.br/gnome/" + "http://mirror.aarnet.edu.au/pub/GNOME/" + "ftp://ftp.cse.buffalo.edu/pub/Gnome/" + "ftp://ftp.nara.wide.ad.jp/pub/X11/GNOME/" ]; xfce = [ - http://archive.xfce.org/ - http://mirror.netcologne.de/xfce/ - http://archive.se.xfce.org/xfce/ - http://archive.be.xfce.org/xfce/ - http://mirror.perldude.de/archive.xfce.org/ - http://archive.be2.xfce.org/ - http://ftp.udc.es/xfce/ - http://archive.al-us.xfce.org/ - http://mirror.yongbok.net/X11/xfce-mirror/ - http://mirrors.tummy.com/pub/archive.xfce.org/ - http://xfce.mirror.uber.com.au/ + "http://archive.xfce.org/" + "http://mirror.netcologne.de/xfce/" + "http://archive.se.xfce.org/xfce/" + "http://archive.be.xfce.org/xfce/" + "http://mirror.perldude.de/archive.xfce.org/" + "http://archive.be2.xfce.org/" + "http://ftp.udc.es/xfce/" + "http://archive.al-us.xfce.org/" + "http://mirror.yongbok.net/X11/xfce-mirror/" + "http://mirrors.tummy.com/pub/archive.xfce.org/" + "http://xfce.mirror.uber.com.au/" ]; # X.org. xorg = [ - https://xorg.freedesktop.org/releases/ - https://ftp.x.org/archive/ + "https://xorg.freedesktop.org/releases/" + "https://ftp.x.org/archive/" ]; # Apache mirrors (see http://www.apache.org/mirrors/). apache = [ - https://www-eu.apache.org/dist/ - https://www-us.apache.org/dist/ - http://www.eu.apache.org/dist/ - ftp://ftp.fu-berlin.de/unix/www/apache/ - http://ftp.tudelft.nl/apache/ - http://mirror.cc.columbia.edu/pub/software/apache/ - https://www.apache.org/dist/ - https://archive.apache.org/dist/ # fallback for old releases - ftp://ftp.funet.fi/pub/mirrors/apache.org/ - http://apache.cs.uu.nl/ - http://apache.cs.utah.edu/ + "https://www-eu.apache.org/dist/" + "https://www-us.apache.org/dist/" + "http://www.eu.apache.org/dist/" + "ftp://ftp.fu-berlin.de/unix/www/apache/" + "http://ftp.tudelft.nl/apache/" + "http://mirror.cc.columbia.edu/pub/software/apache/" + "https://www.apache.org/dist/" + "https://archive.apache.org/dist/" # fallback for old releases + "ftp://ftp.funet.fi/pub/mirrors/apache.org/" + "http://apache.cs.uu.nl/" + "http://apache.cs.utah.edu/" ]; postgresql = [ - http://ftp.postgresql.org/pub/ - ftp://ftp.postgresql.org/pub/ - ftp://ftp-archives.postgresql.org/pub/ + "http://ftp.postgresql.org/pub/" + "ftp://ftp.postgresql.org/pub/" + "ftp://ftp-archives.postgresql.org/pub/" ]; metalab = [ - ftp://mirrors.kernel.org/metalab/ - ftp://ftp.gwdg.de/pub/linux/metalab/ - ftp://ftp.xemacs.org/sites/metalab.unc.edu/ + "ftp://mirrors.kernel.org/metalab/" + "ftp://ftp.gwdg.de/pub/linux/metalab/" + "ftp://ftp.xemacs.org/sites/metalab.unc.edu/" ]; # Bioconductor mirrors (from http://bioconductor.org/about/mirrors) @@ -323,118 +323,118 @@ # http://bioconductor.fmrp.usp.br/ # http://mirror.aarnet.edu.au/pub/bioconductor/ # http://watson.nci.nih.gov/bioc_mirror/ - http://bioconductor.jp/packages/ - http://bioconductor.statistik.tu-dortmund.de/packages/ - http://mirrors.ebi.ac.uk/bioconductor/packages/ - http://mirrors.ustc.edu.cn/bioc/ + "http://bioconductor.jp/packages/" + "http://bioconductor.statistik.tu-dortmund.de/packages/" + "http://mirrors.ebi.ac.uk/bioconductor/packages/" + "http://mirrors.ustc.edu.cn/bioc/" ]; # Hackage mirrors hackage = [ - http://hackage.haskell.org/package/ - http://hdiff.luite.com/packages/archive/package/ - http://hackage.fpcomplete.com/package/ - http://objects-us-east-1.dream.io/hackage-mirror/package/ + "http://hackage.haskell.org/package/" + "http://hdiff.luite.com/packages/archive/package/" + "http://hackage.fpcomplete.com/package/" + "http://objects-us-east-1.dream.io/hackage-mirror/package/" ]; # Roy marples mirrors roy = [ - http://roy.marples.name/downloads/ - http://roy.aydogan.net/ - http://cflags.cc/roy/ + "http://roy.marples.name/downloads/" + "http://roy.aydogan.net/" + "http://cflags.cc/roy/" ]; # Sage mirrors (http://www.sagemath.org/mirrors.html) sageupstream = [ # Africa - http://sagemath.polytechnic.edu.na/spkg/upstream/ - ftp://ftp.sun.ac.za/pub/mirrors/www.sagemath.org/spkg/upstream/ - http://sagemath.mirror.ac.za/spkg/upstream/ - https://ftp.leg.uct.ac.za/pub/packages/sage/spkg/upstream/ - http://mirror.ufs.ac.za/sagemath/spkg/upstream/ + "http://sagemath.polytechnic.edu.na/spkg/upstream/" + "ftp://ftp.sun.ac.za/pub/mirrors/www.sagemath.org/spkg/upstream/" + "http://sagemath.mirror.ac.za/spkg/upstream/" + "https://ftp.leg.uct.ac.za/pub/packages/sage/spkg/upstream/" + "http://mirror.ufs.ac.za/sagemath/spkg/upstream/" # America, North - http://mirrors-usa.go-parts.com/sage/sagemath/spkg/upstream/ - http://mirrors.mit.edu/sage/spkg/upstream/ - http://www.cecm.sfu.ca/sage/spkg/upstream/ - http://files.sagemath.org/spkg/upstream/ - http://mirror.clibre.uqam.ca/sage/spkg/upstream/ - https://mirrors.xmission.com/sage/spkg/upstream/ + "http://mirrors-usa.go-parts.com/sage/sagemath/spkg/upstream/" + "http://mirrors.mit.edu/sage/spkg/upstream/" + "http://www.cecm.sfu.ca/sage/spkg/upstream/" + "http://files.sagemath.org/spkg/upstream/" + "http://mirror.clibre.uqam.ca/sage/spkg/upstream/" + "https://mirrors.xmission.com/sage/spkg/upstream/" # America, South - http://sagemath.c3sl.ufpr.br/spkg/upstream/ - http://linorg.usp.br/sage/spkg/upstream + "http://sagemath.c3sl.ufpr.br/spkg/upstream/" + "http://linorg.usp.br/sage/spkg/upstream" # Asia - http://sage.asis.io/spkg/upstream/ - http://mirror.hust.edu.cn/sagemath/spkg/upstream/ - https://ftp.iitm.ac.in/sage/spkg/upstream/ - http://ftp.kaist.ac.kr/sage/spkg/upstream/ - http://ftp.riken.jp/sagemath/spkg/upstream/ - https://mirrors.tuna.tsinghua.edu.cn/sagemath/spkg/upstream/ - https://mirrors.ustc.edu.cn/sagemath/spkg/upstream/ - http://ftp.tsukuba.wide.ad.jp/software/sage/spkg/upstream/ - http://ftp.yz.yamagata-u.ac.jp/pub/math/sage/spkg/upstream/ - https://mirror.yandex.ru/mirrors/sage.math.washington.edu/spkg/upstream/ + "http://sage.asis.io/spkg/upstream/" + "http://mirror.hust.edu.cn/sagemath/spkg/upstream/" + "https://ftp.iitm.ac.in/sage/spkg/upstream/" + "http://ftp.kaist.ac.kr/sage/spkg/upstream/" + "http://ftp.riken.jp/sagemath/spkg/upstream/" + "https://mirrors.tuna.tsinghua.edu.cn/sagemath/spkg/upstream/" + "https://mirrors.ustc.edu.cn/sagemath/spkg/upstream/" + "http://ftp.tsukuba.wide.ad.jp/software/sage/spkg/upstream/" + "http://ftp.yz.yamagata-u.ac.jp/pub/math/sage/spkg/upstream/" + "https://mirror.yandex.ru/mirrors/sage.math.washington.edu/spkg/upstream/" # Australia - http://echidna.maths.usyd.edu.au/sage/spkg/upstream/ + "http://echidna.maths.usyd.edu.au/sage/spkg/upstream/" # Europe - http://sage.mirror.garr.it/mirrors/sage/spkg/upstream/ - http://sunsite.rediris.es/mirror/sagemath/spkg/upstream/ - http://mirror.switch.ch/mirror/sagemath/spkg/upstream/ - http://mirrors.fe.up.pt/pub/sage/spkg/upstream/ - http://www-ftp.lip6.fr/pub/math/sagemath/spkg/upstream/ - http://ftp.ntua.gr/pub/sagemath/spkg/upstream/ + "http://sage.mirror.garr.it/mirrors/sage/spkg/upstream/" + "http://sunsite.rediris.es/mirror/sagemath/spkg/upstream/" + "http://mirror.switch.ch/mirror/sagemath/spkg/upstream/" + "http://mirrors.fe.up.pt/pub/sage/spkg/upstream/" + "http://www-ftp.lip6.fr/pub/math/sagemath/spkg/upstream/" + "http://ftp.ntua.gr/pub/sagemath/spkg/upstream/" ]; # MySQL mirrors mysql = [ - http://cdn.mysql.com/Downloads/ + "http://cdn.mysql.com/Downloads/" ]; # OpenBSD mirrors openbsd = [ - http://ftp.openbsd.org/pub/OpenBSD/ - ftp://ftp.nluug.nl/pub/OpenBSD/ - ftp://ftp-stud.fht-esslingen.de/pub/OpenBSD/ - ftp://ftp.halifax.rwth-aachen.de/pub/OpenBSD/ - ftp://mirror.switch.ch/pub/OpenBSD/ + "http://ftp.openbsd.org/pub/OpenBSD/" + "ftp://ftp.nluug.nl/pub/OpenBSD/" + "ftp://ftp-stud.fht-esslingen.de/pub/OpenBSD/" + "ftp://ftp.halifax.rwth-aachen.de/pub/OpenBSD/" + "ftp://mirror.switch.ch/pub/OpenBSD/" ]; # Steam Runtime mirrors steamrt = [ - http://repo.steampowered.com/steamrt/ - https://public.abbradar.moe/steamrt/ + "http://repo.steampowered.com/steamrt/" + "https://public.abbradar.moe/steamrt/" ]; # Python PyPI mirrors pypi = [ - https://files.pythonhosted.org/packages/source/ + "https://files.pythonhosted.org/packages/source/" # pypi.io is a more semantic link, but atm it’s referencing # files.pythonhosted.org over two redirects - https://pypi.io/packages/source/ + "https://pypi.io/packages/source/" ]; # Mozilla projects. mozilla = [ - http://download.cdn.mozilla.net/pub/mozilla.org/ - https://archive.mozilla.org/pub/ + "http://download.cdn.mozilla.net/pub/mozilla.org/" + "https://archive.mozilla.org/pub/" ]; # Maven Central maven = [ - https://repo1.maven.org/maven2/ - https://central.maven.org/maven2/ + "https://repo1.maven.org/maven2/" + "https://central.maven.org/maven2/" ]; # Alsa Project alsa = [ - https://www.alsa-project.org/files/pub/ - ftp://ftp.alsa-project.org/pub/ - http://alsa.cybermirror.org/ - http://www.mirrorservice.org/sites/ftp.alsa-project.org/pub/ - http://alsa.mirror.fr/ + "https://www.alsa-project.org/files/pub/" + "ftp://ftp.alsa-project.org/pub/" + "http://alsa.cybermirror.org/" + "http://www.mirrorservice.org/sites/ftp.alsa-project.org/pub/" + "http://alsa.mirror.fr/" ]; } diff --git a/nixpkgs/pkgs/build-support/make-desktopitem/default.nix b/nixpkgs/pkgs/build-support/make-desktopitem/default.nix index 67b82fd66db1..8355a5ad29bc 100644 --- a/nixpkgs/pkgs/build-support/make-desktopitem/default.nix +++ b/nixpkgs/pkgs/build-support/make-desktopitem/default.nix @@ -1,4 +1,5 @@ -{ lib, runCommandLocal }: +{ lib, runCommandLocal, desktop-file-utils }: + { name , type ? "Application" , exec @@ -8,9 +9,10 @@ , desktopName , genericName ? null , mimeType ? null -, categories ? "Application;Other;" +, categories ? null , startupNotify ? null , extraEntries ? null +, fileValidation ? true # whether to validate resulting desktop file. }: let @@ -18,6 +20,7 @@ let {k="Comment"; v=comment;} {k="GenericName"; v=genericName;} {k="MimeType"; v=mimeType;} + {k="Categories"; v=categories;} {k="StartupNotify"; v=startupNotify;}]; valueNotNull = {k, v}: v != null; @@ -28,16 +31,20 @@ let in runCommandLocal "${name}.desktop" {} '' - mkdir -p $out/share/applications - cat > $out/share/applications/${name}.desktop <<EOF + mkdir -p "$out/share/applications" + cat > "$out/share/applications/${name}.desktop" <<EOF [Desktop Entry] Type=${type} Exec=${exec} Terminal=${terminal} Name=${desktopName} - Categories=${categories} ${optionalEntriesString} ${if extraEntries == null then ''EOF'' else '' ${extraEntries} EOF''} + + ${lib.optionalString fileValidation '' + echo "Running desktop-file validation" + ${desktop-file-utils}/bin/desktop-file-validate "$out/share/applications/${name}.desktop" + ''} '' diff --git a/nixpkgs/pkgs/build-support/release/binary-tarball.nix b/nixpkgs/pkgs/build-support/release/binary-tarball.nix index dad65a0e7eb3..168343c80821 100644 --- a/nixpkgs/pkgs/build-support/release/binary-tarball.nix +++ b/nixpkgs/pkgs/build-support/release/binary-tarball.nix @@ -51,29 +51,24 @@ stdenv.mkDerivation ( configureFlags="--prefix=$prefix $configureFlags" dontAddPrefix=1 prefix=$TMPDIR/inst$prefix - ''; # */ - + ''; doDist = true; - distPhase = - '' - mkdir -p $out/tarballs - tar cvfj $out/tarballs/''${releaseName:-binary-dist}.tar.bz2 -C $TMPDIR/inst . - ''; - - - finalPhase = - '' - for i in $out/tarballs/*; do - echo "file binary-dist $i" >> $out/nix-support/hydra-build-products - done + distPhase = '' + mkdir -p $out/tarballs + tar cvfj $out/tarballs/''${releaseName:-binary-dist}.tar.bz2 -C $TMPDIR/inst . + ''; - # Propagate the release name of the source tarball. This is - # to get nice package names in channels. - test -n "$releaseName" && (echo "$releaseName" >> $out/nix-support/hydra-release-name) - ''; + finalPhase = '' + for i in $out/tarballs/*; do + echo "file binary-dist $i" >> $out/nix-support/hydra-build-products + done + # Propagate the release name of the source tarball. This is + # to get nice package names in channels. + test -n "$releaseName" && (echo "$releaseName" >> $out/nix-support/hydra-release-name) + ''; meta = (if args ? meta then args.meta else {}) // { description = "Build of a generic binary distribution"; diff --git a/nixpkgs/pkgs/build-support/release/debian-build.nix b/nixpkgs/pkgs/build-support/release/debian-build.nix index 354d929c9b65..dfa896a86a60 100644 --- a/nixpkgs/pkgs/build-support/release/debian-build.nix +++ b/nixpkgs/pkgs/build-support/release/debian-build.nix @@ -88,7 +88,7 @@ vmTools.runInLinuxImage (stdenv.mkDerivation ( done eval "$postInstall" - ''; # */ + ''; meta = (if args ? meta then args.meta else {}) // { description = "Deb package for ${diskImage.fullName}"; diff --git a/nixpkgs/pkgs/build-support/release/default.nix b/nixpkgs/pkgs/build-support/release/default.nix index 5e3eb751b81e..6b9aa9a8c4ad 100644 --- a/nixpkgs/pkgs/build-support/release/default.nix +++ b/nixpkgs/pkgs/build-support/release/default.nix @@ -1,4 +1,4 @@ -{pkgs}: +{ pkgs }: with pkgs; @@ -77,7 +77,7 @@ rec { its contituents. Channel jobs are a special type of jobs that are listed in the channel tab of Hydra and that can be suscribed. A tarball of the src attribute is distributed via the channel. - + - constituents: a list of derivations on which the channel success depends. - name: the channel name that will be used in the hydra interface. - src: should point to the root folder of the nix-expressions used by the @@ -88,7 +88,7 @@ rec { name = "my-channel"; src = ./.; }; - + */ channel = { name, src, constituents ? [], meta ? {}, isNixOS ? true, ... }@args: diff --git a/nixpkgs/pkgs/build-support/release/maven-build.nix b/nixpkgs/pkgs/build-support/release/maven-build.nix index 71eb63b850d5..eaa47647287c 100644 --- a/nixpkgs/pkgs/build-support/release/maven-build.nix +++ b/nixpkgs/pkgs/build-support/release/maven-build.nix @@ -11,12 +11,12 @@ , ... } @ args : -let +let mvnFlags = "-Dmaven.repo.local=$M2_REPO ${if doTest then "" else "-Dmaven.test.skip.exec=true"} ${extraMvnFlags}"; in stdenv.mkDerivation ( { - inherit name src; + inherit name src; phases = "setupPhase unpackPhase patchPhase mvnCompile ${if doTestCompile then "mvnTestCompile mvnTestJar" else ""} ${if doTest then "mvnTest" else ""} ${if doJavadoc then "mvnJavadoc" else ""} ${if doCheckstyle then "mvnCheckstyle" else ""} mvnJar mvnAssembly mvnRelease finalPhase"; setupPhase = '' @@ -32,15 +32,15 @@ stdenv.mkDerivation ( { mvnCompile = '' mvn compile ${mvnFlags} - ''; + ''; mvnTestCompile = '' mvn test-compile ${mvnFlags} - ''; + ''; mvnTestJar = '' mvn jar:test-jar ${mvnFlags} - ''; + ''; mvnTest = '' mvn test ${mvnFlags} @@ -53,21 +53,21 @@ stdenv.mkDerivation ( { mvn surefire-report:report-only echo "report coverage $out/site/surefire-report.html" >> $out/nix-support/hydra-build-products fi - ''; + ''; mvnJavadoc = '' mvn javadoc:javadoc ${mvnFlags} echo "report javadoc $out/site/apidocs" >> $out/nix-support/hydra-build-products - ''; + ''; mvnCheckstyle = '' mvn checkstyle:checkstyle ${mvnFlags} echo "report checkstyle $out/site/checkstyle.html" >> $out/nix-support/hydra-build-products - ''; + ''; mvnJar = '' mvn jar:jar ${mvnFlags} - ''; + ''; mvnAssembly = '' mvn assembly:assembly -Dmaven.test.skip=true ${mvnFlags} @@ -80,13 +80,13 @@ stdenv.mkDerivation ( { releaseName=$(basename $zip .zip) releaseName="$releaseName-r${toString src.rev or "0"}" cp $zip $out/release/$releaseName.zip - + echo "$releaseName" > $out/nix-support/hydra-release-name ${if doRelease then '' echo "file zip $out/release/$releaseName.zip" >> $out/nix-support/hydra-build-products '' else ""} - ''; + ''; finalPhase = '' if [ -d target/site ] ; then @@ -94,5 +94,5 @@ stdenv.mkDerivation ( { echo "report site $out/site" >> $out/nix-support/hydra-build-products fi ''; -} // args +} // args ) diff --git a/nixpkgs/pkgs/build-support/release/rpm-build.nix b/nixpkgs/pkgs/build-support/release/rpm-build.nix index 194bbc60534e..47c01f2e66b2 100644 --- a/nixpkgs/pkgs/build-support/release/rpm-build.nix +++ b/nixpkgs/pkgs/build-support/release/rpm-build.nix @@ -44,7 +44,7 @@ vmTools.buildRPM ( for rpmdir in $extraRPMs ; do echo "file rpm-extra $(ls $rpmdir/rpms/*/*.rpm | grep -v 'src\.rpm' | sort | head -1)" >> $out/nix-support/hydra-build-products done - ''; # */ + ''; meta = (if args ? meta then args.meta else {}) // { description = "RPM package for ${diskImage.fullName}"; diff --git a/nixpkgs/pkgs/build-support/rust/build-rust-crate/build-crate.nix b/nixpkgs/pkgs/build-support/rust/build-rust-crate/build-crate.nix index 9759235e30e3..d6d1cebb2e91 100644 --- a/nixpkgs/pkgs/build-support/rust/build-rust-crate/build-crate.nix +++ b/nixpkgs/pkgs/build-support/rust/build-rust-crate/build-crate.nix @@ -16,6 +16,9 @@ ++ [crateFeatures] ++ extraRustcOpts ++ lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) "--target ${rust.toRustTarget stdenv.hostPlatform} -C linker=${stdenv.hostPlatform.config}-gcc" + # since rustc 1.42 the "proc_macro" crate is part of the default crate prelude + # https://github.com/rust-lang/cargo/commit/4d64eb99a4#diff-7f98585dbf9d30aa100c8318e2c77e79R1021-R1022 + ++ lib.optional (lib.elem "proc-macro" crateType) "--extern proc_macro" ; rustcMeta = "-C metadata=${metadata} -C extra-filename=-${metadata}"; diff --git a/nixpkgs/pkgs/build-support/rust/build-rust-crate/configure-crate.nix b/nixpkgs/pkgs/build-support/rust/build-rust-crate/configure-crate.nix index 61c39c6b21c0..ed8100537090 100644 --- a/nixpkgs/pkgs/build-support/rust/build-rust-crate/configure-crate.nix +++ b/nixpkgs/pkgs/build-support/rust/build-rust-crate/configure-crate.nix @@ -172,7 +172,7 @@ in '' set +e EXTRA_BUILD=$(sed -n "s/^cargo:rustc-flags=\(.*\)/\1/p" target/build/${crateName}.opt | tr '\n' ' ' | sort -u) EXTRA_FEATURES=$(sed -n "s/^cargo:rustc-cfg=\(.*\)/--cfg \1/p" target/build/${crateName}.opt | tr '\n' ' ') - EXTRA_LINK=$(sed -n "s/^cargo:rustc-link-lib=\(.*\)/\1/p" target/build/${crateName}.opt | tr '\n' ' ' | sort -u) + EXTRA_LINK=$(sed -n "s/^cargo:rustc-link-lib=\(.*\)/\1/p" target/build/${crateName}.opt | tr '\n' ' ') EXTRA_LINK_SEARCH=$(sed -n "s/^cargo:rustc-link-search=\(.*\)/\1/p" target/build/${crateName}.opt | tr '\n' ' ' | sort -u) for env in $(sed -n "s/^cargo:rustc-env=\(.*\)/\1/p" target/build/${crateName}.opt); do diff --git a/nixpkgs/pkgs/build-support/rust/build-rust-crate/default.nix b/nixpkgs/pkgs/build-support/rust/build-rust-crate/default.nix index a175ba9d7f6e..d9ed26f1d94a 100644 --- a/nixpkgs/pkgs/build-support/rust/build-rust-crate/default.nix +++ b/nixpkgs/pkgs/build-support/rust/build-rust-crate/default.nix @@ -13,14 +13,30 @@ let then "macos" else stdenv.hostPlatform.parsed.kernel.name; - # Create rustc arguments to link against the given list of dependencies and - # renames + # Create rustc arguments to link against the given list of dependencies + # and renames. + # + # See docs for crateRenames below. mkRustcDepArgs = dependencies: crateRenames: lib.concatMapStringsSep " " (dep: let - extern = lib.replaceStrings ["-"] ["_"] dep.libName; + normalizeName = lib.replaceStrings ["-"] ["_"]; + extern = normalizeName dep.libName; + # Find a choice that matches in name and optionally version. + findMatchOrUseExtern = choices: + lib.findFirst (choice: + (!(choice ? version) + || choice.version == dep.version or "")) + { rename = extern; } + choices; name = if lib.hasAttr dep.crateName crateRenames then - lib.strings.replaceStrings ["-"] ["_"] crateRenames.${dep.crateName} + let choices = crateRenames.${dep.crateName}; + in + normalizeName ( + if builtins.isList choices + then (findMatchOrUseExtern choices).rename + else choices + ) else extern; in (if lib.any (x: x == "lib" || x == "rlib") dep.crateType then @@ -42,11 +58,128 @@ let installCrate = import ./install-crate.nix { inherit stdenv; }; in -crate_: lib.makeOverridable ({ rust, release, verbose, features, buildInputs, crateOverrides, - dependencies, buildDependencies, crateRenames, - extraRustcOpts, buildTests, - preUnpack, postUnpack, prePatch, patches, postPatch, - preConfigure, postConfigure, preBuild, postBuild, preInstall, postInstall }: +/* The overridable pkgs.buildRustCrate function. + * + * Any unrecognized parameters will be passed as to + * the underlying stdenv.mkDerivation. + */ + crate_: lib.makeOverridable ( + # The rust compiler to use. + # + # Default: pkgs.rustc + { rust + # Whether to build a release version (`true`) or a debug + # version (`false`). Debug versions are faster to build + # but might be much slower at runtime. + , release + # Whether to print rustc invocations etc. + # + # Example: false + # Default: true + , verbose + # A list of rust/cargo features to enable while building the crate. + # Example: [ "std" "async" ] + , features + # Additional build inputs for building this crate. + # + # Example: [ pkgs.openssl ] + , buildInputs + # Allows to override the parameters to buildRustCrate + # for any rust dependency in the transitive build tree. + # + # Default: pkgs.defaultCrateOverrides + # + # Example: + # + # pkgs.defaultCrateOverrides // { + # hello = attrs: { buildInputs = [ openssl ]; }; + # } + , crateOverrides + # Rust library dependencies, i.e. other libaries that were built + # with buildRustCrate. + , dependencies + # Rust build dependencies, i.e. other libaries that were built + # with buildRustCrate and are used by a build script. + , buildDependencies + # Specify the "extern" name of a library if it differs from the library target. + # See above for an extended explanation. + # + # Default: no renames. + # + # Example: + # + # `crateRenames` supports two formats. + # + # The simple version is an attrset that maps the + # `crateName`s of the dependencies to their alternative + # names. + # + # ```nix + # { + # my_crate_name = "my_alternative_name"; + # # ... + # } + # ``` + # + # The extended version is also keyed by the `crateName`s but allows + # different names for different crate versions: + # + # ```nix + # { + # my_crate_name = [ + # { version = "1.2.3"; rename = "my_alternative_name01"; } + # { version = "3.2.3"; rename = "my_alternative_name03"; } + # ] + # # ... + # } + # ``` + # + # This roughly corresponds to the following snippet in Cargo.toml: + # + # ```toml + # [dependencies] + # my_alternative_name01 = { package = "my_crate_name", version = "0.1" } + # my_alternative_name03 = { package = "my_crate_name", version = "0.3" } + # ``` + # + # Dependencies which use the lib target name as extern name, do not need + # to be specified in the crateRenames, even if their crate name differs. + # + # Including multiple versions of a crate is very popular during + # ecosystem transitions, e.g. from futures 0.1 to futures 0.3. + , crateRenames + # A list of extra options to pass to rustc. + # + # Example: [ "-Z debuginfo=2" ] + # Default: [] + , extraRustcOpts + # Whether to enable building tests. + # Use true to enable. + # Default: false + , buildTests + # Passed to stdenv.mkDerivation. + , preUnpack + # Passed to stdenv.mkDerivation. + , postUnpack + # Passed to stdenv.mkDerivation. + , prePatch + # Passed to stdenv.mkDerivation. + , patches + # Passed to stdenv.mkDerivation. + , postPatch + # Passed to stdenv.mkDerivation. + , preConfigure + # Passed to stdenv.mkDerivation. + , postConfigure + # Passed to stdenv.mkDerivation. + , preBuild + # Passed to stdenv.mkDerivation. + , postBuild + # Passed to stdenv.mkDerivation. + , preInstall + # Passed to stdenv.mkDerivation. + , postInstall + }: let crate = crate_ // (lib.attrByPath [ crate_.crateName ] (attr: {}) crateOverrides crate_); dependencies_ = dependencies; @@ -88,6 +221,7 @@ stdenv.mkDerivation (rec { src = crate.src or (fetchCrate { inherit (crate) crateName version sha256; }); name = "rust_${crate.crateName}-${crate.version}${lib.optionalString buildTests_ "-test"}"; + version = crate.version; depsBuildBuild = [ rust stdenv.cc cargo jq ]; buildInputs = (crate.buildInputs or []) ++ buildInputs_; dependencies = map lib.getLib dependencies_; diff --git a/nixpkgs/pkgs/build-support/rust/build-rust-crate/install-crate.nix b/nixpkgs/pkgs/build-support/rust/build-rust-crate/install-crate.nix index 5ba7b69bedc5..f4a4dcdb0d94 100644 --- a/nixpkgs/pkgs/build-support/rust/build-rust-crate/install-crate.nix +++ b/nixpkgs/pkgs/build-support/rust/build-rust-crate/install-crate.nix @@ -14,7 +14,7 @@ if !buildTests then '' fi if [[ "$(ls -A target/lib)" ]]; then mkdir -p $lib/lib - cp target/lib/* $lib/lib #*/ + cp -r target/lib/* $lib/lib #*/ for library in $lib/lib/*.so $lib/lib/*.dylib; do #*/ ln -s $library $(echo $library | sed -e "s/-${metadata}//") done @@ -26,7 +26,7 @@ if !buildTests then '' if [[ -d target/bin ]]; then if [[ "$(ls -A target/bin)" ]]; then mkdir -p $out/bin - cp -P target/bin/* $out/bin # */ + cp -rP target/bin/* $out/bin # */ fi fi runHook postInstall diff --git a/nixpkgs/pkgs/build-support/rust/build-rust-crate/lib.sh b/nixpkgs/pkgs/build-support/rust/build-rust-crate/lib.sh index 5843ee98b0d5..3bf1992cecd8 100644 --- a/nixpkgs/pkgs/build-support/rust/build-rust-crate/lib.sh +++ b/nixpkgs/pkgs/build-support/rust/build-rust-crate/lib.sh @@ -14,7 +14,6 @@ build_lib() { --crate-name $CRATE_NAME \ $lib_src \ --out-dir target/lib \ - --emit=dep-info,link \ -L dependency=target/deps \ --cap-lints allow \ $LIB_RUSTC_OPTS \ @@ -45,7 +44,6 @@ build_bin() { --crate-type bin \ $BIN_RUSTC_OPTS \ --out-dir target/bin \ - --emit=dep-info,link \ -L dependency=target/deps \ $LINK \ $EXTRA_LIB \ @@ -105,11 +103,6 @@ setup_link_paths() { done if [[ -e target/link ]]; then - sort -u target/link.final > target/link.final.sorted - mv target/link.final.sorted target/link.final - sort -u target/link > target/link.sorted - mv target/link.sorted target/link - tr '\n' ' ' < target/link > target/link_ LINK=$(cat target/link_) fi diff --git a/nixpkgs/pkgs/build-support/rust/build-rust-crate/test/default.nix b/nixpkgs/pkgs/build-support/rust/build-rust-crate/test/default.nix index f24583c41fcb..5597e4b0dd66 100644 --- a/nixpkgs/pkgs/build-support/rust/build-rust-crate/test/default.nix +++ b/nixpkgs/pkgs/build-support/rust/build-rust-crate/test/default.nix @@ -1,4 +1,14 @@ -{ lib, buildRustCrate, runCommand, writeTextFile, symlinkJoin, callPackage, releaseTools }: +{ lib +, buildRustCrate +, callPackage +, releaseTools +, runCommand +, runCommandCC +, stdenv +, symlinkJoin +, writeTextFile +}: + let mkCrate = args: let p = { @@ -94,6 +104,58 @@ let '' ); + /* Returns a derivation that asserts that the crate specified by `crateArgs` + has the specified files as output. + + `name` is used as part of the derivation name that performs the checking. + + `crateArgs` is passed to `mkCrate` to build the crate with `buildRustCrate`. + + `expectedFiles` contains a list of expected file paths in the output. E.g. + `[ "./bin/my_binary" ]`. + + `output` specifies the name of the output to use. By default, the default + output is used but e.g. `output = "lib";` will cause the lib output + to be checked instead. You do not need to specify any directories. + */ + assertOutputs = { name, crateArgs, expectedFiles, output? null }: + assert (builtins.isString name); + assert (builtins.isAttrs crateArgs); + assert (builtins.isList expectedFiles); + + let + crate = mkCrate (builtins.removeAttrs crateArgs ["expectedTestOutput"]); + crateOutput = if output == null then crate else crate."${output}"; + expectedFilesFile = writeTextFile { + name = "expected-files-${name}"; + text = + let sorted = builtins.sort (a: b: a<b) expectedFiles; + concatenated = builtins.concatStringsSep "\n" sorted; + in "${concatenated}\n"; + }; + in + runCommand "assert-outputs-${name}" { + } '' + local actualFiles=$(mktemp) + + cd "${crateOutput}" + find . -type f | sort >$actualFiles + diff -q ${expectedFilesFile} $actualFiles >/dev/null || { + echo -e "\033[0;1;31mERROR: Difference in expected output files in ${crateOutput} \033[0m" >&2 + echo === Got: + sed -e 's/^/ /' $actualFiles + echo === Expected: + sed -e 's/^/ /' ${expectedFilesFile} + echo === Diff: + diff -u ${expectedFilesFile} $actualFiles |\ + tail -n +3 |\ + sed -e 's/^/ /' + exit 1 + } + touch $out + '' + ; + in rec { tests = let @@ -135,6 +197,51 @@ let dependencies = [ (mkCrate { crateName = "foo"; libName = "foolib"; src = mkLib "src/lib.rs"; }) ]; crateRenames = { "foo" = "foo_renamed"; }; }; + crateBinRenameMultiVersion = let + crateWithVersion = version: mkCrate { + crateName = "my_lib"; + inherit version; + src = mkFile "src/lib.rs" '' + pub const version: &str = "${version}"; + ''; + }; + depCrate01 = crateWithVersion "0.1.2"; + depCrate02 = crateWithVersion "0.2.1"; + in { + crateName = "my_bin"; + src = symlinkJoin { + name = "my_bin_src"; + paths = [ + (mkFile "src/main.rs" '' + #[test] + fn my_lib_01() { assert_eq!(lib01::version, "0.1.2"); } + + #[test] + fn my_lib_02() { assert_eq!(lib02::version, "0.2.1"); } + + fn main() { } + '') + ]; + }; + dependencies = [ depCrate01 depCrate02 ]; + crateRenames = { + "my_lib" = [ + { + version = "0.1.2"; + rename = "lib01"; + } + { + version = "0.2.1"; + rename = "lib02"; + } + ]; + }; + buildTests = true; + expectedTestOutputs = [ + "test my_lib_01 ... ok" + "test my_lib_02 ... ok" + ]; + }; rustLibTestsDefault = { src = mkTestFile "src/lib.rs" "baz"; buildTests = true; @@ -258,6 +365,64 @@ let ]; }; }; + # Regression test for https://github.com/NixOS/nixpkgs/pull/83379 + # link flag order should be preserved + linkOrder = { + src = symlinkJoin { + name = "buildrs-out-dir-overlay"; + paths = [ + (mkFile "build.rs" '' + fn main() { + // in the other order, linkage will fail + println!("cargo:rustc-link-lib=b"); + println!("cargo:rustc-link-lib=a"); + } + '') + (mkFile "src/main.rs" '' + extern "C" { + fn hello_world(); + } + fn main() { + unsafe { + hello_world(); + } + } + '') + ]; + }; + buildInputs = let + compile = name: text: let + src = writeTextFile { + name = "${name}-src.c"; + inherit text; + }; + in runCommandCC name {} '' + mkdir -p $out/lib + # Note: On darwin (which defaults to clang) we have to add + # `-undefined dynamic_lookup` as otherwise the compilation fails. + cc -shared \ + ${lib.optionalString stdenv.isDarwin "-undefined dynamic_lookup"} \ + -o $out/lib/${name}${stdenv.hostPlatform.extensions.sharedLibrary} ${src} + ''; + b = compile "libb" '' + #include <stdio.h> + + void hello(); + + void hello_world() { + hello(); + printf(" world!\n"); + } + ''; + a = compile "liba" '' + #include <stdio.h> + + void hello() { + printf("hello"); + } + ''; + in [ a b ]; + }; rustCargoTomlInSubDir = { # The "workspace_member" can be set to the sub directory with the crate to build. # By default ".", meaning the top level directory is assumed. @@ -292,9 +457,94 @@ let "test ignore_main ... ok" ]; }; + procMacroInPrelude = { + procMacro = true; + edition = "2018"; + src = symlinkJoin { + name = "proc-macro-in-prelude"; + paths = [ + (mkFile "src/lib.rs" '' + use proc_macro::TokenTree; + '') + ]; + }; + }; }; brotliCrates = (callPackage ./brotli-crates.nix {}); - in lib.mapAttrs (key: value: mkTest (value // lib.optionalAttrs (!value?crateName) { crateName = key; })) cases // { + tests = lib.mapAttrs (key: value: mkTest (value // lib.optionalAttrs (!value?crateName) { crateName = key; })) cases; + in tests // rec { + + crateBinWithPathOutputs = assertOutputs { + name="crateBinWithPath"; + crateArgs = { + crateBin = [{ name = "test_binary1"; path = "src/foobar.rs"; }]; + src = mkBin "src/foobar.rs"; + }; + expectedFiles = [ + "./bin/test_binary1" + ]; + }; + + crateBinWithPathOutputsDebug = assertOutputs { + name="crateBinWithPath"; + crateArgs = { + release = false; + crateBin = [{ name = "test_binary1"; path = "src/foobar.rs"; }]; + src = mkBin "src/foobar.rs"; + }; + expectedFiles = [ + "./bin/test_binary1" + ] ++ lib.optionals stdenv.isDarwin [ + # On Darwin, the debug symbols are in a seperate directory. + "./bin/test_binary1.dSYM/Contents/Info.plist" + "./bin/test_binary1.dSYM/Contents/Resources/DWARF/test_binary1" + ]; + }; + + crateBinNoPath1Outputs = assertOutputs { + name="crateBinNoPath1"; + crateArgs = { + crateBin = [{ name = "my-binary2"; }]; + src = mkBin "src/my_binary2.rs"; + }; + expectedFiles = [ + "./bin/my-binary2" + ]; + }; + + crateLibOutputs = assertOutputs { + name="crateLib"; + output="lib"; + crateArgs = { + libName = "test_lib"; + type = [ "rlib" ]; + libPath = "src/lib.rs"; + src = mkLib "src/lib.rs"; + }; + expectedFiles = [ + "./nix-support/propagated-build-inputs" + "./lib/libtest_lib-042a1fdbef.rlib" + "./lib/link" + ]; + }; + + crateLibOutputsDebug = assertOutputs { + name="crateLib"; + output="lib"; + crateArgs = { + release = false; + libName = "test_lib"; + type = [ "rlib" ]; + libPath = "src/lib.rs"; + src = mkLib "src/lib.rs"; + }; + expectedFiles = [ + "./nix-support/propagated-build-inputs" + "./lib/libtest_lib-042a1fdbef.rlib" + "./lib/link" + ]; + }; + brotliTest = let pkg = brotliCrates.brotli_2_5_0 {}; in runCommand "run-brotli-test-cmd" { diff --git a/nixpkgs/pkgs/build-support/rust/default.nix b/nixpkgs/pkgs/build-support/rust/default.nix index 684429f1e9d2..94a2a5ffa4ec 100644 --- a/nixpkgs/pkgs/build-support/rust/default.nix +++ b/nixpkgs/pkgs/build-support/rust/default.nix @@ -183,6 +183,8 @@ let doCheck = args.doCheck or true; + strictDeps = true; + inherit releaseDir; installPhase = args.installPhase or '' diff --git a/nixpkgs/pkgs/build-support/setup-hooks/audit-blas.sh b/nixpkgs/pkgs/build-support/setup-hooks/audit-blas.sh new file mode 100644 index 000000000000..6a40073fb234 --- /dev/null +++ b/nixpkgs/pkgs/build-support/setup-hooks/audit-blas.sh @@ -0,0 +1,37 @@ +# Ensure that we are always linking against “libblas.so.3” and +# “liblapack.so.3”. + +auditBlas() { + local dir="$prefix" + [ -e "$dir" ] || return 0 + + local i + while IFS= read -r -d $'\0' i; do + if ! isELF "$i"; then continue; fi + + if $OBJDUMP -p "$i" | grep 'NEEDED' | awk '{ print $2; }' | grep -q '\(libmkl_rt.so\|libopenblas.so.0\)'; then + echo "$i refers to a specific implementation of BLAS or LAPACK." + echo "This prevents users from switching BLAS/LAPACK implementations." + echo "Add \`blas' or \`lapack' to buildInputs instead of \`mkl' or \`openblas'." + exit 1 + fi + + (IFS=: + for dir in "$(patchelf --print-rpath "$i")"; do + if [ -f "$dir/libblas.so.3" ] || [ -f "$dir/libblas.so" ]; then + if [ "$dir" != "@blas@/lib" ]; then + echo "$dir is not allowed to contain a library named libblas.so.3" + exit 1 + fi + fi + if [ -f "$dir/liblapack.so.3" ] || [ -f "$dir/liblapack.so" ]; then + if [ "$dir" != "@lapack@/lib" ]; then + echo "$dir is not allowed to contain a library named liblapack.so.3" + exit 1 + fi + fi + done) + done < <(find "$dir" -type f -print0) +} + +fixupOutputHooks+=(auditBlas) diff --git a/nixpkgs/pkgs/build-support/setup-hooks/patch-shebangs.sh b/nixpkgs/pkgs/build-support/setup-hooks/patch-shebangs.sh index 29fed7ad7940..b48b0c50f577 100644 --- a/nixpkgs/pkgs/build-support/setup-hooks/patch-shebangs.sh +++ b/nixpkgs/pkgs/build-support/setup-hooks/patch-shebangs.sh @@ -42,7 +42,7 @@ patchShebangs() { local newInterpreterLine if [ $# -eq 0 ]; then - echo "No arguments supplied to patchShebangs" >0 + echo "No arguments supplied to patchShebangs" >&2 return 0 fi @@ -66,7 +66,7 @@ patchShebangs() { # - options: something starting with a '-' # - environment variables: foo=bar if $(echo "$arg0" | grep -q -- "^-.*\|.*=.*"); then - echo "$f: unsupported interpreter directive \"$oldInterpreterLine\" (set dontPatchShebangs=1 and handle shebang patching yourself)" >0 + echo "$f: unsupported interpreter directive \"$oldInterpreterLine\" (set dontPatchShebangs=1 and handle shebang patching yourself)" >&2 exit 1 fi diff --git a/nixpkgs/pkgs/build-support/skaware/build-skaware-package.nix b/nixpkgs/pkgs/build-support/skaware/build-skaware-package.nix index 9e4456a3a151..e6e2e35789bc 100644 --- a/nixpkgs/pkgs/build-support/skaware/build-skaware-package.nix +++ b/nixpkgs/pkgs/build-support/skaware/build-skaware-package.nix @@ -18,15 +18,12 @@ in { , configureFlags # mostly for moving and deleting files from the build directory # : lines -, postInstall ? "" - # : lines -, postFixup ? "" +, postInstall # : list Maintainer , maintainers ? [] - # : attrs -, meta ? {} -, ... -} @ args: + + +}: let @@ -53,17 +50,24 @@ let "README.*" ]; -in stdenv.mkDerivation ({ +in stdenv.mkDerivation { + inherit pname version; + src = fetchurl { url = "https://skarnet.org/software/${pname}/${pname}-${version}.tar.gz"; inherit sha256; }; + inherit outputs; + dontDisableStatic = true; enableParallelBuilding = true; configureFlags = configureFlags ++ [ "--enable-absolute-paths" + # We assume every nix-based cross target has urandom. + # This might not hold for e.g. BSD. + "--with-sysdep-devurandom=yes" (if stdenv.isDarwin then "--disable-shared" else "--enable-shared") @@ -83,11 +87,13 @@ in stdenv.mkDerivation ({ noiseFiles = commonNoiseFiles; docFiles = commonMetaFiles; }} $doc/share/doc/${pname} - '' + postInstall; + + ${postInstall} + ''; postFixup = '' ${cleanPackaging.checkForRemainingFiles} - '' + postFixup; + ''; meta = { homepage = "https://skarnet.org/software/${pname}/"; @@ -95,9 +101,6 @@ in stdenv.mkDerivation ({ license = stdenv.lib.licenses.isc; maintainers = with lib.maintainers; [ pmahoney Profpatsch ] ++ maintainers; - } // meta; + }; -} // builtins.removeAttrs args [ - "sha256" "configureFlags" "postInstall" "postFixup" - "meta" "description" "platforms" "maintainers" -]) +} diff --git a/nixpkgs/pkgs/build-support/vm/default.nix b/nixpkgs/pkgs/build-support/vm/default.nix index 488c7f2ce2c7..f86e33713840 100644 --- a/nixpkgs/pkgs/build-support/vm/default.nix +++ b/nixpkgs/pkgs/build-support/vm/default.nix @@ -831,15 +831,15 @@ rec { fullName = "Ubuntu 12.04 Precise (i386)"; packagesLists = [ (fetchurl { - url = mirror://ubuntu/dists/precise/main/binary-i386/Packages.bz2; + url = "mirror://ubuntu/dists/precise/main/binary-i386/Packages.bz2"; sha256 = "18ns9h4qhvjfcip9z55grzi371racxavgqkp6b5kfkdq2wwwax2d"; }) (fetchurl { - url = mirror://ubuntu/dists/precise/universe/binary-i386/Packages.bz2; + url = "mirror://ubuntu/dists/precise/universe/binary-i386/Packages.bz2"; sha256 = "085lkzbnzkc74kfdmwdc32sfqyfz8dr0rbiifk8kx9jih3xjw2jk"; }) ]; - urlPrefix = mirror://ubuntu; + urlPrefix = "mirror://ubuntu"; packages = commonDebPackages ++ [ "diffutils" ]; }; @@ -848,15 +848,15 @@ rec { fullName = "Ubuntu 12.04 Precise (amd64)"; packagesLists = [ (fetchurl { - url = mirror://ubuntu/dists/precise/main/binary-amd64/Packages.bz2; + url = "mirror://ubuntu/dists/precise/main/binary-amd64/Packages.bz2"; sha256 = "1aabpn0hdih6cbabyn87yvhccqj44q9k03mqmjsb920iqlckl3fc"; }) (fetchurl { - url = mirror://ubuntu/dists/precise/universe/binary-amd64/Packages.bz2; + url = "mirror://ubuntu/dists/precise/universe/binary-amd64/Packages.bz2"; sha256 = "0x4hz5aplximgb7gnpvrhkw8m7a40s80rkm5b8hil0afblwlg4vr"; }) ]; - urlPrefix = mirror://ubuntu; + urlPrefix = "mirror://ubuntu"; packages = commonDebPackages ++ [ "diffutils" ]; }; @@ -865,15 +865,15 @@ rec { fullName = "Ubuntu 14.04 Trusty (i386)"; packagesLists = [ (fetchurl { - url = mirror://ubuntu/dists/trusty/main/binary-i386/Packages.bz2; + url = "mirror://ubuntu/dists/trusty/main/binary-i386/Packages.bz2"; sha256 = "1d5y3v3v079gdq45hc07ja0bjlmzqfwdwwlq0brwxi8m75k3iz7x"; }) (fetchurl { - url = mirror://ubuntu/dists/trusty/universe/binary-i386/Packages.bz2; + url = "mirror://ubuntu/dists/trusty/universe/binary-i386/Packages.bz2"; sha256 = "03x9w92by320rfklrqhcl3qpwmnxds9c8ijl5zhcb21d6dcz5z1a"; }) ]; - urlPrefix = mirror://ubuntu; + urlPrefix = "mirror://ubuntu"; packages = commonDebPackages ++ [ "diffutils" "libc-bin" ]; }; @@ -882,15 +882,15 @@ rec { fullName = "Ubuntu 14.04 Trusty (amd64)"; packagesLists = [ (fetchurl { - url = mirror://ubuntu/dists/trusty/main/binary-amd64/Packages.bz2; + url = "mirror://ubuntu/dists/trusty/main/binary-amd64/Packages.bz2"; sha256 = "1hhzbyqfr5i0swahwnl5gfp5l9p9hspywb1vpihr3b74p1z935bh"; }) (fetchurl { - url = mirror://ubuntu/dists/trusty/universe/binary-amd64/Packages.bz2; + url = "mirror://ubuntu/dists/trusty/universe/binary-amd64/Packages.bz2"; sha256 = "04560ba8s4z4v5iawknagrkn9q1nzvpn081ycmqvhh73p3p3g1jm"; }) ]; - urlPrefix = mirror://ubuntu; + urlPrefix = "mirror://ubuntu"; packages = commonDebPackages ++ [ "diffutils" "libc-bin" ]; }; @@ -899,15 +899,15 @@ rec { fullName = "Ubuntu 16.04 Xenial (i386)"; packagesLists = [ (fetchurl { - url = mirror://ubuntu/dists/xenial/main/binary-i386/Packages.xz; + url = "mirror://ubuntu/dists/xenial/main/binary-i386/Packages.xz"; sha256 = "13r75sp4slqy8w32y5dnr7pp7p3cfvavyr1g7gwnlkyrq4zx4ahy"; }) (fetchurl { - url = mirror://ubuntu/dists/xenial/universe/binary-i386/Packages.xz; + url = "mirror://ubuntu/dists/xenial/universe/binary-i386/Packages.xz"; sha256 = "14fid1rqm3sc0wlygcvn0yx5aljf51c2jpd4x0zxij4019316hsh"; }) ]; - urlPrefix = mirror://ubuntu; + urlPrefix = "mirror://ubuntu"; packages = commonDebPackages ++ [ "diffutils" "libc-bin" ]; }; @@ -916,15 +916,15 @@ rec { fullName = "Ubuntu 16.04 Xenial (amd64)"; packagesLists = [ (fetchurl { - url = mirror://ubuntu/dists/xenial/main/binary-amd64/Packages.xz; + url = "mirror://ubuntu/dists/xenial/main/binary-amd64/Packages.xz"; sha256 = "110qnkhjkkwm316fbig3aivm2595ydz6zskc4ld5cr8ngcrqm1bn"; }) (fetchurl { - url = mirror://ubuntu/dists/xenial/universe/binary-amd64/Packages.xz; + url = "mirror://ubuntu/dists/xenial/universe/binary-amd64/Packages.xz"; sha256 = "0mm7gj491yi6q4v0n4qkbsm94s59bvqir6fk60j73w7y4la8rg68"; }) ]; - urlPrefix = mirror://ubuntu; + urlPrefix = "mirror://ubuntu"; packages = commonDebPackages ++ [ "diffutils" "libc-bin" ]; }; @@ -933,15 +933,15 @@ rec { fullName = "Ubuntu 17.10 Artful (i386)"; packagesLists = [ (fetchurl { - url = mirror://ubuntu/dists/artful/main/binary-i386/Packages.xz; + url = "mirror://ubuntu/dists/artful/main/binary-i386/Packages.xz"; sha256 = "18yrj4kqdzm39q0527m97h5ing58hkm9yq9iyj636zh2rclym3c8"; }) (fetchurl { - url = mirror://ubuntu/dists/artful/universe/binary-i386/Packages.xz; + url = "mirror://ubuntu/dists/artful/universe/binary-i386/Packages.xz"; sha256 = "1v0njw2w80xfmxi7by76cs8hyxlla5h3gqajlpdw5srjgx2qrm2g"; }) ]; - urlPrefix = mirror://ubuntu; + urlPrefix = "mirror://ubuntu"; packages = commonDebPackages ++ [ "diffutils" "libc-bin" ]; }; @@ -950,15 +950,15 @@ rec { fullName = "Ubuntu 17.10 Artful (amd64)"; packagesLists = [ (fetchurl { - url = mirror://ubuntu/dists/artful/main/binary-amd64/Packages.xz; + url = "mirror://ubuntu/dists/artful/main/binary-amd64/Packages.xz"; sha256 = "104g57j1l3vi8wb5f7rgjvjhf82ccs0vwhc59jfc4ynd51z7fqjk"; }) (fetchurl { - url = mirror://ubuntu/dists/artful/universe/binary-amd64/Packages.xz; + url = "mirror://ubuntu/dists/artful/universe/binary-amd64/Packages.xz"; sha256 = "1qzs95wfy9inaskfx9cf1l5yd3aaqwzy72zzi9xyvkxi75k5gcn4"; }) ]; - urlPrefix = mirror://ubuntu; + urlPrefix = "mirror://ubuntu"; packages = commonDebPackages ++ [ "diffutils" "libc-bin" ]; }; @@ -967,15 +967,15 @@ rec { fullName = "Ubuntu 18.04 Bionic (i386)"; packagesLists = [ (fetchurl { - url = mirror://ubuntu/dists/bionic/main/binary-i386/Packages.xz; + url = "mirror://ubuntu/dists/bionic/main/binary-i386/Packages.xz"; sha256 = "0f0v4131kwf7m7f8j3288rlqdxk1k3vqy74b7fcfd6jz9j8d840i"; }) (fetchurl { - url = mirror://ubuntu/dists/bionic/universe/binary-i386/Packages.xz; + url = "mirror://ubuntu/dists/bionic/universe/binary-i386/Packages.xz"; sha256 = "1v75c0dqr0wp0dqd4hnci92qqs4hll8frqdbpswadgxm5chn91bw"; }) ]; - urlPrefix = mirror://ubuntu; + urlPrefix = "mirror://ubuntu"; packages = commonDebPackages ++ [ "diffutils" "libc-bin" ]; }; @@ -984,15 +984,15 @@ rec { fullName = "Ubuntu 18.04 Bionic (amd64)"; packagesLists = [ (fetchurl { - url = mirror://ubuntu/dists/bionic/main/binary-amd64/Packages.xz; + url = "mirror://ubuntu/dists/bionic/main/binary-amd64/Packages.xz"; sha256 = "1ls81bjyvmfz6i919kszl7xks1ibrh1xqhsk6698ackndkm0wp39"; }) (fetchurl { - url = mirror://ubuntu/dists/bionic/universe/binary-amd64/Packages.xz; + url = "mirror://ubuntu/dists/bionic/universe/binary-amd64/Packages.xz"; sha256 = "1832nqpn4ap95b3sj870xqayrza9in4kih9jkmjax27pq6x15v1r"; }) ]; - urlPrefix = mirror://ubuntu; + urlPrefix = "mirror://ubuntu"; packages = commonDebPackages ++ [ "diffutils" "libc-bin" ]; }; @@ -1000,10 +1000,10 @@ rec { name = "debian-8.11-jessie-i386"; fullName = "Debian 8.11 Jessie (i386)"; packagesList = fetchurl { - url = mirror://debian/dists/jessie/main/binary-i386/Packages.xz; + url = "mirror://debian/dists/jessie/main/binary-i386/Packages.xz"; sha256 = "0adblarhx50yga900il6m25ng0csa81i3wid1dxxmydbdmri7v7d"; }; - urlPrefix = mirror://debian; + urlPrefix = "mirror://debian"; packages = commonDebianPackages; }; @@ -1011,10 +1011,10 @@ rec { name = "debian-8.11-jessie-amd64"; fullName = "Debian 8.11 Jessie (amd64)"; packagesList = fetchurl { - url = mirror://debian/dists/jessie/main/binary-amd64/Packages.xz; + url = "mirror://debian/dists/jessie/main/binary-amd64/Packages.xz"; sha256 = "09y1mv4kqllhxpk1ibjsyl5jig5bp0qxw6pp4sn56rglrpygmn5x"; }; - urlPrefix = mirror://debian; + urlPrefix = "mirror://debian"; packages = commonDebianPackages; }; @@ -1022,10 +1022,10 @@ rec { name = "debian-9.8-stretch-i386"; fullName = "Debian 9.8 Stretch (i386)"; packagesList = fetchurl { - url = http://snapshot.debian.org/archive/debian/20190503T090946Z/dists/stretch/main/binary-i386/Packages.xz; - sha256 = "1dr3skl35iyj85qlc33lq4whippbqf327vnbcyfqqrv6h86k68mw"; + url = "http://snapshot.debian.org/archive/debian/20200301T030401Z/dists/stretch/main/binary-i386/Packages.xz"; + sha256 = "1jglr1d1jys3xddp8f7w9j05db39fah8xy4gfkpqbd1b5d2caslz"; }; - urlPrefix = mirror://debian; + urlPrefix = "mirror://debian"; packages = commonDebianPackages; }; @@ -1033,10 +1033,10 @@ rec { name = "debian-9.8-stretch-amd64"; fullName = "Debian 9.8 Stretch (amd64)"; packagesList = fetchurl { - url = http://snapshot.debian.org/archive/debian/20190503T090946Z/dists/stretch/main/binary-amd64/Packages.xz; + url = "http://snapshot.debian.org/archive/debian/20190503T090946Z/dists/stretch/main/binary-amd64/Packages.xz"; sha256 = "01q00nl47p12n7wx0xclx59wf3zlkzrgj3zxpshyvb91xdnw5sh6"; }; - urlPrefix = mirror://debian; + urlPrefix = "mirror://debian"; packages = commonDebianPackages; }; |