diff options
author | John Ericson <John.Ericson@Obsidian.Systems> | 2017-11-25 13:43:57 -0500 |
---|---|---|
committer | John Ericson <John.Ericson@Obsidian.Systems> | 2017-11-27 03:15:50 -0500 |
commit | e755a8a27d5c33d87a5742817c373028d35443e9 (patch) | |
tree | 68999720a17f0c6f71f35a7835030f44d409af0f /pkgs/os-specific/darwin | |
parent | fbbda41e05d89325baaefef6fd0a420a1c365d7e (diff) | |
download | nixlib-e755a8a27d5c33d87a5742817c373028d35443e9.tar nixlib-e755a8a27d5c33d87a5742817c373028d35443e9.tar.gz nixlib-e755a8a27d5c33d87a5742817c373028d35443e9.tar.bz2 nixlib-e755a8a27d5c33d87a5742817c373028d35443e9.tar.lz nixlib-e755a8a27d5c33d87a5742817c373028d35443e9.tar.xz nixlib-e755a8a27d5c33d87a5742817c373028d35443e9.tar.zst nixlib-e755a8a27d5c33d87a5742817c373028d35443e9.zip |
treewide: Use `targetPrefix` instead of `prefix` for platform name prefixes
Certain tools, e.g. compilers, are customarily prefixed with the name of their target platform so that multiple builds can be used at once without clobbering each other on the PATH. I was using identifiers named `prefix` for this purpose, but that conflicts with the standard use of `prefix` to mean the directory where something is installed. To avoid conflict and confusion, I renamed those to `targetPrefix`.
Diffstat (limited to 'pkgs/os-specific/darwin')
-rw-r--r-- | pkgs/os-specific/darwin/binutils/default.nix | 16 | ||||
-rw-r--r-- | pkgs/os-specific/darwin/cctools/port.nix | 10 |
2 files changed, 13 insertions, 13 deletions
diff --git a/pkgs/os-specific/darwin/binutils/default.nix b/pkgs/os-specific/darwin/binutils/default.nix index 8ac93689373d..613606b50358 100644 --- a/pkgs/os-specific/darwin/binutils/default.nix +++ b/pkgs/os-specific/darwin/binutils/default.nix @@ -3,24 +3,24 @@ }: # Make sure both underlying packages claim to have prepended their binaries -# with the same prefix. -assert binutils-raw.prefix == cctools.prefix; +# with the same targetPrefix. +assert binutils-raw.targetPrefix == cctools.targetPrefix; let - inherit (binutils-raw) prefix; + inherit (binutils-raw) targetPrefix; cmds = [ "ar" "ranlib" "as" "dsymutil" "install_name_tool" "ld" "strip" "otool" "lipo" "nm" "strings" "size" ]; in -# TODO loop over prefixed binaries too +# TODO loop over targetPrefixed binaries too stdenv.mkDerivation { - name = "${prefix}cctools-binutils-darwin"; + name = "${targetPrefix}cctools-binutils-darwin"; buildCommand = '' mkdir -p $out/bin $out/include - ln -s ${binutils-raw.out}/bin/${prefix}c++filt $out/bin/${prefix}c++filt + ln -s ${binutils-raw.out}/bin/${targetPrefix}c++filt $out/bin/${targetPrefix}c++filt # We specifically need: # - ld: binutils doesn't provide it on darwin @@ -33,7 +33,7 @@ stdenv.mkDerivation { # - strip: the binutils one seems to break mach-o files # - lipo: gcc build assumes it exists # - nm: the gnu one doesn't understand many new load commands - for i in ${stdenv.lib.concatStringsSep " " (builtins.map (e: prefix + e) cmds)}; do + for i in ${stdenv.lib.concatStringsSep " " (builtins.map (e: targetPrefix + e) cmds)}; do ln -sf "${cctools}/bin/$i" "$out/bin/$i" done @@ -44,6 +44,6 @@ stdenv.mkDerivation { ''; passthru = { - inherit prefix; + inherit targetPrefix; }; } diff --git a/pkgs/os-specific/darwin/cctools/port.nix b/pkgs/os-specific/darwin/cctools/port.nix index e08e78339832..bcca11d66b19 100644 --- a/pkgs/os-specific/darwin/cctools/port.nix +++ b/pkgs/os-specific/darwin/cctools/port.nix @@ -5,9 +5,9 @@ }: let - # The prefix prepended to binary names to allow multiple binuntils on the + # The targetPrefix prepended to binary names to allow multiple binuntils on the # PATH to both be usable. - prefix = stdenv.lib.optionalString + targetPrefix = stdenv.lib.optionalString (targetPlatform != hostPlatform) "${targetPlatform.config}-"; in @@ -19,7 +19,7 @@ assert (!hostPlatform.isDarwin) -> (maloader != null && xctoolchain != null); let baseParams = rec { - name = "${prefix}cctools-port-${version}"; + name = "${targetPrefix}cctools-port-${version}"; version = "895"; src = fetchFromGitHub { @@ -49,7 +49,7 @@ let enableParallelBuilding = true; - # TODO(@Ericson2314): Always pass "--target" and always prefix. + # TODO(@Ericson2314): Always pass "--target" and always targetPrefix. configurePlatforms = [ "build" "host" ] ++ stdenv.lib.optional (targetPlatform != hostPlatform) "target"; configureFlags = stdenv.lib.optionals (!stdenv.isDarwin) [ "CXXFLAGS=-I${libcxx}/include/c++/v1" @@ -113,7 +113,7 @@ let ''; passthru = { - inherit prefix; + inherit targetPrefix; }; meta = { |