diff options
Diffstat (limited to 'pkgs/build-support')
-rw-r--r-- | pkgs/build-support/bintools-wrapper/default.nix | 2 | ||||
-rw-r--r-- | pkgs/build-support/bintools-wrapper/setup-hook.sh | 8 | ||||
-rw-r--r-- | pkgs/build-support/build-maven.nix | 5 | ||||
-rw-r--r-- | pkgs/build-support/docker/default.nix | 7 | ||||
-rw-r--r-- | pkgs/build-support/emacs/melpa.nix | 25 | ||||
-rw-r--r-- | pkgs/build-support/setup-hooks/remove-pytest-cache.sh | 1 |
6 files changed, 36 insertions, 12 deletions
diff --git a/pkgs/build-support/bintools-wrapper/default.nix b/pkgs/build-support/bintools-wrapper/default.nix index 2739537c25d..91f9e7c71e3 100644 --- a/pkgs/build-support/bintools-wrapper/default.nix +++ b/pkgs/build-support/bintools-wrapper/default.nix @@ -185,6 +185,8 @@ stdenv.mkDerivation { "mips64" = "btsmip"; "mips64el" = "ltsmip"; }.${targetPlatform.parsed.cpu.name} + else if targetPlatform.isPowerPC then "powerpc" + else if targetPlatform.isSparc then "sparc" else throw "unknown emulation for platform: " + targetPlatform.config; in targetPlatform.platform.bfdEmulation or (fmt + sep + arch); diff --git a/pkgs/build-support/bintools-wrapper/setup-hook.sh b/pkgs/build-support/bintools-wrapper/setup-hook.sh index 025f6aa6e7a..f65b792485a 100644 --- a/pkgs/build-support/bintools-wrapper/setup-hook.sh +++ b/pkgs/build-support/bintools-wrapper/setup-hook.sh @@ -20,7 +20,13 @@ bintoolsWrapper_addLDVars () { fi if [[ -d "$1/lib" ]]; then - export NIX_${role_pre}LDFLAGS+=" -L$1/lib" + # Don't add the /lib directory if it actually doesn't contain any libraries. For instance, + # Python and Haskell packages often only have directories like $out/lib/ghc-8.4.3/ or + # $out/lib/python3.6/, so having them in LDFLAGS just makes the linker search unnecessary + # directories and bloats the size of the environment variable space. + if [[ -n "$(echo $1/lib/lib*)" ]]; then + export NIX_${role_pre}LDFLAGS+=" -L$1/lib" + fi fi } diff --git a/pkgs/build-support/build-maven.nix b/pkgs/build-support/build-maven.nix index 30df3e8e733..b9da06c43c8 100644 --- a/pkgs/build-support/build-maven.nix +++ b/pkgs/build-support/build-maven.nix @@ -16,10 +16,11 @@ infoFile: let script = writeText "build-maven-repository.sh" '' ${lib.concatStrings (map (dep: let inherit (dep) - url sha1 groupId artifactId version - authenticated metadata repository-id; + url sha1 groupId artifactId + version metadata repository-id; versionDir = dep.unresolved-version or version; + authenticated = dep.authenticated or false; fetch = (if authenticated then requireFile else fetchurl) { inherit url sha1; diff --git a/pkgs/build-support/docker/default.nix b/pkgs/build-support/docker/default.nix index 950c0c86a6e..bc79f9ff12f 100644 --- a/pkgs/build-support/docker/default.nix +++ b/pkgs/build-support/docker/default.nix @@ -36,10 +36,11 @@ rec { in { imageName # To find the digest of an image, you can use skopeo: - # skopeo inspect docker://docker.io/nixos/nix:1.11 | jq -r '.Digest' - # sha256:20d9485b25ecfd89204e843a962c1bd70e9cc6858d65d7f5fadc340246e2116b + # see doc/functions.xml , imageDigest , sha256 + , os ? "linux" + , arch ? "x86_64" # This used to set a tag to the pulled image , finalImageTag ? "latest" , name ? fixName "docker-image-${imageName}-${finalImageTag}.tar" @@ -59,7 +60,7 @@ rec { sourceURL = "docker://${imageName}@${imageDigest}"; destNameTag = "${imageName}:${finalImageTag}"; } '' - skopeo copy "$sourceURL" "docker-archive://$out:$destNameTag" + skopeo --override-os ${os} --override-arch ${arch} copy "$sourceURL" "docker-archive://$out:$destNameTag" ''; # We need to sum layer.tar, not a directory, hence tarsum instead of nix-hash. diff --git a/pkgs/build-support/emacs/melpa.nix b/pkgs/build-support/emacs/melpa.nix index 5fa45b154a3..2ee99ce973e 100644 --- a/pkgs/build-support/emacs/melpa.nix +++ b/pkgs/build-support/emacs/melpa.nix @@ -5,7 +5,15 @@ with lib; -{ pname +{ /* + pname: Nix package name without special symbols and without version or + "emacs-" prefix. + */ + pname + /* + ename: Original Emacs package name, possibly containing special symbols. + */ +, ename ? null , version , recipe , meta ? {} @@ -22,6 +30,11 @@ in import ./generic.nix { inherit lib stdenv emacs texinfo; } ({ + ename = + if isNull(ename) + then pname + else ename; + melpa = fetchFromGitHub { owner = "melpa"; repo = "melpa"; @@ -35,7 +48,7 @@ import ./generic.nix { inherit lib stdenv emacs texinfo; } ({ preUnpack = '' mkdir -p "$NIX_BUILD_TOP/recipes" if [ -n "$recipe" ]; then - cp "$recipe" "$NIX_BUILD_TOP/recipes/$pname" + cp "$recipe" "$NIX_BUILD_TOP/recipes/$ename" fi ln -s "$melpa/package-build" "$NIX_BUILD_TOP/package-build" @@ -45,7 +58,7 @@ import ./generic.nix { inherit lib stdenv emacs texinfo; } ({ postUnpack = '' mkdir -p "$NIX_BUILD_TOP/working" - ln -s "$NIX_BUILD_TOP/$sourceRoot" "$NIX_BUILD_TOP/working/$pname" + ln -s "$NIX_BUILD_TOP/$sourceRoot" "$NIX_BUILD_TOP/working/$ename" ''; buildPhase = @@ -58,7 +71,7 @@ import ./generic.nix { inherit lib stdenv emacs texinfo; } ({ -L "$melpa/package-build" \ -l "$melpa2nix" \ -f melpa2nix-build-package \ - $pname $version + $ename $version runHook postBuild ''; @@ -66,9 +79,9 @@ import ./generic.nix { inherit lib stdenv emacs texinfo; } ({ installPhase = '' runHook preInstall - archive="$NIX_BUILD_TOP/packages/$pname-$version.el" + archive="$NIX_BUILD_TOP/packages/$ename-$version.el" if [ ! -f "$archive" ]; then - archive="$NIX_BUILD_TOP/packages/$pname-$version.tar" + archive="$NIX_BUILD_TOP/packages/$ename-$version.tar" fi emacs --batch -Q \ diff --git a/pkgs/build-support/setup-hooks/remove-pytest-cache.sh b/pkgs/build-support/setup-hooks/remove-pytest-cache.sh new file mode 100644 index 00000000000..7f3e08bfa67 --- /dev/null +++ b/pkgs/build-support/setup-hooks/remove-pytest-cache.sh @@ -0,0 +1 @@ +postFixupHooks+= |