Skip to content

Commit

Permalink
Merge pull request #124341 from NixOS/staging-next-21.05
Browse files Browse the repository at this point in the history
[21.05] Staging next
  • Loading branch information
Jonathan Ringer authored May 31, 2021
2 parents 0c2e856 + 7b601ad commit 75f90ee
Show file tree
Hide file tree
Showing 22 changed files with 144 additions and 77 deletions.
4 changes: 2 additions & 2 deletions pkgs/applications/graphics/ImageMagick/7.0.nix
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ in

stdenv.mkDerivation rec {
pname = "imagemagick";
version = "7.0.11-9";
version = "7.0.11-13";

src = fetchFromGitHub {
owner = "ImageMagick";
repo = "ImageMagick";
rev = version;
sha256 = "sha256-eL9zFrgkLb3pS8/UlQB5+p50UG8j3Q7TNDwcO/3BuXo=";
sha256 = "sha256-6dYc636m1OeRqIPv5NFz/K8OUvl6sgEQKjfvTngR2Ms=";
};

outputs = [ "out" "dev" "doc" ]; # bin/ isn't really big
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
, curl, openssl, zlib, expat, perlPackages, python3, gettext, cpio
, gnugrep, gnused, gawk, coreutils # needed at runtime by git-filter-branch etc
, openssh, pcre2
, asciidoctor, texinfo, xmlto, docbook2x, docbook_xsl, docbook_xsl_ns, docbook_xml_dtd_45
, asciidoc, texinfo, xmlto, docbook2x, docbook_xsl, docbook_xml_dtd_45
, libxslt, tcl, tk, makeWrapper, libiconv
, svnSupport, subversionClient, perlLibs, smtpPerlLibs
, perlSupport ? stdenv.buildPlatform == stdenv.hostPlatform
Expand Down Expand Up @@ -68,8 +68,8 @@ stdenv.mkDerivation {
'';

nativeBuildInputs = [ gettext perlPackages.perl makeWrapper ]
++ lib.optionals withManual [ asciidoctor texinfo xmlto docbook2x
docbook_xsl docbook_xsl_ns docbook_xml_dtd_45 libxslt ];
++ lib.optionals withManual [ asciidoc texinfo xmlto docbook2x
docbook_xsl docbook_xml_dtd_45 libxslt ];
buildInputs = [curl openssl zlib expat cpio libiconv]
++ lib.optionals perlSupport [ perlPackages.perl ]
++ lib.optionals guiSupport [tcl tk]
Expand Down Expand Up @@ -148,7 +148,7 @@ stdenv.mkDerivation {
}
# Install git-subtree.
make -C contrib/subtree install ${lib.optionalString withManual "USE_ASCIIDOCTOR=1 install-doc"}
make -C contrib/subtree install ${lib.optionalString withManual "install-doc"}
rm -rf contrib/subtree
# Install contrib stuff.
Expand Down Expand Up @@ -233,7 +233,7 @@ stdenv.mkDerivation {
'')

+ lib.optionalString withManual ''# Install man pages
make -j $NIX_BUILD_CORES -l $NIX_BUILD_CORES USE_ASCIIDOCTOR=1 PERL_PATH="${buildPackages.perl}/bin/perl" cmd-list.made install install-html \
make -j $NIX_BUILD_CORES -l $NIX_BUILD_CORES PERL_PATH="${buildPackages.perl}/bin/perl" cmd-list.made install install-html \
-C Documentation ''

+ (if guiSupport then ''
Expand Down
2 changes: 1 addition & 1 deletion pkgs/build-support/pkg-config-wrapper/add-flags.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ var_templates_list=(
accumulateRoles

for var in "${var_templates_list[@]}"; do
mangleVarList "$var" ${role_suffixes[@]+"${role_suffixes[@]}"}
mangleVarListGeneric ":" "$var" ${role_suffixes[@]+"${role_suffixes[@]}"}
done

export NIX_PKG_CONFIG_WRAPPER_FLAGS_SET_@suffixSalt@=1
10 changes: 8 additions & 2 deletions pkgs/build-support/wrapper-common/utils.bash
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ accumulateRoles() {
fi
}

mangleVarList() {
mangleVarListGeneric() {
local sep="$1"
shift
local var="$1"
shift
local -a role_suffixes=("$@")
Expand All @@ -25,11 +27,15 @@ mangleVarList() {
for suffix in "${role_suffixes[@]}"; do
local inputVar="${var}${suffix}"
if [ -v "$inputVar" ]; then
export ${outputVar}+="${!outputVar:+ }${!inputVar}"
export ${outputVar}+="${!outputVar:+$sep}${!inputVar}"
fi
done
}

mangleVarList() {
mangleVarListGeneric " " "$@"
}

mangleVarBool() {
local var="$1"
shift
Expand Down
11 changes: 5 additions & 6 deletions pkgs/development/compilers/llvm/10/clang/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ lib, stdenv, llvm_meta, fetch, cmake, libxml2, libllvm, version, clang-tools-extra_src, python3
{ lib, stdenv, llvm_meta, fetch, substituteAll, cmake, libxml2, libllvm, version, clang-tools-extra_src, python3
, buildLlvmTools
, fixDarwinDylibNames
, enableManpages ? false
Expand Down Expand Up @@ -46,6 +46,10 @@ let
# https://reviews.llvm.org/D51899
./compiler-rt-baremetal.patch
./gnu-install-dirs.patch
(substituteAll {
src = ../../clang-6-10-LLVMgold-path.patch;
libllvmLibdir = "${libllvm.lib}/lib";
})
];

postPatch = ''
Expand All @@ -64,12 +68,7 @@ let

outputs = [ "out" "lib" "dev" "python" ];

# Clang expects to find LLVMgold in its own prefix
postInstall = ''
if [ -e ${libllvm.lib}/lib/LLVMgold.so ]; then
ln -sv ${libllvm.lib}/lib/LLVMgold.so $lib/lib
fi
ln -sv $out/bin/clang $out/bin/cpp
# Move libclang to 'lib' output
Expand Down
11 changes: 5 additions & 6 deletions pkgs/development/compilers/llvm/11/clang/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ lib, stdenv, llvm_meta, fetch, fetchpatch, cmake, libxml2, libllvm, version, clang-tools-extra_src, python3
{ lib, stdenv, llvm_meta, fetch, fetchpatch, substituteAll, cmake, libxml2, libllvm, version, clang-tools-extra_src, python3
, buildLlvmTools
, fixDarwinDylibNames
, enableManpages ? false
Expand Down Expand Up @@ -57,6 +57,10 @@ let
excludes = [ "docs/*" "test/*" ];
sha256 = "0gxgmi0qbm89mq911dahallhi8m6wa9vpklklqmxafx4rplrr8ph";
})
(substituteAll {
src = ../../clang-11-12-LLVMgold-path.patch;
libllvmLibdir = "${libllvm.lib}/lib";
})
];

postPatch = ''
Expand All @@ -75,12 +79,7 @@ let

outputs = [ "out" "lib" "dev" "python" ];

# Clang expects to find LLVMgold in its own prefix
postInstall = ''
if [ -e ${libllvm.lib}/lib/LLVMgold.so ]; then
ln -sv ${libllvm.lib}/lib/LLVMgold.so $lib/lib
fi
ln -sv $out/bin/clang $out/bin/cpp
# Move libclang to 'lib' output
Expand Down
11 changes: 5 additions & 6 deletions pkgs/development/compilers/llvm/12/clang/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ lib, stdenv, llvm_meta, fetch, cmake, libxml2, libllvm, version, clang-tools-extra_src, python3
{ lib, stdenv, llvm_meta, fetch, substituteAll, cmake, libxml2, libllvm, version, clang-tools-extra_src, python3
, buildLlvmTools
, fixDarwinDylibNames
, enableManpages ? false
Expand Down Expand Up @@ -44,6 +44,10 @@ let
./purity.patch
# https://reviews.llvm.org/D51899
./gnu-install-dirs.patch
(substituteAll {
src = ../../clang-11-12-LLVMgold-path.patch;
libllvmLibdir = "${libllvm.lib}/lib";
})
];

postPatch = ''
Expand All @@ -59,12 +63,7 @@ let

outputs = [ "out" "lib" "dev" "python" ];

# Clang expects to find LLVMgold in its own prefix
postInstall = ''
if [ -e ${libllvm.lib}/lib/LLVMgold.so ]; then
ln -sv ${libllvm.lib}/lib/LLVMgold.so $lib/lib
fi
ln -sv $out/bin/clang $out/bin/cpp
# Move libclang to 'lib' output
Expand Down
14 changes: 14 additions & 0 deletions pkgs/development/compilers/llvm/5/clang/LLVMgold-path.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
diff --git a/lib/Driver/ToolChains/CommonArgs.cpp b/lib/Driver/ToolChains/CommonArgs.cpp
index 00bd60bc24bb..17416b0bd3c0 100644
--- a/lib/Driver/ToolChains/CommonArgs.cpp
+++ b/lib/Driver/ToolChains/CommonArgs.cpp
@@ -376,8 +376,7 @@ void tools::AddGoldPlugin(const ToolChain &ToolChain, const ArgList &Args,
// as gold requires -plugin to come before any -plugin-opt that -Wl might
// forward.
CmdArgs.push_back("-plugin");
- std::string Plugin =
- ToolChain.getDriver().Dir + "/../lib" CLANG_LIBDIR_SUFFIX "/LLVMgold.so";
+ std::string Plugin = "@libllvmLibdir@" "/LLVMgold.so";
CmdArgs.push_back(Args.MakeArgString(Plugin));

// Try to pass driver level flags relevant to LTO code generation down to
11 changes: 5 additions & 6 deletions pkgs/development/compilers/llvm/5/clang/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ lib, stdenv, llvm_meta, fetch, cmake, libxml2, libllvm, version, clang-tools-extra_src, python3
{ lib, stdenv, llvm_meta, fetch, substituteAll, cmake, libxml2, libllvm, version, clang-tools-extra_src, python3
, buildLlvmTools
, fixDarwinDylibNames
, enableManpages ? false
Expand Down Expand Up @@ -43,6 +43,10 @@ let
patches = [
./purity.patch
./gnu-install-dirs.patch
(substituteAll {
src = ./LLVMgold-path.patch;
libllvmLibdir = "${libllvm.lib}/lib";
})
];

postPatch = ''
Expand All @@ -58,12 +62,7 @@ let

outputs = [ "out" "lib" "dev" "python" ];

# Clang expects to find LLVMgold in its own prefix
postInstall = ''
if [ -e ${libllvm.lib}/lib/LLVMgold.so ]; then
ln -sv ${libllvm.lib}/lib/LLVMgold.so $lib/lib
fi
ln -sv $out/bin/clang $out/bin/cpp
# Move libclang to 'lib' output
Expand Down
11 changes: 5 additions & 6 deletions pkgs/development/compilers/llvm/6/clang/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ lib, stdenv, llvm_meta, fetch, cmake, libxml2, libllvm, version, clang-tools-extra_src, python3
{ lib, stdenv, llvm_meta, fetch, substituteAll, cmake, libxml2, libllvm, version, clang-tools-extra_src, python3
, buildLlvmTools
, fixDarwinDylibNames
, enableManpages ? false
Expand Down Expand Up @@ -43,6 +43,10 @@ let
patches = [
./purity.patch
./gnu-install-dirs.patch
(substituteAll {
src = ../../clang-6-10-LLVMgold-path.patch;
libllvmLibdir = "${libllvm.lib}/lib";
})
];

postPatch = ''
Expand All @@ -58,12 +62,7 @@ let

outputs = [ "out" "lib" "dev" "python" ];

# Clang expects to find LLVMgold in its own prefix
postInstall = ''
if [ -e ${libllvm.lib}/lib/LLVMgold.so ]; then
ln -sv ${libllvm.lib}/lib/LLVMgold.so $lib/lib
fi
ln -sv $out/bin/clang $out/bin/cpp
# Move libclang to 'lib' output
Expand Down
11 changes: 5 additions & 6 deletions pkgs/development/compilers/llvm/7/clang/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ lib, stdenv, llvm_meta, fetch, cmake, libxml2, libllvm, version, clang-tools-extra_src, python3
{ lib, stdenv, llvm_meta, fetch, substituteAll, cmake, libxml2, libllvm, version, clang-tools-extra_src, python3
, buildLlvmTools
, fixDarwinDylibNames
, enableManpages ? false
Expand Down Expand Up @@ -52,6 +52,10 @@ let
# needed for our bootstrapping to not interfere with C.
./unwindlib.patch
./gnu-install-dirs.patch
(substituteAll {
src = ../../clang-6-10-LLVMgold-path.patch;
libllvmLibdir = "${libllvm.lib}/lib";
})
];

postPatch = ''
Expand All @@ -70,12 +74,7 @@ let

outputs = [ "out" "lib" "dev" "python" ];

# Clang expects to find LLVMgold in its own prefix
postInstall = ''
if [ -e ${libllvm.lib}/lib/LLVMgold.so ]; then
ln -sv ${libllvm.lib}/lib/LLVMgold.so $lib/lib
fi
ln -sv $out/bin/clang $out/bin/cpp
# Move libclang to 'lib' output
Expand Down
11 changes: 5 additions & 6 deletions pkgs/development/compilers/llvm/8/clang/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ lib, stdenv, llvm_meta, fetch, cmake, libxml2, libllvm, version, clang-tools-extra_src, python3
{ lib, stdenv, llvm_meta, fetch, substituteAll, cmake, libxml2, libllvm, version, clang-tools-extra_src, python3
, buildLlvmTools
, fixDarwinDylibNames
, enableManpages ? false
Expand Down Expand Up @@ -59,6 +59,10 @@ let
# make clang -xhip use $PATH to find executables
./HIP-use-PATH-8.patch
./gnu-install-dirs.patch
(substituteAll {
src = ../../clang-6-10-LLVMgold-path.patch;
libllvmLibdir = "${libllvm.lib}/lib";
})
];

postPatch = ''
Expand All @@ -77,12 +81,7 @@ let

outputs = [ "out" "lib" "dev" "python" ];

# Clang expects to find LLVMgold in its own prefix
postInstall = ''
if [ -e ${libllvm.lib}/lib/LLVMgold.so ]; then
ln -sv ${libllvm.lib}/lib/LLVMgold.so $lib/lib
fi
ln -sv $out/bin/clang $out/bin/cpp
# Move libclang to 'lib' output
Expand Down
11 changes: 5 additions & 6 deletions pkgs/development/compilers/llvm/9/clang/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ lib, stdenv, llvm_meta, fetch, cmake, libxml2, libllvm, version, clang-tools-extra_src, python3
{ lib, stdenv, llvm_meta, fetch, substituteAll, cmake, libxml2, libllvm, version, clang-tools-extra_src, python3
, buildLlvmTools
, fixDarwinDylibNames
, enableManpages ? false
Expand Down Expand Up @@ -52,6 +52,10 @@ let
# make clang -xhip use $PATH to find executables
./HIP-use-PATH-9.patch
./gnu-install-dirs.patch
(substituteAll {
src = ../../clang-6-10-LLVMgold-path.patch;
libllvmLibdir = "${libllvm.lib}/lib";
})
];

postPatch = ''
Expand All @@ -70,12 +74,7 @@ let

outputs = [ "out" "lib" "dev" "python" ];

# Clang expects to find LLVMgold in its own prefix
postInstall = ''
if [ -e ${libllvm.lib}/lib/LLVMgold.so ]; then
ln -sv ${libllvm.lib}/lib/LLVMgold.so $lib/lib
fi
ln -sv $out/bin/clang $out/bin/cpp
# Move libclang to 'lib' output
Expand Down
13 changes: 13 additions & 0 deletions pkgs/development/compilers/llvm/clang-11-12-LLVMgold-path.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/lib/Driver/ToolChains/CommonArgs.cpp b/lib/Driver/ToolChains/CommonArgs.cpp
index 6b6e276b8ce7..7896542a1202 100644
--- a/lib/Driver/ToolChains/CommonArgs.cpp
+++ b/lib/Driver/ToolChains/CommonArgs.cpp
@@ -409,7 +409,7 @@ void tools::addLTOOptions(const ToolChain &ToolChain, const ArgList &Args,

SmallString<1024> Plugin;
llvm::sys::path::native(
- Twine(D.Dir) + "/../lib" CLANG_LIBDIR_SUFFIX "/LLVMgold" + Suffix,
+ Twine("@libllvmLibdir@" "/LLVMgold") + Suffix,
Plugin);
CmdArgs.push_back(Args.MakeArgString(Plugin));
}
15 changes: 15 additions & 0 deletions pkgs/development/compilers/llvm/clang-6-10-LLVMgold-path.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
diff --git a/lib/Driver/ToolChains/CommonArgs.cpp b/lib/Driver/ToolChains/CommonArgs.cpp
index 37ec73468570..b73e75aa6e59 100644
--- a/lib/Driver/ToolChains/CommonArgs.cpp
+++ b/lib/Driver/ToolChains/CommonArgs.cpp
@@ -370,8 +370,8 @@ void tools::AddGoldPlugin(const ToolChain &ToolChain, const ArgList &Args,
#endif

SmallString<1024> Plugin;
- llvm::sys::path::native(Twine(ToolChain.getDriver().Dir) +
- "/../lib" CLANG_LIBDIR_SUFFIX "/LLVMgold" +
+ llvm::sys::path::native(Twine("@libllvmLibdir@"
+ "/LLVMgold") +
Suffix,
Plugin);
CmdArgs.push_back(Args.MakeArgString(Plugin));
Loading

0 comments on commit 75f90ee

Please sign in to comment.