From a961aeadae1abcce472014e3d0d7d34f83fe7685 Mon Sep 17 00:00:00 2001 From: Arthur Gautier Date: Fri, 12 Feb 2021 17:18:43 +0000 Subject: [PATCH 001/263] stdenv: provide a deterministically built gcc Signed-off-by: Arthur Gautier --- pkgs/development/compilers/gcc/10/default.nix | 5 +++ .../development/compilers/gcc/4.8/default.nix | 5 +++ .../development/compilers/gcc/4.9/default.nix | 5 +++ pkgs/development/compilers/gcc/6/default.nix | 5 +++ pkgs/development/compilers/gcc/7/default.nix | 5 +++ pkgs/development/compilers/gcc/8/default.nix | 5 +++ pkgs/development/compilers/gcc/9/default.nix | 5 +++ pkgs/stdenv/linux/default.nix | 4 ++ pkgs/top-level/all-packages.nix | 45 ++++++++++++------- 9 files changed, 67 insertions(+), 17 deletions(-) diff --git a/pkgs/development/compilers/gcc/10/default.nix b/pkgs/development/compilers/gcc/10/default.nix index 1502b09cca6..65535af2d8e 100644 --- a/pkgs/development/compilers/gcc/10/default.nix +++ b/pkgs/development/compilers/gcc/10/default.nix @@ -4,6 +4,7 @@ , langObjC ? stdenv.targetPlatform.isDarwin , langObjCpp ? stdenv.targetPlatform.isDarwin , langGo ? false +, reproducibleBuild ? true , profiledCompiler ? false , langJit ? false , staticCompiler ? false @@ -48,6 +49,10 @@ assert langAda -> gnatboot != null; # threadsCross is just for MinGW assert threadsCross != null -> stdenv.targetPlatform.isWindows; +# profiledCompiler builds inject non-determinism in one of the compilation stages. +# If turned on, we can't provide reproducible builds anymore +assert reproducibleBuild -> profiledCompiler == false; + with lib; with builtins; diff --git a/pkgs/development/compilers/gcc/4.8/default.nix b/pkgs/development/compilers/gcc/4.8/default.nix index 6a2121a8298..3f5687116d3 100644 --- a/pkgs/development/compilers/gcc/4.8/default.nix +++ b/pkgs/development/compilers/gcc/4.8/default.nix @@ -4,6 +4,7 @@ , langObjCpp ? stdenv.targetPlatform.isDarwin , langJava ? false , langGo ? false +, reproducibleBuild ? true , profiledCompiler ? false , langJit ? false , staticCompiler ? false @@ -58,6 +59,10 @@ assert langGo -> langCC; # threadsCross is just for MinGW assert threadsCross != null -> stdenv.targetPlatform.isWindows; +# profiledCompiler builds inject non-determinism in one of the compilation stages. +# If turned on, we can't provide reproducible builds anymore +assert reproducibleBuild -> profiledCompiler == false; + with lib; with builtins; diff --git a/pkgs/development/compilers/gcc/4.9/default.nix b/pkgs/development/compilers/gcc/4.9/default.nix index 709288559d1..09c969fbb89 100644 --- a/pkgs/development/compilers/gcc/4.9/default.nix +++ b/pkgs/development/compilers/gcc/4.9/default.nix @@ -4,6 +4,7 @@ , langObjCpp ? stdenv.targetPlatform.isDarwin , langJava ? false , langGo ? false +, reproducibleBuild ? true , profiledCompiler ? false , langJit ? false , staticCompiler ? false @@ -58,6 +59,10 @@ assert langGo -> langCC; # threadsCross is just for MinGW assert threadsCross != null -> stdenv.targetPlatform.isWindows; +# profiledCompiler builds inject non-determinism in one of the compilation stages. +# If turned on, we can't provide reproducible builds anymore +assert reproducibleBuild -> profiledCompiler == false; + with lib; with builtins; diff --git a/pkgs/development/compilers/gcc/6/default.nix b/pkgs/development/compilers/gcc/6/default.nix index 93c9dde61fc..1100683a823 100644 --- a/pkgs/development/compilers/gcc/6/default.nix +++ b/pkgs/development/compilers/gcc/6/default.nix @@ -5,6 +5,7 @@ , langObjCpp ? stdenv.targetPlatform.isDarwin , langJava ? false , langGo ? false +, reproducibleBuild ? true , profiledCompiler ? false , langJit ? false , staticCompiler ? false @@ -61,6 +62,10 @@ assert langAda -> gnatboot != null; # threadsCross is just for MinGW assert threadsCross != null -> stdenv.targetPlatform.isWindows; +# profiledCompiler builds inject non-determinism in one of the compilation stages. +# If turned on, we can't provide reproducible builds anymore +assert reproducibleBuild -> profiledCompiler == false; + with lib; with builtins; diff --git a/pkgs/development/compilers/gcc/7/default.nix b/pkgs/development/compilers/gcc/7/default.nix index d9b4c639b5a..3c8ba292994 100644 --- a/pkgs/development/compilers/gcc/7/default.nix +++ b/pkgs/development/compilers/gcc/7/default.nix @@ -3,6 +3,7 @@ , langObjC ? stdenv.targetPlatform.isDarwin , langObjCpp ? stdenv.targetPlatform.isDarwin , langGo ? false +, reproducibleBuild ? true , profiledCompiler ? false , langJit ? false , staticCompiler ? false @@ -45,6 +46,10 @@ assert langGo -> langCC; # threadsCross is just for MinGW assert threadsCross != null -> stdenv.targetPlatform.isWindows; +# profiledCompiler builds inject non-determinism in one of the compilation stages. +# If turned on, we can't provide reproducible builds anymore +assert reproducibleBuild -> profiledCompiler == false; + with lib; with builtins; diff --git a/pkgs/development/compilers/gcc/8/default.nix b/pkgs/development/compilers/gcc/8/default.nix index 6ecf462d54d..a0d5680147b 100644 --- a/pkgs/development/compilers/gcc/8/default.nix +++ b/pkgs/development/compilers/gcc/8/default.nix @@ -3,6 +3,7 @@ , langObjC ? stdenv.targetPlatform.isDarwin , langObjCpp ? stdenv.targetPlatform.isDarwin , langGo ? false +, reproducibleBuild ? true , profiledCompiler ? false , langJit ? false , staticCompiler ? false @@ -45,6 +46,10 @@ assert langGo -> langCC; # threadsCross is just for MinGW assert threadsCross != null -> stdenv.targetPlatform.isWindows; +# profiledCompiler builds inject non-determinism in one of the compilation stages. +# If turned on, we can't provide reproducible builds anymore +assert reproducibleBuild -> profiledCompiler == false; + with lib; with builtins; diff --git a/pkgs/development/compilers/gcc/9/default.nix b/pkgs/development/compilers/gcc/9/default.nix index 7f35f5c7bb9..fbcb1420df5 100644 --- a/pkgs/development/compilers/gcc/9/default.nix +++ b/pkgs/development/compilers/gcc/9/default.nix @@ -5,6 +5,7 @@ , langObjCpp ? stdenv.targetPlatform.isDarwin , langD ? false , langGo ? false +, reproducibleBuild ? true , profiledCompiler ? false , langJit ? false , staticCompiler ? false @@ -54,6 +55,10 @@ assert langAda -> gnatboot != null; # threadsCross is just for MinGW assert threadsCross != null -> stdenv.targetPlatform.isWindows; +# profiledCompiler builds inject non-determinism in one of the compilation stages. +# If turned on, we can't provide reproducible builds anymore +assert reproducibleBuild -> profiledCompiler == false; + with lib; with builtins; diff --git a/pkgs/stdenv/linux/default.nix b/pkgs/stdenv/linux/default.nix index f753af49926..13003a44986 100644 --- a/pkgs/stdenv/linux/default.nix +++ b/pkgs/stdenv/linux/default.nix @@ -274,6 +274,10 @@ in isl_0_20 = super.isl_0_20.override { stdenv = self.makeStaticLibraries self.stdenv; }; gcc-unwrapped = super.gcc-unwrapped.override { isl = isl_0_20; + # Use a deterministically built compiler + # see https://github.com/NixOS/nixpkgs/issues/108475 for context + reproducibleBuild = true; + profiledCompiler = false; }; }; extraNativeBuildInputs = [ prevStage.patchelf ] ++ diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 167f108cddf..fda927f2ea8 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -9799,9 +9799,16 @@ in if stdenv.targetPlatform.isAarch64 then gcc9 else gcc10; gcc-unwrapped = gcc.cc; + wrapNonDeterministicGcc = stdenv: ccWrapper: + if ccWrapper.isGNU then ccWrapper.overrideAttrs(old: { + cc = old.cc.override { + reproducibleBuild = false; + profiledCompiler = with stdenv; (!isDarwin && (isi686 || isx86_64)); + }; + }) else ccWrapper; + gccStdenv = if stdenv.cc.isGNU then stdenv else stdenv.override { allowedRequisites = null; - cc = gcc; # Remove libcxx/libcxxabi, and add clang for AS if on darwin (it uses # clang's internal assembler). extraBuildInputs = lib.optional stdenv.hostPlatform.isDarwin clang.cc; @@ -9814,6 +9821,8 @@ in gcc9Stdenv = overrideCC gccStdenv buildPackages.gcc9; gcc10Stdenv = overrideCC gccStdenv buildPackages.gcc10; + fastStdenv = overrideCC gccStdenv (wrapNonDeterministicGcc gccStdenv buildPackages.gcc10); + wrapCCMulti = cc: if stdenv.targetPlatform.system == "x86_64-linux" then let # Binutils with glibc multi @@ -9878,8 +9887,10 @@ in cc = gccFun { # copy-pasted inherit noSysDirs; - # PGO seems to speed up compilation by gcc by ~10%, see #445 discussion - profiledCompiler = with stdenv; (!isDarwin && (isi686 || isx86_64)); + + reproducibleBuild = true; + profiledCompiler = false; + isl = if !stdenv.isDarwin then isl_0_20 else null; # just for stage static @@ -9897,8 +9908,8 @@ in gcc48 = lowPrio (wrapCC (callPackage ../development/compilers/gcc/4.8 { inherit noSysDirs; - # PGO seems to speed up compilation by gcc by ~10%, see #445 discussion - profiledCompiler = with stdenv; (!isSunOS && !isDarwin && (isi686 || isx86_64)); + reproducibleBuild = true; + profiledCompiler = false; libcCross = if stdenv.targetPlatform != stdenv.buildPlatform then libcCross else null; threadsCross = if stdenv.targetPlatform != stdenv.buildPlatform then threadsCross else null; @@ -9911,8 +9922,8 @@ in gcc49 = lowPrio (wrapCC (callPackage ../development/compilers/gcc/4.9 { inherit noSysDirs; - # PGO seems to speed up compilation by gcc by ~10%, see #445 discussion - profiledCompiler = with stdenv; (!isDarwin && (isi686 || isx86_64)); + reproducibleBuild = true; + profiledCompiler = false; libcCross = if stdenv.targetPlatform != stdenv.buildPlatform then libcCross else null; threadsCross = if stdenv.targetPlatform != stdenv.buildPlatform then threadsCross else null; @@ -9925,8 +9936,8 @@ in gcc6 = lowPrio (wrapCC (callPackage ../development/compilers/gcc/6 { inherit noSysDirs; - # PGO seems to speed up compilation by gcc by ~10%, see #445 discussion - profiledCompiler = with stdenv; (!isDarwin && (isi686 || isx86_64)); + reproducibleBuild = true; + profiledCompiler = false; libcCross = if stdenv.targetPlatform != stdenv.buildPlatform then libcCross else null; threadsCross = if stdenv.targetPlatform != stdenv.buildPlatform then threadsCross else null; @@ -9944,8 +9955,8 @@ in gcc7 = lowPrio (wrapCC (callPackage ../development/compilers/gcc/7 { inherit noSysDirs; - # PGO seems to speed up compilation by gcc by ~10%, see #445 discussion - profiledCompiler = with stdenv; (!isDarwin && (isi686 || isx86_64)); + reproducibleBuild = true; + profiledCompiler = false; libcCross = if stdenv.targetPlatform != stdenv.buildPlatform then libcCross else null; threadsCross = if stdenv.targetPlatform != stdenv.buildPlatform then threadsCross else null; @@ -9959,8 +9970,8 @@ in gcc8 = lowPrio (wrapCC (callPackage ../development/compilers/gcc/8 { inherit noSysDirs; - # PGO seems to speed up compilation by gcc by ~10%, see #445 discussion - profiledCompiler = with stdenv; (!isDarwin && (isi686 || isx86_64)); + reproducibleBuild = true; + profiledCompiler = false; libcCross = if stdenv.targetPlatform != stdenv.buildPlatform then libcCross else null; threadsCross = if stdenv.targetPlatform != stdenv.buildPlatform then threadsCross else null; @@ -9974,8 +9985,8 @@ in gcc9 = lowPrio (wrapCC (callPackage ../development/compilers/gcc/9 { inherit noSysDirs; - # PGO seems to speed up compilation by gcc by ~10%, see #445 discussion - profiledCompiler = with stdenv; (!isDarwin && (isi686 || isx86_64)); + reproducibleBuild = true; + profiledCompiler = false; enableLTO = !stdenv.isi686; @@ -9988,8 +9999,8 @@ in gcc10 = lowPrio (wrapCC (callPackage ../development/compilers/gcc/10 { inherit noSysDirs; - # PGO seems to speed up compilation by gcc by ~10%, see #445 discussion - profiledCompiler = with stdenv; (!isDarwin && (isi686 || isx86_64)); + reproducibleBuild = true; + profiledCompiler = false; enableLTO = !stdenv.isi686; From 9647bb3135b2260884735d83bbeb7acede628761 Mon Sep 17 00:00:00 2001 From: Rick van Schijndel Date: Fri, 19 Mar 2021 11:37:38 +0100 Subject: [PATCH 002/263] gtk-doc: fix cross-compilation --- pkgs/development/tools/documentation/gtk-doc/default.nix | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pkgs/development/tools/documentation/gtk-doc/default.nix b/pkgs/development/tools/documentation/gtk-doc/default.nix index e74a6b9c3c6..55fd0feff10 100644 --- a/pkgs/development/tools/documentation/gtk-doc/default.nix +++ b/pkgs/development/tools/documentation/gtk-doc/default.nix @@ -32,6 +32,13 @@ python3.pkgs.buildPythonApplication rec { passthru.respect_xml_catalog_files_var_patch ]; + strictDeps = true; + + depsBuildBuild = [ + python3 + pkg-config + ]; + nativeBuildInputs = [ pkg-config gettext From 9171829050544852059e71e5772ac0fafc9283f9 Mon Sep 17 00:00:00 2001 From: Mario Rodas Date: Thu, 1 Apr 2021 04:20:00 +0000 Subject: [PATCH 003/263] ruby: 2.6.7 -> 2.7.3 --- pkgs/top-level/all-packages.nix | 25 +++++++------------------ 1 file changed, 7 insertions(+), 18 deletions(-) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index fdb75d2158a..ad033afa72a 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -2273,13 +2273,9 @@ in discount = callPackage ../tools/text/discount { }; - discourse = callPackage ../servers/web-apps/discourse { - ruby = ruby_2_7; - }; + discourse = callPackage ../servers/web-apps/discourse { }; - discourse-mail-receiver = callPackage ../servers/web-apps/discourse/mail_receiver { - ruby = ruby_2_7; - }; + discourse-mail-receiver = callPackage ../servers/web-apps/discourse/mail_receiver { }; discocss = callPackage ../tools/misc/discocss { }; @@ -4930,19 +4926,14 @@ in gitkraken = callPackage ../applications/version-management/gitkraken { }; - gitlab = callPackage ../applications/version-management/gitlab { - ruby = ruby_2_7; - }; + gitlab = callPackage ../applications/version-management/gitlab { }; gitlab-ee = callPackage ../applications/version-management/gitlab { - ruby = ruby_2_7; gitlabEnterprise = true; }; gitlab-runner = callPackage ../development/tools/continuous-integration/gitlab-runner { }; - gitlab-shell = callPackage ../applications/version-management/gitlab/gitlab-shell { - ruby = ruby_2_7; - }; + gitlab-shell = callPackage ../applications/version-management/gitlab/gitlab-shell { }; gitlab-triage = callPackage ../applications/version-management/gitlab-triage { }; @@ -4950,9 +4941,7 @@ in gitleaks = callPackage ../tools/security/gitleaks { }; - gitaly = callPackage ../applications/version-management/gitlab/gitaly { - ruby = ruby_2_7; - }; + gitaly = callPackage ../applications/version-management/gitlab/gitaly { }; gitstats = callPackage ../applications/version-management/gitstats { }; @@ -12059,8 +12048,8 @@ in ruby_2_7 ruby_3_0; - ruby = ruby_2_6; - rubyPackages = rubyPackages_2_6; + ruby = ruby_2_7; + rubyPackages = rubyPackages_2_7; rubyPackages_2_6 = recurseIntoAttrs ruby_2_6.gems; rubyPackages_2_7 = recurseIntoAttrs ruby_2_7.gems; From 6852f66506e4fbeb42ea2d910e1ae85781e55a23 Mon Sep 17 00:00:00 2001 From: Mario Rodas Date: Thu, 1 Apr 2021 04:20:00 +0000 Subject: [PATCH 004/263] ruby: disable jit by default Building Ruby with jit by default includes clang in its closure, hence causing a large closure size. Ruby jit support is optional, and is only enabled at runtime through the `--jit` flag, hence it should not cause any regression. --- pkgs/development/interpreters/ruby/default.nix | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/pkgs/development/interpreters/ruby/default.nix b/pkgs/development/interpreters/ruby/default.nix index 4b185f038a1..5779ac8afb7 100644 --- a/pkgs/development/interpreters/ruby/default.nix +++ b/pkgs/development/interpreters/ruby/default.nix @@ -55,13 +55,7 @@ let # Or (usually): # $(nix-build -A ruby)/lib/ruby/2.6.0/x86_64-linux/rbconfig.rb # - In $out/lib/libruby.so and/or $out/lib/libruby.dylib - # - # Since some Gems require JIT support, there's probably no - # escape from this reference. Hence, it was decided to enable this - # feature by default, as it's enabled by default by ruby's ./configure - # script. If you'd like to have a ruby without reference to cc, setting - # jitSupport to false should remove all known references mentioned above. - , removeReferencesTo, jitSupport ? true + , removeReferencesTo, jitSupport ? false , autoreconfHook, bison, autoconf , buildEnv, bundler, bundix , libiconv, libobjc, libunwind, Foundation @@ -167,8 +161,9 @@ let installFlags = lib.optional docSupport "install-doc"; # Bundler tries to create this directory postInstall = '' + rbConfig=$(find $out/lib/ruby -name rbconfig.rb) # Remove unnecessary groff reference from runtime closure, since it's big - sed -i '/NROFF/d' $out/lib/ruby/*/*/rbconfig.rb + sed -i '/NROFF/d' $rbConfig ${ lib.optionalString (!jitSupport) '' # Get rid of the CC runtime dependency @@ -177,7 +172,8 @@ let $out/lib/libruby* ${removeReferencesTo}/bin/remove-references-to \ -t ${stdenv.cc} \ - $out/${passthru.libPath}/${stdenv.hostPlatform.system}/rbconfig.rb + $rbConfig + sed -i '/CC_VERSION_MESSAGE/d' $rbConfig '' } # Bundler tries to create this directory @@ -195,8 +191,6 @@ let addEnvHooks "$hostOffset" addGemPath addEnvHooks "$hostOffset" addRubyLibPath EOF - - rbConfig=$(find $out/lib/ruby -name rbconfig.rb) '' + opString docSupport '' # Prevent the docs from being included in the closure sed -i "s|\$(DESTDIR)$devdoc|\$(datarootdir)/\$(RI_BASE_NAME)|" $rbConfig From f5831d89299ad8de2b3b83b4c046ec5e141612c9 Mon Sep 17 00:00:00 2001 From: Mario Rodas Date: Wed, 7 Apr 2021 04:20:00 +0000 Subject: [PATCH 005/263] icu69: init at 69.1 http://site.icu-project.org/download/69 --- pkgs/development/libraries/icu/69.nix | 4 ++++ pkgs/top-level/all-packages.nix | 5 +++++ 2 files changed, 9 insertions(+) create mode 100644 pkgs/development/libraries/icu/69.nix diff --git a/pkgs/development/libraries/icu/69.nix b/pkgs/development/libraries/icu/69.nix new file mode 100644 index 00000000000..8cea41daadb --- /dev/null +++ b/pkgs/development/libraries/icu/69.nix @@ -0,0 +1,4 @@ +import ./base.nix { + version = "69.1"; + sha256 = "0icps0avkwy5df3wwc5kybxcg63hcgk4phdh9g244g0xrmx7pfjc"; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 21c7103938f..054a861fbdf 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -14967,6 +14967,11 @@ in } // (lib.optionalAttrs (stdenv.hostPlatform.isi686 && stdenv.cc.isGNU) { stdenv = gcc6Stdenv; # with gcc-7: undefined reference to `__divmoddi4' })); + icu69 = callPackage ../development/libraries/icu/69.nix ({ + nativeBuildRoot = buildPackages.icu69.override { buildRootOnly = true; }; + } // (lib.optionalAttrs (stdenv.hostPlatform.isi686 && stdenv.cc.isGNU) { + stdenv = gcc6Stdenv; # with gcc-7: undefined reference to `__divmoddi4' + })); icu = icu68; From c634d107d0f13f85070ed1d60d998713074cc574 Mon Sep 17 00:00:00 2001 From: Mario Rodas Date: Wed, 7 Apr 2021 04:20:00 +0000 Subject: [PATCH 006/263] icu: 68.2 -> 69.1 --- pkgs/top-level/all-packages.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 054a861fbdf..37ae0b77d0c 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -14973,7 +14973,7 @@ in stdenv = gcc6Stdenv; # with gcc-7: undefined reference to `__divmoddi4' })); - icu = icu68; + icu = icu69; id3lib = callPackage ../development/libraries/id3lib { }; From 8e14bce57181b141d9e83aff64d0814ab4481cb9 Mon Sep 17 00:00:00 2001 From: Rick van Schijndel Date: Fri, 19 Mar 2021 11:38:29 +0100 Subject: [PATCH 007/263] json-glib: fix cross-compilation by disabling introspection and docs --- .../libraries/json-glib/default.nix | 21 ++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/pkgs/development/libraries/json-glib/default.nix b/pkgs/development/libraries/json-glib/default.nix index ed086dac90f..b879af32bd0 100644 --- a/pkgs/development/libraries/json-glib/default.nix +++ b/pkgs/development/libraries/json-glib/default.nix @@ -6,6 +6,7 @@ , ninja , pkg-config , gettext +, withIntrospection ? stdenv.buildPlatform == stdenv.hostPlatform , gobject-introspection , fixDarwinDylibNames , gtk-doc @@ -18,31 +19,45 @@ stdenv.mkDerivation rec { pname = "json-glib"; version = "1.6.2"; - outputs = [ "out" "dev" "devdoc" ]; + outputs = [ "out" "dev" ] + ++ lib.optional withIntrospection "devdoc"; src = fetchurl { url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz"; sha256 = "092g2dyy1hhl0ix9kp33wcab0pg1qicnsv0cj5ms9g9qs336cgd3"; }; + strictDeps = true; + + depsBuildBuild = [ + pkg-config + ]; + nativeBuildInputs = [ meson ninja pkg-config gettext - gobject-introspection glib - gtk-doc docbook-xsl-nons docbook_xml_dtd_43 ] ++ lib.optional stdenv.hostPlatform.isDarwin [ fixDarwinDylibNames + ] ++ lib.optionals withIntrospection [ + gobject-introspection + gtk-doc ]; propagatedBuildInputs = [ glib ]; + mesonFlags = lib.optionals (!withIntrospection) [ + "-Dintrospection=disabled" + # doc gen uses introspection, doesn't work properly + "-Dgtk_doc=disabled" + ]; + doCheck = true; passthru = { From 72354f8ec17b76e70faf2f6b1f1e7ae9a3b9e3c5 Mon Sep 17 00:00:00 2001 From: TredwellGit Date: Sat, 10 Apr 2021 08:30:54 +0000 Subject: [PATCH 008/263] ffmpeg: 4.3.2 -> 4.4 https://github.com/FFmpeg/FFmpeg/blob/n4.4/Changelog --- .../libraries/ffmpeg-full/default.nix | 16 +++------------- pkgs/development/libraries/ffmpeg/3.4.nix | 2 +- pkgs/development/libraries/ffmpeg/4.nix | 8 ++++---- pkgs/development/libraries/ffmpeg/generic.nix | 3 ++- 4 files changed, 10 insertions(+), 19 deletions(-) diff --git a/pkgs/development/libraries/ffmpeg-full/default.nix b/pkgs/development/libraries/ffmpeg-full/default.nix index d861d25e67a..4cfaa9ebff2 100644 --- a/pkgs/development/libraries/ffmpeg-full/default.nix +++ b/pkgs/development/libraries/ffmpeg-full/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, ffmpeg, addOpenGLRunpath, fetchurl, fetchpatch, pkg-config, perl, texinfo, yasm +{ lib, stdenv, ffmpeg, addOpenGLRunpath, pkg-config, perl, texinfo, yasm /* * Licensing options (yes some are listed twice, filters and such are not listed) */ @@ -126,7 +126,6 @@ , vid-stab ? null # Video stabilization #, vo-aacenc ? null # AAC encoder , vo-amrwbenc ? null # AMR-WB encoder -, wavpack ? null # Wavpack encoder , x264 ? null # H.264/AVC encoder , x265 ? null # H.265/HEVC encoder , xavs ? null # AVS encoder @@ -244,15 +243,6 @@ stdenv.mkDerivation rec { pname = "ffmpeg-full"; inherit (ffmpeg) src version; - # this should go away in the next release - patches = [ - # Patch ffmpeg for svt-av1 until version 4.4 - (fetchpatch { - url = "https://raw.githubusercontent.com/AOMediaCodec/SVT-AV1/v0.8.4/ffmpeg_plugin/0001-Add-ability-for-ffmpeg-to-run-svt-av1.patch"; - sha256 = "1p4g8skr5gjw5h1648j7qrks81zx49lrnx9g0p81qgnrvxc2wwx0"; - }) - ]; - prePatch = '' patchShebangs . '' + lib.optionalString stdenv.isDarwin '' @@ -405,7 +395,6 @@ stdenv.mkDerivation rec { (enableFeature (vid-stab != null && gplLicensing) "libvidstab") # Actual min. version 2.0 #(enableFeature (vo-aacenc != null && version3Licensing) "libvo-aacenc") (enableFeature (vo-amrwbenc != null && version3Licensing) "libvo-amrwbenc") - (enableFeature (wavpack != null) "libwavpack") (enableFeature (x264 != null && gplLicensing) "libx264") (enableFeature (x265 != null && gplLicensing) "libx265") (enableFeature (xavs != null && gplLicensing) "libxavs") @@ -432,7 +421,7 @@ stdenv.mkDerivation rec { libjack2 ladspaH lame libaom libass libbluray libbs2b libcaca libdc1394 libmodplug libmysofa libogg libopus librsvg libssh libtheora libvdpau libvorbis libvpx libwebp libX11 libxcb libXv libXext xz openal openjpeg libpulseaudio rav1e svt-av1 rtmpdump opencore-amr - samba SDL2 soxr speex srt vid-stab vo-amrwbenc wavpack x264 x265 xavs xvidcore + samba SDL2 soxr speex srt vid-stab vo-amrwbenc x264 x265 xavs xvidcore zeromq4 zlib ] ++ optionals openglExtlib [ libGL libGLU ] ++ optionals nonfreeLicensing [ fdk_aac openssl ] @@ -465,6 +454,7 @@ stdenv.mkDerivation rec { meta = with lib; { description = "A complete, cross-platform solution to record, convert and stream audio and video"; homepage = "https://www.ffmpeg.org/"; + changelog = "https://github.com/FFmpeg/FFmpeg/blob/n${version}/Changelog"; longDescription = '' FFmpeg is the leading multimedia framework, able to decode, encode, transcode, mux, demux, stream, filter and play pretty much anything that humans and machines diff --git a/pkgs/development/libraries/ffmpeg/3.4.nix b/pkgs/development/libraries/ffmpeg/3.4.nix index be341d588c1..a5140fa01ca 100644 --- a/pkgs/development/libraries/ffmpeg/3.4.nix +++ b/pkgs/development/libraries/ffmpeg/3.4.nix @@ -1,4 +1,4 @@ -{ callPackage, fetchpatch +{ callPackage # Darwin frameworks , Cocoa, CoreMedia , ... diff --git a/pkgs/development/libraries/ffmpeg/4.nix b/pkgs/development/libraries/ffmpeg/4.nix index 95207b5386f..c765cdf73c5 100644 --- a/pkgs/development/libraries/ffmpeg/4.nix +++ b/pkgs/development/libraries/ffmpeg/4.nix @@ -1,12 +1,12 @@ -{ callPackage, fetchpatch +{ callPackage # Darwin frameworks , Cocoa, CoreMedia, VideoToolbox , ... }@args: callPackage ./generic.nix (rec { - version = "4.3.2"; - branch = "4.3"; - sha256 = "0flik4y7c5kchj65p3p908mk1dsncqgzjdvzysjs12rmf1m6sfmb"; + version = "4.4"; + branch = "4.4"; + sha256 = "03kxc29y8190k4y8s8qdpsghlbpmchv1m8iqygq2qn0vfm4ka2a2"; darwinFrameworks = [ Cocoa CoreMedia VideoToolbox ]; } // args) diff --git a/pkgs/development/libraries/ffmpeg/generic.nix b/pkgs/development/libraries/ffmpeg/generic.nix index 82f1a8bf564..befdb910210 100644 --- a/pkgs/development/libraries/ffmpeg/generic.nix +++ b/pkgs/development/libraries/ffmpeg/generic.nix @@ -213,7 +213,8 @@ stdenv.mkDerivation rec { meta = with lib; { description = "A complete, cross-platform solution to record, convert and stream audio and video"; - homepage = "http://www.ffmpeg.org/"; + homepage = "https://www.ffmpeg.org/"; + changelog = "https://github.com/FFmpeg/FFmpeg/blob/n${version}/Changelog"; longDescription = '' FFmpeg is the leading multimedia framework, able to decode, encode, transcode, mux, demux, stream, filter and play pretty much anything that humans and machines From d09936ea84adc87dcdc47a952c0dba53b4407fa7 Mon Sep 17 00:00:00 2001 From: Tobias Mayer Date: Mon, 12 Apr 2021 12:22:31 +0200 Subject: [PATCH 009/263] gcc10: 10.2 -> 10.3 --- pkgs/development/compilers/gcc/10/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/compilers/gcc/10/default.nix b/pkgs/development/compilers/gcc/10/default.nix index 1502b09cca6..01f2767793f 100644 --- a/pkgs/development/compilers/gcc/10/default.nix +++ b/pkgs/development/compilers/gcc/10/default.nix @@ -52,7 +52,7 @@ with lib; with builtins; let majorVersion = "10"; - version = "${majorVersion}.2.0"; + version = "${majorVersion}.3.0"; inherit (stdenv) buildPlatform hostPlatform targetPlatform; @@ -85,7 +85,7 @@ stdenv.mkDerivation ({ src = fetchurl { url = "mirror://gcc/releases/gcc-${version}/gcc-${version}.tar.xz"; - sha256 = "130xdkhmz1bc2kzx061s3sfwk36xah1fw5w332c0nzwwpdl47pdq"; + sha256 = "0i6378ig6h397zkhd7m4ccwjx5alvzrf2hm27p1pzwjhlv0h9x34"; }; inherit patches; From ba793bcaa80e8f8a9911f952399d26481942fec6 Mon Sep 17 00:00:00 2001 From: TredwellGit Date: Wed, 14 Apr 2021 07:13:15 +0000 Subject: [PATCH 010/263] glibc: 2.32-40 -> 2.32-46 --- .../libraries/glibc/2.32-master.patch.gz | Bin 58063 -> 65492 bytes pkgs/development/libraries/glibc/common.nix | 4 ++-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/libraries/glibc/2.32-master.patch.gz b/pkgs/development/libraries/glibc/2.32-master.patch.gz index bcf4d13443cf5e51b80d5f4cce4f65f8d4878585..2fda4294130a8676fc706ce7adb4b8cbe8878aab 100644 GIT binary patch delta 7524 zcmV-q9h>6M#RJs;1F*E>f2>{WPa`)F{|tY{9u-njk|PUAAaGX+h1?y|9UvaMR#z15 zBcWT!L)k1)UHRYZ-^}>2n+E~)6JghDkH=$sW<36l9HQrmE~7tUB+qtCiJLK%BV}nu ztuU@N{ID79gpK`J8OgQ1FpTQWR^4wj`%$aeXj)VGHNh0xX8truf4n0#%UjA)K4>%! z>J4o&H+IEjmc{dc;0G0Jf{?8jWm5IwnNb!{dYb?NFu9MNgHwPN($RsjKBcCvs)PXK z(<~Hxx-J|pU8;uM^65Bu#CptTq^(~2vL@M(Tx=TNj=VldCNg>ilv8la@M}7ytUinA zJtcy|C-rcp0xPeBe`GYh0d-TK(<0<$>K+IXYBgi-B=$fy%@9W}zPiC^K$bGQ_6NZo z5||uuBUPm${R~#_Cdv3&=K1jEWf97GtpaOJ|D5pHFbX0=W zbYyWCPj4LG0B_%P&W%KVJ)Cj(h7attl_M(MCq?LyNN&ghwNt5z9GT=%;NxQ&Fx@X| zC&b+m!bw+LQw4(|k9i~j>7zL`$kAAai0#wSqnp1l&7!E+i|LMqIS_*f8c27fZ(N^V zUZ0L zqJFOx)RY1A{(W2zeSfzVHF`5B?29Tf0PKqjP}~p{e`5p=)qq=@Pc(--ahQCCta8~< z?S?TYk6Q-6;?2I3zl(rdatkM|S@WxLFKZGR+7V5A^S7hVCvCMMeZKzIIlba5@j$gw z6Fm#=3D#;uscFBM9CRqoAwHhpTCdX0NWsSlyw4}cRv58<0DVYYpLoe`Nb8mq!KB+2 zpqH-=e*%Aqg4;aOI~aymh*px{ovv4-zec09*Tp=Lo37QL8BXcOF;`WcU`z6InXeDL&B33;jk1ASrk$hY>j%&HLu7fs@)z_%n*QiLMG|^N zZQ8rVQn)Nc4RPbDK(>4#1r6~i_kWYF2Z`GUe_Oc_zXc?@Ey1YM1nH}@Qq>OCpAYB( z5Pg#(X`q@(`jOn=@`+Sd)&-ohbncLA&wP34mf^T!`{dc_6NTcIT)xRZ= zg4?5UBEcw5233l<4(Nb!l911yjUQ!j(nd~uA#@ ze{&^*eR51&jar)3WJ}E)ux;n19#^}os$|y|U=69n<1?i!DS8sH(yd5^`V0vSQYY=) zc7A2s{5#&zDUW4G>Z(sGG`54_2?!9X=$J%;dCB#Il=%&W$xzwj(!Le%WQe4K1ph5h zM%lFZi06QQpeh{PsfxUk)K>9od$n45f2sJ>7c-)NJHl1R$;1_Xp-A9Gwy}s}n6oqqkp&OG{HS=(GyzNYd@v}j&%4Vt+i;`;@N@cval+ZUaqEBe*>z5P{~ zVW{IOUM6od)g)Cs-OzI4XvD*;|D#@OHE-`L#mQ0djzB;VHrb>AAP1`(R24n*10G z7;fPh5_P8^C%V&*bcK{hM7oWdtKL{hCwTlxo=V9&JRGSCI;Urs=k3|DADps3&E*us zBWgF#q{5gAK0a|4_bQ}fhlS5tf1dhkmsJ|4?uA+fGFk;Hdc9dHYx?WgOPjPk7{#V- zW$rd=FSbWtysbR})}ZE=x05Tm+A?G7$23@}dMda=?Rwq3OJdH=bEkK1w2G%od8W#* z+y!dl<7{n|10-)d+Y}!>tCYB;q+9;|3fPsU9F?zDX6n1|C!YXUrA$7Fw@3Vi z_Z`nf%{I^9eaz|K3u(9>_MXNZV?ceC`20<6rn!S9sfRt!Ue#VsG;h#Q0oSYQ)j@vq z`OV5lZl2_K(AiQX?xv6#f3!jmam{sj=e#$Rvcgw(ysF>@!7*_e_#a1!hHF_+w^y@h@v#&)$ znV@Q{>_B@PZSoKh`h7xZDsWbj(hH>(n|lU$Q>7iM4f`$`k11kHe-WM&n1Yg+IZC4K zRc$T@=P9$Yt#HmM`}jYPq9>XlwWHYeC#KzE+`a6Fba&X2CXe{9eYkgH=>e?|eDz|jfc zvbrMkV%IRh2(x;qnEpZy4pnSpc8kQldj)Zd#qb8lu#Acn*2_7Sf9??GsISkZezu7% z9r?&r(h6{S-EMa-FLP<9y@KmMPI-_1;WM9X$Ux=Ozr6OBlds3!lVciSRdWVU<9mv4v;o$*aRE1dngY?> z1hkS@$S&XRfe}?FgjDz_K@da4C2DZMbV3_*@FdFwe{FOt>~CmE!Z)bpZW5EgVs$<4 z$&GCeR(A#fS6Dr%76(`EG2Wa3lTc*}8d+Sb%L>xV!~Y)u00960>|IN5+c*$D=U-&^ zP`IXT=xy0S_fqT@d)lJg$Egq$J+?*DBv=_qF8%N2%#h+kq^vm3BEaSn2NESw)R3I{ zzHi9+f6Fs>NAYwJN5{y|lO$^EwBj8jPTIB(q9$+L9b=?J3_3!b;|>_P*m%x*7l#Rt z7{0gkVTS(a<;~T%rZ;cg{|;@KPsJa5+wFjcB=Ih6yLeX!eh3zM0}>E?xUW03PfW9- z9fnq?60MiF*DTv%kruT`MmX(d$TUC6x>$xOe^%`yHudehzg};*ZxI!Jr#cSw8@Q>d>y z;E~(e20c;~ox=dLYv3obxvFsvNiXW!JD{yDcNaF>gv^6fCwFu?tG!XV}IF6#CCBmTtxr6pF-f-E9PU`Jsy*hAS2=3q07g=%3xje-wWG;E0o z&Ya#BA^`qJtz^50+5qBqM~r#5>@Xk|e*_1cOmMLK6C7+naIhi4!E}NnT&UnS)Yto^ z70i9K2S#9LG6Le9 zPPF>_Xb>i85ay&o*j^fhd1w&EgE@A88iYA%5ay&o;Hc4H@}l3Uy-x1cSk?z0P$3M0 zUyAi?EAw+AFiIVxgAO0)AVQA+9FqWfwEGhQa-?yLl7eX+TUe49hnfXuZ;>->`kWvJ z!^j4`W?{}lN4H<*_*UrHZXt&ce^;&?y37j%66B1BD!v^!=lx3dJzlQHmHBBulM7Zv zjeKhE1EA!GxNHD~+KRs!-YfV_Bnb_#h|aSiI?o*FJR6|%Y>3V?6P;IRjyWPaPsHsOO1RVUsTsWle~#Rt1>QlY^^I}Xe~Ib5;P>v$6q(n< zuph8WnPU-GQLwHyRkUf=X|idnDz4Hfjy8Fgwn1ITc~a#~+&(PFLas{?W~X7ajn~^W z9wb@duEm!(B7WWCep{0O;$EEnp_4f9lq8E@S*|B?XZQf3rc}Is~X@+u%^)IxL2WB&;jQhKciy*`q_`a}$+wu)L;V+2wRO}o_z8bPel$3Lo^f9c>TH#FGvSndL>MPDyRdmKTU_C%{@)5S8&QL)VOK#iMjMaS2;xt==KD$YLge@Ykd zW9m;VX&`vce;Ihr8F<~9|Lk4sPuo@${|tYHMTbh1$Lu6_ND-5OWi1-e zibpr8Ly;fXAzQGc1ll64|NGA4zU-KU0+l+cp9t5!?}yL%opaCc$DM)IcLvIS`R4Gj zH35x6H;wDJCBsRq`G+U?7j~LRGYr&7UqcxI!TKPRf8yu|jjrp|`+lR-E_j1K#ZT9s zvH!J~?rJyP1sU`^an-%w#aM?MH-d^;Af(_p_AD7=g|lW|3Mguk1qpfQK`yI~jM=uZ zET}QlkTlS(+OoQFh(Rq^-j~|pQYwc9EotS=1zmmN_JUlA755g_p5xNO+L9X!YlZ6y z3c7#Pe?5f4ezXSgL02D|+9ali=qoNStS!H}ph~R1y|DI7R~M+i2qfg!f~gZe;o|xP z>hXv+5h6l(crlkkPVtaMqSudgL91REI9J>D_&S6_q{z;!W7(6Fq&!y*x*LR|?TVlm zbko=sktb5G9mHKvblueJB13T8bvxd3qr2S&e{^?{T~SbV)}*v%Ma$GCh|+OGrbK`; za$X-D?jH=#FHZLMj|OMX$8jimEC_hu;4=8GiEv|{7`J!!!{O~taplJp7h6U>ndF}^ zq6@_~QSG6CP#85vl|he1Hm9JW#16&bkHb+Za1DnyAzPjae@hm1iBZla2^qoFAyU+a ze-o70@1R_?&@0`N7RNEgiKQ4j9E6&JcEj>Sj;Yx<#H-!FOGPK$hT6J8xZRI>UB4r? zdm@aYJ_ca&UDt;NRE1X`gKkeBps4V#GGY0?0Bx+(i(0Kt6!ubBh-titPwQ+3m)1$- zUKn)RjcsH-?Vzy=l78CCqra!==NfA7e_5Ug^!;rn6B4poAc?(N{z@~M=dF2;6m07y zgG6(1^4`Ilh(||n58#j+9Q;1qZL9x}kN4gU&)=L5&fdI*Z`3X-e@yL0I~kHVmKKt% z@4BD8^=7Gb4K;8zNWfQI`MX4U*}5i=_Z9)?yX{wn#Ov#DI>ew%^Q(N4P#drxe}x_= zBDx)UI1G?8nbayDSBw-t0Ik7;@mXb{(7n0GQeiz;_dt4H;&1ock=JVVy(H=+J>U0N znJnyb?z3Ik@31V|==e?@{`hXuhOxl`KwDQEka$Zn?GUE`Pj+?Y+G2zCd#EZYy~&>o z^V53IMy;yekm&x-;(Mhk&5KaEf9^}!fU{wnNS1mx*Q>mni;2*bio|>&4I@dF6Yu6f zV}~k|mHDV%Wj?YJp?3HHPv@m%3Vb)5h-`FoMUR#moSy1A{a}Mr9esX{Et^hq8W_?* zr3HKAQJWiOaAI{R8L8gy9i5$@9-h3$Ul)T?=~V@p65j2d4o=P&iXbNFe@C{mH~{Pf zuxbdF_14xdoA>XW^}4Na5QLiQ@UM1@kl}xa$c(s^Kh zXr(H|Sua=?oEJ(JTWG0Me~s^y>Olo4o(K#mEj`mp?^8RMW}^0)E1Op1w7zIY6~7jN zN7vYUL8D7yKbI^w=S$_nkA;%c}dpby}B9%_dG>(Uey&p(>TGU-!W!-!<0o zfX!Hau+?l!Xi49?54#9&^09`Y?yLXl+i$^(vkXp{)w>J{F}|j>fBi}`Zd;MGuB@%$ zDmWys9Rda`jPv$~mw^>|WYyq#y>1)_wQ1xKCSw2MH{^O7?ju_!m04qVPTP)gCgWvt zz(}Zj6E@H$uL;Ngl#VYO&RBZH&oh;O!G_XsHa7Vj7~Agi_iU-fD!iJWjG}V`xBC&G z3ARdQhjHJB&4BhTe+N!1R2Wmox?!Sr(%0i7tD-xsG0Oe#uJQ0SP>>Dz8XyA2tJOfn z3PCFVMMD*?==M|3?Sx6}AyHW%`a#f5f@E9t`%&z7gHA69(%`wFip6NZ$ZdW0=i#rz z!Rg-Fz|j67{}MxIavotVN|x)MXAuVefd*?h_UFQ!`mly1e}FJUwLf&^6FBH*sCb8S zyGq62SgNjp=5moGbBs-EQ(MC7{TL!~){GfDk$^^V>SUT}u%SKtVLM1)B@D@X$Bi{a zPqJ<0{IL99!>na&&^OQq@zPu?4<@FCVMqmpIq1r@U>`j^+;20y?J&wLp4fZe^peFH8hNk=uyp`QLZwUL+8qPwKMTCyq+@TVhwSr!O~5^V#;hfZxOPA z19@z<6e-xya0my6gS>8o zWDF$bsVr)oK%2+u*d9Kb4{R9|SuMiEAX0G(blnb|0sV!yS+ z2~Y0KyZl|WaujN&$+!w7=4fW3b;9TwXP-I8<6r% zYcEVs;xavnC*vzTs#PQj9H!_q1E|yw-&8*x7mcb7jf6ai2=Dv4^0{`I5)z7xQHoI(IrUw><~30 zQ~^UNNh~c2qwz7r9jIkBOy#=D#lGs%rzBnz zBVYZJ<4n-wOG6Gv7~Yz%U?25wbqfMX+Yo5`%ZtA*Ex-?h{-EKEDTQt z#HHGqTw=xt>T3el*AfJ<|BttTf1AGiB6af$b5EE+Nu4krBPQVDl%gTkbfK;_69)Wy zHoW1sb&Z)16(*WQEly$N4QqN;qB+9^x>nRCYUi&w!eAJgoUAy-VD?#^yY}k0cNd2A zL`V3mbPs*?=hgN6PVU4o8?99-%;kVhSITkSn#UD~C|S4)d9U)>TC@vff1?#jD`j(j z_ozF9*64-?jvm>m?d_h@ouH<{e`GiOf}QWUj{m9Y4bX$oNzH#!dGhg>_6UK>ursBq zK9_~LZbJYUKeA72oeb5em{sg$*B*hOW8bRX^<-k{71za5X1}Vv>ZD1vZDrbVF!Wzd z)UBr)w(ktvy`@j@fOCtme_Q`~yM8o<(CXkuSwn7|H}Hb;hcbKg)PvLA#~azqB!#FP z_m$?WKdvqaXfuXPXl@Y42QGseCMM4&Vq^2l;LMUsw?m+t*_mL_B#kQ@MQ(iWq4pSh zUXigv6hRah-@ze0}Q!%e;&`6XO_4L?vw#>8Z%A!89H`J|Yc2F%;;5K5bB7c|%e-qC` zjkvjs=VKrJ7nC)zPoJvkXPRA%jr0B8#8d8hDlKtyyj_K`99;AGBV70 zl$R+B>ZIn8@Z<0}e>3nqxiUgCaEy7m*sXbnuv?K@l4Z%lc#X>F;Lg z)=9XA&NQ<4b)wg3nTVN9ce3PEX)L0Y)uP~0l_X3ySy=di$iuwKcmx(0QHOQXNkMfq zDuF>F@H|#B#_K!}%JESNM1(1MBemE$3Y6e!5E39OONz?Jf8+XUPVpXA<>GPm`F?(1 zf#2`-fn~_Pv&&G9JiNIFY5-+*au1<3M>cUhJrSFm-m>#Z`z0FL^?90Rg{ZQ;58$v2hjfBY|U1WLW9(i{>-;>oE;^uNmjOXWU+T`eZP>qUuZNVdr_WI7d0uq-UA zQiyu-mTA0t3Arga(w(;D8z3HOf>{&n;H-`enY(=JF5VWkCyBL50ZKzT*<7a0vuy;%B u+{Sw?GyXsA`yT)R0RR6Za7YqlCIJ5_N$~4&L1iIiAQ1pjMdxv6%L4#M2c?|= delta 37 vcmV+=0NVf5{{zp(1F*E>8-q@wqdHm> 2.32-master.patch.gz To compare the archive contents zdiff can be used. From 61c9c7888f5b6cdaf1308a34199391ddcd217d7c Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Wed, 31 Mar 2021 10:06:18 +0200 Subject: [PATCH 011/263] curl: 7.74.0 -> 7.76.1 --- .../curl/7.74.0-CVE-2021-22876.patch | 139 ----- .../curl/7.74.0-CVE-2021-22890.patch | 473 ------------------ pkgs/tools/networking/curl/default.nix | 9 +- 3 files changed, 2 insertions(+), 619 deletions(-) delete mode 100644 pkgs/tools/networking/curl/7.74.0-CVE-2021-22876.patch delete mode 100644 pkgs/tools/networking/curl/7.74.0-CVE-2021-22890.patch diff --git a/pkgs/tools/networking/curl/7.74.0-CVE-2021-22876.patch b/pkgs/tools/networking/curl/7.74.0-CVE-2021-22876.patch deleted file mode 100644 index f915f298a49..00000000000 --- a/pkgs/tools/networking/curl/7.74.0-CVE-2021-22876.patch +++ /dev/null @@ -1,139 +0,0 @@ -Based on upstream 7214288898f5625a6cc196e22a74232eada7861c, adapted by ris to -compensate for lack of 95cbcec8f986492766c4be3922af1e7644e1e7c5 - ---- - lib/transfer.c | 25 ++++++++++++++-- - tests/data/Makefile.inc | 2 +- - tests/data/test2081 | 66 +++++++++++++++++++++++++++++++++++++++++ - 3 files changed, 90 insertions(+), 3 deletions(-) - create mode 100644 tests/data/test2081 - -diff --git a/lib/transfer.c b/lib/transfer.c -index 1976bc0338bc..a68c021c84d6 100644 ---- a/lib/transfer.c -+++ b/lib/transfer.c -@@ -1581,6 +1581,9 @@ CURLcode Curl_follow(struct Curl_easy *data, - data->set.followlocation++; /* count location-followers */ - - if(data->set.http_auto_referer) { -+ CURLU *u; -+ char *referer; -+ - /* We are asked to automatically set the previous URL as the referer - when we get the next URL. We pick the ->url field, which may or may - not be 100% correct */ -@@ -1590,9 +1593,27 @@ CURLcode Curl_follow(struct Curl_easy *data, - data->change.referer_alloc = FALSE; - } - -- data->change.referer = strdup(data->change.url); -- if(!data->change.referer) -+ /* Make a copy of the URL without crenditals and fragment */ -+ u = curl_url(); -+ if(!u) -+ return CURLE_OUT_OF_MEMORY; -+ -+ uc = curl_url_set(u, CURLUPART_URL, data->change.url, 0); -+ if(!uc) -+ uc = curl_url_set(u, CURLUPART_FRAGMENT, NULL, 0); -+ if(!uc) -+ uc = curl_url_set(u, CURLUPART_USER, NULL, 0); -+ if(!uc) -+ uc = curl_url_set(u, CURLUPART_PASSWORD, NULL, 0); -+ if(!uc) -+ uc = curl_url_get(u, CURLUPART_URL, &referer, 0); -+ -+ curl_url_cleanup(u); -+ -+ if(uc || referer == NULL) - return CURLE_OUT_OF_MEMORY; -+ -+ data->change.referer = referer; - data->change.referer_alloc = TRUE; /* yes, free this later */ - } - } -diff --git a/tests/data/Makefile.inc b/tests/data/Makefile.inc -index 2c7a0ca89fd8..ea52683d2254 100644 ---- a/tests/data/Makefile.inc -+++ b/tests/data/Makefile.inc -@@ -225,7 +225,7 @@ test2064 test2065 test2066 test2067 test2068 test2069 \ - test2064 test2065 test2066 test2067 test2068 test2069 test2070 \ - test2071 test2072 test2073 test2074 test2075 test2076 test2077 \ - test2078 \ --test2080 \ -+test2080 test2081 \ - test2100 \ - \ - test3000 test3001 test3002 test3003 test3004 test3005 test3006 test3007 \ -diff --git a/tests/data/test2081 b/tests/data/test2081 -new file mode 100644 -index 000000000000..a6733e737beb ---- /dev/null -+++ b/tests/data/test2081 -@@ -0,0 +1,66 @@ -+ -+ -+ -+HTTP -+HTTP GET -+referer -+followlocation -+--write-out -+ -+ -+ -+# Server-side -+ -+ -+HTTP/1.1 301 This is a weirdo text message swsclose -+Location: data/%TESTNUMBER0002.txt?coolsite=yes -+Content-Length: 62 -+Connection: close -+ -+This server reply is for testing a simple Location: following -+ -+ -+ -+# Client-side -+ -+ -+http -+ -+ -+Automatic referrer credential and anchor stripping check -+ -+ -+http://user:pass@%HOSTIP:%HTTPPORT/we/want/our/%TESTNUMBER#anchor --location --referer ';auto' --write-out '%{referer}\n' -+ -+ -+ -+# Verify data after the test has been "shot" -+ -+ -+52 -+ -+ -+GET /we/want/our/%TESTNUMBER HTTP/1.1 -+Host: %HOSTIP:%HTTPPORT -+Authorization: Basic dXNlcjpwYXNz -+User-Agent: curl/%VERSION -+Accept: */* -+ -+GET /we/want/our/data/%TESTNUMBER0002.txt?coolsite=yes HTTP/1.1 -+Host: %HOSTIP:%HTTPPORT -+Authorization: Basic dXNlcjpwYXNz -+User-Agent: curl/%VERSION -+Accept: */* -+Referer: http://%HOSTIP:%HTTPPORT/we/want/our/%TESTNUMBER -+ -+ -+ -+HTTP/1.1 301 This is a weirdo text message swsclose -+Location: data/%TESTNUMBER0002.txt?coolsite=yes -+Content-Length: 62 -+Connection: close -+ -+http://%HOSTIP:%HTTPPORT/we/want/our/%TESTNUMBER -+ -+ -+ diff --git a/pkgs/tools/networking/curl/7.74.0-CVE-2021-22890.patch b/pkgs/tools/networking/curl/7.74.0-CVE-2021-22890.patch deleted file mode 100644 index 06cc3842e32..00000000000 --- a/pkgs/tools/networking/curl/7.74.0-CVE-2021-22890.patch +++ /dev/null @@ -1,473 +0,0 @@ -Based on upstream b09c8ee15771c614c4bf3ddac893cdb12187c844, adapted by ris mostly to -compensate for lack of bbe3aa9f881fa27fe828e3c9a36d6831f254a3ee - -diff --git a/lib/vtls/bearssl.c b/lib/vtls/bearssl.c -index 36c32d8d55be..39fc1a29209c 100644 ---- a/lib/vtls/bearssl.c -+++ b/lib/vtls/bearssl.c -@@ -375,7 +375,8 @@ static CURLcode bearssl_connect_step1(struct Curl_easy *data, - void *session; - - Curl_ssl_sessionid_lock(conn); -- if(!Curl_ssl_getsessionid(conn, &session, NULL, sockindex)) { -+ if(!Curl_ssl_getsessionid(conn, SSL_IS_PROXY() ? TRUE : FALSE, -+ &session, NULL, sockindex)) { - br_ssl_engine_set_session_parameters(&backend->ctx.eng, session); - infof(data, "BearSSL: re-using session ID\n"); - } -@@ -571,9 +572,13 @@ static CURLcode bearssl_connect_step3(struct Curl_easy *data, - br_ssl_engine_get_session_parameters(&backend->ctx.eng, session); - Curl_ssl_sessionid_lock(conn); -- incache = !(Curl_ssl_getsessionid(conn, &oldsession, NULL, sockindex)); -+ incache = !(Curl_ssl_getsessionid(conn, -+ SSL_IS_PROXY() ? TRUE : FALSE, -+ &oldsession, NULL, sockindex)); - if(incache) - Curl_ssl_delsessionid(conn, oldsession); -- ret = Curl_ssl_addsessionid(conn, session, 0, sockindex); -+ ret = Curl_ssl_addsessionid(conn, -+ SSL_IS_PROXY() ? TRUE : FALSE, -+ session, 0, sockindex); - Curl_ssl_sessionid_unlock(conn); - if(ret) { - free(session); -diff --git a/lib/vtls/gtls.c b/lib/vtls/gtls.c -index a75937b4646c..3b0d940a60e1 100644 ---- a/lib/vtls/gtls.c -+++ b/lib/vtls/gtls.c -@@ -727,5 +727,7 @@ gtls_connect_step1(struct Curl_easy *data, - - Curl_ssl_sessionid_lock(conn); -- if(!Curl_ssl_getsessionid(conn, &ssl_sessionid, &ssl_idsize, sockindex)) { -+ if(!Curl_ssl_getsessionid(conn, -+ SSL_IS_PROXY() ? TRUE : FALSE, -+ &ssl_sessionid, &ssl_idsize, sockindex)) { - /* we got a session id, use it! */ - gnutls_session_set_data(session, ssl_sessionid, ssl_idsize); -@@ -1286,8 +1287,9 @@ gtls_connect_step3(struct Curl_easy *data, - gnutls_session_get_data(session, connect_sessionid, &connect_idsize); - - Curl_ssl_sessionid_lock(conn); -- incache = !(Curl_ssl_getsessionid(conn, &ssl_sessionid, NULL, -- sockindex)); -+ incache = !(Curl_ssl_getsessionid(conn, -+ SSL_IS_PROXY() ? TRUE : FALSE, -+ &ssl_sessionid, NULL, sockindex)); - if(incache) { - /* there was one before in the cache, so instead of risking that the - previous one was rejected, we just kill that and store the new */ -@@ -1295,8 +1297,10 @@ gtls_connect_step3(struct Curl_easy *data, - } - - /* store this session id */ -- result = Curl_ssl_addsessionid(conn, connect_sessionid, connect_idsize, -- sockindex); -+ result = Curl_ssl_addsessionid(conn, -+ SSL_IS_PROXY() ? TRUE : FALSE, -+ connect_sessionid, connect_idsize, -+ sockindex); - Curl_ssl_sessionid_unlock(conn); - if(result) { - free(connect_sessionid); -diff --git a/lib/vtls/mbedtls.c b/lib/vtls/mbedtls.c -index 95cd4d99b665..93a7ac1fd87d 100644 ---- a/lib/vtls/mbedtls.c -+++ b/lib/vtls/mbedtls.c -@@ -463,7 +463,9 @@ mbed_connect_step1(struct Curl_easy *data, struct connectdata *conn, - void *old_session = NULL; - - Curl_ssl_sessionid_lock(conn); -- if(!Curl_ssl_getsessionid(conn, &old_session, NULL, sockindex)) { -+ if(!Curl_ssl_getsessionid(conn, -+ SSL_IS_PROXY() ? TRUE : FALSE, -+ &old_session, NULL, sockindex)) { - ret = mbedtls_ssl_set_session(&backend->ssl, old_session); - if(ret) { - Curl_ssl_sessionid_unlock(conn); -@@ -724,6 +726,7 @@ mbed_connect_step3(struct Curl_easy *data, struct connectdata *conn, - int ret; - mbedtls_ssl_session *our_ssl_sessionid; - void *old_ssl_sessionid = NULL; -+ bool isproxy = SSL_IS_PROXY() ? TRUE : FALSE; - - our_ssl_sessionid = malloc(sizeof(mbedtls_ssl_session)); - if(!our_ssl_sessionid) -@@ -742,10 +745,12 @@ mbed_connect_step3(struct Curl_easy *data, struct connectdata *conn, - - /* If there's already a matching session in the cache, delete it */ - Curl_ssl_sessionid_lock(conn); -- if(!Curl_ssl_getsessionid(conn, &old_ssl_sessionid, NULL, sockindex)) -+ if(!Curl_ssl_getsessionid(conn, isproxy, &old_ssl_sessionid, NULL, -+ sockindex)) - Curl_ssl_delsessionid(conn, old_ssl_sessionid); - -- retcode = Curl_ssl_addsessionid(conn, our_ssl_sessionid, 0, sockindex); -+ retcode = Curl_ssl_addsessionid(conn, isproxy, our_ssl_sessionid, -+ 0, sockindex); - Curl_ssl_sessionid_unlock(conn); - if(retcode) { - mbedtls_ssl_session_free(our_ssl_sessionid); -diff --git a/lib/vtls/mesalink.c b/lib/vtls/mesalink.c -index 4f1ab8627f49..5d6a1495d790 100644 ---- a/lib/vtls/mesalink.c -+++ b/lib/vtls/mesalink.c -@@ -261,7 +261,9 @@ mesalink_connect_step1(struct Curl_easy *data, - void *ssl_sessionid = NULL; - - Curl_ssl_sessionid_lock(conn); -- if(!Curl_ssl_getsessionid(conn, &ssl_sessionid, NULL, sockindex)) { -+ if(!Curl_ssl_getsessionid(conn, -+ SSL_IS_PROXY() ? TRUE : FALSE, -+ &ssl_sessionid, NULL, sockindex)) { - /* we got a session id, use it! */ - if(!SSL_set_session(BACKEND->handle, ssl_sessionid)) { - Curl_ssl_sessionid_unlock(conn); -@@ -345,12 +347,14 @@ mesalink_connect_step3(struct connectdata *conn, int sockindex) - bool incache; - SSL_SESSION *our_ssl_sessionid; - void *old_ssl_sessionid = NULL; -+ bool isproxy = SSL_IS_PROXY() ? TRUE : FALSE; - - our_ssl_sessionid = SSL_get_session(BACKEND->handle); - - Curl_ssl_sessionid_lock(conn); - incache = -- !(Curl_ssl_getsessionid(conn, &old_ssl_sessionid, NULL, sockindex)); -+ !(Curl_ssl_getsessionid(conn, isproxy, &old_ssl_sessionid, NULL, -+ sockindex)); - if(incache) { - if(old_ssl_sessionid != our_ssl_sessionid) { - infof(data, "old SSL session ID is stale, removing\n"); -@@ -361,8 +364,9 @@ mesalink_connect_step3(struct connectdata *conn, int sockindex) - } - - if(!incache) { -- result = Curl_ssl_addsessionid( -- conn, our_ssl_sessionid, 0 /* unknown size */, sockindex); -+ result = -+ Curl_ssl_addsessionid(conn, isproxy, our_ssl_sessionid, 0, -+ sockindex); - if(result) { - Curl_ssl_sessionid_unlock(conn); - failf(data, "failed to store ssl session"); -diff --git a/lib/vtls/openssl.c b/lib/vtls/openssl.c -index 498f8b9d1d08..68b98984b460 100644 ---- a/lib/vtls/openssl.c -+++ b/lib/vtls/openssl.c -@@ -393,12 +393,23 @@ static int ossl_get_ssl_conn_index(void) - */ - static int ossl_get_ssl_sockindex_index(void) - { -- static int ssl_ex_data_sockindex_index = -1; -- if(ssl_ex_data_sockindex_index < 0) { -- ssl_ex_data_sockindex_index = SSL_get_ex_new_index(0, NULL, NULL, NULL, -- NULL); -+ static int sockindex_index = -1; -+ if(sockindex_index < 0) { -+ sockindex_index = SSL_get_ex_new_index(0, NULL, NULL, NULL, NULL); - } -- return ssl_ex_data_sockindex_index; -+ return sockindex_index; -+} -+ -+/* Return an extra data index for proxy boolean. -+ * This index can be used with SSL_get_ex_data() and SSL_set_ex_data(). -+ */ -+static int ossl_get_proxy_index(void) -+{ -+ static int proxy_index = -1; -+ if(proxy_index < 0) { -+ proxy_index = SSL_get_ex_new_index(0, NULL, NULL, NULL, NULL); -+ } -+ return proxy_index; - } - - static int passwd_callback(char *buf, int num, int encrypting, -@@ -1174,6 +1185,7 @@ static int ossl_init(void) - - /* Initialize the extra data indexes */ -- if(ossl_get_ssl_conn_index() < 0 || ossl_get_ssl_sockindex_index() < 0) -+ if(ossl_get_ssl_conn_index() < 0 || -+ ossl_get_ssl_sockindex_index() < 0 || ossl_get_proxy_index() < 0) - return 0; - - return 1; -@@ -2432,8 +2443,10 @@ static int ossl_new_session_cb(SSL *ssl, SSL_SESSION *ssl_sessionid) - curl_socket_t *sockindex_ptr; - int connectdata_idx = ossl_get_ssl_conn_index(); - int sockindex_idx = ossl_get_ssl_sockindex_index(); -+ int proxy_idx = ossl_get_proxy_index(); -+ bool isproxy; - -- if(connectdata_idx < 0 || sockindex_idx < 0) -+ if(connectdata_idx < 0 || sockindex_idx < 0 || proxy_idx < 0) - return 0; - - conn = (struct connectdata*) SSL_get_ex_data(ssl, connectdata_idx); -@@ -2446,13 +2459,18 @@ static int ossl_new_session_cb(SSL *ssl, SSL_SESSION *ssl_sessionid) - sockindex_ptr = (curl_socket_t*) SSL_get_ex_data(ssl, sockindex_idx); - sockindex = (int)(sockindex_ptr - conn->sock); - -+ isproxy = SSL_get_ex_data(ssl, proxy_idx) ? TRUE : FALSE; -+ - if(SSL_SET_OPTION(primary.sessionid)) { - bool incache; - void *old_ssl_sessionid = NULL; - - Curl_ssl_sessionid_lock(conn); -- incache = !(Curl_ssl_getsessionid(conn, &old_ssl_sessionid, NULL, -- sockindex)); -+ if(isproxy) -+ incache = FALSE; -+ else -+ incache = !(Curl_ssl_getsessionid(conn, isproxy, -+ &old_ssl_sessionid, NULL, sockindex)); - if(incache) { - if(old_ssl_sessionid != ssl_sessionid) { - infof(data, "old SSL session ID is stale, removing\n"); -@@ -2462,8 +2480,8 @@ static int ossl_new_session_cb(SSL *ssl, SSL_SESSION *ssl_sessionid) - } - - if(!incache) { -- if(!Curl_ssl_addsessionid(conn, ssl_sessionid, -- 0 /* unknown size */, sockindex)) { -+ if(!Curl_ssl_addsessionid(conn, isproxy, ssl_sessionid, -+ 0 /* unknown size */, sockindex)) { - /* the session has been put into the session cache */ - res = 1; - } -@@ -3193,16 +3211,26 @@ static CURLcode ossl_connect_step1(struct Curl_easy *data, - void *ssl_sessionid = NULL; - int connectdata_idx = ossl_get_ssl_conn_index(); - int sockindex_idx = ossl_get_ssl_sockindex_index(); -+ int proxy_idx = ossl_get_proxy_index(); - -- if(connectdata_idx >= 0 && sockindex_idx >= 0) { -+ if(connectdata_idx >= 0 && sockindex_idx >= 0 && -+ proxy_idx >= 0) { - /* Store the data needed for the "new session" callback. - * The sockindex is stored as a pointer to an array element. */ - SSL_set_ex_data(backend->handle, connectdata_idx, conn); - SSL_set_ex_data(backend->handle, sockindex_idx, conn->sock + sockindex); -+#ifndef CURL_DISABLE_PROXY -+ SSL_set_ex_data(backend->handle, proxy_idx, SSL_IS_PROXY() ? (void *) 1: -+ NULL); -+#else -+ SSL_set_ex_data(backend->handle, proxy_idx, NULL); -+#endif -+ - } - - Curl_ssl_sessionid_lock(conn); -- if(!Curl_ssl_getsessionid(conn, &ssl_sessionid, NULL, sockindex)) { -+ if(!Curl_ssl_getsessionid(conn, SSL_IS_PROXY() ? TRUE : FALSE, -+ &ssl_sessionid, NULL, sockindex)) { - /* we got a session id, use it! */ - if(!SSL_set_session(backend->handle, ssl_sessionid)) { - Curl_ssl_sessionid_unlock(conn); -diff --git a/lib/vtls/schannel.c b/lib/vtls/schannel.c -index d7b89d43f892..931bd853eb8e 100644 ---- a/lib/vtls/schannel.c -+++ b/lib/vtls/schannel.c -@@ -496,5 +496,7 @@ schannel_connect_step1(struct Curl_easy *data, struct connectdata *conn, - if(SSL_SET_OPTION(primary.sessionid)) { - Curl_ssl_sessionid_lock(conn); -- if(!Curl_ssl_getsessionid(conn, (void **)&old_cred, NULL, sockindex)) { -+ if(!Curl_ssl_getsessionid(conn, -+ SSL_IS_PROXY() ? TRUE : FALSE, -+ (void **)&old_cred, NULL, sockindex)) { - BACKEND->cred = old_cred; - DEBUGF(infof(data, "schannel: re-using existing credential handle\n")); -@@ -1337,8 +1338,9 @@ schannel_connect_step3(struct Curl_easy *data, struct connectdata *conn, - struct ssl_connect_data *connssl = &conn->ssl[sockindex]; - SECURITY_STATUS sspi_status = SEC_E_OK; - CERT_CONTEXT *ccert_context = NULL; -+ bool isproxy = SSL_IS_PROXY(); - #ifdef DEBUGBUILD -- const char * const hostname = SSL_IS_PROXY() ? conn->http_proxy.host.name : -+ const char * const hostname = isproxy ? conn->http_proxy.host.name : - conn->host.name; - #endif - #ifdef HAS_ALPN -@@ -1414,8 +1416,8 @@ schannel_connect_step3(struct Curl_easy *data, struct connectdata *conn, - struct Curl_schannel_cred *old_cred = NULL; - - Curl_ssl_sessionid_lock(conn); -- incache = !(Curl_ssl_getsessionid(conn, (void **)&old_cred, NULL, -- sockindex)); -+ incache = !(Curl_ssl_getsessionid(conn, isproxy, (void **)&old_cred, -+ NULL, sockindex)); - if(incache) { - if(old_cred != BACKEND->cred) { - DEBUGF(infof(data, -@@ -1426,7 +1428,7 @@ schannel_connect_step3(struct Curl_easy *data, struct connectdata *conn, - } - } - if(!incache) { -- result = Curl_ssl_addsessionid(conn, (void *)BACKEND->cred, -+ result = Curl_ssl_addsessionid(conn, isproxy, BACKEND->cred, - sizeof(struct Curl_schannel_cred), - sockindex); - if(result) { -diff --git a/lib/vtls/sectransp.c b/lib/vtls/sectransp.c -index 05b57dfaad91..e69b99b72cd6 100644 ---- a/lib/vtls/sectransp.c -+++ b/lib/vtls/sectransp.c -@@ -1400,10 +1400,12 @@ static CURLcode sectransp_connect_step1(struct Curl_easy *data, - char * const ssl_cert = SSL_SET_OPTION(primary.clientcert); - const struct curl_blob *ssl_cert_blob = SSL_SET_OPTION(primary.cert_blob); - #ifndef CURL_DISABLE_PROXY -- const char * const hostname = SSL_IS_PROXY() ? conn->http_proxy.host.name : -+ bool isproxy = SSL_IS_PROXY(); -+ const char * const hostname = isproxy ? conn->http_proxy.host.name : - conn->host.name; - const long int port = SSL_IS_PROXY() ? conn->port : conn->remote_port; - #else -+ const isproxy = FALSE; - const char * const hostname = conn->host.name; - const long int port = conn->remote_port; - #endif -@@ -1613,7 +1615,7 @@ static CURLcode sectransp_connect_step1(struct Curl_easy *data, - #ifdef USE_NGHTTP2 - if(data->state.httpversion >= CURL_HTTP_VERSION_2 - #ifndef CURL_DISABLE_PROXY -- && (!SSL_IS_PROXY() || !conn->bits.tunnel_proxy) -+ && (!isproxy || !conn->bits.tunnel_proxy) - #endif - ) { - CFArrayAppendValue(alpnArr, CFSTR(NGHTTP2_PROTO_VERSION_ID)); -@@ -1953,7 +1955,7 @@ static CURLcode sectransp_connect_step1(struct Curl_easy *data, - size_t ssl_sessionid_len; - - Curl_ssl_sessionid_lock(conn); -- if(!Curl_ssl_getsessionid(conn, (void **)&ssl_sessionid, -+ if(!Curl_ssl_getsessionid(conn, isproxy, (void **)&ssl_sessionid, - &ssl_sessionid_len, sockindex)) { - /* we got a session id, use it! */ - err = SSLSetPeerID(backend->ssl_ctx, ssl_sessionid, ssl_sessionid_len); -@@ -1981,7 +1983,7 @@ static CURLcode sectransp_connect_step1(struct Curl_easy *data, - return CURLE_SSL_CONNECT_ERROR; - } - -- result = Curl_ssl_addsessionid(conn, ssl_sessionid, ssl_sessionid_len, -+ result = Curl_ssl_addsessionid(conn, isproxy, ssl_sessionid, ssl_sessionid_len, - sockindex); - Curl_ssl_sessionid_unlock(conn); - if(result) { -diff --git a/lib/vtls/vtls.c b/lib/vtls/vtls.c -index 6a0069237fdb..95fd6356285f 100644 ---- a/lib/vtls/vtls.c -+++ b/lib/vtls/vtls.c -@@ -367,5 +367,6 @@ void Curl_ssl_sessionid_unlock(struct Curl_easy *data) - */ - bool Curl_ssl_getsessionid(struct connectdata *conn, -+ const bool isProxy, - void **ssl_sessionid, - size_t *idsize, /* set 0 if unknown */ - int sockindex) -@@ -377,7 +378,6 @@ bool Curl_ssl_getsessionid(struct Curl_easy *data, - bool no_match = TRUE; - - #ifndef CURL_DISABLE_PROXY -- const bool isProxy = CONNECT_PROXY_SSL(); - struct ssl_primary_config * const ssl_config = isProxy ? - &conn->proxy_ssl_config : - &conn->ssl_config; -@@ -389,10 +389,15 @@ bool Curl_ssl_getsessionid(struct Curl_easy *data, - struct ssl_primary_config * const ssl_config = &conn->ssl_config; - const char * const name = conn->host.name; - int port = conn->remote_port; -- (void)sockindex; - #endif -+ (void)sockindex; - *ssl_sessionid = NULL; - -+#ifdef CURL_DISABLE_PROXY -+ if(isProxy) -+ return TRUE; -+#endif -+ - DEBUGASSERT(SSL_SET_OPTION(primary.sessionid)); - - if(!SSL_SET_OPTION(primary.sessionid)) -@@ -480,5 +485,6 @@ void Curl_ssl_delsessionid(struct Curl_easy *data, void *ssl_sessionid) - */ - CURLcode Curl_ssl_addsessionid(struct connectdata *conn, -+ bool isProxy, - void *ssl_sessionid, - size_t idsize, - int sockindex) -@@ -492,7 +498,6 @@ CURLcode Curl_ssl_addsessionid(struct Curl_easy *data, - int conn_to_port; - long *general_age; - #ifndef CURL_DISABLE_PROXY -- const bool isProxy = CONNECT_PROXY_SSL(); - struct ssl_primary_config * const ssl_config = isProxy ? - &conn->proxy_ssl_config : - &conn->ssl_config; -@@ -505,6 +510,7 @@ CURLcode Curl_ssl_addsessionid(struct Curl_easy *data, - const char *hostname = conn->host.name; - (void)sockindex; - #endif -+ (void)sockindex; - DEBUGASSERT(SSL_SET_OPTION(primary.sessionid)); - - clone_host = strdup(hostname); -diff --git a/lib/vtls/vtls.h b/lib/vtls/vtls.h -index 273184f1894a..2b43e7744b19 100644 ---- a/lib/vtls/vtls.h -+++ b/lib/vtls/vtls.h -@@ -235,5 +235,6 @@ void Curl_ssl_sessionid_unlock(struct Curl_easy *data); - */ - bool Curl_ssl_getsessionid(struct connectdata *conn, -+ const bool isproxy, - void **ssl_sessionid, - size_t *idsize, /* set 0 if unknown */ - int sockindex); -@@ -245,5 +246,6 @@ bool Curl_ssl_getsessionid(struct Curl_easy *data, - */ - CURLcode Curl_ssl_addsessionid(struct connectdata *conn, -+ const bool isProxy, - void *ssl_sessionid, - size_t idsize, - int sockindex); -diff --git a/lib/vtls/wolfssl.c b/lib/vtls/wolfssl.c -index 7159ac9d5e64..8fb2ea7acf31 100644 ---- a/lib/vtls/wolfssl.c -+++ b/lib/vtls/wolfssl.c -@@ -516,7 +516,9 @@ wolfssl_connect_step1(struct Curl_easy *data, struct connectdata *conn, - void *ssl_sessionid = NULL; - - Curl_ssl_sessionid_lock(conn); -- if(!Curl_ssl_getsessionid(conn, &ssl_sessionid, NULL, sockindex)) { -+ if(!Curl_ssl_getsessionid(conn, -+ SSL_IS_PROXY() ? TRUE : FALSE, -+ &ssl_sessionid, NULL, sockindex)) { - /* we got a session id, use it! */ - if(!SSL_set_session(backend->handle, ssl_sessionid)) { - char error_buffer[WOLFSSL_MAX_ERROR_SZ]; -@@ -772,10 +774,11 @@ wolfssl_connect_step3(struct Curl_easy *data, struct connectdata *conn, - void *old_ssl_sessionid = NULL; - - our_ssl_sessionid = SSL_get_session(backend->handle); -+ bool isproxy = SSL_IS_PROXY() ? TRUE : FALSE; - - Curl_ssl_sessionid_lock(conn); -- incache = !(Curl_ssl_getsessionid(conn, &old_ssl_sessionid, NULL, -- sockindex)); -+ incache = !(Curl_ssl_getsessionid(conn, isproxy, -+ &old_ssl_sessionid, NULL, sockindex)); - if(incache) { - if(old_ssl_sessionid != our_ssl_sessionid) { - infof(data, "old SSL session ID is stale, removing\n"); -@@ -786,8 +789,8 @@ wolfssl_connect_step3(struct Curl_easy *data, struct connectdata *conn, - } - - if(!incache) { -- result = Curl_ssl_addsessionid(conn, our_ssl_sessionid, -- 0 /* unknown size */, sockindex); -+ result = Curl_ssl_addsessionid(conn, isproxy, our_ssl_sessionid, -+ 0, sockindex); - if(result) { - Curl_ssl_sessionid_unlock(conn); - failf(data, "failed to store ssl session"); diff --git a/pkgs/tools/networking/curl/default.nix b/pkgs/tools/networking/curl/default.nix index 7c24be7aea7..f73ab773876 100644 --- a/pkgs/tools/networking/curl/default.nix +++ b/pkgs/tools/networking/curl/default.nix @@ -35,21 +35,16 @@ assert gssSupport -> libkrb5 != null; stdenv.mkDerivation rec { pname = "curl"; - version = "7.74.0"; + version = "7.76.1"; src = fetchurl { urls = [ "https://curl.haxx.se/download/${pname}-${version}.tar.bz2" "https://github.com/curl/curl/releases/download/${lib.replaceStrings ["."] ["_"] pname}-${version}/${pname}-${version}.tar.bz2" ]; - sha256 = "19bp3d91xq9vqwlbzq261j23mk9lz4lyka4gr2fm6dhnd3k66k8g"; + sha256 = "1scmfrp0c27pkd7yva9k50miprjpsyfbb33apx72qc9igm6ii3ks"; }; - patches = [ - ./7.74.0-CVE-2021-22876.patch - ./7.74.0-CVE-2021-22890.patch - ]; - outputs = [ "bin" "dev" "out" "man" "devdoc" ]; separateDebugInfo = stdenv.isLinux; From ea3bdfcebe8a9f2bc2e1629d0c691e699028d841 Mon Sep 17 00:00:00 2001 From: Lancelot SIX Date: Thu, 7 Jan 2021 20:51:44 +0000 Subject: [PATCH 012/263] readline81: init at 8.1p0 See https://lists.gnu.org/archive/html/info-gnu/2020-12/msg00002.html for release information --- pkgs/development/libraries/readline/8.1.nix | 62 +++++++++++++++++++ .../readline/readline-8.1-patches.nix | 4 ++ pkgs/top-level/all-packages.nix | 2 + 3 files changed, 68 insertions(+) create mode 100644 pkgs/development/libraries/readline/8.1.nix create mode 100644 pkgs/development/libraries/readline/readline-8.1-patches.nix diff --git a/pkgs/development/libraries/readline/8.1.nix b/pkgs/development/libraries/readline/8.1.nix new file mode 100644 index 00000000000..35835c1a143 --- /dev/null +++ b/pkgs/development/libraries/readline/8.1.nix @@ -0,0 +1,62 @@ +{ fetchurl, stdenv, lib, ncurses +}: + +stdenv.mkDerivation rec { + pname = "readline"; + version = "8.1p${toString (builtins.length upstreamPatches)}"; + + src = fetchurl { + url = "mirror://gnu/readline/readline-${meta.branch}.tar.gz"; + sha256 = "00ibp0n9crbwx15k9vvckq5wsipw98b1px8pd8i34chy2gpb9kpq"; + }; + + outputs = [ "out" "dev" "man" "doc" "info" ]; + + propagatedBuildInputs = [ncurses]; + + patchFlags = [ "-p0" ]; + + upstreamPatches = + (let + patch = nr: sha256: + fetchurl { + url = "mirror://gnu/readline/readline-${meta.branch}-patches/readline81-${nr}"; + inherit sha256; + }; + in + import ./readline-8.1-patches.nix patch); + + patches = + [ ./link-against-ncurses.patch + ./no-arch_only-6.3.patch + ] + ++ upstreamPatches; + + meta = with lib; { + description = "Library for interactive line editing"; + + longDescription = '' + The GNU Readline library provides a set of functions for use by + applications that allow users to edit command lines as they are + typed in. Both Emacs and vi editing modes are available. The + Readline library includes additional functions to maintain a + list of previously-entered command lines, to recall and perhaps + reedit those lines, and perform csh-like history expansion on + previous commands. + + The history facilities are also placed into a separate library, + the History library, as part of the build process. The History + library may be used without Readline in applications which + desire its capabilities. + ''; + + homepage = "https://savannah.gnu.org/projects/readline/"; + + license = licenses.gpl3Plus; + + maintainers = with maintainers; [ dtzWill ]; + + platforms = platforms.unix; + branch = "8.1"; + }; +} diff --git a/pkgs/development/libraries/readline/readline-8.1-patches.nix b/pkgs/development/libraries/readline/readline-8.1-patches.nix new file mode 100644 index 00000000000..b8019fb3350 --- /dev/null +++ b/pkgs/development/libraries/readline/readline-8.1-patches.nix @@ -0,0 +1,4 @@ +# Automatically generated by `update-patch-set.sh'; do not edit. + +patch: [ +] diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index aa67263ce6f..2c0d974f248 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -17106,6 +17106,8 @@ in readline80 = callPackage ../development/libraries/readline/8.0.nix { }; + readline81 = callPackage ../development/libraries/readline/8.1.nix { }; + readosm = callPackage ../development/libraries/readosm { }; rinutils = callPackage ../development/libraries/rinutils { }; From 090b1804b7b3f63a31e8a8d8225d56aaa06eb3fd Mon Sep 17 00:00:00 2001 From: Lancelot SIX Date: Thu, 7 Jan 2021 20:52:10 +0000 Subject: [PATCH 013/263] bash_5: upgrade readline dependency to 8.1 Readline 8.1 is required for bash-5.1 to work properly. From bash-5.1 release message[1]: > Bash can be linked against an already-installed Readline library > rather than the private version in lib/readline if desired. Only > readline-8.1 and later versions are able to provide all of the symbols > that bash-5.1 requires; earlier versions of the Readline library will > not work correctly. [1] https://lists.gnu.org/archive/html/info-gnu/2020-12/msg00003.html --- pkgs/shells/bash/5.1.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/shells/bash/5.1.nix b/pkgs/shells/bash/5.1.nix index d234b18e6c9..ddf2edfd1db 100644 --- a/pkgs/shells/bash/5.1.nix +++ b/pkgs/shells/bash/5.1.nix @@ -7,14 +7,14 @@ # patch for cygwin requires readline support , interactive ? stdenv.isCygwin -, readline80 ? null +, readline81 ? null , withDocs ? false , texinfo ? null }: with lib; -assert interactive -> readline80 != null; +assert interactive -> readline81 != null; assert withDocs -> texinfo != null; assert stdenv.hostPlatform.isDarwin -> binutils != null; let @@ -74,7 +74,7 @@ stdenv.mkDerivation rec { ++ optional withDocs texinfo ++ optional stdenv.hostPlatform.isDarwin binutils; - buildInputs = optional interactive readline80; + buildInputs = optional interactive readline81; enableParallelBuilding = true; From 72c9089baeaf01fdb67788f9fa02c9ed8d739ad1 Mon Sep 17 00:00:00 2001 From: Lancelot SIX Date: Thu, 7 Jan 2021 20:58:34 +0000 Subject: [PATCH 014/263] gdb: upgrade readline dependency to 8.1 --- pkgs/top-level/all-packages.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 2c0d974f248..8f44dc03267 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -13505,7 +13505,7 @@ in gdb = callPackage ../development/tools/misc/gdb { guile = null; - readline = readline80; + readline = readline81; }; jhiccup = callPackage ../development/tools/java/jhiccup { }; From 721d1dfb68a72aecbdec443cacae079c60847439 Mon Sep 17 00:00:00 2001 From: Lancelot SIX Date: Wed, 14 Apr 2021 22:44:56 +0100 Subject: [PATCH 015/263] libqalculate: upgrade readline dependency to 8.1 --- pkgs/top-level/all-packages.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 8f44dc03267..9e5e1241ac5 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -16003,7 +16003,7 @@ in libpwquality = callPackage ../development/libraries/libpwquality { }; libqalculate = callPackage ../development/libraries/libqalculate { - readline = readline80; + readline = readline81; }; libqt5pas = libsForQt5.callPackage ../development/compilers/fpc/libqt5pas.nix { }; From 1671b1f2a9c6b170a76a8cba05d1354c3d2c3c3e Mon Sep 17 00:00:00 2001 From: Lancelot SIX Date: Wed, 14 Apr 2021 22:45:39 +0100 Subject: [PATCH 016/263] notcurses: upgrade readline dependency to 8.1 --- pkgs/top-level/all-packages.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 9e5e1241ac5..8327d1b8ea6 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -16534,7 +16534,7 @@ in notify-sharp = callPackage ../development/libraries/notify-sharp { }; notcurses = callPackage ../development/libraries/notcurses { - readline = readline80; + readline = readline81; }; ncurses5 = ncurses.override { From 3b5b199012236a67d7841a6742b534efccc67621 Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Thu, 15 Apr 2021 01:29:11 +0000 Subject: [PATCH 017/263] netbsd.statHook: init This fixes the build of various NetBSD programs on Linux, e.g. netbsd.statHook. --- pkgs/os-specific/bsd/netbsd/default.nix | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/pkgs/os-specific/bsd/netbsd/default.nix b/pkgs/os-specific/bsd/netbsd/default.nix index b86891352f0..2efa775c016 100644 --- a/pkgs/os-specific/bsd/netbsd/default.nix +++ b/pkgs/os-specific/bsd/netbsd/default.nix @@ -1,5 +1,5 @@ { stdenv, stdenvNoCC, fetchcvs, lib, groff, mandoc, zlib, bison, flex -, writeText, buildPackages, splicePackages, symlinkJoin }: +, makeSetupHook, writeText, buildPackages, splicePackages, symlinkJoin }: let fetchNetBSD = path: version: sha256: fetchcvs { @@ -30,7 +30,7 @@ let extraPaths = [ ]; - nativeBuildInputs = [ makeMinimal install tsort lorder mandoc groff stat ]; + nativeBuildInputs = [ makeMinimal install tsort lorder mandoc groff statHook ]; buildInputs = [ compat ]; # depsBuildBuild = [ buildPackages.stdenv.cc ]; @@ -243,6 +243,7 @@ let ]; }; + # Don't add this to nativeBuildInputs directly. Use statHook instead. stat = mkDerivation { path = "usr.bin/stat"; version = "8.0"; @@ -250,6 +251,17 @@ let nativeBuildInputs = [ makeMinimal install mandoc groff ]; }; + # stat isn't in POSIX, and NetBSD stat supports a completely + # different range of flags than GNU stat, so including it in PATH + # breaks stdenv. Work around that with a hook that will point + # NetBSD's build system and NetBSD stat without including it in + # PATH. + statHook = makeSetupHook { + name = "netbsd-stat-hook"; + } (writeText "netbsd-stat-hook-impl" '' + makeFlagsArray+=(TOOL_STAT=${netbsd.stat}/bin/stat) + ''); + tsort = mkDerivation { path = "usr.bin/tsort"; version = "8.0"; @@ -563,7 +575,7 @@ let sha256 = "0630lbvz6v4ic13bfg8ccwfhqkgcv76bfdw9f36rfsnwfgpxqsmq"; meta.platforms = lib.platforms.netbsd; nativeBuildInputs = [ makeMinimal install mandoc groff flex - bison genassym gencat lorder tsort stat ]; + bison genassym gencat lorder tsort statHook ]; extraPaths = [ sys.src ld_elf_so.src ]; }; @@ -587,7 +599,7 @@ let librpcsvc.src libutil.src librt.src libcrypt.src ]; buildInputs = [ buildPackages.netbsd.headers csu ]; nativeBuildInputs = [ makeMinimal install mandoc groff flex - bison genassym gencat lorder tsort stat ]; + bison genassym gencat lorder tsort statHook ]; NIX_CFLAGS_COMPILE = "-B${csu}/lib"; meta.platforms = lib.platforms.netbsd; SHLIBINSTALLDIR = "$(out)/lib"; From 314aa175d35e703707653b4e7a5d15fde9a29322 Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Thu, 15 Apr 2021 02:45:13 +0000 Subject: [PATCH 018/263] netbsd: bison -> byacc These are only mostly compatible, and libc won't build with bison. --- pkgs/os-specific/bsd/netbsd/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/os-specific/bsd/netbsd/default.nix b/pkgs/os-specific/bsd/netbsd/default.nix index 2efa775c016..c658ee578cc 100644 --- a/pkgs/os-specific/bsd/netbsd/default.nix +++ b/pkgs/os-specific/bsd/netbsd/default.nix @@ -1,4 +1,4 @@ -{ stdenv, stdenvNoCC, fetchcvs, lib, groff, mandoc, zlib, bison, flex +{ stdenv, stdenvNoCC, fetchcvs, lib, groff, mandoc, zlib, byacc, flex , makeSetupHook, writeText, buildPackages, splicePackages, symlinkJoin }: let @@ -575,7 +575,7 @@ let sha256 = "0630lbvz6v4ic13bfg8ccwfhqkgcv76bfdw9f36rfsnwfgpxqsmq"; meta.platforms = lib.platforms.netbsd; nativeBuildInputs = [ makeMinimal install mandoc groff flex - bison genassym gencat lorder tsort statHook ]; + byacc genassym gencat lorder tsort statHook ]; extraPaths = [ sys.src ld_elf_so.src ]; }; @@ -599,7 +599,7 @@ let librpcsvc.src libutil.src librt.src libcrypt.src ]; buildInputs = [ buildPackages.netbsd.headers csu ]; nativeBuildInputs = [ makeMinimal install mandoc groff flex - bison genassym gencat lorder tsort statHook ]; + byacc genassym gencat lorder tsort statHook ]; NIX_CFLAGS_COMPILE = "-B${csu}/lib"; meta.platforms = lib.platforms.netbsd; SHLIBINSTALLDIR = "$(out)/lib"; From 93d0f1c237d6406b17d7b0334c1e63f1cbcf962a Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Thu, 15 Apr 2021 02:54:46 +0000 Subject: [PATCH 019/263] netbsd.libc: fix build --- pkgs/os-specific/bsd/netbsd/default.nix | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pkgs/os-specific/bsd/netbsd/default.nix b/pkgs/os-specific/bsd/netbsd/default.nix index c658ee578cc..0d6efcd06f1 100644 --- a/pkgs/os-specific/bsd/netbsd/default.nix +++ b/pkgs/os-specific/bsd/netbsd/default.nix @@ -599,7 +599,7 @@ let librpcsvc.src libutil.src librt.src libcrypt.src ]; buildInputs = [ buildPackages.netbsd.headers csu ]; nativeBuildInputs = [ makeMinimal install mandoc groff flex - byacc genassym gencat lorder tsort statHook ]; + byacc genassym gencat lorder tsort statHook rpcgen ]; NIX_CFLAGS_COMPILE = "-B${csu}/lib"; meta.platforms = lib.platforms.netbsd; SHLIBINSTALLDIR = "$(out)/lib"; @@ -629,8 +629,8 @@ let make -C $NETBSDSRCDIR/lib/libresolv $makeFlags make -C $NETBSDSRCDIR/lib/libresolv $makeFlags install - make -C $NETBSDSRCDIR/lib/librpcsv $makeFlags - make -C $NETBSDSRCDIR/lib/librpcsv $makeFlags install + make -C $NETBSDSRCDIR/lib/librpcsvc $makeFlags + make -C $NETBSDSRCDIR/lib/librpcsvc $makeFlags install make -C $NETBSDSRCDIR/lib/i18n_module $makeFlags make -C $NETBSDSRCDIR/lib/i18n_module $makeFlags install @@ -645,8 +645,8 @@ let make -C $NETBSDSRCDIR/lib/libcrypt $makeFlags install ''; postPatch = '' - substituteInPlace sys/Makefile.inc \ - --replace /usr/include/sys/syscall.h ${buildPackages.netbsd.headers}/include/sys/syscall.h + sed -i 's,/usr\(/include/sys/syscall.h\),${buildPackages.netbsd.headers}\1,g' \ + sys/Makefile.inc ../librt/sys/Makefile.inc ''; }; # From d0568d305ad7c8645f9e044b68cbce7065bc50e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Thu, 15 Apr 2021 11:38:45 +0200 Subject: [PATCH 020/263] qtModule: use pname and version --- pkgs/development/libraries/qt-5/qtModule.nix | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/pkgs/development/libraries/qt-5/qtModule.nix b/pkgs/development/libraries/qt-5/qtModule.nix index 930ed9d67ba..ebd6e887ec9 100644 --- a/pkgs/development/libraries/qt-5/qtModule.nix +++ b/pkgs/development/libraries/qt-5/qtModule.nix @@ -7,15 +7,14 @@ let inherit (lib) licenses maintainers platforms; in args: let - inherit (args) name; - version = args.version or srcs.${name}.version; - src = args.src or srcs.${name}.src; + pname = args.name; + version = args.version or srcs.${pname}.version; + src = args.src or srcs.${pname}.src; in mkDerivation (args // { - name = "${name}-${version}"; - inherit src; - patches = args.patches or patches.${name} or []; + inherit pname version src; + patches = args.patches or patches.${pname} or []; nativeBuildInputs = (args.nativeBuildInputs or []) ++ [ perl self.qmake ]; propagatedBuildInputs = args.qtInputs ++ (args.propagatedBuildInputs or []); From fc141a889d05b05719f6b70f617cc500beea3c38 Mon Sep 17 00:00:00 2001 From: Kasper Date: Thu, 15 Apr 2021 23:18:51 +0200 Subject: [PATCH 021/263] libselinux: fix build with musl (#119472) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Kasper Gałkowski Co-authored-by: Sandro --- pkgs/os-specific/linux/libselinux/default.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkgs/os-specific/linux/libselinux/default.nix b/pkgs/os-specific/linux/libselinux/default.nix index 2c9239b2e7d..fbf7e4bd995 100644 --- a/pkgs/os-specific/linux/libselinux/default.nix +++ b/pkgs/os-specific/linux/libselinux/default.nix @@ -44,6 +44,11 @@ stdenv.mkDerivation rec { "PYTHONLIBDIR=$(py)/${python3.sitePackages}" ]; + postPatch = lib.optionalString stdenv.hostPlatform.isMusl '' + substituteInPlace src/procattr.c \ + --replace "#include " "" + ''; + preInstall = optionalString enablePython '' mkdir -p $py/${python3.sitePackages}/selinux ''; From 5b9a6f10f8a74f385d160e1719b29ad6d0319d95 Mon Sep 17 00:00:00 2001 From: Jeff Mitchell Date: Thu, 15 Apr 2021 19:36:01 -0500 Subject: [PATCH 022/263] protobuf: 3.15.7 -> 3.15.8 (#119574) --- pkgs/development/libraries/protobuf/3.15.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/libraries/protobuf/3.15.nix b/pkgs/development/libraries/protobuf/3.15.nix index 661a552882e..e4783be6a35 100644 --- a/pkgs/development/libraries/protobuf/3.15.nix +++ b/pkgs/development/libraries/protobuf/3.15.nix @@ -1,6 +1,6 @@ { callPackage, ... }: callPackage ./generic-v3.nix { - version = "3.15.7"; - sha256 = "03fx96rwxfbmr47f1nrflvaq5kk5p3a9wms4688nbnmymyghyml0"; + version = "3.15.8"; + sha256 = "1q3k8axhq6g8fqczmd6kbgzpdplrrgygppym4x1l99lzhplx9rqv"; } From 995ecddd9a85600f53909af0c885e5e65655fbfb Mon Sep 17 00:00:00 2001 From: Thomas Gerbet Date: Fri, 16 Apr 2021 11:03:18 +0200 Subject: [PATCH 023/263] re2c: 1.3 -> 2.1.1 Release notes: https://re2c.org/releases/release_notes.html#release-2-1-1 --- .../tools/parsing/re2c/default.nix | 40 ++----------------- 1 file changed, 4 insertions(+), 36 deletions(-) diff --git a/pkgs/development/tools/parsing/re2c/default.nix b/pkgs/development/tools/parsing/re2c/default.nix index ebba9903a47..a945f3bdde0 100644 --- a/pkgs/development/tools/parsing/re2c/default.nix +++ b/pkgs/development/tools/parsing/re2c/default.nix @@ -1,48 +1,16 @@ -{ lib, stdenv, fetchFromGitHub, fetchpatch, autoreconfHook }: +{ lib, stdenv, fetchFromGitHub, autoreconfHook }: stdenv.mkDerivation rec { pname = "re2c"; - version = "1.3"; + version = "2.1.1"; src = fetchFromGitHub { owner = "skvadrik"; repo = "re2c"; rev = version; - sha256 = "0aqlf2h6i2m3dq11dkq89p4w4c9kp4x66s5rhp84gmpz5xqv1x5h"; + sha256 = "06nvk5sf4vrc2bvpj4vi2xwy3ggv548sn530drz5fi67nhzgga26"; }; - patches = [ - (fetchpatch { - name = "CVE-2018-21232-part1.patch"; - url = "https://github.com/skvadrik/re2c/commit/fd634998f813340768c333cdad638498602856e5.patch"; - sha256 = "1blyg5lyhqd4ymisih65xl0g36ig71ijia4skkkd59rdvj78aiw6"; - }) - - (fetchpatch { - name = "CVE-2018-21232-part2.patch"; - url = "https://github.com/skvadrik/re2c/commit/7b5643476bd99c994c4f51b8143f942982d85521.patch"; - sha256 = "0rhmgqrinpk49r9x75ygrs14lz72aw5ad5kr6qp9bdyl8gs082qp"; - }) - - (fetchpatch { - name = "CVE-2018-21232-part3.patch"; - url = "https://github.com/skvadrik/re2c/commit/4d9c809355b574f2a58eac119f5e076c48e4d1e2.patch"; - sha256 = "0k86wg9icw1gkqpf7rq2w6xsq4caxw3rc0zfxf39liwa35027rai"; - }) - - (fetchpatch { - name = "CVE-2018-21232-part4.patch"; - url = "https://github.com/skvadrik/re2c/commit/89be91f3df00657261870adbc590209fdb2bc405.patch"; - sha256 = "1aygy9va7jwby93chlskwg7z90fn07x5hym0gziwlkx8k900p3a3"; - }) - - (fetchpatch { - name = "CVE-2020-11958.patch"; - url = "https://github.com/skvadrik/re2c/commit/c4603ba5ce229db83a2a4fb93e6d4b4e3ec3776a.patch"; - sha256 = "1d95ahxk92g7k87sda9gxgmr3blyfzwd2y7h9jxj8zkd74knd9zh"; - }) - ]; - nativeBuildInputs = [ autoreconfHook ]; doCheck = true; @@ -54,7 +22,7 @@ stdenv.mkDerivation rec { meta = with lib; { description = "Tool for writing very fast and very flexible scanners"; - homepage = "http://re2c.org"; + homepage = "https://re2c.org"; license = licenses.publicDomain; platforms = platforms.all; maintainers = with maintainers; [ thoughtpolice ]; From b1037225ef008c395fce65d3992524e54196dad0 Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Fri, 12 Feb 2021 20:50:02 +0000 Subject: [PATCH 024/263] infoqscraper: mark broken --- pkgs/development/python-modules/infoqscraper/default.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkgs/development/python-modules/infoqscraper/default.nix b/pkgs/development/python-modules/infoqscraper/default.nix index b250dfc6c7f..629f343a7cb 100644 --- a/pkgs/development/python-modules/infoqscraper/default.nix +++ b/pkgs/development/python-modules/infoqscraper/default.nix @@ -28,6 +28,9 @@ buildPythonPackage rec { homepage = "https://github.com/cykl/infoqscraper/wiki"; license = licenses.mit; maintainers = with maintainers; [ edwtjo ]; + # infoq HTML has changed: + # https://github.com/cykl/infoqscraper/issues/29 + broken = true; }; } From 6694363a3a4393edb5b5f6b4b59da69d112ac078 Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Fri, 12 Feb 2021 20:51:31 +0000 Subject: [PATCH 025/263] swftools: mark insecure; clarify license Fixes: https://github.com/NixOS/nixpkgs/issues/90991 --- pkgs/tools/video/swftools/default.nix | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/pkgs/tools/video/swftools/default.nix b/pkgs/tools/video/swftools/default.nix index cd3af661840..4d3014388c8 100644 --- a/pkgs/tools/video/swftools/default.nix +++ b/pkgs/tools/video/swftools/default.nix @@ -1,6 +1,5 @@ { lib, stdenv, fetchurl, freetype, libjpeg, libungif, zlib }: -with lib; stdenv.mkDerivation rec { pname = "swftools"; version = "0.9.2"; @@ -14,11 +13,28 @@ stdenv.mkDerivation rec { buildInputs = [ freetype libjpeg libungif zlib ]; - meta = { + meta = with lib; { description = "Collection of SWF manipulation and creation utilities"; homepage = "http://www.swftools.org/about.html"; - license = licenses.gpl2; + license = licenses.gpl2Only; maintainers = [ maintainers.koral ]; platforms = lib.platforms.unix; + broken = true; + knownVulnerabilities = [ + "CVE-2017-10976" + "CVE-2017-11096" + "CVE-2017-11097" + "CVE-2017-11098" + "CVE-2017-11099" + "CVE-2017-11100" + "CVE-2017-11101" + "CVE-2017-16711" + "CVE-2017-16793" + "CVE-2017-16794" + "CVE-2017-16796" + "CVE-2017-16797" + "CVE-2017-16868" + "CVE-2017-16890" + ]; }; } From a2a5b1d6e7f73ed7c126cc2a64324c3e67c1ea0a Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Fri, 12 Feb 2021 21:11:11 +0000 Subject: [PATCH 026/263] imlib: fix build with giflib; clarify license libungif was merged into giflib in 2006, and hasn't been updated since. --- pkgs/development/libraries/imlib/default.nix | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/pkgs/development/libraries/imlib/default.nix b/pkgs/development/libraries/imlib/default.nix index 53612f8205f..1d6fed2281e 100644 --- a/pkgs/development/libraries/imlib/default.nix +++ b/pkgs/development/libraries/imlib/default.nix @@ -1,4 +1,6 @@ -{lib, stdenv, fetchurl, fetchpatch, libX11, libXext, xorgproto, libjpeg, libungif, libtiff, libpng}: +{ lib, stdenv, fetchurl, fetchpatch +, libX11, libXext, xorgproto, libjpeg, giflib, libtiff, libpng +}: stdenv.mkDerivation { name = "imlib-1.9.15"; @@ -13,6 +15,16 @@ stdenv.mkDerivation { url = "https://gitweb.gentoo.org/repo/gentoo.git/plain/media-libs/imlib/files/imlib-1.9.15-bpp16-CVE-2007-3568.patch"; sha256 = "0lxfibi094gki39sq1w4p0hcx25xlk0875agbhjkjngzx862wvbg"; }) + + # The following two patches fix the build with recent giflib. + (fetchpatch { + url = "https://gitweb.gentoo.org/repo/gentoo.git/plain/media-libs/imlib/files/imlib-1.9.15-giflib51-1.patch?id=c6d0ed89ad5653421f21cbf3b3d40fd9a1361828"; + sha256 = "0jynlhxcyjiwnz1m8j48xwz4z5csgyg03jfjc8xgpvvcyid4m65l"; + }) + (fetchpatch { + url = "https://gitweb.gentoo.org/repo/gentoo.git/plain/media-libs/imlib/files/imlib-1.9.15-giflib51-2.patch?id=c6d0ed89ad5653421f21cbf3b3d40fd9a1361828"; + sha256 = "164x7rd992930rqllmr89p5ahfmbz37ipi8x0igd8gkvc8a4fd5x"; + }) ]; configureFlags = [ @@ -21,11 +33,11 @@ stdenv.mkDerivation { "--x-libraries=${libX11.out}/lib" ]; - buildInputs = [libjpeg libXext libX11 xorgproto libtiff libungif libpng]; + buildInputs = [ libjpeg libXext libX11 xorgproto libtiff giflib libpng ]; meta = with lib; { description = "An image loading and rendering library for X11"; platforms = platforms.unix; - license = with licenses; [ gpl2 lgpl2 ]; + license = with licenses; [ gpl2Only lgpl2Only ]; }; } From 451d9d6f8ec63129fb518180ab72b7e88b596dd0 Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Fri, 12 Feb 2021 21:12:55 +0000 Subject: [PATCH 027/263] fbv: fix build with giflib; clarify license libungif was merged into giflib in 2006, and hasn't been updated since. --- pkgs/tools/graphics/fbv/default.nix | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/pkgs/tools/graphics/fbv/default.nix b/pkgs/tools/graphics/fbv/default.nix index 6f6e0aeca2c..5b46d5d2268 100644 --- a/pkgs/tools/graphics/fbv/default.nix +++ b/pkgs/tools/graphics/fbv/default.nix @@ -1,14 +1,25 @@ -{ lib, stdenv, fetchurl, getopt, libjpeg, libpng12, libungif }: +{ lib, stdenv, fetchurl, fetchpatch, getopt, libjpeg, libpng12, giflib }: stdenv.mkDerivation rec { - name = "fbv-1.0b"; + pname = "fbv"; + version = "1.0b"; src = fetchurl { - url = "http://s-tech.elsat.net.pl/fbv/${name}.tar.gz"; + url = "http://s-tech.elsat.net.pl/fbv/fbv-${version}.tar.gz"; sha256 = "0g5b550vk11l639y8p5sx1v1i6ihgqk0x1hd0ri1bc2yzpdbjmcv"; }; - buildInputs = [ getopt libjpeg libpng12 libungif ]; + patches = [ + (fetchpatch { + url = "https://raw.githubusercontent.com/void-linux/void-packages/4a5bfe522ea5afd8203e804dc6a642d0871cd6dd/srcpkgs/fbv/patches/giflib-5.1.patch"; + sha256 = "00q1zcn92yvvyij68bnq0m1sr3a411w914f4nyp6mpz0j5xc6dc7"; + }) + ]; + + patchFlags = [ "-p0" ]; + + buildInputs = [ getopt libjpeg libpng12 giflib ]; + makeFlags = [ "LDFLAGS=-lgif" ]; enableParallelBuilding = true; @@ -19,7 +30,7 @@ stdenv.mkDerivation rec { meta = with lib; { description = "View pictures on a linux framebuffer device"; homepage = "http://s-tech.elsat.net.pl/fbv/"; - license = licenses.gpl2; + license = licenses.gpl2Only; maintainers = with maintainers; [ peterhoeg ]; }; } From 6e3b5fd04622b4740ba10eb557d1aae1b835049d Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Fri, 12 Feb 2021 21:15:48 +0000 Subject: [PATCH 028/263] libungif: remove in favour of giflib libungif was merged into giflib in 2006, and hasn't been updated since. All non-broken packages still using it build fine with giflib. See . --- pkgs/applications/editors/emacs/generic.nix | 4 ++-- pkgs/applications/graphics/fbida/default.nix | 4 ++-- .../science/math/glsurf/default.nix | 4 ++-- .../window-managers/icewm/default.nix | 4 ++-- .../window-managers/windowmaker/default.nix | 4 ++-- pkgs/desktops/gnustep/base/default.nix | 4 ++-- .../libraries/SDL2_image/default.nix | 4 ++-- .../development/libraries/SDL_image/default.nix | 4 ++-- pkgs/development/libraries/giflib/libungif.nix | 17 ----------------- pkgs/development/libraries/pslib/default.nix | 4 ++-- pkgs/tools/misc/fontforge/default.nix | 4 ++-- pkgs/tools/video/swftools/default.nix | 4 ++-- pkgs/top-level/aliases.nix | 1 + pkgs/top-level/all-packages.nix | 2 -- 14 files changed, 23 insertions(+), 41 deletions(-) delete mode 100644 pkgs/development/libraries/giflib/libungif.nix diff --git a/pkgs/applications/editors/emacs/generic.nix b/pkgs/applications/editors/emacs/generic.nix index 6726790d50f..b093c7e0529 100644 --- a/pkgs/applications/editors/emacs/generic.nix +++ b/pkgs/applications/editors/emacs/generic.nix @@ -7,7 +7,7 @@ , patches ? [ ] }: { stdenv, lib, fetchurl, fetchpatch, ncurses, xlibsWrapper, libXaw, libXpm -, Xaw3d, libXcursor, pkg-config, gettext, libXft, dbus, libpng, libjpeg, libungif +, Xaw3d, libXcursor, pkg-config, gettext, libXft, dbus, libpng, libjpeg, giflib , libtiff, librsvg, gconf, libxml2, imagemagick, gnutls, libselinux , alsaLib, cairo, acl, gpm, AppKit, GSS, ImageIO, m17n_lib, libotf , jansson, harfbuzz @@ -108,7 +108,7 @@ let emacs = stdenv.mkDerivation (lib.optionalAttrs nativeComp { [ ncurses gconf libxml2 gnutls alsaLib acl gpm gettext jansson harfbuzz.dev ] ++ lib.optionals stdenv.isLinux [ dbus libselinux systemd ] ++ lib.optionals withX - [ xlibsWrapper libXaw Xaw3d libXpm libpng libjpeg libungif libtiff libXft + [ xlibsWrapper libXaw Xaw3d libXpm libpng libjpeg giflib libtiff libXft gconf cairo ] ++ lib.optionals (withX || withNS) [ librsvg ] ++ lib.optionals withImageMagick [ imagemagick ] diff --git a/pkgs/applications/graphics/fbida/default.nix b/pkgs/applications/graphics/fbida/default.nix index 9ed6ee75159..f2d2e267595 100644 --- a/pkgs/applications/graphics/fbida/default.nix +++ b/pkgs/applications/graphics/fbida/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, fetchurl, libjpeg, libexif, libungif, libtiff, libpng, libwebp, libdrm +{ lib, stdenv, fetchurl, libjpeg, libexif, giflib, libtiff, libpng, libwebp, libdrm , pkg-config, freetype, fontconfig, which, imagemagick, curl, sane-backends, libXpm , epoxy, poppler, mesa, lirc }: @@ -12,7 +12,7 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ pkg-config which ]; buildInputs = [ - libexif libjpeg libpng libungif freetype fontconfig libtiff libwebp + libexif libjpeg libpng giflib freetype fontconfig libtiff libwebp imagemagick curl sane-backends libdrm libXpm epoxy poppler lirc mesa ]; diff --git a/pkgs/applications/science/math/glsurf/default.nix b/pkgs/applications/science/math/glsurf/default.nix index 599d4bac8e7..3b4604fe2aa 100644 --- a/pkgs/applications/science/math/glsurf/default.nix +++ b/pkgs/applications/science/math/glsurf/default.nix @@ -1,5 +1,5 @@ -{ lib, stdenv, fetchurl, ocamlPackages, libGLU, libGL, freeglut -, libmysqlclient, mpfr, gmp, libtiff, libjpeg, libpng, giflib +{ lib, stdenv, fetchurl, ocamlPackages, libGLU, libGL, freeglut, giflib +, libmysqlclient, mpfr, gmp, libtiff, libjpeg, libpng }: stdenv.mkDerivation { diff --git a/pkgs/applications/window-managers/icewm/default.nix b/pkgs/applications/window-managers/icewm/default.nix index 8f1a920296a..b24aa24222b 100644 --- a/pkgs/applications/window-managers/icewm/default.nix +++ b/pkgs/applications/window-managers/icewm/default.nix @@ -30,7 +30,7 @@ , libpthreadstubs , libsndfile , libtiff -, libungif +, giflib , libxcb , mkfontdir , pcre @@ -81,7 +81,7 @@ stdenv.mkDerivation rec { libpthreadstubs libsndfile libtiff - libungif + giflib libxcb mkfontdir pcre diff --git a/pkgs/applications/window-managers/windowmaker/default.nix b/pkgs/applications/window-managers/windowmaker/default.nix index e56ff2512c1..8c354c616fd 100644 --- a/pkgs/applications/window-managers/windowmaker/default.nix +++ b/pkgs/applications/window-managers/windowmaker/default.nix @@ -1,6 +1,6 @@ { lib, stdenv, fetchurl, pkg-config , libX11, libXext, libXft, libXmu, libXinerama, libXrandr, libXpm -, imagemagick, libpng, libjpeg, libexif, libtiff, libungif, libwebp }: +, imagemagick, libpng, libjpeg, libexif, libtiff, giflib, libwebp }: stdenv.mkDerivation rec { pname = "windowmaker"; @@ -15,7 +15,7 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ pkg-config ]; buildInputs = [ libX11 libXext libXft libXmu libXinerama libXrandr libXpm - imagemagick libpng libjpeg libexif libtiff libungif libwebp ]; + imagemagick libpng libjpeg libexif libtiff giflib libwebp ]; configureFlags = [ "--with-x" diff --git a/pkgs/desktops/gnustep/base/default.nix b/pkgs/desktops/gnustep/base/default.nix index 8fe232dff7b..e661dae9099 100644 --- a/pkgs/desktops/gnustep/base/default.nix +++ b/pkgs/desktops/gnustep/base/default.nix @@ -4,7 +4,7 @@ , fetchurl, fetchpatch , gmp, gnutls , libffi, binutils-unwrapped -, libjpeg, libtiff, libpng, giflib, libungif +, libjpeg, libtiff, libpng, giflib , libxml2, libxslt, libiconv , libobjc, libgcrypt , icu @@ -26,7 +26,7 @@ gsmakeDerivation { cups gmp gnutls libffi binutils-unwrapped - libjpeg libtiff libpng giflib libungif + libjpeg libtiff libpng giflib giflib libxml2 libxslt libiconv libobjc libgcrypt icu diff --git a/pkgs/development/libraries/SDL2_image/default.nix b/pkgs/development/libraries/SDL2_image/default.nix index 96f85ddb0ea..a0f770178cc 100644 --- a/pkgs/development/libraries/SDL2_image/default.nix +++ b/pkgs/development/libraries/SDL2_image/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, fetchurl, SDL2, libpng, libjpeg, libtiff, libungif, libwebp, libXpm, zlib, Foundation }: +{ lib, stdenv, fetchurl, SDL2, libpng, libjpeg, libtiff, giflib, libwebp, libXpm, zlib, Foundation }: stdenv.mkDerivation rec { pname = "SDL2_image"; @@ -9,7 +9,7 @@ stdenv.mkDerivation rec { sha256 = "1l0864kas9cwpp2d32yxl81g98lx40dhbdp03dz7sbv84vhgdmdx"; }; - buildInputs = [ SDL2 libpng libjpeg libtiff libungif libwebp libXpm zlib ] + buildInputs = [ SDL2 libpng libjpeg libtiff giflib libwebp libXpm zlib ] ++ lib.optional stdenv.isDarwin Foundation; diff --git a/pkgs/development/libraries/SDL_image/default.nix b/pkgs/development/libraries/SDL_image/default.nix index 2e5841b3f48..fe97f016743 100644 --- a/pkgs/development/libraries/SDL_image/default.nix +++ b/pkgs/development/libraries/SDL_image/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, fetchurl, fetchpatch, SDL, libpng, libjpeg, libtiff, libungif, libXpm }: +{ lib, stdenv, fetchurl, fetchpatch, SDL, libpng, libjpeg, libtiff, giflib, libXpm }: stdenv.mkDerivation rec { pname = "SDL_image"; @@ -24,7 +24,7 @@ stdenv.mkDerivation rec { "--disable-tif-shared" ] ++ lib.optional stdenv.isDarwin "--disable-sdltest"; - buildInputs = [ SDL libpng libjpeg libtiff libungif libXpm ]; + buildInputs = [ SDL libpng libjpeg libtiff giflib libXpm ]; meta = with lib; { description = "SDL image library"; diff --git a/pkgs/development/libraries/giflib/libungif.nix b/pkgs/development/libraries/giflib/libungif.nix deleted file mode 100644 index d8c32d14fca..00000000000 --- a/pkgs/development/libraries/giflib/libungif.nix +++ /dev/null @@ -1,17 +0,0 @@ -{lib, stdenv, fetchurl}: - -stdenv.mkDerivation { - name = "libungif-4.1.4"; - src = fetchurl { - url = "mirror://sourceforge/giflib/libungif-4.1.4.tar.gz"; - sha256 = "5e65e1e5deacd0cde489900dbf54c6c2ee2ebc818199e720dbad685d87abda3d"; - }; - - hardeningDisable = [ "format" ]; - - meta = with lib; { - description = "Library and utilities for processing GIFs"; - platforms = platforms.unix; - license = licenses.mit; - }; -} diff --git a/pkgs/development/libraries/pslib/default.nix b/pkgs/development/libraries/pslib/default.nix index ec2362009ff..b3439b7ee96 100644 --- a/pkgs/development/libraries/pslib/default.nix +++ b/pkgs/development/libraries/pslib/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, fetchurl, cmake, pkg-config, zlib, libpng, libjpeg, libungif, libtiff +{ lib, stdenv, fetchurl, cmake, pkg-config, zlib, libpng, libjpeg, giflib, libtiff }: stdenv.mkDerivation rec { @@ -12,7 +12,7 @@ stdenv.mkDerivation rec { }; nativeBuildInputs = [ cmake pkg-config ]; - buildInputs = [ zlib libpng libjpeg libungif libtiff ]; + buildInputs = [ zlib libpng libjpeg giflib libtiff ]; doCheck = true; diff --git a/pkgs/tools/misc/fontforge/default.nix b/pkgs/tools/misc/fontforge/default.nix index 89bd0f0491e..5f64057c46c 100644 --- a/pkgs/tools/misc/fontforge/default.nix +++ b/pkgs/tools/misc/fontforge/default.nix @@ -1,6 +1,6 @@ { stdenv, fetchpatch, fetchFromGitHub, lib , cmake, perl, uthash, pkg-config, gettext -, python, freetype, zlib, glib, libungif, libpng, libjpeg, libtiff, libxml2, cairo, pango +, python, freetype, zlib, glib, giflib, libpng, libjpeg, libtiff, libxml2, cairo, pango , readline, woff2, zeromq, libuninameslist , withSpiro ? false, libspiro , withGTK ? false, gtk3 @@ -47,7 +47,7 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ pkg-config cmake ]; buildInputs = [ readline uthash woff2 zeromq libuninameslist - python freetype zlib glib libungif libpng libjpeg libtiff libxml2 + python freetype zlib glib giflib libpng libjpeg libtiff libxml2 ] ++ lib.optionals withSpiro [libspiro] ++ lib.optionals withGUI [ gtk3 cairo pango ] diff --git a/pkgs/tools/video/swftools/default.nix b/pkgs/tools/video/swftools/default.nix index 4d3014388c8..6867869a0a9 100644 --- a/pkgs/tools/video/swftools/default.nix +++ b/pkgs/tools/video/swftools/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, fetchurl, freetype, libjpeg, libungif, zlib }: +{ lib, stdenv, fetchurl, freetype, libjpeg, zlib }: stdenv.mkDerivation rec { pname = "swftools"; @@ -11,7 +11,7 @@ stdenv.mkDerivation rec { patches = [ ./swftools.patch ]; - buildInputs = [ freetype libjpeg libungif zlib ]; + buildInputs = [ freetype libjpeg zlib ]; meta = with lib; { description = "Collection of SWF manipulation and creation utilities"; diff --git a/pkgs/top-level/aliases.nix b/pkgs/top-level/aliases.nix index fe162e3723f..45f86eb56f9 100644 --- a/pkgs/top-level/aliases.nix +++ b/pkgs/top-level/aliases.nix @@ -380,6 +380,7 @@ mapAliases ({ libtxc_dxtn = throw "libtxc_dxtn was removed 2020-03-16, now integrated in Mesa"; libtxc_dxtn_s2tc = throw "libtxc_dxtn_s2tc was removed 2020-03-16, now integrated in Mesa"; libudev = udev; # added 2018-04-25 + libungif = giflib; # added 2020-02-12 libusb = libusb1; # added 2020-04-28 libsexy = throw "libsexy has been removed from nixpkgs, as it's abandoned and no package needed it."; # 2019-12-10 libstdcxxHook = throw "libstdcxx hook has been removed because cc-wrapper is now directly aware of the c++ standard library intended to be used."; # 2020-06-22 diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index debfb711d89..33ffdc7c503 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -16163,8 +16163,6 @@ in libunarr = callPackage ../development/libraries/libunarr { }; - libungif = callPackage ../development/libraries/giflib/libungif.nix { }; - libunibreak = callPackage ../development/libraries/libunibreak { }; libuninameslist = callPackage ../development/libraries/libuninameslist { }; From 70e33e3ae34e799e5b077704ffa35702a190362d Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Fri, 12 Feb 2021 22:32:08 +0000 Subject: [PATCH 029/263] glsurf: use current giflib This requires bumping the version of camlimages used by glsurf to a version that supports current giflib. The most recent versions of camlimages (even of 4.x) don't support ocaml 4.01 any more, so I've upgraded to 4.1.2 here, the last version that supports ocaml 4.01 (and which happily supports current giflib). --- .../science/math/glsurf/default.nix | 6 +-- .../ocaml-modules/camlimages/4.0.nix | 41 ------------------- .../ocaml-modules/camlimages/4.1.2.nix | 37 +++++++++++++++++ pkgs/top-level/all-packages.nix | 1 - pkgs/top-level/ocaml-packages.nix | 5 +-- 5 files changed, 42 insertions(+), 48 deletions(-) delete mode 100644 pkgs/development/ocaml-modules/camlimages/4.0.nix create mode 100644 pkgs/development/ocaml-modules/camlimages/4.1.2.nix diff --git a/pkgs/applications/science/math/glsurf/default.nix b/pkgs/applications/science/math/glsurf/default.nix index 3b4604fe2aa..bf8b5d7673b 100644 --- a/pkgs/applications/science/math/glsurf/default.nix +++ b/pkgs/applications/science/math/glsurf/default.nix @@ -10,10 +10,10 @@ stdenv.mkDerivation { sha256 = "0w8xxfnw2snflz8wdr2ca9f5g91w5vbyp1hwlx1v7vg83d4bwqs7"; }; - buildInputs = [ freeglut libGLU libGL libmysqlclient mpfr gmp - libtiff libjpeg libpng giflib ] + buildInputs = [ freeglut libGLU libGL libmysqlclient mpfr giflib gmp + libtiff libjpeg libpng ] ++ (with ocamlPackages; [ - ocaml findlib ocaml_mysql lablgl camlimages_4_0 mlgmpidl + ocaml findlib ocaml_mysql lablgl camlimages_4_1_2 mlgmpidl ]); installPhase = '' diff --git a/pkgs/development/ocaml-modules/camlimages/4.0.nix b/pkgs/development/ocaml-modules/camlimages/4.0.nix deleted file mode 100644 index 26735b1c5d7..00000000000 --- a/pkgs/development/ocaml-modules/camlimages/4.0.nix +++ /dev/null @@ -1,41 +0,0 @@ -{ lib, stdenv, fetchurl, omake, ocaml, libtiff, libjpeg, libpng, giflib, findlib, libXpm, freetype, graphicsmagick, ghostscript }: - -let - pname = "camlimages"; - version = "4.0.1"; -in - -stdenv.mkDerivation { - name = "${pname}-${version}"; - - src = fetchurl { - url = "https://bitbucket.org/camlspotter/camlimages/get/v4.0.1.tar.gz"; - sha256 = "b40237c1505487049799a7af296eb3996b3fa08eab94415546f46d61355747c4"; - }; - - buildInputs = [ ocaml omake findlib graphicsmagick ghostscript ]; - - propagatedBuildInputs = [libtiff libjpeg libpng giflib freetype libXpm ]; - - createFindlibDestdir = true; - - preConfigure = '' - rm ./configure - ''; - - buildPhase = '' - omake - ''; - - installPhase = '' - omake install - ''; - - meta = with lib; { - branch = "4.0"; - homepage = "https://bitbucket.org/camlspotter/camlimages"; - description = "OCaml image processing library"; - license = licenses.lgpl2; - maintainers = [ maintainers.vbgl ]; - }; -} diff --git a/pkgs/development/ocaml-modules/camlimages/4.1.2.nix b/pkgs/development/ocaml-modules/camlimages/4.1.2.nix new file mode 100644 index 00000000000..437cb84d15d --- /dev/null +++ b/pkgs/development/ocaml-modules/camlimages/4.1.2.nix @@ -0,0 +1,37 @@ +{ lib, stdenv, fetchFromGitLab, fetchpatch, omake, ocaml, findlib +, graphicsmagick, ghostscript +, freetype, giflib, libjpeg, libpng, libtiff, libXpm +}: + +stdenv.mkDerivation rec { + pname = "camlimages"; + version = "4.1.2"; + + src = fetchFromGitLab { + owner = "camlspotter"; + repo = "camlimages"; + rev = "98661d507e12ce91a51295a50f244cb8265b4439"; # no tag + sha256 = "0kpxj8wm2m17wjq217jzjpfgv1d7sp4w1yd1gi8ipn5rj4sid2j8"; + }; + + buildInputs = [ ocaml omake findlib graphicsmagick ghostscript ]; + propagatedBuildInputs = [ libtiff libjpeg libpng giflib freetype libXpm ]; + + createFindlibDestdir = true; + + buildPhase = '' + omake + ''; + + installPhase = '' + omake install + ''; + + meta = with lib; { + branch = "4.0"; + homepage = "https://bitbucket.org/camlspotter/camlimages"; + description = "OCaml image processing library"; + license = licenses.lgpl2; + maintainers = [ maintainers.vbgl ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 33ffdc7c503..053c4328df7 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -14518,7 +14518,6 @@ in glsurf = callPackage ../applications/science/math/glsurf { libpng = libpng12; - giflib = giflib_4_1; ocamlPackages = ocaml-ng.ocamlPackages_4_01_0; }; diff --git a/pkgs/top-level/ocaml-packages.nix b/pkgs/top-level/ocaml-packages.nix index 5aa7482fdc6..0561a4ea810 100644 --- a/pkgs/top-level/ocaml-packages.nix +++ b/pkgs/top-level/ocaml-packages.nix @@ -114,12 +114,11 @@ let then callPackage ../development/ocaml-modules/camomile { } else callPackage ../development/ocaml-modules/camomile/0.8.5.nix { }; - camlimages_4_0 = + camlimages_4_1_2 = if lib.versionOlder "4.02" ocaml.version then null - else callPackage ../development/ocaml-modules/camlimages/4.0.nix { + else callPackage ../development/ocaml-modules/camlimages/4.1.2.nix { libpng = pkgs.libpng12; - giflib = pkgs.giflib_4_1; }; camlimages = callPackage ../development/ocaml-modules/camlimages { }; From e459db3f81dfdfb4d006bed4e909f8559ee7d887 Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Fri, 12 Feb 2021 23:04:18 +0000 Subject: [PATCH 030/263] glsurf: fix license The README says GPL 2 or any later version, not LGPL. --- pkgs/applications/science/math/glsurf/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/applications/science/math/glsurf/default.nix b/pkgs/applications/science/math/glsurf/default.nix index bf8b5d7673b..208bb95f930 100644 --- a/pkgs/applications/science/math/glsurf/default.nix +++ b/pkgs/applications/science/math/glsurf/default.nix @@ -26,6 +26,6 @@ stdenv.mkDerivation { meta = { homepage = "https://raffalli.eu/~christophe/glsurf/"; description = "A program to draw implicit surfaces and curves"; - license = lib.licenses.lgpl21; + license = lib.licenses.gpl2Plus; }; } From f8db5c60f39033c9082c34f3919d8bb287db9099 Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Fri, 12 Feb 2021 23:25:31 +0000 Subject: [PATCH 031/263] giflib_4_1: remove Everything still using this builds fine without it. --- pkgs/desktops/gnustep/default.nix | 3 +-- pkgs/top-level/aliases.nix | 1 + pkgs/top-level/all-packages.nix | 5 +---- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/pkgs/desktops/gnustep/default.nix b/pkgs/desktops/gnustep/default.nix index abbabd4abf2..d337512dcec 100644 --- a/pkgs/desktops/gnustep/default.nix +++ b/pkgs/desktops/gnustep/default.nix @@ -1,6 +1,5 @@ { newScope , llvmPackages -, giflib_4_1 }: let @@ -16,7 +15,7 @@ let libobjc = callPackage ./libobjc2 {}; make = callPackage ./make {}; back = callPackage ./back {}; - base = callPackage ./base { giflib = giflib_4_1; }; + base = callPackage ./base { }; gui = callPackage ./gui {}; gworkspace = callPackage ./gworkspace {}; }; diff --git a/pkgs/top-level/aliases.nix b/pkgs/top-level/aliases.nix index 45f86eb56f9..4d718cb3ac1 100644 --- a/pkgs/top-level/aliases.nix +++ b/pkgs/top-level/aliases.nix @@ -231,6 +231,7 @@ mapAliases ({ gdb-multitarget = gdb; # added 2017-11-13 gdk_pixbuf = gdk-pixbuf; # added 2019-05-22 gettextWithExpat = gettext; # 2016-02-19 + giflib_4_1 = throw "giflib_4_1 has been removed; use giflib instead"; # 2020-02-12 gitAndTools = self // { # added 2021-01-14 darcsToGit = darcs-to-git; gitAnnex = git-annex; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 053c4328df7..e806c6af866 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -16157,7 +16157,6 @@ in libwhereami = callPackage ../development/libraries/libwhereami { }; - giflib_4_1 = callPackage ../development/libraries/giflib/4.1.nix { }; giflib = callPackage ../development/libraries/giflib { }; libunarr = callPackage ../development/libraries/libunarr { }; @@ -30418,9 +30417,7 @@ in vbam = callPackage ../misc/emulators/vbam { }; - vice = callPackage ../misc/emulators/vice { - giflib = giflib_4_1; - }; + vice = callPackage ../misc/emulators/vice { }; ViennaRNA = callPackage ../applications/science/molecular-dynamics/viennarna { }; From ca9be0511b0661be5255dd1fe0b05c5eaf3e56d8 Mon Sep 17 00:00:00 2001 From: sternenseemann <0rpkxez4ksa01gb3typccl0i@systemli.org> Date: Fri, 16 Apr 2021 13:55:41 +0200 Subject: [PATCH 032/263] binutils-unwrapped: force targetPrefix if cross compiling The binutils build system checks by itself if it is building a cross toolchain or not and prepends or omits a targetPrefix accordingly. This means that we can always pass target via configureTargets. However the binutils build system and our bintools wrapper disagree over whether we are building a cross toolchain or not sometimes since cross compilation can be relatively subtle in nixpkgs. For example every use of crossOverlays will make nixpkgs build a cross toolchain even though localSystem == crossSystem. The cross infrastructure is also used to build native binaries with a different stdenv (musl instead of glibc, clang instead of gcc). In all of these cases stdenv.hostPlatform.config == stdenv.targetPlatform.config, causing binutils to not prepend a target prefix. At the same time stdenv.hostPlatform != stdenv.targetPlatform causing the bintools wrapper to expect a target prefix, thus building an incomplete set of bintools. This is why currently pkgsCross.gnu64 and pkgsCross.musl64 aren't working. The solution is quite simple however: If we detect that we are building a cross toolchain in the binutils-unwrapped expression, we force the targetPrefix with --programprefix and fulfill the expectations of the bintools wrapper at the same time. Tested (on x86_64-linux): * pkgsCross.musl64.hello * pkgsCross.aarch64-multiplatform.hello * pkgs.hello Still not working is pkgsCross.gnu64, since x86_64-unknown-linux-gnu-stage-final-gcc gets confused about targets now, so bootstrapping the stdenv fails. Since this wasn't working previously anyways, it's proably fine to fix this separately. --- .../development/tools/misc/binutils/default.nix | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/pkgs/development/tools/misc/binutils/default.nix b/pkgs/development/tools/misc/binutils/default.nix index 995f3f7430c..8042655a859 100644 --- a/pkgs/development/tools/misc/binutils/default.nix +++ b/pkgs/development/tools/misc/binutils/default.nix @@ -107,8 +107,7 @@ stdenv.mkDerivation { hardeningDisable = [ "format" "pie" ]; - # TODO(@Ericson2314): Always pass "--target" and always targetPrefix. - configurePlatforms = [ "build" "host" ] ++ lib.optional (stdenv.targetPlatform != stdenv.hostPlatform) "target"; + configurePlatforms = [ "build" "host" "target" ]; configureFlags = (if enableShared then [ "--enable-shared" "--disable-static" ] @@ -126,7 +125,19 @@ stdenv.mkDerivation { # RUNPATH instead of RPATH on binaries. This is important because # RUNPATH can be overriden using LD_LIBRARY_PATH at runtime. "--enable-new-dtags" - ] ++ lib.optionals gold [ "--enable-gold" "--enable-plugins" ]; + + # force target prefix. Some versions of binutils will make it empty + # if `--host` and `--target` are too close, even if Nixpkgs thinks + # the platforms are different (e.g. because not all the info makes + # the `config`). Other versions of binutils will always prefix if + # `--target` is passed, even if `--host` and `--target` are the same. + # The easiest thing for us to do is not leave it to chance, and force + # the program prefix to be what we want it to be. + "--program-prefix=${targetPrefix}" + ] ++ lib.optionals gold [ + "--enable-gold" + "--enable-plugins" + ]; doCheck = false; # fails From 914c604a0147a3de73919b26dc68f7a13b1239cb Mon Sep 17 00:00:00 2001 From: Calum MacRae Date: Sat, 27 Mar 2021 12:13:42 +0000 Subject: [PATCH 033/263] apple-sdk: fix PrivateFrameworks symlinks With the absence of these symlinks, private frameworks aren't exposed to the linker. --- pkgs/os-specific/darwin/apple-sdk/default.nix | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/pkgs/os-specific/darwin/apple-sdk/default.nix b/pkgs/os-specific/darwin/apple-sdk/default.nix index b88107f992c..67e9bb80da0 100644 --- a/pkgs/os-specific/darwin/apple-sdk/default.nix +++ b/pkgs/os-specific/darwin/apple-sdk/default.nix @@ -192,6 +192,20 @@ let mkdir -p $out/Library/Frameworks/ cp -r ${darwin-stubs}/System/Library/${lib.optionalString private "Private"}Frameworks/${name}.framework \ $out/Library/Frameworks + + cd $out/Library/Frameworks/${name}.framework + + versions=(./Versions/*) + if [ "''${#versions[@]}" != 1 ]; then + echo "Unable to determine current version of framework ${name}" + exit 1 + fi + current=$(basename ''${versions[0]}) + + chmod u+w -R . + ln -s "$current" Versions/Current + ln -s Versions/Current/* . + # NOTE there's no re-export checking here, this is probably wrong ''; }; From 2c82907da4492bd1dd92815ae82fe1efea6043d3 Mon Sep 17 00:00:00 2001 From: Calum MacRae Date: Sat, 27 Mar 2021 12:14:55 +0000 Subject: [PATCH 034/263] apple-sdk: generate SkyLight framework outputs --- pkgs/os-specific/darwin/apple-sdk/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/os-specific/darwin/apple-sdk/default.nix b/pkgs/os-specific/darwin/apple-sdk/default.nix index 67e9bb80da0..1b60abf562b 100644 --- a/pkgs/os-specific/darwin/apple-sdk/default.nix +++ b/pkgs/os-specific/darwin/apple-sdk/default.nix @@ -326,7 +326,7 @@ in rec { "Versions/A/Frameworks/WebKitLegacy.framework/Versions/A/WebKitLegacy.tbd" ]; }); - } // lib.genAttrs [ "ContactsPersistence" "UIFoundation" "GameCenter" ] (x: tbdOnlyFramework x {}); + } // lib.genAttrs [ "ContactsPersistence" "GameCenter" "SkyLight" "UIFoundation" ] (x: tbdOnlyFramework x {}); bareFrameworks = lib.mapAttrs framework (import ./frameworks.nix { inherit frameworks libs; From 28192c446c6e6006c1446319644b8b96e11f979c Mon Sep 17 00:00:00 2001 From: Calum MacRae Date: Sat, 27 Mar 2021 12:15:35 +0000 Subject: [PATCH 035/263] spacebar: fix builds on macOS Big Sur --- pkgs/os-specific/darwin/spacebar/default.nix | 4 ++-- pkgs/top-level/all-packages.nix | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/os-specific/darwin/spacebar/default.nix b/pkgs/os-specific/darwin/spacebar/default.nix index 780347c60c5..8cfbaa3f9a3 100644 --- a/pkgs/os-specific/darwin/spacebar/default.nix +++ b/pkgs/os-specific/darwin/spacebar/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, fetchFromGitHub, Carbon, Cocoa, ScriptingBridge }: +{ lib, stdenv, fetchFromGitHub, Carbon, Cocoa, ScriptingBridge, SkyLight }: stdenv.mkDerivation rec { pname = "spacebar"; @@ -11,7 +11,7 @@ stdenv.mkDerivation rec { sha256 = "0f5ddn3sx13rwwh0nfl784160s8ml3m5593d5fz2b1996aznzrsx"; }; - buildInputs = [ Carbon Cocoa ScriptingBridge ]; + buildInputs = [ Carbon Cocoa ScriptingBridge SkyLight ]; installPhase = '' mkdir -p $out/bin diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index e806c6af866..87ccb52e0cb 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -8424,7 +8424,7 @@ in spacebar = callPackage ../os-specific/darwin/spacebar { inherit (darwin.apple_sdk.frameworks) - Carbon Cocoa ScriptingBridge; + Carbon Cocoa ScriptingBridge SkyLight; }; spaceFM = callPackage ../applications/misc/spacefm { }; From 1d7c44ec5daff0606ab8ae63f8b5f6c491fddc82 Mon Sep 17 00:00:00 2001 From: Wolfgang Walther Date: Fri, 16 Apr 2021 19:08:47 +0200 Subject: [PATCH 036/263] python3Packages.sphinx: 3.3.1 -> 3.5.4 --- pkgs/development/python-modules/sphinx/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/development/python-modules/sphinx/default.nix b/pkgs/development/python-modules/sphinx/default.nix index 9ce0015cdf8..e81ee3c6f1e 100644 --- a/pkgs/development/python-modules/sphinx/default.nix +++ b/pkgs/development/python-modules/sphinx/default.nix @@ -33,11 +33,11 @@ buildPythonPackage rec { pname = "sphinx"; - version = "3.3.1"; + version = "3.5.4"; src = fetchPypi { pname = "Sphinx"; inherit version; - sha256 = "1e8d592225447104d1172be415bc2972bd1357e3e12fdc76edf2261105db4300"; + sha256 = "19010b7b9fa0dc7756a6e105b2aacd3a80f798af3c25c273be64d7beeb482cb1"; }; LC_ALL = "en_US.UTF-8"; @@ -74,7 +74,7 @@ buildPythonPackage rec { meta = { description = "A tool that makes it easy to create intelligent and beautiful documentation for Python projects"; - homepage = "http://sphinx.pocoo.org/"; + homepage = "https://www.sphinx-doc.org"; license = lib.licenses.bsd3; maintainers = with lib.maintainers; [ nand0p ]; }; From acdc783418538f23cdfb671bc8fd4b1c076979bd Mon Sep 17 00:00:00 2001 From: sternenseemann <0rpkxez4ksa01gb3typccl0i@systemli.org> Date: Fri, 16 Apr 2021 17:39:04 +0200 Subject: [PATCH 037/263] gcc*: always force --program-prefix and pass --target Don't rely on gcc detecting from the passed platforms which prefix to use, but always specify the prefix nixpkgs expects (or doesn't). This allows us to work around problems where the configure script would add prefix where nixpkgs doesn't expect one (if `--target` was specified, but the same as `--host`) or doesn't add one if nixpkgs expects one (if `--target` and `--host` are the same, but we are actually cross compiling, but the relevant parts of the platform are not encoded into the platform config. See also ca9be0511b0661be5255dd1fe0b05c5eaf3e56d8. --- pkgs/development/compilers/gcc/10/default.nix | 3 +-- pkgs/development/compilers/gcc/4.8/default.nix | 3 +-- pkgs/development/compilers/gcc/4.9/default.nix | 3 +-- pkgs/development/compilers/gcc/6/default.nix | 3 +-- pkgs/development/compilers/gcc/7/default.nix | 3 +-- pkgs/development/compilers/gcc/8/default.nix | 3 +-- pkgs/development/compilers/gcc/9/default.nix | 3 +-- .../compilers/gcc/common/configure-flags.nix | 15 +++++++++++++++ 8 files changed, 22 insertions(+), 14 deletions(-) diff --git a/pkgs/development/compilers/gcc/10/default.nix b/pkgs/development/compilers/gcc/10/default.nix index 1502b09cca6..c265fff2215 100644 --- a/pkgs/development/compilers/gcc/10/default.nix +++ b/pkgs/development/compilers/gcc/10/default.nix @@ -186,8 +186,7 @@ stdenv.mkDerivation ({ dontDisableStatic = true; - # TODO(@Ericson2314): Always pass "--target" and always prefix. - configurePlatforms = [ "build" "host" ] ++ lib.optional (targetPlatform != hostPlatform) "target"; + configurePlatforms = [ "build" "host" "target" ]; configureFlags = import ../common/configure-flags.nix { inherit diff --git a/pkgs/development/compilers/gcc/4.8/default.nix b/pkgs/development/compilers/gcc/4.8/default.nix index 6a2121a8298..957c85cfde5 100644 --- a/pkgs/development/compilers/gcc/4.8/default.nix +++ b/pkgs/development/compilers/gcc/4.8/default.nix @@ -196,8 +196,7 @@ stdenv.mkDerivation ({ dontDisableStatic = true; - # TODO(@Ericson2314): Always pass "--target" and always prefix. - configurePlatforms = [ "build" "host" ] ++ lib.optional (targetPlatform != hostPlatform) "target"; + configurePlatforms = [ "build" "host" "target" ]; configureFlags = import ../common/configure-flags.nix { inherit diff --git a/pkgs/development/compilers/gcc/4.9/default.nix b/pkgs/development/compilers/gcc/4.9/default.nix index 709288559d1..5d30f80edb2 100644 --- a/pkgs/development/compilers/gcc/4.9/default.nix +++ b/pkgs/development/compilers/gcc/4.9/default.nix @@ -209,8 +209,7 @@ stdenv.mkDerivation ({ dontDisableStatic = true; - # TODO(@Ericson2314): Always pass "--target" and always prefix. - configurePlatforms = [ "build" "host" ] ++ lib.optional (targetPlatform != hostPlatform) "target"; + configurePlatforms = [ "build" "host" "target" ]; configureFlags = import ../common/configure-flags.nix { inherit diff --git a/pkgs/development/compilers/gcc/6/default.nix b/pkgs/development/compilers/gcc/6/default.nix index 93c9dde61fc..0ac54e093b4 100644 --- a/pkgs/development/compilers/gcc/6/default.nix +++ b/pkgs/development/compilers/gcc/6/default.nix @@ -232,8 +232,7 @@ stdenv.mkDerivation ({ dontDisableStatic = true; - # TODO(@Ericson2314): Always pass "--target" and always prefix. - configurePlatforms = [ "build" "host" ] ++ lib.optional (targetPlatform != hostPlatform) "target"; + configurePlatforms = [ "build" "host" "target" ]; configureFlags = import ../common/configure-flags.nix { inherit diff --git a/pkgs/development/compilers/gcc/7/default.nix b/pkgs/development/compilers/gcc/7/default.nix index d9b4c639b5a..233d022514e 100644 --- a/pkgs/development/compilers/gcc/7/default.nix +++ b/pkgs/development/compilers/gcc/7/default.nix @@ -197,8 +197,7 @@ stdenv.mkDerivation ({ dontDisableStatic = true; - # TODO(@Ericson2314): Always pass "--target" and always prefix. - configurePlatforms = [ "build" "host" ] ++ lib.optional (targetPlatform != hostPlatform) "target"; + configurePlatforms = [ "build" "host" "target" ]; configureFlags = import ../common/configure-flags.nix { inherit diff --git a/pkgs/development/compilers/gcc/8/default.nix b/pkgs/development/compilers/gcc/8/default.nix index 6ecf462d54d..4e57e43437f 100644 --- a/pkgs/development/compilers/gcc/8/default.nix +++ b/pkgs/development/compilers/gcc/8/default.nix @@ -182,8 +182,7 @@ stdenv.mkDerivation ({ dontDisableStatic = true; - # TODO(@Ericson2314): Always pass "--target" and always prefix. - configurePlatforms = [ "build" "host" ] ++ lib.optional (targetPlatform != hostPlatform) "target"; + configurePlatforms = [ "build" "host" "target" ]; configureFlags = import ../common/configure-flags.nix { inherit diff --git a/pkgs/development/compilers/gcc/9/default.nix b/pkgs/development/compilers/gcc/9/default.nix index 7f35f5c7bb9..92810ecffaf 100644 --- a/pkgs/development/compilers/gcc/9/default.nix +++ b/pkgs/development/compilers/gcc/9/default.nix @@ -199,8 +199,7 @@ stdenv.mkDerivation ({ dontDisableStatic = true; - # TODO(@Ericson2314): Always pass "--target" and always prefix. - configurePlatforms = [ "build" "host" ] ++ lib.optional (targetPlatform != hostPlatform) "target"; + configurePlatforms = [ "build" "host" "target" ]; configureFlags = import ../common/configure-flags.nix { inherit diff --git a/pkgs/development/compilers/gcc/common/configure-flags.nix b/pkgs/development/compilers/gcc/common/configure-flags.nix index fc4fbb34c50..4cf06cd4107 100644 --- a/pkgs/development/compilers/gcc/common/configure-flags.nix +++ b/pkgs/development/compilers/gcc/common/configure-flags.nix @@ -44,6 +44,9 @@ let crossMingw = targetPlatform != hostPlatform && targetPlatform.libc == "msvcrt"; crossDarwin = targetPlatform != hostPlatform && targetPlatform.libc == "libSystem"; + targetPrefix = lib.optionalString (stdenv.targetPlatform != stdenv.hostPlatform) + "${stdenv.targetPlatform.config}-"; + crossConfigureFlags = # Ensure that -print-prog-name is able to find the correct programs. [ @@ -112,6 +115,18 @@ let # Basic configuration ++ [ + # Force target prefix. The behavior if `--target` and `--host` + # are specified is inconsistent: Sometimes specifying `--target` + # always causes a prefix to be generated, sometimes it's only + # added if the `--host` and `--target` differ. This means that + # sometimes there may be a prefix even though nixpkgs doesn't + # expect one and sometimes there may be none even though nixpkgs + # expects one (since not all information is serialized into the + # config attribute). The easiest way out of these problems is to + # always set the program prefix, so gcc will conform to our + # expectations. + "--program-prefix=${targetPrefix}" + (lib.enableFeature enableLTO "lto") "--disable-libstdcxx-pch" "--without-included-gettext" From e75c5353bb337b8e8bacf02c7b369b1e897771b9 Mon Sep 17 00:00:00 2001 From: sternenseemann <0rpkxez4ksa01gb3typccl0i@systemli.org> Date: Fri, 16 Apr 2021 18:00:56 +0200 Subject: [PATCH 038/263] gdb: always set --program-prefix and pass --target This makes the targetPrefix always conform to nixpkgs' expectations instead of relying on the autotools build system to figure it out correctly (which is also inconsistent across versions). See also ca9be0511b0661be5255dd1fe0b05c5eaf3e56d8. --- pkgs/development/tools/misc/gdb/default.nix | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/pkgs/development/tools/misc/gdb/default.nix b/pkgs/development/tools/misc/gdb/default.nix index 6f923778975..66d4e8bc057 100644 --- a/pkgs/development/tools/misc/gdb/default.nix +++ b/pkgs/development/tools/misc/gdb/default.nix @@ -61,8 +61,7 @@ stdenv.mkDerivation rec { NIX_CFLAGS_COMPILE = "-Wno-format-nonliteral"; - # TODO(@Ericson2314): Always pass "--target" and always prefix. - configurePlatforms = [ "build" "host" ] ++ lib.optional (stdenv.targetPlatform != stdenv.hostPlatform) "target"; + configurePlatforms = [ "build" "host" "target" ]; # GDB have to be built out of tree. preConfigure = '' @@ -72,6 +71,13 @@ stdenv.mkDerivation rec { configureScript = "../configure"; configureFlags = with lib; [ + # Set the program prefix to the current targetPrefix. + # This ensures that the prefix always conforms to + # nixpkgs' expectations instead of relying on the build + # system which only receives `config` which is merely a + # subset of the platform description. + "--program-prefix=${targetPrefix}" + "--enable-targets=all" "--enable-64-bit-bfd" "--disable-install-libbfd" "--disable-shared" "--enable-static" From 247faaf47f5a956ccaa2bdb26ac865ac556cf593 Mon Sep 17 00:00:00 2001 From: Peter Hoeg Date: Fri, 16 Apr 2021 16:19:48 +0800 Subject: [PATCH 039/263] plasma5: 5.21.3 -> 5.21.4 --- pkgs/desktops/plasma-5/fetch.sh | 2 +- pkgs/desktops/plasma-5/srcs.nix | 416 ++++++++++++++++---------------- 2 files changed, 209 insertions(+), 209 deletions(-) diff --git a/pkgs/desktops/plasma-5/fetch.sh b/pkgs/desktops/plasma-5/fetch.sh index 10214b3fe23..398f9a1b97d 100644 --- a/pkgs/desktops/plasma-5/fetch.sh +++ b/pkgs/desktops/plasma-5/fetch.sh @@ -1 +1 @@ -WGET_ARGS=( https://download.kde.org/stable/plasma/5.21.3/ -A '*.tar.xz' ) +WGET_ARGS=( https://download.kde.org/stable/plasma/5.21.4/ -A '*.tar.xz' ) diff --git a/pkgs/desktops/plasma-5/srcs.nix b/pkgs/desktops/plasma-5/srcs.nix index bf93e0564d9..8fa7ba91c6a 100644 --- a/pkgs/desktops/plasma-5/srcs.nix +++ b/pkgs/desktops/plasma-5/srcs.nix @@ -4,419 +4,419 @@ { bluedevil = { - version = "5.21.3"; + version = "5.21.4"; src = fetchurl { - url = "${mirror}/stable/plasma/5.21.3/bluedevil-5.21.3.tar.xz"; - sha256 = "1xqm4bn97asilc4yw5rvmmhk7c7wvmbalalr6gz8gw4gv0pg67qv"; - name = "bluedevil-5.21.3.tar.xz"; + url = "${mirror}/stable/plasma/5.21.4/bluedevil-5.21.4.tar.xz"; + sha256 = "0ls6ijk10pgi75ycwcnq3z4j5hn657cnr4s7fky53qkc3y2x25g1"; + name = "bluedevil-5.21.4.tar.xz"; }; }; breeze = { - version = "5.21.3"; + version = "5.21.4"; src = fetchurl { - url = "${mirror}/stable/plasma/5.21.3/breeze-5.21.3.tar.xz"; - sha256 = "0frm3f8q1n0pdzjk7zwmvlrl19fb9265ihnnfhak6ckaq50x72l3"; - name = "breeze-5.21.3.tar.xz"; + url = "${mirror}/stable/plasma/5.21.4/breeze-5.21.4.tar.xz"; + sha256 = "1n6hwppcbnn3hw5r3f9jssvslnming9qvs4s2czyl0kky1nv8bfm"; + name = "breeze-5.21.4.tar.xz"; }; }; breeze-grub = { - version = "5.21.3"; + version = "5.21.4"; src = fetchurl { - url = "${mirror}/stable/plasma/5.21.3/breeze-grub-5.21.3.tar.xz"; - sha256 = "1j0pk4pv5pxwhwah1gd5znnsw3j15x2sc74pp6zinz9a1ywjklnz"; - name = "breeze-grub-5.21.3.tar.xz"; + url = "${mirror}/stable/plasma/5.21.4/breeze-grub-5.21.4.tar.xz"; + sha256 = "1jd8fy9b5cmv1da27xqbl6x3197pq6m4wwxzylxgnmciivhmnzm2"; + name = "breeze-grub-5.21.4.tar.xz"; }; }; breeze-gtk = { - version = "5.21.3"; + version = "5.21.4"; src = fetchurl { - url = "${mirror}/stable/plasma/5.21.3/breeze-gtk-5.21.3.tar.xz"; - sha256 = "1x5by915lfhbkhgrhy3lkwg64skwdlqaxzbq92x0m9v9a9agwidc"; - name = "breeze-gtk-5.21.3.tar.xz"; + url = "${mirror}/stable/plasma/5.21.4/breeze-gtk-5.21.4.tar.xz"; + sha256 = "03aj8rxh46j663m26jsb9hrg0x5j0hvzjqwc8l1ayfcwkdgl4b4i"; + name = "breeze-gtk-5.21.4.tar.xz"; }; }; breeze-plymouth = { - version = "5.21.3"; + version = "5.21.4"; src = fetchurl { - url = "${mirror}/stable/plasma/5.21.3/breeze-plymouth-5.21.3.tar.xz"; - sha256 = "01ida3pfj6g1igndjfjpv16199zysgxlxlnc7vsx7kr8aval8pmx"; - name = "breeze-plymouth-5.21.3.tar.xz"; + url = "${mirror}/stable/plasma/5.21.4/breeze-plymouth-5.21.4.tar.xz"; + sha256 = "0ibwl2aikh547k851pb78216v8ld5la9xg3f9945dcbf7ly88nd7"; + name = "breeze-plymouth-5.21.4.tar.xz"; }; }; discover = { - version = "5.21.3"; + version = "5.21.4"; src = fetchurl { - url = "${mirror}/stable/plasma/5.21.3/discover-5.21.3.tar.xz"; - sha256 = "170kxhrwj4mvj5qg7cyz3sxdfyp7rr4pgsi3v7kahs19a9w3isnx"; - name = "discover-5.21.3.tar.xz"; + url = "${mirror}/stable/plasma/5.21.4/discover-5.21.4.tar.xz"; + sha256 = "1f3hvafyf2kga1ywn5aia37xxgagx6p2b43h7ap7mjkmw7ywyr30"; + name = "discover-5.21.4.tar.xz"; }; }; drkonqi = { - version = "5.21.3"; + version = "5.21.4"; src = fetchurl { - url = "${mirror}/stable/plasma/5.21.3/drkonqi-5.21.3.tar.xz"; - sha256 = "1hq37vi0vndhy66labspm75blicx1g4q594wxfxzl076mav5jds4"; - name = "drkonqi-5.21.3.tar.xz"; + url = "${mirror}/stable/plasma/5.21.4/drkonqi-5.21.4.tar.xz"; + sha256 = "123l0hyyzskjivasp1q8w9y2f2mbjrwjap3yfi23h98zbzcblcaq"; + name = "drkonqi-5.21.4.tar.xz"; }; }; kactivitymanagerd = { - version = "5.21.3"; + version = "5.21.4"; src = fetchurl { - url = "${mirror}/stable/plasma/5.21.3/kactivitymanagerd-5.21.3.tar.xz"; - sha256 = "1x5p6rbjf9kz07r5mrkiglvbigvk5bfx8qpb8l2vagsbvlg298c3"; - name = "kactivitymanagerd-5.21.3.tar.xz"; + url = "${mirror}/stable/plasma/5.21.4/kactivitymanagerd-5.21.4.tar.xz"; + sha256 = "0waawpy5pqllj8iacrxpwsnz4m1yy7z8jih63s7psgr22cbvd116"; + name = "kactivitymanagerd-5.21.4.tar.xz"; }; }; kde-cli-tools = { - version = "5.21.3"; + version = "5.21.4"; src = fetchurl { - url = "${mirror}/stable/plasma/5.21.3/kde-cli-tools-5.21.3.tar.xz"; - sha256 = "0hkmr3zxg4np1ppsgj77ijgkwgvl7d0zxwl46xjc2px877lx8bpp"; - name = "kde-cli-tools-5.21.3.tar.xz"; + url = "${mirror}/stable/plasma/5.21.4/kde-cli-tools-5.21.4.tar.xz"; + sha256 = "1hvfb0qg6hxbyih665xwki8gbxjljgbw6x2blh2cikp7df66nhh1"; + name = "kde-cli-tools-5.21.4.tar.xz"; }; }; kdecoration = { - version = "5.21.3"; + version = "5.21.4"; src = fetchurl { - url = "${mirror}/stable/plasma/5.21.3/kdecoration-5.21.3.tar.xz"; - sha256 = "06a3gsf1lyjxccjzn0ad254wsf7x2bln2i6kyk5j4gwqss6lplf5"; - name = "kdecoration-5.21.3.tar.xz"; + url = "${mirror}/stable/plasma/5.21.4/kdecoration-5.21.4.tar.xz"; + sha256 = "003yp803gnsszlnbw1lbh043h8xlrrzg92v7vls8k5cb04ib0p8a"; + name = "kdecoration-5.21.4.tar.xz"; }; }; kde-gtk-config = { - version = "5.21.3"; + version = "5.21.4"; src = fetchurl { - url = "${mirror}/stable/plasma/5.21.3/kde-gtk-config-5.21.3.tar.xz"; - sha256 = "17fyan2jah059kj1i0sy7h901a4d2k7cc87sd84mskyys7g8vs1h"; - name = "kde-gtk-config-5.21.3.tar.xz"; + url = "${mirror}/stable/plasma/5.21.4/kde-gtk-config-5.21.4.tar.xz"; + sha256 = "0g7h1l5q9hdi2iq1kh5aclxjw1ffpq1l020p37k7f251m49440y8"; + name = "kde-gtk-config-5.21.4.tar.xz"; }; }; kdeplasma-addons = { - version = "5.21.3"; + version = "5.21.4"; src = fetchurl { - url = "${mirror}/stable/plasma/5.21.3/kdeplasma-addons-5.21.3.tar.xz"; - sha256 = "1181ax96csn4170p5blvhr679d7l865nby5a66swscyl3a5ys8b1"; - name = "kdeplasma-addons-5.21.3.tar.xz"; + url = "${mirror}/stable/plasma/5.21.4/kdeplasma-addons-5.21.4.tar.xz"; + sha256 = "18jny36w6zf4nfqffaqgmdgp4vcaa2civnd2lrrls8jhlz81grid"; + name = "kdeplasma-addons-5.21.4.tar.xz"; }; }; kgamma5 = { - version = "5.21.3"; + version = "5.21.4"; src = fetchurl { - url = "${mirror}/stable/plasma/5.21.3/kgamma5-5.21.3.tar.xz"; - sha256 = "0h8rwwd6lyfzmxsr5sfvllh1j8gk1pbq1w2fva8q534qrkqhqb49"; - name = "kgamma5-5.21.3.tar.xz"; + url = "${mirror}/stable/plasma/5.21.4/kgamma5-5.21.4.tar.xz"; + sha256 = "1rzn3d7i2i4bba9nfydbsvjqc7wzfz9lgd7qg74k19hzmfiqfhsl"; + name = "kgamma5-5.21.4.tar.xz"; }; }; khotkeys = { - version = "5.21.3"; + version = "5.21.4"; src = fetchurl { - url = "${mirror}/stable/plasma/5.21.3/khotkeys-5.21.3.tar.xz"; - sha256 = "1n3ahrb5mzrxap572ydal1sy5q71af97iy4i2fwbljdb6zb1l1bl"; - name = "khotkeys-5.21.3.tar.xz"; + url = "${mirror}/stable/plasma/5.21.4/khotkeys-5.21.4.tar.xz"; + sha256 = "05k6b8zilll97s14s50x27dk8p4lzmld95gzgrsv4i81jdvjgx53"; + name = "khotkeys-5.21.4.tar.xz"; }; }; kinfocenter = { - version = "5.21.3"; + version = "5.21.4"; src = fetchurl { - url = "${mirror}/stable/plasma/5.21.3/kinfocenter-5.21.3.tar.xz"; - sha256 = "1hj4mnx2mxb1ya7la05frx5c39cp3q7c5f78lnp6p8bkv3ylik72"; - name = "kinfocenter-5.21.3.tar.xz"; + url = "${mirror}/stable/plasma/5.21.4/kinfocenter-5.21.4.tar.xz"; + sha256 = "150kfx4cb10zjsaqkyidh1qis5644849xfqfnd5ldwsn07nkyp1y"; + name = "kinfocenter-5.21.4.tar.xz"; }; }; kmenuedit = { - version = "5.21.3"; + version = "5.21.4"; src = fetchurl { - url = "${mirror}/stable/plasma/5.21.3/kmenuedit-5.21.3.tar.xz"; - sha256 = "0fc3sal11amaj5ydws86hdmc45zhrxkv6lc5sfy200wvff3ynjjj"; - name = "kmenuedit-5.21.3.tar.xz"; + url = "${mirror}/stable/plasma/5.21.4/kmenuedit-5.21.4.tar.xz"; + sha256 = "1hmqji2ahkw3knv7pcj5m86zlmxmbsz98xv2igdx2gv6hrjbn8nh"; + name = "kmenuedit-5.21.4.tar.xz"; }; }; kscreen = { - version = "5.21.3"; + version = "5.21.4"; src = fetchurl { - url = "${mirror}/stable/plasma/5.21.3/kscreen-5.21.3.tar.xz"; - sha256 = "1f9gxdlj883ddmc1xgd1nmm8n6m5yd269kfx3m9bbp61cw4hrqlm"; - name = "kscreen-5.21.3.tar.xz"; + url = "${mirror}/stable/plasma/5.21.4/kscreen-5.21.4.tar.xz"; + sha256 = "1n9ymmysdfipwwi3f6ixg1kh3pkbp5wvi2y8fli0cpjdbrfj5lfr"; + name = "kscreen-5.21.4.tar.xz"; }; }; kscreenlocker = { - version = "5.21.3"; + version = "5.21.4"; src = fetchurl { - url = "${mirror}/stable/plasma/5.21.3/kscreenlocker-5.21.3.tar.xz"; - sha256 = "1hjlpwwca9nrdwgsiy5ss5ainr1fy1wfvi4g599cvijb77qc84h0"; - name = "kscreenlocker-5.21.3.tar.xz"; + url = "${mirror}/stable/plasma/5.21.4/kscreenlocker-5.21.4.tar.xz"; + sha256 = "1z94p93khl2b8zz965d6wdd4vi1q60f0s2a7ca9ph06gp8d574k4"; + name = "kscreenlocker-5.21.4.tar.xz"; }; }; ksshaskpass = { - version = "5.21.3"; + version = "5.21.4"; src = fetchurl { - url = "${mirror}/stable/plasma/5.21.3/ksshaskpass-5.21.3.tar.xz"; - sha256 = "16c2kzdmw3viphaygdff29cvi06r53ag4a6hkxw15yrscw31n3ns"; - name = "ksshaskpass-5.21.3.tar.xz"; + url = "${mirror}/stable/plasma/5.21.4/ksshaskpass-5.21.4.tar.xz"; + sha256 = "0zj4160xs940b9rin43b0a3j6czm3n04drg484y1h2mfqjflgc61"; + name = "ksshaskpass-5.21.4.tar.xz"; }; }; ksysguard = { - version = "5.21.3"; + version = "5.21.4"; src = fetchurl { - url = "${mirror}/stable/plasma/5.21.3/ksysguard-5.21.3.tar.xz"; - sha256 = "0ys1idjqb9n67czdhlds6mhhiizxq8qq4rmds9nq8cm961g5kqsf"; - name = "ksysguard-5.21.3.tar.xz"; + url = "${mirror}/stable/plasma/5.21.4/ksysguard-5.21.4.tar.xz"; + sha256 = "10p5bb80rcawd0qdm4f17whmqrfhzhv6hd20d57f1i9m7ijq456d"; + name = "ksysguard-5.21.4.tar.xz"; }; }; kwallet-pam = { - version = "5.21.3"; + version = "5.21.4"; src = fetchurl { - url = "${mirror}/stable/plasma/5.21.3/kwallet-pam-5.21.3.tar.xz"; - sha256 = "1dnni2k4ry11mfjnfc0i44zww3glhsbr70qnpkl9dsf5rj4dcwj3"; - name = "kwallet-pam-5.21.3.tar.xz"; + url = "${mirror}/stable/plasma/5.21.4/kwallet-pam-5.21.4.tar.xz"; + sha256 = "0s3wy9qikciblr6g98kn6s4ii5pnqwcngzng0czr3r4p90w33kkg"; + name = "kwallet-pam-5.21.4.tar.xz"; }; }; kwayland-integration = { - version = "5.21.3"; + version = "5.21.4"; src = fetchurl { - url = "${mirror}/stable/plasma/5.21.3/kwayland-integration-5.21.3.tar.xz"; - sha256 = "0kqw5dbsxmdm5fi34yq718ngkx5j23211jh4l9vl029qgbi42xhc"; - name = "kwayland-integration-5.21.3.tar.xz"; + url = "${mirror}/stable/plasma/5.21.4/kwayland-integration-5.21.4.tar.xz"; + sha256 = "1r3fmmzmdyfdam4hsjvjv3wss5zvyi674xsyn6csclmq3jwfz70k"; + name = "kwayland-integration-5.21.4.tar.xz"; }; }; kwayland-server = { - version = "5.21.3"; + version = "5.21.4"; src = fetchurl { - url = "${mirror}/stable/plasma/5.21.3/kwayland-server-5.21.3.tar.xz"; - sha256 = "0d3asblzz9c7cbjfdk33z26hn5n14rdrc3s9jm9awvcc1sd122a4"; - name = "kwayland-server-5.21.3.tar.xz"; + url = "${mirror}/stable/plasma/5.21.4/kwayland-server-5.21.4.tar.xz"; + sha256 = "1mkivw3siyxhgyhrm6fkqmp2wiswckrb433q87dh1j9gp7kg8cpz"; + name = "kwayland-server-5.21.4.tar.xz"; }; }; kwin = { - version = "5.21.3"; + version = "5.21.4"; src = fetchurl { - url = "${mirror}/stable/plasma/5.21.3/kwin-5.21.3.tar.xz"; - sha256 = "0ni0ipfm0hp90sq03m1a5lm6shxb2cf9j1a4kiqpaf7n62ch8f3w"; - name = "kwin-5.21.3.tar.xz"; + url = "${mirror}/stable/plasma/5.21.4/kwin-5.21.4.tar.xz"; + sha256 = "0br3hxnbqm2vyxcxind01784zd88bkhpz6ira03g3gjq7hlwzjx9"; + name = "kwin-5.21.4.tar.xz"; }; }; kwrited = { - version = "5.21.3"; + version = "5.21.4"; src = fetchurl { - url = "${mirror}/stable/plasma/5.21.3/kwrited-5.21.3.tar.xz"; - sha256 = "01nn94qmi8q38rdv694d9qs7zahsziclmkw49zy0wlffq4ivpk6x"; - name = "kwrited-5.21.3.tar.xz"; + url = "${mirror}/stable/plasma/5.21.4/kwrited-5.21.4.tar.xz"; + sha256 = "1hrsy1r7b7sgnj0l8zn1yxlrfhrrbk8rq2frbfi329fk3psca247"; + name = "kwrited-5.21.4.tar.xz"; }; }; libkscreen = { - version = "5.21.3"; + version = "5.21.4"; src = fetchurl { - url = "${mirror}/stable/plasma/5.21.3/libkscreen-5.21.3.tar.xz"; - sha256 = "1j2d1xpn48ks0wk9vvnvj9r03bc0ggrqvblyhs30p31svfihjs3a"; - name = "libkscreen-5.21.3.tar.xz"; + url = "${mirror}/stable/plasma/5.21.4/libkscreen-5.21.4.tar.xz"; + sha256 = "0b0mlc1lzfbkpzxs8rd7s7q5xmqla6p1q1jdnjxly3wj60pas2dc"; + name = "libkscreen-5.21.4.tar.xz"; }; }; libksysguard = { - version = "5.21.3.1"; + version = "5.21.4"; src = fetchurl { - url = "${mirror}/stable/plasma/5.21.3/libksysguard-5.21.3.1.tar.xz"; - sha256 = "0nayjihapn71wrnzfb4wv9laafysl0x6sn98sbwhclapbdvxnw73"; - name = "libksysguard-5.21.3.1.tar.xz"; + url = "${mirror}/stable/plasma/5.21.4/libksysguard-5.21.4.tar.xz"; + sha256 = "0sziqldjwcwpblkn7mn4w9xg34lv9pzdlc87andka4g1lxcln2gc"; + name = "libksysguard-5.21.4.tar.xz"; }; }; milou = { - version = "5.21.3"; + version = "5.21.4"; src = fetchurl { - url = "${mirror}/stable/plasma/5.21.3/milou-5.21.3.tar.xz"; - sha256 = "0qbk0y783n7f7pl0akx252vyblrrgmsg5yr7ncaijq4x4l90f1yf"; - name = "milou-5.21.3.tar.xz"; + url = "${mirror}/stable/plasma/5.21.4/milou-5.21.4.tar.xz"; + sha256 = "0y6mvzc5prgg1n7z2gzv1b7ngh0fygggrhdbk5wvpy6zp8yanwka"; + name = "milou-5.21.4.tar.xz"; }; }; oxygen = { - version = "5.21.3"; + version = "5.21.4"; src = fetchurl { - url = "${mirror}/stable/plasma/5.21.3/oxygen-5.21.3.tar.xz"; - sha256 = "16yj1qx4mbi62brkn8wkcr6sz5dkbl2pf49zc1hadnxfm9wd3z0a"; - name = "oxygen-5.21.3.tar.xz"; + url = "${mirror}/stable/plasma/5.21.4/oxygen-5.21.4.tar.xz"; + sha256 = "1d7cdpy3k7zyg3k6n6jz2473cqhbi7npgnpka4kc2lfjrkb9s0zj"; + name = "oxygen-5.21.4.tar.xz"; }; }; plasma-browser-integration = { - version = "5.21.3"; + version = "5.21.4"; src = fetchurl { - url = "${mirror}/stable/plasma/5.21.3/plasma-browser-integration-5.21.3.tar.xz"; - sha256 = "1hz996lv3vvp1zldzpkb9dmvnn94v69j2vq9sfs446c25ggf9d6y"; - name = "plasma-browser-integration-5.21.3.tar.xz"; + url = "${mirror}/stable/plasma/5.21.4/plasma-browser-integration-5.21.4.tar.xz"; + sha256 = "14yna45ykfa88a17iy4c5qkd673ay818693qqn13s4zwkxriby3n"; + name = "plasma-browser-integration-5.21.4.tar.xz"; }; }; plasma-desktop = { - version = "5.21.3"; + version = "5.21.4"; src = fetchurl { - url = "${mirror}/stable/plasma/5.21.3/plasma-desktop-5.21.3.tar.xz"; - sha256 = "0bryk523qfzb5max1h460d67ir6xbrsws9bq72bdfbv1wkv64kyy"; - name = "plasma-desktop-5.21.3.tar.xz"; + url = "${mirror}/stable/plasma/5.21.4/plasma-desktop-5.21.4.tar.xz"; + sha256 = "1drv50601030xvskkw1pa5hi5ngrx2i8lkj7m8i9pym8zy15qqy9"; + name = "plasma-desktop-5.21.4.tar.xz"; }; }; plasma-disks = { - version = "5.21.3"; + version = "5.21.4"; src = fetchurl { - url = "${mirror}/stable/plasma/5.21.3/plasma-disks-5.21.3.tar.xz"; - sha256 = "18a7dppfhb2wpb7sfhnayq96bxjlzygdz7sppcjikxil8klhv1aq"; - name = "plasma-disks-5.21.3.tar.xz"; + url = "${mirror}/stable/plasma/5.21.4/plasma-disks-5.21.4.tar.xz"; + sha256 = "1hjihh088v1w03lpz5pcz6pycbpd8b8kh54a44pq7zkhh6l6n65g"; + name = "plasma-disks-5.21.4.tar.xz"; }; }; plasma-firewall = { - version = "5.21.3"; + version = "5.21.4"; src = fetchurl { - url = "${mirror}/stable/plasma/5.21.3/plasma-firewall-5.21.3.tar.xz"; - sha256 = "0bzmcakzwiimc90bbpih1z5isrcfhdfwlslp4q3v3npppnivv9bw"; - name = "plasma-firewall-5.21.3.tar.xz"; + url = "${mirror}/stable/plasma/5.21.4/plasma-firewall-5.21.4.tar.xz"; + sha256 = "1in9maphksc7ajj6jhy0qxgw5f7fy4m23dpik6wvxc5r3v5b76z7"; + name = "plasma-firewall-5.21.4.tar.xz"; }; }; plasma-integration = { - version = "5.21.3"; + version = "5.21.4"; src = fetchurl { - url = "${mirror}/stable/plasma/5.21.3/plasma-integration-5.21.3.tar.xz"; - sha256 = "09dlbfildd8wl0nbss84yibljyl6cadx95q8q4n0c5wymyc4zqy1"; - name = "plasma-integration-5.21.3.tar.xz"; + url = "${mirror}/stable/plasma/5.21.4/plasma-integration-5.21.4.tar.xz"; + sha256 = "0bj2k5c4170apy7ascfdqc052jm35pi2w5zb3m39qb5b7ylq1hhw"; + name = "plasma-integration-5.21.4.tar.xz"; }; }; plasma-nano = { - version = "5.21.3"; + version = "5.21.4"; src = fetchurl { - url = "${mirror}/stable/plasma/5.21.3/plasma-nano-5.21.3.tar.xz"; - sha256 = "1yqn29769nnfhiyqbpv15c0zxvkfzq4yvk9x9qlchbcwjc1gr23j"; - name = "plasma-nano-5.21.3.tar.xz"; + url = "${mirror}/stable/plasma/5.21.4/plasma-nano-5.21.4.tar.xz"; + sha256 = "0v5vr5di9bk57g2xi442qj8yv9219mdpc0l0n2bsvbb8x4f0d5qk"; + name = "plasma-nano-5.21.4.tar.xz"; }; }; plasma-nm = { - version = "5.21.3"; + version = "5.21.4"; src = fetchurl { - url = "${mirror}/stable/plasma/5.21.3/plasma-nm-5.21.3.tar.xz"; - sha256 = "0d7v757kzd0pcvlz201m0njcz9y8j0bqkwbzdz3gik9s7x6rl73p"; - name = "plasma-nm-5.21.3.tar.xz"; + url = "${mirror}/stable/plasma/5.21.4/plasma-nm-5.21.4.tar.xz"; + sha256 = "1gy1drykjyipmrpqbb7yk2232g5hzy316gkmr45invgfg3fizl73"; + name = "plasma-nm-5.21.4.tar.xz"; }; }; plasma-pa = { - version = "5.21.3"; + version = "5.21.4"; src = fetchurl { - url = "${mirror}/stable/plasma/5.21.3/plasma-pa-5.21.3.tar.xz"; - sha256 = "16z9xzn5swrzz86yd8lykjphs92ghdsahfxjv0v9nj3ca24kfibp"; - name = "plasma-pa-5.21.3.tar.xz"; + url = "${mirror}/stable/plasma/5.21.4/plasma-pa-5.21.4.tar.xz"; + sha256 = "1rcghgqvasldmpianxhn980kc3nw1knmdlmxz52kngnpnimmqmz9"; + name = "plasma-pa-5.21.4.tar.xz"; }; }; plasma-phone-components = { - version = "5.21.3"; + version = "5.21.4"; src = fetchurl { - url = "${mirror}/stable/plasma/5.21.3/plasma-phone-components-5.21.3.tar.xz"; - sha256 = "1dhv0gdyk47dl8il6zwjdz84jmz2d4ppfyifzc2rzf0ys934scn0"; - name = "plasma-phone-components-5.21.3.tar.xz"; + url = "${mirror}/stable/plasma/5.21.4/plasma-phone-components-5.21.4.tar.xz"; + sha256 = "08dpch4c6q59c9ys4n4w1hky09886hi1wqxgwwr4lyp02g3xmwbd"; + name = "plasma-phone-components-5.21.4.tar.xz"; }; }; plasma-sdk = { - version = "5.21.3"; + version = "5.21.4"; src = fetchurl { - url = "${mirror}/stable/plasma/5.21.3/plasma-sdk-5.21.3.tar.xz"; - sha256 = "0asbb7j5b8c4kixw1yf7mdfyd8gjrf57gdb2wfs1npasak0dw84w"; - name = "plasma-sdk-5.21.3.tar.xz"; + url = "${mirror}/stable/plasma/5.21.4/plasma-sdk-5.21.4.tar.xz"; + sha256 = "1cn0lq3d5ipmlwkjzarm7s5ipx6ybjv9cz93pnpxkfxlbi47q0s0"; + name = "plasma-sdk-5.21.4.tar.xz"; }; }; plasma-systemmonitor = { - version = "5.21.3"; + version = "5.21.4"; src = fetchurl { - url = "${mirror}/stable/plasma/5.21.3/plasma-systemmonitor-5.21.3.tar.xz"; - sha256 = "1w1xzqmpzk016f8rkyx6cvm6lng3h177c441hird13n6v147l7ll"; - name = "plasma-systemmonitor-5.21.3.tar.xz"; + url = "${mirror}/stable/plasma/5.21.4/plasma-systemmonitor-5.21.4.tar.xz"; + sha256 = "16mrq66qripffnj4gskzb6l52hqw9siqr8cwxq618cwk5g7hg544"; + name = "plasma-systemmonitor-5.21.4.tar.xz"; }; }; plasma-tests = { - version = "5.21.3"; + version = "5.21.4"; src = fetchurl { - url = "${mirror}/stable/plasma/5.21.3/plasma-tests-5.21.3.tar.xz"; - sha256 = "000iwijpxxicixy5zbbgfs96h988x1d4wvjw90vagjw4hj361dk8"; - name = "plasma-tests-5.21.3.tar.xz"; + url = "${mirror}/stable/plasma/5.21.4/plasma-tests-5.21.4.tar.xz"; + sha256 = "0mxl3laym3wlhqnq7pmjm1g9mm0r306dnsr3yjl5mmhdx3dwb165"; + name = "plasma-tests-5.21.4.tar.xz"; }; }; plasma-thunderbolt = { - version = "5.21.3"; + version = "5.21.4"; src = fetchurl { - url = "${mirror}/stable/plasma/5.21.3/plasma-thunderbolt-5.21.3.tar.xz"; - sha256 = "1j0nb9p5wbgksxy19bxsz9ni9ys40r4arvs8rl8pvvv9hndqhndm"; - name = "plasma-thunderbolt-5.21.3.tar.xz"; + url = "${mirror}/stable/plasma/5.21.4/plasma-thunderbolt-5.21.4.tar.xz"; + sha256 = "10r90hjm1ykigy587kdna6cydbbh9y4h7rbifx2r5rjzkhp9mihd"; + name = "plasma-thunderbolt-5.21.4.tar.xz"; }; }; plasma-vault = { - version = "5.21.3"; + version = "5.21.4"; src = fetchurl { - url = "${mirror}/stable/plasma/5.21.3/plasma-vault-5.21.3.tar.xz"; - sha256 = "1q59q6y8gx4qbp1a5nbsg8zmrdljacfqd3i5n214nlj6al13sg9j"; - name = "plasma-vault-5.21.3.tar.xz"; + url = "${mirror}/stable/plasma/5.21.4/plasma-vault-5.21.4.tar.xz"; + sha256 = "13d4z2g34skhw11wykhwyigdzxpa12pgq01i30km5cyp0idi6xy5"; + name = "plasma-vault-5.21.4.tar.xz"; }; }; plasma-workspace = { - version = "5.21.3"; + version = "5.21.4"; src = fetchurl { - url = "${mirror}/stable/plasma/5.21.3/plasma-workspace-5.21.3.tar.xz"; - sha256 = "1djanxc7mslw9hnbzlngf6pflc6byjzqb14ibilg3fxsir2jwq40"; - name = "plasma-workspace-5.21.3.tar.xz"; + url = "${mirror}/stable/plasma/5.21.4/plasma-workspace-5.21.4.tar.xz"; + sha256 = "1m98ssdq4vzhlqazd87qmgryi3fhmp68y47qw95yhaxnf12ih2xs"; + name = "plasma-workspace-5.21.4.tar.xz"; }; }; plasma-workspace-wallpapers = { - version = "5.21.3"; + version = "5.21.4"; src = fetchurl { - url = "${mirror}/stable/plasma/5.21.3/plasma-workspace-wallpapers-5.21.3.tar.xz"; - sha256 = "1qjkk3qfzz1id898kmx7xx6rr6p77y0jfwkjyf26abk51bdfk9lm"; - name = "plasma-workspace-wallpapers-5.21.3.tar.xz"; + url = "${mirror}/stable/plasma/5.21.4/plasma-workspace-wallpapers-5.21.4.tar.xz"; + sha256 = "1myqz90b1fcmzgq08a15mlikn83iv6hflmdw7985419w7cly81n7"; + name = "plasma-workspace-wallpapers-5.21.4.tar.xz"; }; }; plymouth-kcm = { - version = "5.21.3"; + version = "5.21.4"; src = fetchurl { - url = "${mirror}/stable/plasma/5.21.3/plymouth-kcm-5.21.3.tar.xz"; - sha256 = "0wmpvb06z0js50c9jpv61jlxbx9sf1f5lidzs5v4xs31shxc9sbg"; - name = "plymouth-kcm-5.21.3.tar.xz"; + url = "${mirror}/stable/plasma/5.21.4/plymouth-kcm-5.21.4.tar.xz"; + sha256 = "1d0na5831azka04n3j78582i3hy5ns1hpdw24y558rly16w80z60"; + name = "plymouth-kcm-5.21.4.tar.xz"; }; }; polkit-kde-agent = { - version = "1-5.21.3"; + version = "1-5.21.4"; src = fetchurl { - url = "${mirror}/stable/plasma/5.21.3/polkit-kde-agent-1-5.21.3.tar.xz"; - sha256 = "06qpkf01665mjr49wyc3f336g6g7l93k8l35q0yyih58i3v04s0v"; - name = "polkit-kde-agent-1-5.21.3.tar.xz"; + url = "${mirror}/stable/plasma/5.21.4/polkit-kde-agent-1-5.21.4.tar.xz"; + sha256 = "0lg2ls4fb135p64y3kmkxczrqmqzlzdq4ywsrf58ayi42drghdmj"; + name = "polkit-kde-agent-1-5.21.4.tar.xz"; }; }; powerdevil = { - version = "5.21.3"; + version = "5.21.4"; src = fetchurl { - url = "${mirror}/stable/plasma/5.21.3/powerdevil-5.21.3.tar.xz"; - sha256 = "0lk6bvc0mym3x3sd85bsvsxvm82vr40lcx355xjycxskf75c5jzz"; - name = "powerdevil-5.21.3.tar.xz"; + url = "${mirror}/stable/plasma/5.21.4/powerdevil-5.21.4.tar.xz"; + sha256 = "0i84k7dv8nvww0pfly2d7mplydjgzdkh14sd17113rlwzyfp5wf6"; + name = "powerdevil-5.21.4.tar.xz"; }; }; qqc2-breeze-style = { - version = "5.21.3"; + version = "5.21.4"; src = fetchurl { - url = "${mirror}/stable/plasma/5.21.3/qqc2-breeze-style-5.21.3.tar.xz"; - sha256 = "1ydvirjrkjbwfc2faz74dd9zlmfz18fa3cig143gna9rfr5api54"; - name = "qqc2-breeze-style-5.21.3.tar.xz"; + url = "${mirror}/stable/plasma/5.21.4/qqc2-breeze-style-5.21.4.tar.xz"; + sha256 = "0ny9i75zm0j4m103kazs6lnny8lcmisgl6kmyvjwsnxfl0wfrdww"; + name = "qqc2-breeze-style-5.21.4.tar.xz"; }; }; sddm-kcm = { - version = "5.21.3"; + version = "5.21.4"; src = fetchurl { - url = "${mirror}/stable/plasma/5.21.3/sddm-kcm-5.21.3.tar.xz"; - sha256 = "1flqgfpiz66s7dsw1k95zdrbj7ka09r0i2pcdygnrwlls5yvqljz"; - name = "sddm-kcm-5.21.3.tar.xz"; + url = "${mirror}/stable/plasma/5.21.4/sddm-kcm-5.21.4.tar.xz"; + sha256 = "00940pi4x7is88w6b25f5chqhi97xqvnmn92jzy629p1g8zg75ik"; + name = "sddm-kcm-5.21.4.tar.xz"; }; }; systemsettings = { - version = "5.21.3"; + version = "5.21.4"; src = fetchurl { - url = "${mirror}/stable/plasma/5.21.3/systemsettings-5.21.3.tar.xz"; - sha256 = "08ynlg282x1klgpd43mh3ng4m579iq9hjlln96fqaw19g7x1i58x"; - name = "systemsettings-5.21.3.tar.xz"; + url = "${mirror}/stable/plasma/5.21.4/systemsettings-5.21.4.tar.xz"; + sha256 = "017d42fdb8dn1srni4lvdyvraaflybbcwkdgdl98vwyv9hw0qjq3"; + name = "systemsettings-5.21.4.tar.xz"; }; }; xdg-desktop-portal-kde = { - version = "5.21.3"; + version = "5.21.4"; src = fetchurl { - url = "${mirror}/stable/plasma/5.21.3/xdg-desktop-portal-kde-5.21.3.tar.xz"; - sha256 = "05r1kbw39jmj2gfn42052y779l0k89kxh7xynw07igr7c5mxy4ih"; - name = "xdg-desktop-portal-kde-5.21.3.tar.xz"; + url = "${mirror}/stable/plasma/5.21.4/xdg-desktop-portal-kde-5.21.4.tar.xz"; + sha256 = "01klvbvivw2zd478vj7bq0dn7l5mwsrqhnkj8hd5vc9xcaq6kgzg"; + name = "xdg-desktop-portal-kde-5.21.4.tar.xz"; }; }; } From 2534314225ee8bf23717da6ec84d79c1c880aeec Mon Sep 17 00:00:00 2001 From: Peter Hoeg Date: Fri, 16 Apr 2021 16:41:23 +0800 Subject: [PATCH 040/263] plasma-wayland-protocols: 1.1.1 -> 1.2.1 --- .../libraries/plasma-wayland-protocols/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/development/libraries/plasma-wayland-protocols/default.nix b/pkgs/development/libraries/plasma-wayland-protocols/default.nix index 2d3a5239d7b..ea02eb428db 100644 --- a/pkgs/development/libraries/plasma-wayland-protocols/default.nix +++ b/pkgs/development/libraries/plasma-wayland-protocols/default.nix @@ -5,11 +5,11 @@ mkDerivation rec { pname = "plasma-wayland-protocols"; - version = "1.1.1"; + version = "1.2.1"; src = fetchurl { - url = "mirror://kde/stable/${pname}/${version}/${pname}-${version}.tar.xz"; - sha256 = "sha256-xUkzg9EVFxw0NeqaIbOWaGBjKoRFRP+sj1SJBDalHTg="; + url = "mirror://kde/stable/${pname}/${pname}-v${version}.tar.xz"; + sha256 = "sha256-KHuQkD+afzlMdedcsYdCaGLq9kqS8b5+LvaOmf2Muqo="; }; nativeBuildInputs = [ extra-cmake-modules ]; From e432e78d1cbe08a00ff1c2ea4dc05cedcc842627 Mon Sep 17 00:00:00 2001 From: Pierre Bourdon Date: Sat, 17 Apr 2021 14:33:00 +0200 Subject: [PATCH 041/263] glib: fix docs cross compilation (again) Do not depend on host gtk-doc when cross compiling (we do not use it there), and document why we need a host gtk-doc in the first place. --- pkgs/development/libraries/glib/default.nix | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/pkgs/development/libraries/glib/default.nix b/pkgs/development/libraries/glib/default.nix index ce64bef95ad..fccd6ddb041 100644 --- a/pkgs/development/libraries/glib/default.nix +++ b/pkgs/development/libraries/glib/default.nix @@ -92,13 +92,23 @@ stdenv.mkDerivation rec { buildInputs = [ libelf setupHook pcre bash gnum4 # install glib-gettextize and m4 macros for other apps to use - gtk-doc ] ++ optionals stdenv.isLinux [ libselinux util-linuxMinimal # for libmount ] ++ optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [ AppKit Carbon Cocoa CoreFoundation CoreServices Foundation - ]); + ]) ++ optionals (stdenv.hostPlatform == stdenv.buildPlatform) [ + # Note: this needs to be both in buildInputs and nativeBuildInputs. The + # Meson gtkdoc module uses find_program to look it up (-> build dep), but + # glib's own Meson configuration uses the host pkg-config to find its + # version (-> host dep). We could technically go and fix this in glib, add + # pkg-config to depsBuildBuild, but this would be a futile exercise since + # Meson's gtkdoc integration does not support cross compilation[1] anyway + # and this derivation disables the docs build when cross compiling. + # + # [1] https://github.com/mesonbuild/meson/issues/2003 + gtk-doc + ]; strictDeps = true; From be4eb91b3c53d985255216a7bc924ced88699135 Mon Sep 17 00:00:00 2001 From: sternenseemann <0rpkxez4ksa01gb3typccl0i@systemli.org> Date: Thu, 15 Apr 2021 11:47:39 +0200 Subject: [PATCH 042/263] llvmPackages_7.libunwind: init at 7.1.0 --- pkgs/development/compilers/llvm/7/default.nix | 6 ++++ .../compilers/llvm/7/libunwind/default.nix | 33 +++++++++++++++++++ 2 files changed, 39 insertions(+) create mode 100644 pkgs/development/compilers/llvm/7/libunwind/default.nix diff --git a/pkgs/development/compilers/llvm/7/default.nix b/pkgs/development/compilers/llvm/7/default.nix index 2170177117e..5ae5f9ecb20 100644 --- a/pkgs/development/compilers/llvm/7/default.nix +++ b/pkgs/development/compilers/llvm/7/default.nix @@ -181,6 +181,12 @@ let libunwind = libraries.libunwind; })); + libunwind = callPackage ./libunwind ({ + inherit (buildLlvmTools) llvm; + } // lib.optionalAttrs (stdenv.hostPlatform.useLLVM or false) { + stdenv = overrideCC stdenv buildLlvmTools.lldClangNoLibcxx; + }); + openmp = callPackage ./openmp.nix {}; }); diff --git a/pkgs/development/compilers/llvm/7/libunwind/default.nix b/pkgs/development/compilers/llvm/7/libunwind/default.nix new file mode 100644 index 00000000000..8fb6e2c7b6d --- /dev/null +++ b/pkgs/development/compilers/llvm/7/libunwind/default.nix @@ -0,0 +1,33 @@ +{ lib, stdenv, version, fetch, fetchpatch, cmake, llvm, libcxx +, enableShared ? !stdenv.hostPlatform.isStatic +}: + +stdenv.mkDerivation { + pname = "libunwind"; + inherit version; + + src = fetch "libunwind" "035dsxs10nyiqd00q07yycvmkjl01yz4jdlrjvmch8klxg4pyjhp"; + + patches = lib.optional (stdenv.hostPlatform.useLLVM or false) [ + # removes use of `new` that require libc++ + (fetchpatch { + url = "https://github.com/llvm-mirror/libunwind/commit/34a45c630d4c79af403661d267db42fbe7de1178.patch"; + sha256 = "0n0pv6jvcky8pn3srhrf9x5kbnd0d2kia9xlx2g590f5q0bgwfhv"; + }) + # cleans up remaining libc++ dependencies (mostly header inclusions) + (fetchpatch { + url = "https://github.com/llvm-mirror/libunwind/commit/e050272d2eb57eb4e56a37b429a61df2ebb8aa3e.patch"; + sha256 = "170mwmj0wf40iyk1kzdpaiy36rz9n8dpl881h4h7s5da0rh51xya"; + includes = [ "src/libunwind.cpp" "src/UnwindCursor.hpp" ]; + }) + ]; + + nativeBuildInputs = [ cmake llvm ]; + + cmakeFlags = lib.optionals (!enableShared) [ + "-DLIBUNWIND_ENABLE_SHARED=OFF" + ] ++ lib.optionals (stdenv.hostPlatform.useLLVM or false) [ + "-DLIBUNWIND_HAS_NOSTDINCXX_FLAG=ON" + "-DLLVM_ENABLE_LIBCXX=ON" + ]; +} From 486e12ad685be4c0dc5e3033bc1c69f0146b0a99 Mon Sep 17 00:00:00 2001 From: sternenseemann <0rpkxez4ksa01gb3typccl0i@systemli.org> Date: Thu, 15 Apr 2021 00:42:15 +0200 Subject: [PATCH 043/263] llvmPackages_7.libcxxabi: take libunwind as an optional dependency again This reverts commit 76b54c75b3bc7a17ffaa20a862246f1d7fe89b58 and brings llvmPackages_7.libcxxabi in line with what the other llvmPackages sets are doing again (with llvmPackages_7 being the sole outlier). This also fixes an evaluation error of llvmPackages_7.libcxxabi if stdenv.hostPlatform.useLLVM is true as the nonexistant libunwind argument would be overridden. --- .../compilers/llvm/7/libc++abi/default.nix | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/pkgs/development/compilers/llvm/7/libc++abi/default.nix b/pkgs/development/compilers/llvm/7/libc++abi/default.nix index 84c47865141..9f9606f586c 100644 --- a/pkgs/development/compilers/llvm/7/libc++abi/default.nix +++ b/pkgs/development/compilers/llvm/7/libc++abi/default.nix @@ -1,5 +1,5 @@ -{ lib, stdenv, cmake, fetch, libcxx, llvm, version -, standalone ? false +{ lib, stdenv, cmake, fetch, libcxx, libunwind, llvm, version +, standalone ? stdenv.hostPlatform.useLLVM or false # on musl the shared objects don't build , enableShared ? !stdenv.hostPlatform.isStatic }: @@ -11,6 +11,7 @@ stdenv.mkDerivation { src = fetch "libcxxabi" "1zcqxsdjhawgz1cvpk07y3jl6fg9p3ay4nl69zsirqb2ghgyhhb2"; nativeBuildInputs = [ cmake ]; + buildInputs = lib.optional (!stdenv.isDarwin && !stdenv.isFreeBSD && !stdenv.hostPlatform.isWasm) libunwind; postUnpack = '' unpackFile ${libcxx.src} @@ -22,9 +23,10 @@ stdenv.mkDerivation { patch -p1 -d $(ls -d libcxx-*) -i ${../../libcxx-0001-musl-hacks.patch} ''; - cmakeFlags = - lib.optional standalone "-DLLVM_ENABLE_LIBCXX=ON" ++ - lib.optional (!enableShared) "-DLIBCXXABI_ENABLE_SHARED=OFF"; + cmakeFlags = lib.optionals standalone [ + "-DLLVM_ENABLE_LIBCXX=ON" + "-DLIBCXXABI_USE_LLVM_UNWINDER=ON" + ] ++ lib.optional (!enableShared) "-DLIBCXXABI_ENABLE_SHARED=OFF"; installPhase = if stdenv.isDarwin then '' From 55a476b00bac9c5e3d2164b1e9c62f67df3b4a63 Mon Sep 17 00:00:00 2001 From: sternenseemann <0rpkxez4ksa01gb3typccl0i@systemli.org> Date: Sat, 17 Apr 2021 16:59:35 +0200 Subject: [PATCH 044/263] llvmPackages_7.libcxx: make sure to use compiler-rt if useLLVM This reflects what the other llvmPackages sets are doing. --- pkgs/development/compilers/llvm/7/libc++/default.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkgs/development/compilers/llvm/7/libc++/default.nix b/pkgs/development/compilers/llvm/7/libc++/default.nix index fb50c4e24d7..37f90fae5e4 100644 --- a/pkgs/development/compilers/llvm/7/libc++/default.nix +++ b/pkgs/development/compilers/llvm/7/libc++/default.nix @@ -37,7 +37,8 @@ stdenv.mkDerivation { "-DLIBCXX_LIBCPPABI_VERSION=2" "-DLIBCXX_CXX_ABI=libcxxabi" ] ++ lib.optional stdenv.hostPlatform.isMusl "-DLIBCXX_HAS_MUSL_LIBC=1" - ++ lib.optional (!enableShared) "-DLIBCXX_ENABLE_SHARED=OFF" ; + ++ lib.optional (stdenv.hostPlatform.useLLVM or false) "-DLIBCXX_USE_COMPILER_RT=ON" + ++ lib.optional (!enableShared) "-DLIBCXX_ENABLE_SHARED=OFF" ; passthru = { isLLVM = true; From 49ff6509a2cf45b271cadfc4025e6bea5efd7ee2 Mon Sep 17 00:00:00 2001 From: sternenseemann <0rpkxez4ksa01gb3typccl0i@systemli.org> Date: Sat, 17 Apr 2021 17:44:15 +0200 Subject: [PATCH 045/263] llvmPackages_7.clang: backport patch introducing --unwindlib flag MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This flag was introduced for clang 9, but we use it in the `lldClang` wrapper for `llvmPackages` 7, 8 and 9. For this purpose the patch was backported for `llvmPackages_8.clang`, but not for `llvmPackages_7.clang` which has been done in this commit. `lldClang` is mostly used when cross compiling and `stdenv.hostPlatform.useLLVM` is true. Most likely this problem wasn't noticed since `useLLVM` with `llvmPackages_7` was broken for other reasons as well and all cross targets (like `wasi32`) which have `useLLVM` at the moment use `llvmPackages_8`. With this change tests.cross.llvm.hello.{musl64, …} works again. --- .../compilers/llvm/7/clang/default.nix | 3 + .../compilers/llvm/7/clang/unwindlib.patch | 227 ++++++++++++++++++ 2 files changed, 230 insertions(+) create mode 100644 pkgs/development/compilers/llvm/7/clang/unwindlib.patch diff --git a/pkgs/development/compilers/llvm/7/clang/default.nix b/pkgs/development/compilers/llvm/7/clang/default.nix index 4ab13441e36..a4d43d9d7f4 100644 --- a/pkgs/development/compilers/llvm/7/clang/default.nix +++ b/pkgs/development/compilers/llvm/7/clang/default.nix @@ -43,6 +43,9 @@ let ./purity.patch # make clang -xhip use $PATH to find executables ./HIP-use-PATH-7.patch + # Backport for the `--unwindlib=[libgcc|compiler-rt]` flag, which is + # needed for our bootstrapping to not interfere with C. + ./unwindlib.patch ]; postPatch = '' diff --git a/pkgs/development/compilers/llvm/7/clang/unwindlib.patch b/pkgs/development/compilers/llvm/7/clang/unwindlib.patch new file mode 100644 index 00000000000..59a092d7c70 --- /dev/null +++ b/pkgs/development/compilers/llvm/7/clang/unwindlib.patch @@ -0,0 +1,227 @@ +commit a5cacb5ba7f1f18e7bb6f6709e42683eeb7e6470 +Author: Sterling Augustine +Date: Tue Mar 19 20:01:59 2019 +0000 + + Add --unwindlib=[libgcc|compiler-rt] to parallel --rtlib= [take 2] + + "clang++ hello.cc --rtlib=compiler-rt" + + now can works without specifying additional unwind or exception + handling libraries. + + This reworked version of the feature no longer modifies today's default + unwind library for compiler-rt: which is nothing. Rather, a user + can specify -DCLANG_DEFAULT_UNWINDLIB=libunwind when configuring + the compiler. + + This should address the issues from the previous version. + + Update tests for new --unwindlib semantics. + + Differential Revision: https://reviews.llvm.org/D59109 + + llvm-svn: 356508 + +diff --git clang/CMakeLists.txt clang/CMakeLists.txt +index 52b881939499..2c3fb62f6e73 100644 +--- clang/CMakeLists.txt ++++ clang/CMakeLists.txt +@@ -244,6 +244,24 @@ if (NOT(CLANG_DEFAULT_RTLIB STREQUAL "" OR + "Default runtime library to use (\"libgcc\" or \"compiler-rt\", empty for platform default)" FORCE) + endif() + ++set(CLANG_DEFAULT_UNWINDLIB "" CACHE STRING ++ "Default unwind library to use (\"none\" \"libgcc\" or \"libunwind\", empty to match runtime library.)") ++if (CLANG_DEFAULT_UNWINDLIB STREQUAL "") ++ if (CLANG_DEFAULT_RTLIB STREQUAL "libgcc") ++ set (CLANG_DEFAULT_UNWINDLIB "libgcc" CACHE STRING "" FORCE) ++ elseif (CLANG_DEFAULT_RTLIBS STREQUAL "libunwind") ++ set (CLANG_DEFAULT_UNWINDLIB "none" CACHE STRING "" FORCE) ++ endif() ++endif() ++ ++if (NOT(CLANG_DEFAULT_UNWINDLIB STREQUAL "none" OR ++ CLANG_DEFAULT_UNWINDLIB STREQUAL "libgcc" OR ++ CLANG_DEFAULT_UNWINDLIB STREQUAL "libunwind")) ++ message(WARNING "Resetting default unwindlib to use platform default") ++ set(CLANG_DEFAULT_UNWINDLIB "" CACHE STRING ++ "Default unwind library to use (\"none\" \"libgcc\" or \"libunwind\", empty for none)" FORCE) ++endif() ++ + set(CLANG_DEFAULT_OBJCOPY "objcopy" CACHE STRING + "Default objcopy executable to use.") + +diff --git clang/include/clang/Basic/DiagnosticDriverKinds.td clang/include/clang/Basic/DiagnosticDriverKinds.td +index 7f75f45c6578..7e1bb33b5cef 100644 +--- clang/include/clang/Basic/DiagnosticDriverKinds.td ++++ clang/include/clang/Basic/DiagnosticDriverKinds.td +@@ -52,6 +52,10 @@ def err_drv_invalid_rtlib_name : Error< + "invalid runtime library name in argument '%0'">; + def err_drv_unsupported_rtlib_for_platform : Error< + "unsupported runtime library '%0' for platform '%1'">; ++def err_drv_invalid_unwindlib_name : Error< ++ "invalid unwind library name in argument '%0'">; ++def err_drv_incompatible_unwindlib : Error< ++ "--rtlib=libgcc requires --unwindlib=libgcc">; + def err_drv_invalid_stdlib_name : Error< + "invalid library name in argument '%0'">; + def err_drv_invalid_output_with_multiple_archs : Error< +diff --git clang/include/clang/Config/config.h.cmake clang/include/clang/Config/config.h.cmake +index 1d624450b9d9..2d4cb747e87e 100644 +--- clang/include/clang/Config/config.h.cmake ++++ clang/include/clang/Config/config.h.cmake +@@ -23,6 +23,9 @@ + /* Default runtime library to use. */ + #define CLANG_DEFAULT_RTLIB "${CLANG_DEFAULT_RTLIB}" + ++/* Default unwind library to use. */ ++#define CLANG_DEFAULT_UNWINDLIB "${CLANG_DEFAULT_UNWINDLIB}" ++ + /* Default objcopy to use */ + #define CLANG_DEFAULT_OBJCOPY "${CLANG_DEFAULT_OBJCOPY}" + +diff --git clang/include/clang/Driver/Options.td clang/include/clang/Driver/Options.td +index 601aa8744967..0e74a2d36dea 100644 +--- clang/include/clang/Driver/Options.td ++++ clang/include/clang/Driver/Options.td +@@ -2428,6 +2428,8 @@ def std_EQ : Joined<["-", "--"], "std=">, Flags<[CC1Option]>, + }]>; + def stdlib_EQ : Joined<["-", "--"], "stdlib=">, Flags<[CC1Option]>, + HelpText<"C++ standard library to use">, Values<"libc++,libstdc++,platform">; ++def unwindlib_EQ : Joined<["-", "--"], "unwindlib=">, Flags<[CC1Option]>, ++ HelpText<"Unwind library to use">, Values<"libgcc,unwindlib,platform">; + def sub__library : JoinedOrSeparate<["-"], "sub_library">; + def sub__umbrella : JoinedOrSeparate<["-"], "sub_umbrella">; + def system_header_prefix : Joined<["--"], "system-header-prefix=">, +diff --git clang/include/clang/Driver/ToolChain.h clang/include/clang/Driver/ToolChain.h +index 2f9c2c190e32..d5b131bcf112 100644 +--- clang/include/clang/Driver/ToolChain.h ++++ clang/include/clang/Driver/ToolChain.h +@@ -99,6 +99,12 @@ public: + RLT_Libgcc + }; + ++ enum UnwindLibType { ++ UNW_None, ++ UNW_CompilerRT, ++ UNW_Libgcc ++ }; ++ + enum RTTIMode { + RM_Enabled, + RM_Disabled, +@@ -352,6 +358,10 @@ public: + return ToolChain::CST_Libstdcxx; + } + ++ virtual UnwindLibType GetDefaultUnwindLibType() const { ++ return ToolChain::UNW_None; ++ } ++ + virtual std::string getCompilerRTPath() const; + + virtual std::string getCompilerRT(const llvm::opt::ArgList &Args, +@@ -484,6 +494,10 @@ public: + // given compilation arguments. + virtual CXXStdlibType GetCXXStdlibType(const llvm::opt::ArgList &Args) const; + ++ // GetUnwindLibType - Determine the unwind library type to use with the ++ // given compilation arguments. ++ virtual UnwindLibType GetUnwindLibType(const llvm::opt::ArgList &Args) const; ++ + /// AddClangCXXStdlibIncludeArgs - Add the clang -cc1 level arguments to set + /// the include paths to use for the given C++ standard library type. + virtual void +diff --git clang/lib/Driver/ToolChain.cpp clang/lib/Driver/ToolChain.cpp +index cf3db34688df..d980dd5d23fb 100644 +--- clang/lib/Driver/ToolChain.cpp ++++ clang/lib/Driver/ToolChain.cpp +@@ -665,6 +665,33 @@ ToolChain::RuntimeLibType ToolChain::GetRuntimeLibType( + return GetDefaultRuntimeLibType(); + } + ++ToolChain::UnwindLibType ToolChain::GetUnwindLibType( ++ const ArgList &Args) const { ++ const Arg *A = Args.getLastArg(options::OPT_unwindlib_EQ); ++ StringRef LibName = A ? A->getValue() : CLANG_DEFAULT_UNWINDLIB; ++ ++ if (LibName == "none") ++ return ToolChain::UNW_None; ++ else if (LibName == "platform" || LibName == "") { ++ ToolChain::RuntimeLibType RtLibType = GetRuntimeLibType(Args); ++ if (RtLibType == ToolChain::RLT_CompilerRT) ++ return ToolChain::UNW_None; ++ else if (RtLibType == ToolChain::RLT_Libgcc) ++ return ToolChain::UNW_Libgcc; ++ } else if (LibName == "libunwind") { ++ if (GetRuntimeLibType(Args) == RLT_Libgcc) ++ getDriver().Diag(diag::err_drv_incompatible_unwindlib); ++ return ToolChain::UNW_CompilerRT; ++ } else if (LibName == "libgcc") ++ return ToolChain::UNW_Libgcc; ++ ++ if (A) ++ getDriver().Diag(diag::err_drv_invalid_unwindlib_name) ++ << A->getAsString(Args); ++ ++ return GetDefaultUnwindLibType(); ++} ++ + ToolChain::CXXStdlibType ToolChain::GetCXXStdlibType(const ArgList &Args) const{ + const Arg *A = Args.getLastArg(options::OPT_stdlib_EQ); + StringRef LibName = A ? A->getValue() : CLANG_DEFAULT_CXX_STDLIB; +diff --git clang/test/Driver/compiler-rt-unwind.c clang/test/Driver/compiler-rt-unwind.c +new file mode 100644 +index 000000000000..00024dfa7ed3 +--- /dev/null ++++ clang/test/Driver/compiler-rt-unwind.c +@@ -0,0 +1,49 @@ ++// General tests that the driver handles combinations of --rtlib=XXX and ++// --unwindlib=XXX properly. ++// ++// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ ++// RUN: --target=x86_64-unknown-linux \ ++// RUN: --gcc-toolchain="" \ ++// RUN: | FileCheck --check-prefix=RTLIB-EMPTY %s ++// RTLIB-EMPTY: "{{.*}}lgcc" ++// RTLIB-EMPTY: "{{.*}}-lgcc_s" ++// ++// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ ++// RUN: --target=x86_64-unknown-linux -rtlib=libgcc \ ++// RUN: --gcc-toolchain="" \ ++// RUN: | FileCheck --check-prefix=RTLIB-GCC %s ++// RTLIB-GCC: "{{.*}}lgcc" ++// RTLIB-GCC: "{{.*}}lgcc_s" ++// ++// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ ++// RUN: --target=x86_64-unknown-linux -rtlib=libgcc --unwindlib=libunwind \ ++// RUN: --gcc-toolchain="" \ ++// RUN: | FileCheck --check-prefix=RTLIB-GCC-UNWINDLIB-COMPILER-RT %s ++// RTLIB-GCC-UNWINDLIB-COMPILER-RT: "{{.*}}lgcc" ++// RTLIB-GCC-UNWINDLIB-COMPILER-RT: "{{.*}}lunwind" ++// ++// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ ++// RUN: --target=x86_64-unknown-linux -rtlib=compiler-rt \ ++// RUN: --gcc-toolchain="" \ ++// RUN: | FileCheck --check-prefix=RTLIB-COMPILER-RT %s ++// RTLIB-COMPILER-RT: "{{.*}}libclang_rt.builtins-x86_64.a" ++// ++// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ ++// RUN: --target=x86_64-unknown-linux -rtlib=compiler-rt --unwindlib=libgcc \ ++// RUN: --gcc-toolchain="" \ ++// RUN: | FileCheck --check-prefix=RTLIB-COMPILER-RT-UNWINDLIB-GCC %s ++// RTLIB-COMPILER-RT-UNWINDLIB-GCC: "{{.*}}libclang_rt.builtins-x86_64.a" ++// RTLIB-COMPILER-RT-UNWINDLIB-GCC: "{{.*}}lgcc_s" ++// ++// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ ++// RUN: --target=x86_64-unknown-linux -rtlib=compiler-rt --unwindlib=libgcc \ ++// RUN: -static --gcc-toolchain="" \ ++// RUN: | FileCheck --check-prefix=RTLIB-COMPILER-RT-UNWINDLIB-GCC-STATIC %s ++// RTLIB-COMPILER-RT-UNWINDLIB-GCC-STATIC: "{{.*}}libclang_rt.builtins-x86_64.a" ++// RTLIB-COMPILER-RT-UNWINDLIB-GCC-STATIC: "{{.*}}lgcc_eh" ++// ++// RUN: not %clang -no-canonical-prefixes %s -o %t.o 2> %t.err \ ++// RUN: --target=x86_64-unknown-linux -rtlib=libgcc --unwindlib=libunwind \ ++// RUN: --gcc-toolchain="" \ ++// RUN: FileCheck --input-file=%t.err --check-prefix=RTLIB-GCC-UNWINDLIB-COMPILER_RT %s ++// RTLIB-GCC-UNWINDLIB-COMPILER_RT: "{{[.|\\\n]*}}--rtlib=libgcc requires --unwindlib=libgcc" From 3af7e984705fe4633767eceab97ae6f00890060f Mon Sep 17 00:00:00 2001 From: John Ericson Date: Sun, 18 Apr 2021 00:18:13 -0400 Subject: [PATCH 046/263] llvmPackages_7.libcxxabi: Fix Darwin bootstrap In 486e12ad685be4c0dc5e3033bc1c69f0146b0a99 cmake flags were added matching later compilers use of libunwind for `useLLVM = true`. Unfortunately, `useLLVM` on Darwin was not something tested before, and so the other compilers led us astray: one of the new flags tried to make libunwind be used when it wasn't a dep. This is now fixed with more conditional code, but I hope things can perhaps be made simpler with more insight into why libunwind is skipped. Perhaps it is included in libSystem? Finally, I moved the definition of `cmakeFlags` to match the order in the other llvm versions. CC @sternenseemann and @thefloweringash --- .../compilers/llvm/7/libc++abi/default.nix | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/pkgs/development/compilers/llvm/7/libc++abi/default.nix b/pkgs/development/compilers/llvm/7/libc++abi/default.nix index 9f9606f586c..4f29ca0d6e2 100644 --- a/pkgs/development/compilers/llvm/7/libc++abi/default.nix +++ b/pkgs/development/compilers/llvm/7/libc++abi/default.nix @@ -1,5 +1,6 @@ { lib, stdenv, cmake, fetch, libcxx, libunwind, llvm, version , standalone ? stdenv.hostPlatform.useLLVM or false +, withLibunwind ? !stdenv.isDarwin && !stdenv.isFreeBSD && !stdenv.hostPlatform.isWasm # on musl the shared objects don't build , enableShared ? !stdenv.hostPlatform.isStatic }: @@ -11,7 +12,13 @@ stdenv.mkDerivation { src = fetch "libcxxabi" "1zcqxsdjhawgz1cvpk07y3jl6fg9p3ay4nl69zsirqb2ghgyhhb2"; nativeBuildInputs = [ cmake ]; - buildInputs = lib.optional (!stdenv.isDarwin && !stdenv.isFreeBSD && !stdenv.hostPlatform.isWasm) libunwind; + buildInputs = lib.optional withLibunwind libunwind; + + cmakeFlags = lib.optionals standalone [ + "-DLLVM_ENABLE_LIBCXX=ON" + ] ++ lib.optionals (standalone && withLibunwind) [ + "-DLIBCXXABI_USE_LLVM_UNWINDER=ON" + ] ++ lib.optional (!enableShared) "-DLIBCXXABI_ENABLE_SHARED=OFF"; postUnpack = '' unpackFile ${libcxx.src} @@ -23,11 +30,6 @@ stdenv.mkDerivation { patch -p1 -d $(ls -d libcxx-*) -i ${../../libcxx-0001-musl-hacks.patch} ''; - cmakeFlags = lib.optionals standalone [ - "-DLLVM_ENABLE_LIBCXX=ON" - "-DLIBCXXABI_USE_LLVM_UNWINDER=ON" - ] ++ lib.optional (!enableShared) "-DLIBCXXABI_ENABLE_SHARED=OFF"; - installPhase = if stdenv.isDarwin then '' for file in lib/*.dylib; do From b90cd11c48d2c22bf7d60b1fe12cdb0040bf2823 Mon Sep 17 00:00:00 2001 From: sternenseemann <0rpkxez4ksa01gb3typccl0i@systemli.org> Date: Fri, 16 Apr 2021 10:33:28 +0200 Subject: [PATCH 047/263] glibc: always compile with a gcc stdenv Our glibc doesn't compile with clang and useLLVM doesn't make the stdenv implicitly switch to musl (and arguably shouldn't do that). To make LLVM cross compilation without patching glibc to compile with clang (which is probably a lot of work), always compile glibc with gcc. This should unbreak a lot of cross compilation tests, I have tested: * tests.cross.llvm.gnu64 * tests.cross.llvm.aarch64-multiplatform Basing against staging because this change only really makes sense if useLLVM works with llvmPackages_7 which is only the case in staging at the moment. --- pkgs/top-level/all-packages.nix | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 8a5bb51863e..30fd9cd4828 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -10257,10 +10257,12 @@ in stripped = false; })); - crossLibcStdenv = overrideCC stdenv - (if stdenv.hostPlatform.useLLVM or false - then buildPackages.llvmPackages_8.lldClangNoLibc - else buildPackages.gccCrossStageStatic); + gccCrossLibcStdenv = overrideCC stdenv buildPackages.gccCrossStageStatic; + + crossLibcStdenv = + if stdenv.hostPlatform.useLLVM or false + then overrideCC stdenv buildPackages.llvmPackages_8.lldClangNoLibc + else gccCrossLibcStdenv; # The GCC used to build libc for the target platform. Normal gccs will be # built with, and use, that cross-compiled libc. @@ -14463,7 +14465,9 @@ in inherit (darwin.apple_sdk.frameworks) Cocoa Kernel; }; - glibc = callPackage ../development/libraries/glibc { }; + glibc = callPackage ../development/libraries/glibc { + stdenv = gccStdenv; # doesn't compile without gcc + }; # Provided by libc on Operating Systems that use the Extensible Linker Format. elf-header = @@ -14479,7 +14483,7 @@ in # Being redundant to avoid cycles on boot. TODO: find a better way glibcCross = callPackage ../development/libraries/glibc { - stdenv = crossLibcStdenv; + stdenv = gccCrossLibcStdenv; # doesn't compile without gcc }; muslCross = musl.override { From 529b5394941305e39b3b3bb116d4928e3421ac4a Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Sun, 18 Apr 2021 10:50:14 +0000 Subject: [PATCH 048/263] netbsd.mkDerivation: popd in moveUsrDir Permanently changing the directory here was breaking the kernel build, which needs to do other things after moveUsrDir. --- pkgs/os-specific/bsd/netbsd/builder.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkgs/os-specific/bsd/netbsd/builder.sh b/pkgs/os-specific/bsd/netbsd/builder.sh index 925001567f7..332e5c2098f 100644 --- a/pkgs/os-specific/bsd/netbsd/builder.sh +++ b/pkgs/os-specific/bsd/netbsd/builder.sh @@ -105,9 +105,10 @@ moveUsrDir() { if [ -d $prefix ]; then # Remove lingering /usr references if [ -d $prefix/usr ]; then - cd $prefix/usr + pushd $prefix/usr find . -type d -exec mkdir -p $out/\{} \; find . \( -type f -o -type l \) -exec mv \{} $out/\{} \; + popd fi find $prefix -type d -empty -delete From 05e8b0de1a94d47ef073ae791f7494bd0b3fc5e5 Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Sun, 18 Apr 2021 10:47:35 +0000 Subject: [PATCH 049/263] netbsd.uuencode: init at 8.0 Required to build the NetBSD kernel. --- pkgs/os-specific/bsd/netbsd/default.nix | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pkgs/os-specific/bsd/netbsd/default.nix b/pkgs/os-specific/bsd/netbsd/default.nix index 4e4d5bb1b7f..7576d4a75cb 100644 --- a/pkgs/os-specific/bsd/netbsd/default.nix +++ b/pkgs/os-specific/bsd/netbsd/default.nix @@ -379,6 +379,13 @@ let (fetchNetBSD "tools/Makefile.host" "8.0" "1p23dsc4qrv93vc6gzid9w2479jwswry9qfn88505s0pdd7h6nvp") ]; }; + + uudecode = mkDerivation { + path = "usr.bin/uudecode"; + version = "8.0"; + sha256 = "00a3zmh15pg4vx6hz0kaa5mi8d2b1sj4h512d7p6wbvxq6mznwcn"; + NIX_CFLAGS_COMPILE = lib.optional stdenv.isLinux "-DNO_BASE64"; + }; ## ## END COMMAND LINE TOOLS ## From 8603012521b9ef7e758580de25e5e70ae650b045 Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Sun, 18 Apr 2021 11:44:47 +0000 Subject: [PATCH 050/263] netbsd.sys: add missing uudecode dependency --- pkgs/os-specific/bsd/netbsd/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/os-specific/bsd/netbsd/default.nix b/pkgs/os-specific/bsd/netbsd/default.nix index 7576d4a75cb..7688f7db5da 100644 --- a/pkgs/os-specific/bsd/netbsd/default.nix +++ b/pkgs/os-specific/bsd/netbsd/default.nix @@ -417,6 +417,7 @@ let version = "8.0"; sha256 = "123ilg8fqmp69bw6bs6nh98fpi1v2n9lamrzar61p27ji6sj7g0w"; propagatedBuildInputs = [ include ]; + nativeBuildInputs = [ makeMinimal install tsort lorder statHook uudecode ]; #meta.platforms = lib.platforms.netbsd; extraPaths = [ common.src ]; MKKMOD = "no"; From f7e988de8c2adb81c4b76305a79343273899aaff Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Sun, 18 Apr 2021 11:46:28 +0000 Subject: [PATCH 051/263] netbsd.sys: set FIRMWAREDIR Otherwise, would try to install firmware to /libdata/firmware. --- pkgs/os-specific/bsd/netbsd/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/os-specific/bsd/netbsd/default.nix b/pkgs/os-specific/bsd/netbsd/default.nix index 7688f7db5da..fae11237964 100644 --- a/pkgs/os-specific/bsd/netbsd/default.nix +++ b/pkgs/os-specific/bsd/netbsd/default.nix @@ -421,6 +421,7 @@ let #meta.platforms = lib.platforms.netbsd; extraPaths = [ common.src ]; MKKMOD = "no"; + makeFlags = [ "FIRMWAREDIR=$(out)/libdata/firmware" ]; }; headers = symlinkJoin { From bdb8ec0ce6223a4cb81ba0a396d4aa777683ab07 Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Sun, 18 Apr 2021 16:42:48 +0000 Subject: [PATCH 052/263] netbsd.sys: set platforms I don't think there's any reason for this not to be set. Maybe it was from before netbsd.headers overrode meta.platforms for its constituents. --- pkgs/os-specific/bsd/netbsd/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/os-specific/bsd/netbsd/default.nix b/pkgs/os-specific/bsd/netbsd/default.nix index fae11237964..e3259cee714 100644 --- a/pkgs/os-specific/bsd/netbsd/default.nix +++ b/pkgs/os-specific/bsd/netbsd/default.nix @@ -418,7 +418,7 @@ let sha256 = "123ilg8fqmp69bw6bs6nh98fpi1v2n9lamrzar61p27ji6sj7g0w"; propagatedBuildInputs = [ include ]; nativeBuildInputs = [ makeMinimal install tsort lorder statHook uudecode ]; - #meta.platforms = lib.platforms.netbsd; + meta.platforms = lib.platforms.netbsd; extraPaths = [ common.src ]; MKKMOD = "no"; makeFlags = [ "FIRMWAREDIR=$(out)/libdata/firmware" ]; From 3e9decc557f1372afbaf6010d831c3333357bd00 Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Sun, 18 Apr 2021 11:10:42 +0000 Subject: [PATCH 053/263] netbsd.cksum: init at 8.0 We need the source directory of this package for config(1), so we might as well just package it. --- pkgs/os-specific/bsd/netbsd/default.nix | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pkgs/os-specific/bsd/netbsd/default.nix b/pkgs/os-specific/bsd/netbsd/default.nix index 910e5044c59..26d4685cbfc 100644 --- a/pkgs/os-specific/bsd/netbsd/default.nix +++ b/pkgs/os-specific/bsd/netbsd/default.nix @@ -386,6 +386,13 @@ let sha256 = "00a3zmh15pg4vx6hz0kaa5mi8d2b1sj4h512d7p6wbvxq6mznwcn"; NIX_CFLAGS_COMPILE = lib.optional stdenv.isLinux "-DNO_BASE64"; }; + + cksum = mkDerivation { + path = "usr.bin/cksum"; + version = "8.0"; + sha256 = "0327820171djn9dzb2q1arypxw2zsxiixnd1ahy34dagd9cwcphj"; + meta.platforms = lib.platforms.netbsd; + }; ## ## END COMMAND LINE TOOLS ## From 37ac32a351f3ce93bd731e9fbf5f54f1c37829f1 Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Sun, 18 Apr 2021 11:13:22 +0000 Subject: [PATCH 054/263] netbsd.config: init at 8.0 Needed to build the NetBSD kernel. --- pkgs/os-specific/bsd/netbsd/default.nix | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pkgs/os-specific/bsd/netbsd/default.nix b/pkgs/os-specific/bsd/netbsd/default.nix index 26d4685cbfc..c94f00f4782 100644 --- a/pkgs/os-specific/bsd/netbsd/default.nix +++ b/pkgs/os-specific/bsd/netbsd/default.nix @@ -393,6 +393,16 @@ let sha256 = "0327820171djn9dzb2q1arypxw2zsxiixnd1ahy34dagd9cwcphj"; meta.platforms = lib.platforms.netbsd; }; + + config = mkDerivation { + path = "usr.bin/config"; + version = "8.0"; + sha256 = "0piyn8lgdqxwz9wkgc2plzp2xpj93fs4xncri8l0jfas9rv5j2m5"; + NIX_CFLAGS_COMPILE = [ "-DMAKE_BOOTSTRAP" ]; + buildInputs = [ compat ]; + nativeBuildInputs = [ makeMinimal install mandoc byacc flex ]; + extraPaths = [ cksum.src ]; + }; ## ## END COMMAND LINE TOOLS ## From ddcb48cc3d176bae330a3d9fd0dfcc4038f1085b Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Sun, 18 Apr 2021 16:53:11 +0000 Subject: [PATCH 055/263] netbsd.sys: actually build the kernel Before, we were only building the headers, firmware, and bootloader. CONFIG could be overridden to use another pre-defined kernel, but there's no way to pass a custom kernel configuration yet. Tested booting the built kernel in a NetBSD VM. --- pkgs/os-specific/bsd/netbsd/default.nix | 29 ++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/pkgs/os-specific/bsd/netbsd/default.nix b/pkgs/os-specific/bsd/netbsd/default.nix index c94f00f4782..112a70917cf 100644 --- a/pkgs/os-specific/bsd/netbsd/default.nix +++ b/pkgs/os-specific/bsd/netbsd/default.nix @@ -433,12 +433,35 @@ let path = "sys"; version = "8.0"; sha256 = "123ilg8fqmp69bw6bs6nh98fpi1v2n9lamrzar61p27ji6sj7g0w"; + + CONFIG = "GENERIC"; + propagatedBuildInputs = [ include ]; - nativeBuildInputs = [ makeMinimal install tsort lorder statHook uudecode ]; + nativeBuildInputs = [ + makeMinimal install tsort lorder statHook uudecode config genassym + ]; + + postConfigure = '' + pushd arch/$MACHINE/conf + config $CONFIG + popd + ''; + + makeFlags = [ "FIRMWAREDIR=$(out)/libdata/firmware" ]; + hardeningDisable = [ "pic" ]; + MKKMOD = "no"; + NIX_CFLAGS_COMPILE = [ "-Wa,--no-warn" ]; + + postBuild = '' + make -C arch/$MACHINE/compile/$CONFIG $makeFlags + ''; + + postInstall = '' + cp arch/$MACHINE/compile/$CONFIG/netbsd $out + ''; + meta.platforms = lib.platforms.netbsd; extraPaths = [ common.src ]; - MKKMOD = "no"; - makeFlags = [ "FIRMWAREDIR=$(out)/libdata/firmware" ]; }; headers = symlinkJoin { From 33406ad455a87d869af520cb8214d40a3f55732e Mon Sep 17 00:00:00 2001 From: sterni <0rpkxez4ksa01gb3typccl0i@systemli.org> Date: Mon, 19 Apr 2021 02:49:45 +0200 Subject: [PATCH 056/263] re2: 20201001 -> 20210401 (#119742) Co-authored-by: Sandro --- pkgs/development/libraries/re2/default.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkgs/development/libraries/re2/default.nix b/pkgs/development/libraries/re2/default.nix index 2d8d0059764..9b7a2e91011 100644 --- a/pkgs/development/libraries/re2/default.nix +++ b/pkgs/development/libraries/re2/default.nix @@ -1,14 +1,14 @@ { lib, stdenv, fetchFromGitHub }: -stdenv.mkDerivation { +stdenv.mkDerivation rec { pname = "re2"; - version = "20201001"; + version = "2021-04-01"; src = fetchFromGitHub { owner = "google"; repo = "re2"; - rev = "2020-10-01"; - sha256 = "0a5f7av1pk6p3jxc2w6prl00lyrplap97m68hnhw7jllnwljk0bx"; + rev = version; + sha256 = "1iia0883lssj7ckbsr0n7yb3gdw24c8wnl2q5hhzlml23h4ipbh3"; }; preConfigure = '' From 35da81b990a5420376c2ac0986cf41f892992f31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Janne=20He=C3=9F?= Date: Mon, 19 Apr 2021 08:33:03 +0200 Subject: [PATCH 057/263] openssh: 8.5p1 -> 8.6p1 --- pkgs/tools/networking/openssh/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/tools/networking/openssh/default.nix b/pkgs/tools/networking/openssh/default.nix index 3ea35daaeb3..4cc943fc75f 100644 --- a/pkgs/tools/networking/openssh/default.nix +++ b/pkgs/tools/networking/openssh/default.nix @@ -5,11 +5,11 @@ in { openssh = common rec { pname = "openssh"; - version = "8.5p1"; + version = "8.6p1"; src = fetchurl { url = "mirror://openbsd/OpenSSH/portable/openssh-${version}.tar.gz"; - sha256 = "09gc8rv7728chxraab85dzkdikaw4aph1wlcwcc9kai9si0kybzm"; + sha256 = "1bnpivgk98h2f9afpp88jv6g9ps83vnpxd031n2jqxi12vdf9rn3"; }; extraPatches = [ ./ssh-keysign-8.5.patch ]; From 57832e625c556e77aba380ef0280c6f88c62e9cd Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Mon, 19 Apr 2021 10:55:08 +0000 Subject: [PATCH 058/263] lua: don't always set LUA_USE_LINUX This is supposed to be automatically set by Lua's Makefile if PLAT is set appropriately, but it was being overridden by us overridding CFLAGS. Setting it manually was a hack. The correct thing to do was to make sure SYSCFLAGS (where Lua's Makefile puts LUA_USE_LINUX) was still included in our custom CFLAGS. --- pkgs/development/interpreters/lua-5/interpreter.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/interpreters/lua-5/interpreter.nix b/pkgs/development/interpreters/lua-5/interpreter.nix index 35a074add09..9cad009d426 100644 --- a/pkgs/development/interpreters/lua-5/interpreter.nix +++ b/pkgs/development/interpreters/lua-5/interpreter.nix @@ -49,7 +49,7 @@ self = stdenv.mkDerivation rec { configurePhase = '' runHook preConfigure - makeFlagsArray+=(CFLAGS="-DLUA_USE_LINUX -O2 -fPIC${if compat then " -DLUA_COMPAT_ALL" else ""}" ) + makeFlagsArray+=(CFLAGS='-O2 -fPIC${lib.optionalString compat " -DLUA_COMPAT_ALL"} $(SYSCFLAGS)' ) makeFlagsArray+=(${lib.optionalString stdenv.isDarwin "CC=\"$CC\""}${lib.optionalString (stdenv.buildPlatform != stdenv.hostPlatform) " 'AR=${stdenv.hostPlatform.config}-ar rcu'"}) installFlagsArray=( TO_BIN="lua luac" INSTALL_DATA='cp -d' \ From 936b27b5d4a64f6e9ce3728bdaa8a78490236e6b Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Mon, 19 Apr 2021 11:02:16 +0000 Subject: [PATCH 059/263] lua: support non-Linux non-Darwin operating systems --- .../interpreters/lua-5/interpreter.nix | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/pkgs/development/interpreters/lua-5/interpreter.nix b/pkgs/development/interpreters/lua-5/interpreter.nix index 9cad009d426..4b257c20900 100644 --- a/pkgs/development/interpreters/lua-5/interpreter.nix +++ b/pkgs/development/interpreters/lua-5/interpreter.nix @@ -11,6 +11,15 @@ let luaPackages = callPackage ../../lua-modules {lua=self; overrides=packageOverrides;}; +plat = if stdenv.isLinux then "linux" + else if stdenv.isDarwin then "macosx" + else if stdenv.hostPlatform.isMinGW then "mingw" + else if stdenv.isFreeBSD then "freebsd" + else if stdenv.isSunOS then "solaris" + else if stdenv.hostPlatform.isBSD then "bsd" + else if stdenv.hostPlatform.isUnix then "posix" + else "generic"; + self = stdenv.mkDerivation rec { pname = "lua"; luaversion = with sourceVersion; "${major}.${minor}"; @@ -36,11 +45,8 @@ self = stdenv.mkDerivation rec { "R=${version}" "LDFLAGS=-fPIC" "V=${luaversion}" - ] ++ (if stdenv.isDarwin then [ - "PLAT=macosx" - ] else [ - "PLAT=linux" - ]) ++ (if stdenv.buildPlatform != stdenv.hostPlatform then [ + "PLAT=${plat}" + ] ++ (if stdenv.buildPlatform != stdenv.hostPlatform then [ "CC=${stdenv.hostPlatform.config}-gcc" "RANLIB=${stdenv.hostPlatform.config}-ranlib" ] else []) From 34f8d7e15a3ca5762c84f867f70773674b002cb2 Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Mon, 19 Apr 2021 11:38:01 +0000 Subject: [PATCH 060/263] lua: one dso patch to rule them all We do this same patch in three different ways for four different Lua versions, even though the structure of the Makefile barely changes between releases. We can easily consolidate this by just modifying the Makefile ourselves instead of using patches (Makefiles are very amenable to this). --- .../interpreters/lua-5/default.nix | 28 +-------- .../interpreters/lua-5/interpreter.nix | 8 +++ .../interpreters/lua-5/liblua.so.patch | 60 ------------------- .../lua-5/{lua-5.3-dso.make => lua-dso.make} | 4 -- 4 files changed, 11 insertions(+), 89 deletions(-) delete mode 100644 pkgs/development/interpreters/lua-5/liblua.so.patch rename pkgs/development/interpreters/lua-5/{lua-5.3-dso.make => lua-dso.make} (89%) diff --git a/pkgs/development/interpreters/lua-5/default.nix b/pkgs/development/interpreters/lua-5/default.nix index 3a52d58ffab..ae5d76aa36c 100644 --- a/pkgs/development/interpreters/lua-5/default.nix +++ b/pkgs/development/interpreters/lua-5/default.nix @@ -1,27 +1,10 @@ # similar to interpreters/python/default.nix { stdenv, lib, callPackage, fetchurl, fetchpatch }: -let - dsoPatch51 = fetchurl { - url = "https://projects.archlinux.org/svntogit/packages.git/plain/trunk/lua-arch.patch?h=packages/lua51"; - sha256 = "11fcyb4q55p4p7kdb8yp85xlw8imy14kzamp2khvcyxss4vw8ipw"; - name = "lua-arch.patch"; - }; - dsoPatch52 = fetchurl { - url = "https://projects.archlinux.org/svntogit/packages.git/plain/trunk/liblua.so.patch?h=packages/lua52"; - sha256 = "1by1dy4ql61f5c6njq9ibf9kaqm3y633g2q8j54iyjr4cxvqwqz9"; - name = "lua-arch.patch"; - }; - -in rec { +rec { lua5_4 = callPackage ./interpreter.nix { sourceVersion = { major = "5"; minor = "4"; patch = "2"; }; hash = "0ksj5zpj74n0jkamy3di1p6l10v4gjnd2zjnb453qc6px6bhsmqi"; - patches = [ - # build lua as a shared library as well, MIT-licensed from - # https://github.com/archlinux/svntogit-packages/tree/packages/lua/trunk - ./liblua.so.patch - ]; }; lua5_4_compat = lua5_4.override({ @@ -35,11 +18,6 @@ in rec { patches = lib.optionals stdenv.isDarwin [ ./5.2.darwin.patch ]; - postConfigure = lib.optionalString (!stdenv.isDarwin) '' - cat ${./lua-5.3-dso.make} >> src/Makefile - sed -e 's/ALL_T *= */& $(LUA_SO)/' -i src/Makefile - ''; - postBuild = lib.optionalString (!stdenv.isDarwin) '' ( cd src; make $makeFlags "''${makeFlagsArray[@]}" liblua.so ) ''; @@ -53,7 +31,7 @@ in rec { lua5_2 = callPackage ./interpreter.nix { sourceVersion = { major = "5"; minor = "2"; patch = "4"; }; hash = "0jwznq0l8qg9wh5grwg07b5cy3lzngvl5m2nl1ikp6vqssmf9qmr"; - patches = if stdenv.isDarwin then [ ./5.2.darwin.patch ] else [ dsoPatch52 ]; + patches = lib.optional stdenv.isDarwin ./5.2.darwin.patch; }; lua5_2_compat = lua5_2.override({ @@ -64,7 +42,7 @@ in rec { lua5_1 = callPackage ./interpreter.nix { sourceVersion = { major = "5"; minor = "1"; patch = "5"; }; hash = "2640fc56a795f29d28ef15e13c34a47e223960b0240e8cb0a82d9b0738695333"; - patches = (if stdenv.isDarwin then [ ./5.1.darwin.patch ] else [ dsoPatch51 ]) + patches = (lib.optional stdenv.isDarwin ./5.1.darwin.patch) ++ [ ./CVE-2014-5461.patch ]; }; diff --git a/pkgs/development/interpreters/lua-5/interpreter.nix b/pkgs/development/interpreters/lua-5/interpreter.nix index 4b257c20900..cb31bf52eeb 100644 --- a/pkgs/development/interpreters/lua-5/interpreter.nix +++ b/pkgs/development/interpreters/lua-5/interpreter.nix @@ -38,6 +38,14 @@ self = stdenv.mkDerivation rec { inherit patches; + postPatch = lib.optionalString (!stdenv.isDarwin) '' + # Add a target for a shared library to the Makefile. + sed -e '1s/^/LUA_SO = liblua.so/' \ + -e 's/ALL_T *= */&$(LUA_SO) /' \ + -i src/Makefile + cat ${./lua-dso.make} >> src/Makefile + ''; + # see configurePhase for additional flags (with space) makeFlags = [ "INSTALL_TOP=${placeholder "out"}" diff --git a/pkgs/development/interpreters/lua-5/liblua.so.patch b/pkgs/development/interpreters/lua-5/liblua.so.patch deleted file mode 100644 index 197832116c1..00000000000 --- a/pkgs/development/interpreters/lua-5/liblua.so.patch +++ /dev/null @@ -1,60 +0,0 @@ -diff --git a/Makefile b/Makefile -index 416f444..eeaff03 100644 ---- a/Makefile -+++ b/Makefile -@@ -52,7 +52,7 @@ R= $V.0 - all: $(PLAT) - - $(PLATS) help test clean: -- @cd src && $(MAKE) $@ -+ @cd src && $(MAKE) $@ V=$(V) R=$(R) - - install: dummy - cd src && $(MKDIR) $(INSTALL_BIN) $(INSTALL_INC) $(INSTALL_LIB) $(INSTALL_MAN) $(INSTALL_LMOD) $(INSTALL_CMOD) -diff --git a/src/Makefile b/src/Makefile -index 514593d..372a6dc 100644 ---- a/src/Makefile -+++ b/src/Makefile -@@ -33,6 +33,7 @@ CMCFLAGS= -Os - PLATS= guess aix bsd c89 freebsd generic linux linux-readline macosx mingw posix solaris - - LUA_A= liblua.a -+LUA_SO= liblua.so - CORE_O= lapi.o lcode.o lctype.o ldebug.o ldo.o ldump.o lfunc.o lgc.o llex.o lmem.o lobject.o lopcodes.o lparser.o lstate.o lstring.o ltable.o ltm.o lundump.o lvm.o lzio.o - LIB_O= lauxlib.o lbaselib.o lcorolib.o ldblib.o liolib.o lmathlib.o loadlib.o loslib.o lstrlib.o ltablib.o lutf8lib.o linit.o - BASE_O= $(CORE_O) $(LIB_O) $(MYOBJS) -@@ -44,7 +45,7 @@ LUAC_T= luac - LUAC_O= luac.o - - ALL_O= $(BASE_O) $(LUA_O) $(LUAC_O) --ALL_T= $(LUA_A) $(LUA_T) $(LUAC_T) -+ALL_T= $(LUA_A) $(LUA_T) $(LUAC_T) $(LUA_SO) - ALL_A= $(LUA_A) - - # Targets start here. -@@ -60,6 +61,12 @@ $(LUA_A): $(BASE_O) - $(AR) $@ $(BASE_O) - $(RANLIB) $@ - -+$(LUA_SO): $(CORE_O) $(LIB_O) -+ $(CC) -shared -ldl -Wl,-soname,$(LUA_SO).$(V) -o $@.$(R) $? -lm $(MYLDFLAGS) -+ ln -sf $(LUA_SO).$(R) $(LUA_SO).$(V) -+ ln -sf $(LUA_SO).$(R) $(LUA_SO) -+ -+ - $(LUA_T): $(LUA_O) $(LUA_A) - $(CC) -o $@ $(LDFLAGS) $(LUA_O) $(LUA_A) $(LIBS) - -diff --git a/src/luaconf.h b/src/luaconf.h -index bdf927e..7e15198 100644 ---- a/src/luaconf.h -+++ b/src/luaconf.h -@@ -227,7 +227,7 @@ - - #else /* }{ */ - --#define LUA_ROOT "/usr/local/" -+#define LUA_ROOT "/usr/" - #define LUA_LDIR LUA_ROOT "share/lua/" LUA_VDIR "/" - #define LUA_CDIR LUA_ROOT "lib/lua/" LUA_VDIR "/" - diff --git a/pkgs/development/interpreters/lua-5/lua-5.3-dso.make b/pkgs/development/interpreters/lua-5/lua-dso.make similarity index 89% rename from pkgs/development/interpreters/lua-5/lua-5.3-dso.make rename to pkgs/development/interpreters/lua-5/lua-dso.make index c70dbc4f9cc..d49c6bff498 100644 --- a/pkgs/development/interpreters/lua-5/lua-5.3-dso.make +++ b/pkgs/development/interpreters/lua-5/lua-dso.make @@ -1,8 +1,4 @@ - -LUA_SO=liblua.so - $(LUA_SO): $(CORE_O) $(LIB_O) $(CC) -shared -ldl -Wl,-soname,$(LUA_SO).$(V) -o $@.$(R) $? -lm $(MYLDFLAGS) ln -sf $(LUA_SO).$(R) $(LUA_SO).$(V) ln -sf $(LUA_SO).$(R) $(LUA_SO) - From 8abdf1db65fa89ec4be64a36fc3daf4d5c5b2c73 Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Mon, 19 Apr 2021 11:04:11 +0000 Subject: [PATCH 061/263] lua: don't try to -ldl -lm on non-Linux OSes On other OSes, like NetBSD, these are part of libc. Fortunately, the Lua Makefile already knows about this, and has a SYSLIBS variable we can use for this. --- pkgs/development/interpreters/lua-5/lua-dso.make | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/interpreters/lua-5/lua-dso.make b/pkgs/development/interpreters/lua-5/lua-dso.make index d49c6bff498..11ac71fd819 100644 --- a/pkgs/development/interpreters/lua-5/lua-dso.make +++ b/pkgs/development/interpreters/lua-5/lua-dso.make @@ -1,4 +1,4 @@ $(LUA_SO): $(CORE_O) $(LIB_O) - $(CC) -shared -ldl -Wl,-soname,$(LUA_SO).$(V) -o $@.$(R) $? -lm $(MYLDFLAGS) + $(CC) -shared $(SYSLIBS) -Wl,-soname,$(LUA_SO).$(V) -o $@.$(R) $? $(MYLDFLAGS) ln -sf $(LUA_SO).$(R) $(LUA_SO).$(V) ln -sf $(LUA_SO).$(R) $(LUA_SO) From 25d4f0d334ef4a24a11a41dafd3595c26d954f41 Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Mon, 19 Apr 2021 11:09:36 +0000 Subject: [PATCH 062/263] lua: use stdenv.cc.targetPrefix This evaluates to an empty string when not cross compiling, so by using this instead of stdenv.hostPlatform.config we can eliminate a conditional. --- pkgs/development/interpreters/lua-5/interpreter.nix | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/pkgs/development/interpreters/lua-5/interpreter.nix b/pkgs/development/interpreters/lua-5/interpreter.nix index cb31bf52eeb..973e9296435 100644 --- a/pkgs/development/interpreters/lua-5/interpreter.nix +++ b/pkgs/development/interpreters/lua-5/interpreter.nix @@ -54,17 +54,15 @@ self = stdenv.mkDerivation rec { "LDFLAGS=-fPIC" "V=${luaversion}" "PLAT=${plat}" - ] ++ (if stdenv.buildPlatform != stdenv.hostPlatform then [ - "CC=${stdenv.hostPlatform.config}-gcc" - "RANLIB=${stdenv.hostPlatform.config}-ranlib" - ] else []) - ; + "CC=${stdenv.cc.targetPrefix}cc" + "RANLIB=${stdenv.cc.targetPrefix}ranlib" + ]; configurePhase = '' runHook preConfigure makeFlagsArray+=(CFLAGS='-O2 -fPIC${lib.optionalString compat " -DLUA_COMPAT_ALL"} $(SYSCFLAGS)' ) - makeFlagsArray+=(${lib.optionalString stdenv.isDarwin "CC=\"$CC\""}${lib.optionalString (stdenv.buildPlatform != stdenv.hostPlatform) " 'AR=${stdenv.hostPlatform.config}-ar rcu'"}) + makeFlagsArray+=(${lib.optionalString stdenv.isDarwin "CC=\"$CC\""}${lib.optionalString (stdenv.buildPlatform != stdenv.hostPlatform) " 'AR=${stdenv.cc.targetPrefix}ar rcu'"}) installFlagsArray=( TO_BIN="lua luac" INSTALL_DATA='cp -d' \ TO_LIB="${if stdenv.isDarwin then "liblua.${version}.dylib" else "liblua.a liblua.so liblua.so.${luaversion} liblua.so.${version}"}" ) From 5910c5375f3097fb8feefde92ef6b8561a745dcf Mon Sep 17 00:00:00 2001 From: John Ericson Date: Mon, 19 Apr 2021 19:49:22 +0000 Subject: [PATCH 063/263] netbsd.mkDerviation: remove pointless `attrs.src or` `attrs` overrides these defaults already. --- pkgs/os-specific/bsd/netbsd/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/os-specific/bsd/netbsd/default.nix b/pkgs/os-specific/bsd/netbsd/default.nix index 112a70917cf..d461a3e62f3 100644 --- a/pkgs/os-specific/bsd/netbsd/default.nix +++ b/pkgs/os-specific/bsd/netbsd/default.nix @@ -26,7 +26,7 @@ let stdenv' = if attrs.noCC or false then stdenvNoCC else stdenv; in stdenv'.mkDerivation ({ name = "${attrs.pname or (baseNameOf attrs.path)}-netbsd-${attrs.version}"; - src = attrs.src or fetchNetBSD attrs.path attrs.version attrs.sha256; + src = fetchNetBSD attrs.path attrs.version attrs.sha256; extraPaths = [ ]; From 72cb0293675896fc52d29afcdb3d3cda33480bf5 Mon Sep 17 00:00:00 2001 From: Dmitry Kalinkin Date: Sat, 10 Apr 2021 05:08:13 -0400 Subject: [PATCH 064/263] python{2,3}Packages.matplotlib: use lib.generators.toINI to generate setup.cfg --- pkgs/development/python-modules/matplotlib/2.nix | 10 ++++++++-- .../python-modules/matplotlib/default.nix | 13 +++++++++++-- .../python-modules/matplotlib/setup-darwin.cfg | 7 ------- .../development/python-modules/matplotlib/setup.cfg | 5 ----- 4 files changed, 19 insertions(+), 16 deletions(-) delete mode 100644 pkgs/development/python-modules/matplotlib/setup-darwin.cfg delete mode 100644 pkgs/development/python-modules/matplotlib/setup.cfg diff --git a/pkgs/development/python-modules/matplotlib/2.nix b/pkgs/development/python-modules/matplotlib/2.nix index 2c929d9a694..63254e8f5f3 100644 --- a/pkgs/development/python-modules/matplotlib/2.nix +++ b/pkgs/development/python-modules/matplotlib/2.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, fetchPypi, python, buildPythonPackage, pycairo, backports_functools_lru_cache +{ lib, stdenv, fetchPypi, writeText, python, buildPythonPackage, pycairo, backports_functools_lru_cache , which, cycler, dateutil, nose, numpy, pyparsing, sphinx, tornado, kiwisolver , freetype, libpng, pkg-config, mock, pytz, pygobject3, gobject-introspection, functools32, subprocess32 , fetchpatch @@ -54,7 +54,13 @@ buildPythonPackage rec { ++ lib.optionals enableQt [ pyqt4 ] ++ lib.optionals python.isPy2 [ functools32 subprocess32 ]; - setup_cfg = ./setup.cfg; + passthru.config = { + directories = { basedirlist = "."; }; + libs = { + system_freetype = true; + }; + }; + setup_cfg = writeText "setup.cfg" (lib.generators.toINI {} passthru.config); preBuild = '' cp "$setup_cfg" ./setup.cfg ''; diff --git a/pkgs/development/python-modules/matplotlib/default.nix b/pkgs/development/python-modules/matplotlib/default.nix index 4be4189f8c7..70076847c0d 100644 --- a/pkgs/development/python-modules/matplotlib/default.nix +++ b/pkgs/development/python-modules/matplotlib/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, fetchPypi, python, buildPythonPackage, isPy3k, pycairo, backports_functools_lru_cache +{ lib, stdenv, fetchPypi, writeText, python, buildPythonPackage, isPy3k, pycairo, backports_functools_lru_cache , which, cycler, dateutil, nose, numpy, pyparsing, sphinx, tornado, kiwisolver , freetype, libpng, pkg-config, mock, pytz, pygobject3, gobject-introspection , certifi, pillow @@ -45,7 +45,16 @@ buildPythonPackage rec { ++ lib.optionals enableTk [ tcl tk tkinter libX11 ] ++ lib.optionals enableQt [ pyqt5 ]; - setup_cfg = if stdenv.isDarwin then ./setup-darwin.cfg else ./setup.cfg; + passthru.config = { + directories = { basedirlist = "."; }; + libs = { + system_freetype = true; + } // lib.optionalAttrs stdenv.isDarwin { + # LTO not working in darwin stdenv, see #19312 + enable_lto = false; + }; + }; + setup_cfg = writeText "setup.cfg" (lib.generators.toINI {} passthru.config); preBuild = '' cp "$setup_cfg" ./setup.cfg ''; diff --git a/pkgs/development/python-modules/matplotlib/setup-darwin.cfg b/pkgs/development/python-modules/matplotlib/setup-darwin.cfg deleted file mode 100644 index f6463d9c574..00000000000 --- a/pkgs/development/python-modules/matplotlib/setup-darwin.cfg +++ /dev/null @@ -1,7 +0,0 @@ -[directories] -basedirlist = . - -[libs] -system_freetype = true -# LTO not working in darwin stdenv, see #19312 -enable_lto = false diff --git a/pkgs/development/python-modules/matplotlib/setup.cfg b/pkgs/development/python-modules/matplotlib/setup.cfg deleted file mode 100644 index 6a773862765..00000000000 --- a/pkgs/development/python-modules/matplotlib/setup.cfg +++ /dev/null @@ -1,5 +0,0 @@ -[directories] -basedirlist = . - -[libs] -system_freetype = true From e6d9e58289fa6b97f8b7f843d7be6e21f8a96fa2 Mon Sep 17 00:00:00 2001 From: Dmitry Kalinkin Date: Sat, 10 Apr 2021 05:18:11 -0400 Subject: [PATCH 065/263] python3Packages.matplotlib: 3.3.4 -> 3.4.1 --- .../development/python-modules/matplotlib/default.nix | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/pkgs/development/python-modules/matplotlib/default.nix b/pkgs/development/python-modules/matplotlib/default.nix index 70076847c0d..e6e8183e999 100644 --- a/pkgs/development/python-modules/matplotlib/default.nix +++ b/pkgs/development/python-modules/matplotlib/default.nix @@ -1,6 +1,6 @@ { lib, stdenv, fetchPypi, writeText, python, buildPythonPackage, isPy3k, pycairo, backports_functools_lru_cache , which, cycler, dateutil, nose, numpy, pyparsing, sphinx, tornado, kiwisolver -, freetype, libpng, pkg-config, mock, pytz, pygobject3, gobject-introspection +, freetype, qhull, libpng, pkg-config, mock, pytz, pygobject3, gobject-introspection , certifi, pillow , enableGhostscript ? true, ghostscript ? null, gtk3 , enableGtk3 ? false, cairo @@ -20,14 +20,14 @@ assert enableTk -> (tcl != null) assert enableQt -> pyqt5 != null; buildPythonPackage rec { - version = "3.3.4"; + version = "3.4.1"; pname = "matplotlib"; disabled = !isPy3k; src = fetchPypi { inherit pname version; - sha256 = "3e477db76c22929e4c6876c44f88d790aacdf3c3f8f3a90cb1975c0bf37825b0"; + sha256 = "84d4c4f650f356678a5d658a43ca21a41fca13f9b8b00169c0b76e6a6a948908"; }; XDG_RUNTIME_DIR = "/tmp"; @@ -39,8 +39,8 @@ buildPythonPackage rec { ++ lib.optional stdenv.isDarwin [ Cocoa ]; propagatedBuildInputs = - [ cycler dateutil numpy pyparsing tornado freetype kiwisolver - certifi libpng mock pytz pillow ] + [ cycler dateutil numpy pyparsing tornado freetype qhull + kiwisolver certifi libpng mock pytz pillow ] ++ lib.optionals enableGtk3 [ cairo pycairo gtk3 gobject-introspection pygobject3 ] ++ lib.optionals enableTk [ tcl tk tkinter libX11 ] ++ lib.optionals enableQt [ pyqt5 ]; @@ -49,6 +49,7 @@ buildPythonPackage rec { directories = { basedirlist = "."; }; libs = { system_freetype = true; + system_qhull = true; } // lib.optionalAttrs stdenv.isDarwin { # LTO not working in darwin stdenv, see #19312 enable_lto = false; From de797ef97e107b967e3283f4096a46e7b9b0b00d Mon Sep 17 00:00:00 2001 From: Dmitry Kalinkin Date: Sat, 10 Apr 2021 06:43:47 -0400 Subject: [PATCH 066/263] python2Packages.matplotlib: remove invalid libs.system_freetype setup option --- pkgs/development/python-modules/matplotlib/2.nix | 3 --- 1 file changed, 3 deletions(-) diff --git a/pkgs/development/python-modules/matplotlib/2.nix b/pkgs/development/python-modules/matplotlib/2.nix index 63254e8f5f3..e0879050704 100644 --- a/pkgs/development/python-modules/matplotlib/2.nix +++ b/pkgs/development/python-modules/matplotlib/2.nix @@ -56,9 +56,6 @@ buildPythonPackage rec { passthru.config = { directories = { basedirlist = "."; }; - libs = { - system_freetype = true; - }; }; setup_cfg = writeText "setup.cfg" (lib.generators.toINI {} passthru.config); preBuild = '' From 72a1c0cbc46acbb1e5f2678373a19373de924ac3 Mon Sep 17 00:00:00 2001 From: Dmitry Kalinkin Date: Sun, 11 Apr 2021 01:39:38 -0400 Subject: [PATCH 067/263] python{2,3}Packages.matplotlib: remove pointless asserts --- pkgs/development/python-modules/matplotlib/2.nix | 12 ++---------- .../python-modules/matplotlib/default.nix | 14 +++----------- 2 files changed, 5 insertions(+), 21 deletions(-) diff --git a/pkgs/development/python-modules/matplotlib/2.nix b/pkgs/development/python-modules/matplotlib/2.nix index e0879050704..a6ee1a3bade 100644 --- a/pkgs/development/python-modules/matplotlib/2.nix +++ b/pkgs/development/python-modules/matplotlib/2.nix @@ -2,23 +2,15 @@ , which, cycler, dateutil, nose, numpy, pyparsing, sphinx, tornado, kiwisolver , freetype, libpng, pkg-config, mock, pytz, pygobject3, gobject-introspection, functools32, subprocess32 , fetchpatch -, enableGhostscript ? false, ghostscript ? null, gtk3 +, enableGhostscript ? false, ghostscript, gtk3 , enableGtk3 ? false, cairo # darwin has its own "MacOSX" backend -, enableTk ? !stdenv.isDarwin, tcl ? null, tk ? null, tkinter ? null, libX11 ? null +, enableTk ? !stdenv.isDarwin, tcl, tk, tkinter, libX11 , enableQt ? false, pyqt4 , Cocoa , pythonOlder }: -assert enableGhostscript -> ghostscript != null; -assert enableTk -> (tcl != null) - && (tk != null) - && (tkinter != null) - && (libX11 != null) - ; -assert enableQt -> pyqt4 != null; - buildPythonPackage rec { version = "2.2.3"; pname = "matplotlib"; diff --git a/pkgs/development/python-modules/matplotlib/default.nix b/pkgs/development/python-modules/matplotlib/default.nix index e6e8183e999..7364920cba2 100644 --- a/pkgs/development/python-modules/matplotlib/default.nix +++ b/pkgs/development/python-modules/matplotlib/default.nix @@ -2,23 +2,15 @@ , which, cycler, dateutil, nose, numpy, pyparsing, sphinx, tornado, kiwisolver , freetype, qhull, libpng, pkg-config, mock, pytz, pygobject3, gobject-introspection , certifi, pillow -, enableGhostscript ? true, ghostscript ? null, gtk3 +, enableGhostscript ? true, ghostscript, gtk3 , enableGtk3 ? false, cairo # darwin has its own "MacOSX" backend -, enableTk ? !stdenv.isDarwin, tcl ? null, tk ? null, tkinter ? null, libX11 ? null -, enableQt ? false, pyqt5 ? null +, enableTk ? !stdenv.isDarwin, tcl, tk, tkinter, libX11 +, enableQt ? false, pyqt5 , Cocoa , pythonOlder }: -assert enableGhostscript -> ghostscript != null; -assert enableTk -> (tcl != null) - && (tk != null) - && (tkinter != null) - && (libX11 != null) - ; -assert enableQt -> pyqt5 != null; - buildPythonPackage rec { version = "3.4.1"; pname = "matplotlib"; From 9d8c015cb3651ffe837c8083255a8dd9e68335f2 Mon Sep 17 00:00:00 2001 From: Jonathan Ringer Date: Tue, 20 Apr 2021 14:49:39 -0700 Subject: [PATCH 068/263] [staging] openssl: fix bin installation for static builds (#119825) Co-authored-by: Sandro --- pkgs/development/libraries/openssl/default.nix | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/pkgs/development/libraries/openssl/default.nix b/pkgs/development/libraries/openssl/default.nix index f6d45f66b1a..1c53a32a49e 100644 --- a/pkgs/development/libraries/openssl/default.nix +++ b/pkgs/development/libraries/openssl/default.nix @@ -123,8 +123,6 @@ let if [ -n "$(echo $out/lib/*.so $out/lib/*.dylib $out/lib/*.dll)" ]; then rm "$out/lib/"*.a fi - - mkdir -p $bin '' + lib.optionalString (!stdenv.hostPlatform.isWindows) # Fix bin/c_rehash's perl interpreter line # @@ -138,9 +136,9 @@ let # "#!/usr/bin/env perl" '' substituteInPlace $out/bin/c_rehash --replace ${buildPackages.perl}/bin/perl "/usr/bin/env perl" - '' + - '' - mv $out/bin $bin/ + '' + '' + mkdir -p $bin + mv $out/bin $bin/bin mkdir $dev mv $out/include $dev/ From 390b3b192d69a6760e8465fe781d04ef054ec438 Mon Sep 17 00:00:00 2001 From: nixinator <33lockdown33@protonmail.com> Date: Tue, 20 Apr 2021 02:13:37 +0100 Subject: [PATCH 069/263] tk-8.6.6: demos/hello: exec: wish8.6: not found. fixes #31311 --- pkgs/development/libraries/tk/generic.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkgs/development/libraries/tk/generic.nix b/pkgs/development/libraries/tk/generic.nix index 57dc3dac2d0..ecb3840b2de 100644 --- a/pkgs/development/libraries/tk/generic.nix +++ b/pkgs/development/libraries/tk/generic.nix @@ -16,6 +16,12 @@ stdenv.mkDerivation { cd unix ''; + postPatch = '' + for file in $(find library/demos/. -type f ! -name "*.*"); do + substituteInPlace $file --replace "exec wish" "exec $out/bin/wish" + done + ''; + postInstall = '' ln -s $out/bin/wish* $out/bin/wish cp ../{unix,generic}/*.h $out/include From f16053c34d655ee9dc9af947fca5c7c96414606b Mon Sep 17 00:00:00 2001 From: Andrew Childs Date: Tue, 20 Apr 2021 18:12:37 +0900 Subject: [PATCH 070/263] rubygems: 3.1.3 -> 3.2.16 --- pkgs/development/interpreters/ruby/default.nix | 14 ++++++++++++-- .../interpreters/ruby/rubygems/default.nix | 11 +++-------- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/pkgs/development/interpreters/ruby/default.nix b/pkgs/development/interpreters/ruby/default.nix index 4b185f038a1..6f335039ebe 100644 --- a/pkgs/development/interpreters/ruby/default.nix +++ b/pkgs/development/interpreters/ruby/default.nix @@ -12,7 +12,7 @@ let opString = lib.optionalString; patchSet = import ./rvm-patchsets.nix { inherit fetchFromGitHub; }; config = import ./config.nix { inherit fetchFromSavannah; }; - rubygems = import ./rubygems { inherit stdenv lib fetchurl fetchpatch; }; + rubygems = import ./rubygems { inherit stdenv lib fetchurl; }; # Contains the ruby version heuristics rubyVersion = import ./ruby-version.nix { inherit lib; }; @@ -112,7 +112,17 @@ let patchLevel = ver.patchLevel; }).${ver.majMinTiny} ++ op atLeast27 ./do-not-regenerate-revision.h.patch - ++ op (atLeast30 && useRailsExpress) ./do-not-update-gems-baseruby.patch; + ++ op (atLeast30 && useRailsExpress) ./do-not-update-gems-baseruby.patch + # Ruby prior to 3.0 has a bug the installer (tools/rbinstall.rb) but + # the resulting error was swallowed. Newer rubygems no longer swallows + # this error. We upgrade rubygems when rubygemsSupport is enabled, so + # we have to fix this bug to prevent the install step from failing. + # See https://github.com/ruby/ruby/pull/2930 + ++ op (!atLeast30 && rubygemsSupport) + (fetchpatch { + url = "https://github.com/ruby/ruby/commit/261d8dd20afd26feb05f00a560abd99227269c1c.patch"; + sha256 = "0wrii25cxcz2v8bgkrf7ibcanjlxwclzhayin578bf0qydxdm9qy"; + }); postUnpack = opString rubygemsSupport '' rm -rf $sourceRoot/{lib,test}/rubygems* diff --git a/pkgs/development/interpreters/ruby/rubygems/default.nix b/pkgs/development/interpreters/ruby/rubygems/default.nix index 19eed817ec2..db508caae31 100644 --- a/pkgs/development/interpreters/ruby/rubygems/default.nix +++ b/pkgs/development/interpreters/ruby/rubygems/default.nix @@ -1,23 +1,18 @@ -{ stdenv, lib, fetchurl, fetchpatch }: +{ stdenv, lib, fetchurl }: stdenv.mkDerivation rec { name = "rubygems"; - version = "3.1.3"; + version = "3.2.16"; src = fetchurl { url = "https://rubygems.org/rubygems/rubygems-${version}.tgz"; - sha256 = "181wjclxnq5lrwnr53famy9pg8911hi9w2v0vy7dqgjqnc4iy1hp"; + sha256 = "1bpn45hchcbirqvqwxcxyk1xy2xkdd915jci2hfjq4y6zc4idns0"; }; patches = [ ./0001-add-post-extract-hook.patch ./0002-binaries-with-env-shebang.patch ./0003-gem-install-default-to-user.patch - - (fetchpatch { - url = "https://github.com/rubygems/rubygems/commit/0af4d2d369ff580ef54839ec15a8c7ec419978cb.patch"; - sha256 = "13gyfxn4rmxq1dbxq5rzphnhagn8n8kpp8lb9h6h4s9d4zaklax9"; - }) ]; installPhase = '' From 52f76322523a6b3b1d2d2b38be912333a0fb7722 Mon Sep 17 00:00:00 2001 From: Maxine Aubrey Date: Wed, 21 Apr 2021 13:34:21 +0200 Subject: [PATCH 071/263] networkmanager: 1.30.2 -> 1.30.4 --- pkgs/tools/networking/networkmanager/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/tools/networking/networkmanager/default.nix b/pkgs/tools/networking/networkmanager/default.nix index c2de2ed8adb..63d79ba8678 100644 --- a/pkgs/tools/networking/networkmanager/default.nix +++ b/pkgs/tools/networking/networkmanager/default.nix @@ -10,11 +10,11 @@ let pythonForDocs = python3.withPackages (pkgs: with pkgs; [ pygobject3 ]); in stdenv.mkDerivation rec { pname = "networkmanager"; - version = "1.30.2"; + version = "1.30.4"; src = fetchurl { url = "mirror://gnome/sources/NetworkManager/${lib.versions.majorMinor version}/NetworkManager-${version}.tar.xz"; - sha256 = "sha256-DI6A53h3hg5KTmq0oPfNwRhuNWtlsEKnUYlxiLiJRNI="; + sha256 = "sha256-YFC3JCEuo85zhhEzWb6pr6H2eaVPYNmZpZmYkuZywZA="; }; outputs = [ "out" "dev" "devdoc" "man" "doc" ]; From 6e3b8543bc068185cb604fd6f10e0f3c2d729cdb Mon Sep 17 00:00:00 2001 From: Maxine Aubrey Date: Wed, 21 Apr 2021 13:43:11 +0200 Subject: [PATCH 072/263] networkmanager: add maxeaubrey to maintainers --- pkgs/tools/networking/networkmanager/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/tools/networking/networkmanager/default.nix b/pkgs/tools/networking/networkmanager/default.nix index 63d79ba8678..0b9a18bedea 100644 --- a/pkgs/tools/networking/networkmanager/default.nix +++ b/pkgs/tools/networking/networkmanager/default.nix @@ -106,7 +106,7 @@ in stdenv.mkDerivation rec { homepage = "https://wiki.gnome.org/Projects/NetworkManager"; description = "Network configuration and management tool"; license = licenses.gpl2Plus; - maintainers = with maintainers; [ phreedom domenkozar obadz worldofpeace ]; + maintainers = with maintainers; [ phreedom domenkozar obadz worldofpeace maxeaubrey ]; platforms = platforms.linux; }; } From f28239c54a6af9e7bcf971ad94892331e66866e3 Mon Sep 17 00:00:00 2001 From: Luflosi Date: Wed, 21 Apr 2021 22:11:32 +0200 Subject: [PATCH 073/263] diffutils: name -> pname --- pkgs/tools/text/diffutils/default.nix | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pkgs/tools/text/diffutils/default.nix b/pkgs/tools/text/diffutils/default.nix index bcb7fad58da..d95e7ae399d 100644 --- a/pkgs/tools/text/diffutils/default.nix +++ b/pkgs/tools/text/diffutils/default.nix @@ -6,10 +6,11 @@ # files. stdenv.mkDerivation rec { - name = "diffutils-3.7"; + pname = "diffutils"; + version = "3.7"; src = fetchurl { - url = "mirror://gnu/diffutils/${name}.tar.xz"; + url = "mirror://gnu/diffutils/diffutils-${version}.tar.xz"; sha256 = "09isrg0isjinv8c535nxsi1s86wfdfzml80dbw41dj9x3hiad9xk"; }; From 34a136c71023a44e6a2bfe5d0436981abee4f236 Mon Sep 17 00:00:00 2001 From: Lancelot SIX Date: Thu, 7 Jan 2021 20:58:20 +0000 Subject: [PATCH 074/263] readline80: delete readline-8.0 is not used anywhere in the tree (since introduction of readline-8.1); drop it. --- pkgs/development/libraries/readline/8.0.nix | 62 ------------------- .../readline/readline-8.0-patches.nix | 8 --- pkgs/top-level/aliases.nix | 1 + pkgs/top-level/all-packages.nix | 2 - 4 files changed, 1 insertion(+), 72 deletions(-) delete mode 100644 pkgs/development/libraries/readline/8.0.nix delete mode 100644 pkgs/development/libraries/readline/readline-8.0-patches.nix diff --git a/pkgs/development/libraries/readline/8.0.nix b/pkgs/development/libraries/readline/8.0.nix deleted file mode 100644 index 9ea0277467e..00000000000 --- a/pkgs/development/libraries/readline/8.0.nix +++ /dev/null @@ -1,62 +0,0 @@ -{ fetchurl, lib, stdenv, ncurses -}: - -stdenv.mkDerivation rec { - pname = "readline"; - version = "8.0p${toString (builtins.length upstreamPatches)}"; - - src = fetchurl { - url = "mirror://gnu/readline/readline-${meta.branch}.tar.gz"; - sha256 = "0qg4924hf4hg0r0wbx2chswsr08734536fh5iagkd3a7f4czafg3"; - }; - - outputs = [ "out" "dev" "man" "doc" "info" ]; - - propagatedBuildInputs = [ncurses]; - - patchFlags = [ "-p0" ]; - - upstreamPatches = - (let - patch = nr: sha256: - fetchurl { - url = "mirror://gnu/readline/readline-${meta.branch}-patches/readline80-${nr}"; - inherit sha256; - }; - in - import ./readline-8.0-patches.nix patch); - - patches = - [ ./link-against-ncurses.patch - ./no-arch_only-6.3.patch - ] - ++ upstreamPatches; - - meta = with lib; { - description = "Library for interactive line editing"; - - longDescription = '' - The GNU Readline library provides a set of functions for use by - applications that allow users to edit command lines as they are - typed in. Both Emacs and vi editing modes are available. The - Readline library includes additional functions to maintain a - list of previously-entered command lines, to recall and perhaps - reedit those lines, and perform csh-like history expansion on - previous commands. - - The history facilities are also placed into a separate library, - the History library, as part of the build process. The History - library may be used without Readline in applications which - desire its capabilities. - ''; - - homepage = "https://savannah.gnu.org/projects/readline/"; - - license = licenses.gpl3Plus; - - maintainers = with maintainers; [ dtzWill ]; - - platforms = platforms.unix; - branch = "8.0"; - }; -} diff --git a/pkgs/development/libraries/readline/readline-8.0-patches.nix b/pkgs/development/libraries/readline/readline-8.0-patches.nix deleted file mode 100644 index 2fac6a413c7..00000000000 --- a/pkgs/development/libraries/readline/readline-8.0-patches.nix +++ /dev/null @@ -1,8 +0,0 @@ -# Automatically generated by `update-patch-set.sh'; do not edit. - -patch: [ -(patch "001" "0sfh7wn0pr743xspnb1zndxndlv9rc0hcg14cbw5cmyg6f4ykrfq") -(patch "002" "1xy8mv8xm8hsfixwp3ci9kfx3dii3y92cq27wwd0jq75y6zzxc1n") -(patch "003" "1vza7sxjcsr2z295ij12nzgncdil1vb6as3mqy4m7svi1chv5pcl") -(patch "004" "0k1rfx9w32lglxg564yvp0mw6jg6883p8ac2f2lxxqpf80m3vami") -] diff --git a/pkgs/top-level/aliases.nix b/pkgs/top-level/aliases.nix index fe162e3723f..9648df014fb 100644 --- a/pkgs/top-level/aliases.nix +++ b/pkgs/top-level/aliases.nix @@ -614,6 +614,7 @@ mapAliases ({ rdf4store = throw "rdf4store has been removed from nixpkgs."; # added 2019-12-21 rdiff_backup = rdiff-backup; # added 2014-11-23 rdmd = dtools; # added 2017-08-19 + readline80 = throw "readline-8.0 is no longer supported in nixpkgs, please use 'readline' for main supported version or 'readline81' for most recent version"; # added 2021-04-22 rhc = throw "rhc was deprecated on 2019-04-09: abandoned by upstream."; rng_tools = rng-tools; # added 2018-10-24 robomongo = robo3t; #added 2017-09-28 diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 8327d1b8ea6..5f41caa067c 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -17104,8 +17104,6 @@ in readline70 = callPackage ../development/libraries/readline/7.0.nix { }; - readline80 = callPackage ../development/libraries/readline/8.0.nix { }; - readline81 = callPackage ../development/libraries/readline/8.1.nix { }; readosm = callPackage ../development/libraries/readosm { }; From 2a16327a83e9593152152bc1790144c59998c290 Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Thu, 22 Apr 2021 10:34:56 +0000 Subject: [PATCH 075/263] netbsd.ld_elf_so: fix build Tested building pkgsCross.x86_64-netbsd.netbsd.ld_elf_so from x86_64-linux. --- pkgs/os-specific/bsd/netbsd/default.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkgs/os-specific/bsd/netbsd/default.nix b/pkgs/os-specific/bsd/netbsd/default.nix index d461a3e62f3..f6c36c2b0ae 100644 --- a/pkgs/os-specific/bsd/netbsd/default.nix +++ b/pkgs/os-specific/bsd/netbsd/default.nix @@ -633,7 +633,11 @@ let version = "8.0"; sha256 = "1jmqpi0kg2daiqnvpwdyfy8rpnszxsm70sxizz0r7wn53xjr5hva"; meta.platforms = lib.platforms.netbsd; + LIBC_PIC = "${stdenv.cc.libc}/lib/libc_pic.a"; + # Hack to prevent a symlink being installed here for compatibility. + SHLINKINSTALLDIR = "/usr/libexec"; USE_FORT = "yes"; + makeFlags = [ "CLIBOBJ=${stdenv.cc.libc}/lib" ]; extraPaths = [ libc.src ] ++ libc.extraPaths; }; From 4e45ad35748f46ee64324bb320947dbcccd3493f Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Thu, 22 Apr 2021 12:37:48 +0200 Subject: [PATCH 076/263] python3Packages.dnspython: update license --- pkgs/development/python-modules/dnspython/1.nix | 14 +++++++++----- .../python-modules/dnspython/default.nix | 14 +++++++++----- 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/pkgs/development/python-modules/dnspython/1.nix b/pkgs/development/python-modules/dnspython/1.nix index 30f280a5029..5ff02c04338 100644 --- a/pkgs/development/python-modules/dnspython/1.nix +++ b/pkgs/development/python-modules/dnspython/1.nix @@ -1,4 +1,8 @@ -{ buildPythonPackage, fetchPypi, lib, pythonOlder }: +{ lib +, buildPythonPackage +, fetchPypi +, pythonOlder +}: buildPythonPackage rec { pname = "dnspython"; @@ -12,11 +16,11 @@ buildPythonPackage rec { # needs networking for some tests doCheck = false; + pythonImportsCheck = [ "dns" ]; - meta = { - description = "A DNS toolkit for Python 3.x"; + meta = with lib; { + description = "A DNS toolkit for Python"; homepage = "http://www.dnspython.org"; - # BSD-like, check https://www.dnspython.org/LICENSE for details - license = lib.licenses.free; + license = with licenses; [ isc ]; }; } diff --git a/pkgs/development/python-modules/dnspython/default.nix b/pkgs/development/python-modules/dnspython/default.nix index 1d224af0354..b982f0eaca9 100644 --- a/pkgs/development/python-modules/dnspython/default.nix +++ b/pkgs/development/python-modules/dnspython/default.nix @@ -1,4 +1,8 @@ -{ buildPythonPackage, fetchPypi, lib, pythonOlder }: +{ lib +, buildPythonPackage +, fetchPypi +, pythonOlder +}: buildPythonPackage rec { pname = "dnspython"; @@ -13,11 +17,11 @@ buildPythonPackage rec { # needs networking for some tests doCheck = false; + pythonImportsCheck = [ "dns" ]; - meta = { - description = "A DNS toolkit for Python 3.x"; + meta = with lib; { + description = "A DNS toolkit for Python"; homepage = "http://www.dnspython.org"; - # BSD-like, check https://www.dnspython.org/LICENSE for details - license = lib.licenses.free; + license = with licenses; [ isc ]; }; } From 8c48bb08d77df0cb40a9ed9a7f4b1712f08f529a Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Thu, 22 Apr 2021 15:20:23 +0000 Subject: [PATCH 077/263] netbsd.libossaudio: fix build The file this was trying to modify doesn't even exist. Tested by building pkgsCross.x86_64-netbsd.netbsd.libossaudio from x86_64-linux. --- pkgs/os-specific/bsd/netbsd/default.nix | 3 --- 1 file changed, 3 deletions(-) diff --git a/pkgs/os-specific/bsd/netbsd/default.nix b/pkgs/os-specific/bsd/netbsd/default.nix index d461a3e62f3..d5486aa23ce 100644 --- a/pkgs/os-specific/bsd/netbsd/default.nix +++ b/pkgs/os-specific/bsd/netbsd/default.nix @@ -563,9 +563,6 @@ let version = "8.0"; sha256 = "03azp5anavhjr15sinjlik9792lyf7w4zmkcihlkksrywhs05axh"; meta.platforms = lib.platforms.netbsd; - postPatch = '' - substituteInPlace rpc/Makefile --replace /usr $out - ''; }; librpcsvc = mkDerivation { From 82c231d17e5177ff2f6cba02ed5f3c9388f13f3b Mon Sep 17 00:00:00 2001 From: John Ericson Date: Mon, 9 Mar 2020 02:10:06 -0400 Subject: [PATCH 078/263] netbsd: Generalize builder to any-bsd setup hook Do this to get ready for other BSDs. --- pkgs/os-specific/bsd/netbsd/default.nix | 172 +++++++++++------- .../bsd/{netbsd/builder.sh => setup-hook.sh} | 21 +-- pkgs/top-level/all-packages.nix | 4 + 3 files changed, 123 insertions(+), 74 deletions(-) rename pkgs/os-specific/bsd/{netbsd/builder.sh => setup-hook.sh} (89%) diff --git a/pkgs/os-specific/bsd/netbsd/default.nix b/pkgs/os-specific/bsd/netbsd/default.nix index 783e16f4b4f..20c445dc9dd 100644 --- a/pkgs/os-specific/bsd/netbsd/default.nix +++ b/pkgs/os-specific/bsd/netbsd/default.nix @@ -1,5 +1,9 @@ -{ stdenv, stdenvNoCC, fetchcvs, lib, groff, mandoc, zlib, byacc, flex -, makeSetupHook, writeText, buildPackages, splicePackages, symlinkJoin }: +{ stdenv, lib, stdenvNoCC +, buildPackages, splicePackages +, bsdSetupHook, makeSetupHook, fetchcvs, groff, mandoc, byacc, flex +, zlib +, writeText, symlinkJoin +}: let fetchNetBSD = path: version: sha256: fetchcvs { @@ -30,7 +34,10 @@ let extraPaths = [ ]; - nativeBuildInputs = [ makeMinimal install tsort lorder mandoc groff statHook ]; + nativeBuildInputs = [ + bsdSetupHook + makeMinimal install tsort lorder mandoc groff statHook + ]; buildInputs = [ compat ]; # depsBuildBuild = [ buildPackages.stdenv.cc ]; @@ -56,9 +63,7 @@ let LD = "${stdenv'.cc.targetPrefix or ""}ld"; STRIP = "${stdenv'.cc.targetPrefix or ""}strip"; - NETBSD_PATH = attrs.path; - - builder = ./builder.sh; + BSD_PATH = attrs.path; meta = with lib; { maintainers = with maintainers; [ matthewbauer qyliss ]; @@ -85,7 +90,7 @@ let version = "8.0"; buildInputs = []; - nativeBuildInputs = []; + nativeBuildInputs = [ bsdSetupHook ]; skipIncludesPhase = true; @@ -106,7 +111,7 @@ let install -D nbmake $out/bin/nbmake ln -s $out/bin/nbmake $out/bin/make mkdir -p $out/share - cp -r $NETBSDSRCDIR/share/mk $out/share/mk + cp -r $BSDSRCDIR/share/mk $out/share/mk runHook postInstall ''; @@ -124,7 +129,10 @@ let ]; # override defaults to prevent infinite recursion - nativeBuildInputs = [ makeMinimal ]; + nativeBuildInputs = [ + bsdSetupHook + makeMinimal + ]; buildInputs = [ zlib ]; # the build system re-runs `./configure` with `HOST_CC` (which is their @@ -148,24 +156,24 @@ let # why aren't these installed by netbsd? install -D compat_defs.h $out/include/compat_defs.h - install -D $NETBSDSRCDIR/include/cdbw.h $out/include/cdbw.h - install -D $NETBSDSRCDIR/sys/sys/cdbr.h $out/include/cdbr.h - install -D $NETBSDSRCDIR/sys/sys/featuretest.h \ + install -D $BSDSRCDIR/include/cdbw.h $out/include/cdbw.h + install -D $BSDSRCDIR/sys/sys/cdbr.h $out/include/cdbr.h + install -D $BSDSRCDIR/sys/sys/featuretest.h \ $out/include/sys/featuretest.h - install -D $NETBSDSRCDIR/sys/sys/md5.h $out/include/md5.h - install -D $NETBSDSRCDIR/sys/sys/rmd160.h $out/include/rmd160.h - install -D $NETBSDSRCDIR/sys/sys/sha1.h $out/include/sha1.h - install -D $NETBSDSRCDIR/sys/sys/sha2.h $out/include/sha2.h - install -D $NETBSDSRCDIR/sys/sys/queue.h $out/include/sys/queue.h - install -D $NETBSDSRCDIR/include/vis.h $out/include/vis.h - install -D $NETBSDSRCDIR/include/db.h $out/include/db.h - install -D $NETBSDSRCDIR/include/netconfig.h $out/include/netconfig.h - install -D $NETBSDSRCDIR/include/rpc/types.h $out/include/rpc/types.h - install -D $NETBSDSRCDIR/include/utmpx.h $out/include/utmpx.h - install -D $NETBSDSRCDIR/include/tzfile.h $out/include/tzfile.h - install -D $NETBSDSRCDIR/sys/sys/tree.h $out/include/sys/tree.h - install -D $NETBSDSRCDIR/include/nl_types.h $out/include/nl_types.h - install -D $NETBSDSRCDIR/include/stringlist.h $out/include/stringlist.h + install -D $BSDSRCDIR/sys/sys/md5.h $out/include/md5.h + install -D $BSDSRCDIR/sys/sys/rmd160.h $out/include/rmd160.h + install -D $BSDSRCDIR/sys/sys/sha1.h $out/include/sha1.h + install -D $BSDSRCDIR/sys/sys/sha2.h $out/include/sha2.h + install -D $BSDSRCDIR/sys/sys/queue.h $out/include/sys/queue.h + install -D $BSDSRCDIR/include/vis.h $out/include/vis.h + install -D $BSDSRCDIR/include/db.h $out/include/db.h + install -D $BSDSRCDIR/include/netconfig.h $out/include/netconfig.h + install -D $BSDSRCDIR/include/rpc/types.h $out/include/rpc/types.h + install -D $BSDSRCDIR/include/utmpx.h $out/include/utmpx.h + install -D $BSDSRCDIR/include/tzfile.h $out/include/tzfile.h + install -D $BSDSRCDIR/sys/sys/tree.h $out/include/sys/tree.h + install -D $BSDSRCDIR/include/nl_types.h $out/include/nl_types.h + install -D $BSDSRCDIR/include/stringlist.h $out/include/stringlist.h '' + lib.optionalString stdenv.isDarwin '' mkdir -p $out/include/ssp touch $out/include/ssp/ssp.h @@ -194,7 +202,11 @@ let version = "8.0"; sha256 = "1f6pbz3qv1qcrchdxif8p5lbmnwl8b9nq615hsd3cyl4avd5bfqj"; extraPaths = [ mtree.src make.src ]; - nativeBuildInputs = [ makeMinimal mandoc groff ]; + nativeBuildInputs = [ + bsdSetupHook + makeMinimal + mandoc groff + ]; skipIncludesPhase = true; buildInputs = [ compat fts ]; installPhase = '' @@ -214,7 +226,9 @@ let path = "include/fts.h"; sha256 = "01d4fpxvz1pgzfk5xznz5dcm0x0gdzwcsfm1h3d0xc9kc6hj2q77"; version = "8.0"; - nativeBuildInputs = [ ]; + nativeBuildInputs = [ + bsdSetupHook + ]; propagatedBuildInputs = [ compat ]; extraPaths = [ (fetchNetBSD "lib/libc/gen/fts.c" "8.0" "1a8hmf26242nmv05ipn3ircxb0jqmmi66rh78kkyi9vjwkfl3qn7") @@ -248,7 +262,11 @@ let path = "usr.bin/stat"; version = "8.0"; sha256 = "0z4r96id2r4cfy443rw2s1n52n186xm0lqvs8s3qjf4314z7r7yh"; - nativeBuildInputs = [ makeMinimal install mandoc groff ]; + nativeBuildInputs = [ + bsdSetupHook + makeMinimal + install mandoc groff + ]; }; # stat isn't in POSIX, and NetBSD stat supports a completely @@ -266,14 +284,22 @@ let path = "usr.bin/tsort"; version = "8.0"; sha256 = "1dqvf9gin29nnq3c4byxc7lfd062pg7m84843zdy6n0z63hnnwiq"; - nativeBuildInputs = [ makeMinimal install mandoc groff ]; + nativeBuildInputs = [ + bsdSetupHook + makeMinimal + install mandoc groff + ]; }; lorder = mkDerivation { path = "usr.bin/lorder"; version = "8.0"; sha256 = "0rjf9blihhm0n699vr2bg88m4yjhkbxh6fxliaay3wxkgnydjwn2"; - nativeBuildInputs = [ makeMinimal install mandoc groff ]; + nativeBuildInputs = [ + bsdSetupHook + makeMinimal + install mandoc groff + ]; }; ## ## END BOOTSTRAPPING @@ -290,17 +316,17 @@ let # make needs this to pick up our sys make files export NIX_CFLAGS_COMPILE+=" -D_PATH_DEFSYSPATH=\"$out/share/mk\"" - substituteInPlace $NETBSDSRCDIR/share/mk/bsd.lib.mk \ + substituteInPlace $BSDSRCDIR/share/mk/bsd.lib.mk \ --replace '_INSTRANLIB=''${empty(PRESERVE):?-a "''${RANLIB} -t":}' '_INSTRANLIB=' - substituteInPlace $NETBSDSRCDIR/share/mk/bsd.kinc.mk \ + substituteInPlace $BSDSRCDIR/share/mk/bsd.kinc.mk \ --replace /bin/rm rm '' + lib.optionalString stdenv.isDarwin '' - substituteInPlace $NETBSDSRCDIR/share/mk/bsd.sys.mk \ + substituteInPlace $BSDSRCDIR/share/mk/bsd.sys.mk \ --replace '-Wl,--fatal-warnings' "" \ --replace '-Wl,--warn-shared-textrel' "" ''; postInstall = '' - make -C $NETBSDSRCDIR/share/mk FILESDIR=$out/share/mk install + make -C $BSDSRCDIR/share/mk FILESDIR=$out/share/mk install ''; extraPaths = [ (fetchNetBSD "share/mk" "8.0" "033q4w3rmvwznz6m7fn9xcf13chyhwwl8ijj3a9mrn80fkwm55qs") @@ -371,7 +397,11 @@ let sha256 = "092y7db7k4kh2jq8qc55126r5qqvlb8lq8mhmy5ipbi36hwb4zrz"; HOSTPROG = "tic"; buildInputs = [ compat ]; - nativeBuildInputs = [ makeMinimal install mandoc groff nbperf ]; + nativeBuildInputs = [ + bsdSetupHook + makeMinimal + install mandoc groff nbperf + ]; makeFlags = [ "TOOLDIR=$(out)" ]; extraPaths = [ libterminfo.src @@ -399,8 +429,11 @@ let version = "8.0"; sha256 = "0piyn8lgdqxwz9wkgc2plzp2xpj93fs4xncri8l0jfas9rv5j2m5"; NIX_CFLAGS_COMPILE = [ "-DMAKE_BOOTSTRAP" ]; + nativeBuildInputs = [ + bsdSetupHook + makeMinimal install mandoc byacc flex + ]; buildInputs = [ compat ]; - nativeBuildInputs = [ makeMinimal install mandoc byacc flex ]; extraPaths = [ cksum.src ]; }; ## @@ -414,7 +447,11 @@ let path = "include"; version = "8.0"; sha256 = "128m77k16i7frvk8kifhmxzk7a37m7z1s0bbmja3ywga6sx6v6sq"; - nativeBuildInputs = [ makeMinimal install mandoc groff nbperf rpcgen ]; + nativeBuildInputs = [ + bsdSetupHook + makeMinimal + install mandoc groff nbperf rpcgen + ]; extraPaths = [ common.src ]; headersOnly = true; noCC = true; @@ -438,6 +475,7 @@ let propagatedBuildInputs = [ include ]; nativeBuildInputs = [ + bsdSetupHook makeMinimal install tsort lorder statHook uudecode config genassym ]; @@ -517,7 +555,7 @@ let --replace '#include ' 'void use_env(bool);' ''; postInstall = '' - make -C $NETBSDSRCDIR/share/terminfo BINDIR=$out/share install + make -C $BSDSRCDIR/share/terminfo BINDIR=$out/share install ''; extraPaths = [ (fetchNetBSD "share/terminfo" "8.0" "18db0fk1dw691vk6lsm6dksm4cf08g8kdm0gc4052ysdagg2m6sm") @@ -620,8 +658,12 @@ let version = "8.0"; sha256 = "0630lbvz6v4ic13bfg8ccwfhqkgcv76bfdw9f36rfsnwfgpxqsmq"; meta.platforms = lib.platforms.netbsd; - nativeBuildInputs = [ makeMinimal install mandoc groff flex - byacc genassym gencat lorder tsort statHook ]; + nativeBuildInputs = [ + bsdSetupHook + makeMinimal + install mandoc groff flex + byacc genassym gencat lorder tsort statHook + ]; extraPaths = [ sys.src ld_elf_so.src ]; }; @@ -644,12 +686,18 @@ let sha256 = "0lgbc58qgn8kwm3l011x1ml1kgcf7jsgq7hbf0hxhlbvxq5bljl3"; USE_FORT = "yes"; MKPROFILE = "no"; - extraPaths = [ common.src i18n_module.src sys.src - ld_elf_so.src libpthread.src libm.src libresolv.src - librpcsvc.src libutil.src librt.src libcrypt.src ]; + extraPaths = [ + common.src i18n_module.src sys.src + ld_elf_so.src libpthread.src libm.src libresolv.src + librpcsvc.src libutil.src librt.src libcrypt.src + ]; + nativeBuildInputs = [ + bsdSetupHook + makeMinimal + install mandoc groff flex + byacc genassym gencat lorder tsort statHook rpcgen + ]; buildInputs = [ buildPackages.netbsd.headers csu ]; - nativeBuildInputs = [ makeMinimal install mandoc groff flex - byacc genassym gencat lorder tsort statHook rpcgen ]; NIX_CFLAGS_COMPILE = "-B${csu}/lib"; meta.platforms = lib.platforms.netbsd; SHLIBINSTALLDIR = "$(out)/lib"; @@ -670,29 +718,29 @@ let NIX_CFLAGS_COMPILE+=" -I$out/include" NIX_LDFLAGS+=" -L$out/lib" - make -C $NETBSDSRCDIR/lib/libpthread $makeFlags - make -C $NETBSDSRCDIR/lib/libpthread $makeFlags install + make -C $BSDSRCDIR/lib/libpthread $makeFlags + make -C $BSDSRCDIR/lib/libpthread $makeFlags install - make -C $NETBSDSRCDIR/lib/libm $makeFlags - make -C $NETBSDSRCDIR/lib/libm $makeFlags install + make -C $BSDSRCDIR/lib/libm $makeFlags + make -C $BSDSRCDIR/lib/libm $makeFlags install - make -C $NETBSDSRCDIR/lib/libresolv $makeFlags - make -C $NETBSDSRCDIR/lib/libresolv $makeFlags install + make -C $BSDSRCDIR/lib/libresolv $makeFlags + make -C $BSDSRCDIR/lib/libresolv $makeFlags install - make -C $NETBSDSRCDIR/lib/librpcsvc $makeFlags - make -C $NETBSDSRCDIR/lib/librpcsvc $makeFlags install + make -C $BSDSRCDIR/lib/librpcsvc $makeFlags + make -C $BSDSRCDIR/lib/librpcsvc $makeFlags install - make -C $NETBSDSRCDIR/lib/i18n_module $makeFlags - make -C $NETBSDSRCDIR/lib/i18n_module $makeFlags install + make -C $BSDSRCDIR/lib/i18n_module $makeFlags + make -C $BSDSRCDIR/lib/i18n_module $makeFlags install - make -C $NETBSDSRCDIR/lib/libutil $makeFlags - make -C $NETBSDSRCDIR/lib/libutil $makeFlags install + make -C $BSDSRCDIR/lib/libutil $makeFlags + make -C $BSDSRCDIR/lib/libutil $makeFlags install - make -C $NETBSDSRCDIR/lib/librt $makeFlags - make -C $NETBSDSRCDIR/lib/librt $makeFlags install + make -C $BSDSRCDIR/lib/librt $makeFlags + make -C $BSDSRCDIR/lib/librt $makeFlags install - make -C $NETBSDSRCDIR/lib/libcrypt $makeFlags - make -C $NETBSDSRCDIR/lib/libcrypt $makeFlags install + make -C $BSDSRCDIR/lib/libcrypt $makeFlags + make -C $BSDSRCDIR/lib/libcrypt $makeFlags install ''; postPatch = '' sed -i 's,/usr\(/include/sys/syscall.h\),${buildPackages.netbsd.headers}\1,g' \ diff --git a/pkgs/os-specific/bsd/netbsd/builder.sh b/pkgs/os-specific/bsd/setup-hook.sh similarity index 89% rename from pkgs/os-specific/bsd/netbsd/builder.sh rename to pkgs/os-specific/bsd/setup-hook.sh index 332e5c2098f..45babc38d7a 100644 --- a/pkgs/os-specific/bsd/netbsd/builder.sh +++ b/pkgs/os-specific/bsd/setup-hook.sh @@ -1,6 +1,4 @@ -source $stdenv/setup - -# NetBSD makefiles should be able to detect this +# BSD makefiles should be able to detect this # but without they end up using gcc on Darwin stdenv addMakeFlags() { export setOutputFlags= @@ -64,13 +62,12 @@ addMakeFlags() { makeFlags="-j $NIX_BUILD_CORES $makeFlags" } -setNetBSDSourceDir() { +setBSDSourceDir() { # merge together all extra paths # there should be a better way to do this sourceRoot=$PWD/$sourceRoot - export NETBSDSRCDIR=$sourceRoot - export BSDSRCDIR=$NETBSDSRCDIR - export _SRC_TOP_=$NETBSDSRCDIR + export BSDSRCDIR=$sourceRoot + export _SRC_TOP_=$BSDSRCDIR chmod -R u+w $sourceRoot for path in $extraPaths; do cd $path @@ -80,13 +77,14 @@ setNetBSDSourceDir() { done cd $sourceRoot - if [ -d "$NETBSD_PATH" ] - then sourceRoot=$sourceRoot/$NETBSD_PATH + if [ -d "$BSD_PATH" ] + then sourceRoot=$sourceRoot/$BSD_PATH fi } includesPhase() { if [ -z "${skipIncludesPhase:-}" ]; then + runHook preIncludes local flagsArray=( $makeFlags ${makeFlagsArray+"${makeFlagsArray[@]}"} @@ -98,6 +96,7 @@ includesPhase() { moveUsrDir + runHook postIncludes fi } @@ -115,9 +114,7 @@ moveUsrDir() { fi } -postUnpackHooks+=(setNetBSDSourceDir) +postUnpackHooks+=(setBSDSourceDir) preConfigureHooks+=(addMakeFlags) preInstallHooks+=(includesPhase) fixupOutputHooks+=(moveUsrDir) - -genericBuild diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index fc760bdc7dc..c0e5b3f9d7e 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -30975,6 +30975,10 @@ in fts = if stdenv.hostPlatform.isMusl then netbsd.fts else null; + bsdSetupHook = makeSetupHook { + name = "bsd-setup-hook"; + } ../os-specific/bsd/setup-hook.sh; + netbsd = callPackages ../os-specific/bsd/netbsd {}; netbsdCross = callPackages ../os-specific/bsd/netbsd { stdenv = crossLibcStdenv; From a2d88c63c6100b9edbe5ea084f0a8caef9793234 Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Thu, 22 Apr 2021 15:46:20 +0000 Subject: [PATCH 079/263] netbsd.libterminfo: fix build Tested building netbsd.libterminfo and pkgsCross.x86_64-netbsd.netbsd.libterminfo from x86_64-linux. --- pkgs/os-specific/bsd/netbsd/default.nix | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pkgs/os-specific/bsd/netbsd/default.nix b/pkgs/os-specific/bsd/netbsd/default.nix index 783e16f4b4f..978f163bfaf 100644 --- a/pkgs/os-specific/bsd/netbsd/default.nix +++ b/pkgs/os-specific/bsd/netbsd/default.nix @@ -510,12 +510,19 @@ let path = "lib/libterminfo"; version = "8.0"; sha256 = "14gp0d6fh6zjnbac2yjhyq5m6rca7gm6q1s9gilhzpdgl9m7vb9r"; + nativeBuildInputs = [ + makeMinimal install tsort lorder mandoc statHook nbperf tic + ]; buildInputs = [ compat ]; + SHLIBINSTALLDIR = "$(out)/lib"; postPatch = '' substituteInPlace term.c --replace /usr/share $out/share substituteInPlace setupterm.c \ --replace '#include ' 'void use_env(bool);' ''; + postBuild = '' + make -C $NETBSDSRCDIR/share/terminfo BINDIR=$out/share + ''; postInstall = '' make -C $NETBSDSRCDIR/share/terminfo BINDIR=$out/share install ''; From c5ab13fc009d4408e462ff57781a6d7366f7b49f Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Thu, 22 Apr 2021 16:35:47 +0000 Subject: [PATCH 080/263] netbsd.libresolv: fix build Tested building pkgsCross.x86_64-netbsd.netbsd.libresolv from x86_64-linux. --- pkgs/os-specific/bsd/netbsd/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/os-specific/bsd/netbsd/default.nix b/pkgs/os-specific/bsd/netbsd/default.nix index 03eb5f84e2f..51a19f0f2fa 100644 --- a/pkgs/os-specific/bsd/netbsd/default.nix +++ b/pkgs/os-specific/bsd/netbsd/default.nix @@ -644,6 +644,7 @@ let version = "8.0"; sha256 = "11vpb3p2343wyrhw4v9gwz7i0lcpb9ysmfs9gsx56b5gkgipdy4v"; meta.platforms = lib.platforms.netbsd; + extraPaths = [ libc.src ]; }; libm = mkDerivation { From 760c0428cb11665da611b23c204e3feea02aecb7 Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Thu, 22 Apr 2021 16:44:41 +0000 Subject: [PATCH 081/263] netbsd.i18n_module: fix build Tested building pkgsCross.x86_64-netbsd.netbsd.i18n_module from x86_64-linux. --- pkgs/os-specific/bsd/netbsd/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/os-specific/bsd/netbsd/default.nix b/pkgs/os-specific/bsd/netbsd/default.nix index 51a19f0f2fa..533151feddc 100644 --- a/pkgs/os-specific/bsd/netbsd/default.nix +++ b/pkgs/os-specific/bsd/netbsd/default.nix @@ -659,6 +659,7 @@ let version = "8.0"; sha256 = "0w6y5v3binm7gf2kn7y9jja8k18rhnyl55cvvfnfipjqdxvxd9jd"; meta.platforms = lib.platforms.netbsd; + extraPaths = [ libc.src ]; }; csu = mkDerivation { From 892d3fd7a0c65637841574ee11a281d21eaa7155 Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Thu, 22 Apr 2021 13:12:22 +0000 Subject: [PATCH 082/263] ocamlPackages.camlimages_4_1: fix meta I should have changed meta.branch in 70e33e3ae34 ("glsurf: use current giflib"), but I overlooked it. The bitbucket URL doesn't seem to exist any more, so I've updated the homepage to the GitLab repository we fetch the sources from. Fixes: 70e33e3ae34 ("glsurf: use current giflib") --- pkgs/development/ocaml-modules/camlimages/4.1.2.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/ocaml-modules/camlimages/4.1.2.nix b/pkgs/development/ocaml-modules/camlimages/4.1.2.nix index 437cb84d15d..dba303afdf2 100644 --- a/pkgs/development/ocaml-modules/camlimages/4.1.2.nix +++ b/pkgs/development/ocaml-modules/camlimages/4.1.2.nix @@ -28,8 +28,8 @@ stdenv.mkDerivation rec { ''; meta = with lib; { - branch = "4.0"; - homepage = "https://bitbucket.org/camlspotter/camlimages"; + branch = "4.1"; + homepage = "https://gitlab.com/camlspotter/camlimages"; description = "OCaml image processing library"; license = licenses.lgpl2; maintainers = [ maintainers.vbgl ]; From e4b05fbf47cf4842a550190c13a7595b762fdb27 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Mon, 9 Mar 2020 02:10:06 -0400 Subject: [PATCH 083/263] netbsd: Make boostrapping more orthodox and don't rely on splicing - No splicing makes everything less finnicky. - Normal bootstrapping matches e.g. linux where kernel headers are also `stdenvNoCC` but part of this stage. --- pkgs/os-specific/bsd/default.nix | 5 - pkgs/os-specific/bsd/netbsd/default.nix | 224 +++++++++++++++--------- pkgs/top-level/all-packages.nix | 8 +- 3 files changed, 142 insertions(+), 95 deletions(-) delete mode 100644 pkgs/os-specific/bsd/default.nix diff --git a/pkgs/os-specific/bsd/default.nix b/pkgs/os-specific/bsd/default.nix deleted file mode 100644 index ee7158e2a8c..00000000000 --- a/pkgs/os-specific/bsd/default.nix +++ /dev/null @@ -1,5 +0,0 @@ -{ callPackages, recurseIntoAttrs }: - -{ - netbsd = recurseIntoAttrs (callPackages ./netbsd {}); -} diff --git a/pkgs/os-specific/bsd/netbsd/default.nix b/pkgs/os-specific/bsd/netbsd/default.nix index 533151feddc..61f3a6e58d2 100644 --- a/pkgs/os-specific/bsd/netbsd/default.nix +++ b/pkgs/os-specific/bsd/netbsd/default.nix @@ -1,5 +1,6 @@ { stdenv, lib, stdenvNoCC -, buildPackages, splicePackages +, pkgsBuildBuild, pkgsBuildHost, pkgsBuildTarget, pkgsHostHost, pkgsTargetTarget +, buildPackages, splicePackages, newScope , bsdSetupHook, makeSetupHook, fetchcvs, groff, mandoc, byacc, flex , zlib , writeText, symlinkJoin @@ -13,18 +14,39 @@ let tag = "netbsd-${lib.replaceStrings ["."] ["-"] version}-RELEASE"; }; - # Splice packages so we get the correct package when using - # nativeBuildInputs... - nbSplicedPackages = splicePackages { - pkgsBuildBuild = buildPackages.buildPackages.netbsd; - pkgsBuildHost = buildPackages.netbsd; - pkgsBuildTarget = {}; - pkgsHostHost = {}; - pkgsHostTarget = netbsd; - pkgsTargetTarget = {}; + otherSplices = { + selfBuildBuild = pkgsBuildBuild.netbsd; + selfBuildHost = pkgsBuildHost.netbsd; + selfBuildTarget = pkgsBuildTarget.netbsd; + selfHostHost = pkgsHostHost.netbsd; + selfTargetTarget = pkgsTargetTarget.netbsd or {}; # might be missing }; - netbsd = with nbSplicedPackages; { +in lib.makeScopeWithSplicing + splicePackages + newScope + otherSplices + {} + (self: let + inherit (self) mkDerivation; + in { + + # Why do we have splicing and yet do `nativeBuildInputs = with self; ...`? + # + # We use `lib.makeScopeWithSplicing` because this should be used for all + # nested package sets which support cross, so the inner `callPackage` works + # correctly. But for the inline packages we don't bother to use + # `callPackage`. + # + # We still could have tried to `with` a big spliced packages set, but + # splicing is jank and causes a number of bootstrapping infinite recursions + # if one is not careful. Pulling deps out of the right package set directly + # side-steps splicing entirely and avoids those footguns. + # + # For non-bootstrap-critical packages, we might as well use `callPackage` for + # consistency with everything else, and maybe put in separate files too. + + compatIfNeeded = lib.optional (!stdenvNoCC.hostPlatform.isNetBSD) self.compat; mkDerivation = lib.makeOverridable (attrs: let stdenv' = if attrs.noCC or false then stdenvNoCC else stdenv; @@ -34,12 +56,12 @@ let extraPaths = [ ]; - nativeBuildInputs = [ + nativeBuildInputs = with buildPackages.netbsd; [ bsdSetupHook - makeMinimal install tsort lorder mandoc groff statHook + makeMinimal + install tsort lorder mandoc groff statHook ]; - buildInputs = [ compat ]; - # depsBuildBuild = [ buildPackages.stdenv.cc ]; + buildInputs = with self; compatIfNeeded; OBJCOPY = if stdenv.isDarwin then "true" else "objcopy"; HOST_SH = "${buildPackages.bash}/bin/sh"; @@ -65,6 +87,8 @@ let BSD_PATH = attrs.path; + strictDeps = true; + meta = with lib; { maintainers = with maintainers; [ matthewbauer qyliss ]; platforms = platforms.unix; @@ -89,14 +113,14 @@ let sha256 = "1xbzfd4i7allrkk1if74a8ymgpizyj0gkvdigzzj37qar7la7nc1"; version = "8.0"; - buildInputs = []; - nativeBuildInputs = [ bsdSetupHook ]; + buildInputs = with self; []; + nativeBuildInputs = with buildPackages.netbsd; [ bsdSetupHook ]; skipIncludesPhase = true; postPatch = '' patchShebangs configure - ${make.postPatch} + ${self.make.postPatch} ''; buildPhase = '' runHook preBuild @@ -115,30 +139,33 @@ let runHook postInstall ''; - extraPaths = [ make.src ] ++ make.extraPaths; + extraPaths = with self; [ make.src ] ++ make.extraPaths; }; - compat = if stdenv.hostPlatform.isNetBSD then stdenv else mkDerivation rec { + compat = mkDerivation (let + version = "8.0"; + commonDeps = [ zlib ]; + in { path = "tools/compat"; sha256 = "050449lq5gpxqsripdqip5ks49g5ypjga188nd3ss8dg1zf7ydz3"; - version = "8.0"; + inherit version; setupHooks = [ ../../../build-support/setup-hooks/role.bash ./compat-setup-hook.sh ]; - # override defaults to prevent infinite recursion - nativeBuildInputs = [ + # the build system re-runs `./configure` with `HOST_CC` (which is their + # name for Build CC) as a compiler to make `defs.mk`, which is installed + depsBuildBuild = [ buildPackages.stdenv.cc ] ++ commonDeps; + HOST_CC = "${buildPackages.stdenv.cc.targetPrefix}cc"; + + nativeBuildInputs = with buildPackages.netbsd; commonDeps ++ [ bsdSetupHook makeMinimal ]; - buildInputs = [ zlib ]; - # the build system re-runs `./configure` with `HOST_CC` (which is their - # name for Build CC) as a compiler to make `defs.mk`, which is installed - depsBuildBuild = [ buildPackages.stdenv.cc ] ++ buildInputs; - HOST_CC = "${buildPackages.stdenv.cc.targetPrefix}cc"; + buildInputs = with self; commonDeps; # temporarily use gnuinstall for bootstrapping # bsdinstall will be built later @@ -183,12 +210,12 @@ let --subst-var-by out $out \ --subst-var-by version ${version} ''; - extraPaths = [ libc.src libutil.src + extraPaths = with self; [ libc.src libutil.src (fetchNetBSD "include" "8.0" "128m77k16i7frvk8kifhmxzk7a37m7z1s0bbmja3ywga6sx6v6sq") (fetchNetBSD "external/bsd/flex" "8.0" "0yxcjshz9nj827qhmjwwjmzvmmqgaf0d25b42k7lj84vliwrgyr6") (fetchNetBSD "sys/sys" "8.0" "0b0yjjy0c0cvk5nyffppqwxlwh2s1qr2xzl97a9ldck00dibar94") ] ++ libutil.extraPaths ++ libc.extraPaths; - }; + }); # HACK: to ensure parent directories exist. This emulates GNU # install’s -D option. No alternative seems to exist in BSD install. @@ -201,14 +228,14 @@ let path = "usr.bin/xinstall"; version = "8.0"; sha256 = "1f6pbz3qv1qcrchdxif8p5lbmnwl8b9nq615hsd3cyl4avd5bfqj"; - extraPaths = [ mtree.src make.src ]; - nativeBuildInputs = [ + extraPaths = with self; [ mtree.src make.src ]; + nativeBuildInputs = with buildPackages.netbsd; [ bsdSetupHook makeMinimal mandoc groff ]; skipIncludesPhase = true; - buildInputs = [ compat fts ]; + buildInputs = with self; compatIfNeeded ++ [ fts ]; installPhase = '' runHook preInstall @@ -226,11 +253,11 @@ let path = "include/fts.h"; sha256 = "01d4fpxvz1pgzfk5xznz5dcm0x0gdzwcsfm1h3d0xc9kc6hj2q77"; version = "8.0"; - nativeBuildInputs = [ + nativeBuildInputs = with buildPackages.netbsd; [ bsdSetupHook ]; - propagatedBuildInputs = [ compat ]; - extraPaths = [ + propagatedBuildInputs = with self; compatIfNeeded; + extraPaths = with self; [ (fetchNetBSD "lib/libc/gen/fts.c" "8.0" "1a8hmf26242nmv05ipn3ircxb0jqmmi66rh78kkyi9vjwkfl3qn7") (fetchNetBSD "lib/libc/include/namespace.h" "8.0" "1sjvh9nw3prnk4rmdwrfsxh6gdb9lmilkn46jcfh3q5c8glqzrd7") (fetchNetBSD "lib/libc/gen/fts.3" "8.0" "1asxw0n3fhjdadwkkq3xplfgqgl3q32w1lyrvbakfa3gs0wz5zc1") @@ -262,7 +289,7 @@ let path = "usr.bin/stat"; version = "8.0"; sha256 = "0z4r96id2r4cfy443rw2s1n52n186xm0lqvs8s3qjf4314z7r7yh"; - nativeBuildInputs = [ + nativeBuildInputs = with buildPackages.netbsd; [ bsdSetupHook makeMinimal install mandoc groff @@ -277,14 +304,14 @@ let statHook = makeSetupHook { name = "netbsd-stat-hook"; } (writeText "netbsd-stat-hook-impl" '' - makeFlagsArray+=(TOOL_STAT=${netbsd.stat}/bin/stat) + makeFlagsArray+=(TOOL_STAT=${self.stat}/bin/stat) ''); tsort = mkDerivation { path = "usr.bin/tsort"; version = "8.0"; sha256 = "1dqvf9gin29nnq3c4byxc7lfd062pg7m84843zdy6n0z63hnnwiq"; - nativeBuildInputs = [ + nativeBuildInputs = with buildPackages.netbsd; [ bsdSetupHook makeMinimal install mandoc groff @@ -295,7 +322,7 @@ let path = "usr.bin/lorder"; version = "8.0"; sha256 = "0rjf9blihhm0n699vr2bg88m4yjhkbxh6fxliaay3wxkgnydjwn2"; - nativeBuildInputs = [ + nativeBuildInputs = with buildPackages.netbsd; [ bsdSetupHook makeMinimal install mandoc groff @@ -337,7 +364,7 @@ let path = "usr.sbin/mtree"; version = "8.0"; sha256 = "0hanmzm8bgwz2bhsinmsgfmgy6nbdhprwmgwbyjm6bl17vgn7vid"; - extraPaths = [ mknod.src ]; + extraPaths = with self; [ mknod.src ]; }; mknod = mkDerivation { @@ -396,14 +423,14 @@ let version = "8.0"; sha256 = "092y7db7k4kh2jq8qc55126r5qqvlb8lq8mhmy5ipbi36hwb4zrz"; HOSTPROG = "tic"; - buildInputs = [ compat ]; - nativeBuildInputs = [ + buildInputs = with self; compatIfNeeded; + nativeBuildInputs = with buildPackages.netbsd; [ bsdSetupHook makeMinimal install mandoc groff nbperf ]; makeFlags = [ "TOOLDIR=$(out)" ]; - extraPaths = [ + extraPaths = with self; [ libterminfo.src (fetchNetBSD "usr.bin/tic" "8.0" "0diirnzmdnpc5bixyb34c9rid9paw2a4zfczqrpqrfvjsf1nnljf") (fetchNetBSD "tools/Makefile.host" "8.0" "1p23dsc4qrv93vc6gzid9w2479jwswry9qfn88505s0pdd7h6nvp") @@ -429,12 +456,12 @@ let version = "8.0"; sha256 = "0piyn8lgdqxwz9wkgc2plzp2xpj93fs4xncri8l0jfas9rv5j2m5"; NIX_CFLAGS_COMPILE = [ "-DMAKE_BOOTSTRAP" ]; - nativeBuildInputs = [ + nativeBuildInputs = with buildPackages.netbsd; [ bsdSetupHook makeMinimal install mandoc byacc flex ]; - buildInputs = [ compat ]; - extraPaths = [ cksum.src ]; + buildInputs = with self; compatIfNeeded; + extraPaths = with self; [ cksum.src ]; }; ## ## END COMMAND LINE TOOLS @@ -447,34 +474,35 @@ let path = "include"; version = "8.0"; sha256 = "128m77k16i7frvk8kifhmxzk7a37m7z1s0bbmja3ywga6sx6v6sq"; - nativeBuildInputs = [ + nativeBuildInputs = with buildPackages.netbsd; [ bsdSetupHook makeMinimal install mandoc groff nbperf rpcgen ]; - extraPaths = [ common.src ]; + extraPaths = with self; [ common.src ]; headersOnly = true; noCC = true; - # meta.platforms = lib.platforms.netbsd; - makeFlags = [ "RPCGEN_CPP=${buildPackages.gcc-unwrapped}/bin/cpp" ]; + meta.platforms = lib.platforms.netbsd; + makeFlags = [ "RPCGEN_CPP=${buildPackages.stdenv.cc.cc}/bin/cpp" ]; }; common = mkDerivation { path = "common"; version = "8.0"; sha256 = "1fsm2b7p7zkhiz523jw75088cq2h39iknp0fp3di9a64bikwbhi1"; + noCC = true; }; - # The full kernel - sys = mkDerivation { + sys-headers = mkDerivation { + pname = "sys-headers"; path = "sys"; version = "8.0"; sha256 = "123ilg8fqmp69bw6bs6nh98fpi1v2n9lamrzar61p27ji6sj7g0w"; CONFIG = "GENERIC"; - propagatedBuildInputs = [ include ]; - nativeBuildInputs = [ + propagatedBuildInputs = with self; [ include ]; + nativeBuildInputs = with buildPackages.netbsd; [ bsdSetupHook makeMinimal install tsort lorder statHook uudecode config genassym ]; @@ -499,17 +527,31 @@ let ''; meta.platforms = lib.platforms.netbsd; - extraPaths = [ common.src ]; + extraPaths = with self; [ common.src ]; + + installPhase = "includesPhase"; + dontBuild = true; + noCC = true; + }; + + # The full kernel. We do the funny thing of overridding the headers to the + # full kernal and not vice versa to avoid infinite recursion -- the headers + # come earlier in the bootstrap. + sys = self.sys-headers.override { + pname = "sys"; + installPhase = null; + noCC = false; + dontBuild = false; }; headers = symlinkJoin { name = "netbsd-headers-8.0"; - paths = [ include ] ++ map (pkg: pkg.override (_: { - installPhase = "includesPhase"; - dontBuild = true; - noCC = true; - meta.platforms = lib.platforms.all; - })) [ sys libpthread ]; + paths = with self; [ + include + sys-headers + libpthread-headers + ]; + meta.platforms = lib.platforms.netbsd; }; ## ## END HEADERS @@ -522,15 +564,15 @@ let path = "lib/libutil"; version = "8.0"; sha256 = "077syyxd303m4x7avs5nxzk4c9n13d5lyk5aicsacqjvx79qrk3i"; - extraPaths = [ common.src ]; + extraPaths = with self; [ common.src ]; }; libedit = mkDerivation { path = "lib/libedit"; version = "8.0"; sha256 = "0pmqh2mkfp70bwchiwyrkdyq9jcihx12g1awd6alqi9bpr3f9xmd"; - buildInputs = [ libterminfo libcurses ]; - propagatedBuildInputs = [ compat ]; + buildInputs = with self; [ libterminfo libcurses ]; + propagatedBuildInputs = with self; compatIfNeeded; postPatch = '' sed -i '1i #undef bool_t' el.h substituteInPlace config.h \ @@ -548,10 +590,10 @@ let path = "lib/libterminfo"; version = "8.0"; sha256 = "14gp0d6fh6zjnbac2yjhyq5m6rca7gm6q1s9gilhzpdgl9m7vb9r"; - nativeBuildInputs = [ + nativeBuildInputs = with buildPackages.netbsd; [ makeMinimal install tsort lorder mandoc statHook nbperf tic ]; - buildInputs = [ compat ]; + buildInputs = with self; compatIfNeeded; SHLIBINSTALLDIR = "$(out)/lib"; postPatch = '' substituteInPlace term.c --replace /usr/share $out/share @@ -564,7 +606,7 @@ let postInstall = '' make -C $BSDSRCDIR/share/terminfo BINDIR=$out/share install ''; - extraPaths = [ + extraPaths = with self; [ (fetchNetBSD "share/terminfo" "8.0" "18db0fk1dw691vk6lsm6dksm4cf08g8kdm0gc4052ysdagg2m6sm") ]; }; @@ -573,13 +615,13 @@ let path = "lib/libcurses"; version = "8.0"; sha256 = "0azhzh1910v24dqx45zmh4z4dl63fgsykajrbikx5xfvvmkcq7xs"; - buildInputs = [ libterminfo ]; + buildInputs = with self; [ libterminfo ]; NIX_CFLAGS_COMPILE = [ "-D__scanflike(a,b)=" "-D__va_list=va_list" "-D__warn_references(a,b)=" ] ++ lib.optional stdenv.isDarwin "-D__strong_alias(a,b)="; - propagatedBuildInputs = [ compat ]; + propagatedBuildInputs = with self; compatIfNeeded; MKDOC = "no"; # missing vfontedpr postPatch = lib.optionalString (!stdenv.isDarwin) '' substituteInPlace printw.c \ @@ -632,19 +674,30 @@ let meta.platforms = lib.platforms.netbsd; }; - libpthread = mkDerivation { + libpthread-headers = mkDerivation { + pname = "libpthread-headers"; path = "lib/libpthread"; version = "8.0"; sha256 = "0pcz61klc3ijf5z2zf8s78nj7bwjfblzjllx7vr4z5qv3m0sdb3j"; + installPhase = "includesPhase"; + dontBuild = true; + noCC = true; meta.platforms = lib.platforms.netbsd; }; + libpthread = self.libpthread-headers.override { + pname = "libpthread"; + installPhase = null; + noCC = false; + dontBuild = false; + }; + libresolv = mkDerivation { path = "lib/libresolv"; version = "8.0"; sha256 = "11vpb3p2343wyrhw4v9gwz7i0lcpb9ysmfs9gsx56b5gkgipdy4v"; meta.platforms = lib.platforms.netbsd; - extraPaths = [ libc.src ]; + extraPaths = with self; [ libc.src ]; }; libm = mkDerivation { @@ -659,7 +712,7 @@ let version = "8.0"; sha256 = "0w6y5v3binm7gf2kn7y9jja8k18rhnyl55cvvfnfipjqdxvxd9jd"; meta.platforms = lib.platforms.netbsd; - extraPaths = [ libc.src ]; + extraPaths = with self; [ libc.src ]; }; csu = mkDerivation { @@ -667,13 +720,14 @@ let version = "8.0"; sha256 = "0630lbvz6v4ic13bfg8ccwfhqkgcv76bfdw9f36rfsnwfgpxqsmq"; meta.platforms = lib.platforms.netbsd; - nativeBuildInputs = [ + nativeBuildInputs = with buildPackages.netbsd; [ bsdSetupHook makeMinimal install mandoc groff flex byacc genassym gencat lorder tsort statHook ]; - extraPaths = [ sys.src ld_elf_so.src ]; + buildInputs = with self; [ headers ]; + extraPaths = with self; [ sys.src ld_elf_so.src ]; }; ld_elf_so = mkDerivation { @@ -686,7 +740,7 @@ let SHLINKINSTALLDIR = "/usr/libexec"; USE_FORT = "yes"; makeFlags = [ "CLIBOBJ=${stdenv.cc.libc}/lib" ]; - extraPaths = [ libc.src ] ++ libc.extraPaths; + extraPaths = with self; [ libc.src ] ++ libc.extraPaths; }; libc = mkDerivation { @@ -695,30 +749,30 @@ let sha256 = "0lgbc58qgn8kwm3l011x1ml1kgcf7jsgq7hbf0hxhlbvxq5bljl3"; USE_FORT = "yes"; MKPROFILE = "no"; - extraPaths = [ + extraPaths = with self; [ common.src i18n_module.src sys.src ld_elf_so.src libpthread.src libm.src libresolv.src librpcsvc.src libutil.src librt.src libcrypt.src ]; - nativeBuildInputs = [ + nativeBuildInputs = with buildPackages.netbsd; [ bsdSetupHook makeMinimal install mandoc groff flex byacc genassym gencat lorder tsort statHook rpcgen ]; - buildInputs = [ buildPackages.netbsd.headers csu ]; - NIX_CFLAGS_COMPILE = "-B${csu}/lib"; + buildInputs = with self; [ headers csu ]; + NIX_CFLAGS_COMPILE = "-B${self.csu}/lib"; meta.platforms = lib.platforms.netbsd; SHLIBINSTALLDIR = "$(out)/lib"; NLSDIR = "$(out)/share/nls"; makeFlags = [ "FILESDIR=$(out)/var/db"]; postInstall = '' - pushd ${buildPackages.netbsd.headers} + pushd ${self.headers} find . -type d -exec mkdir -p $out/\{} \; find . \( -type f -o -type l \) -exec cp -pr \{} $out/\{} \; popd - pushd ${csu} + pushd ${self.csu} find . -type d -exec mkdir -p $out/\{} \; find . \( -type f -o -type l \) -exec cp -pr \{} $out/\{} \; popd @@ -752,7 +806,7 @@ let make -C $BSDSRCDIR/lib/libcrypt $makeFlags install ''; postPatch = '' - sed -i 's,/usr\(/include/sys/syscall.h\),${buildPackages.netbsd.headers}\1,g' \ + sed -i 's,/usr\(/include/sys/syscall.h\),${self.headers}\1,g' \ sys/Makefile.inc ../librt/sys/Makefile.inc ''; }; @@ -790,6 +844,4 @@ let # END MISCELLANEOUS # - }; - -in netbsd +}) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 1e33a921552..36d9b4f9572 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -10316,7 +10316,7 @@ in libcCross1 = if stdenv.targetPlatform.libc == "msvcrt" then targetPackages.windows.mingw_w64_headers else if stdenv.targetPlatform.libc == "libSystem" then darwin.xcode - else if stdenv.targetPlatform.libc == "nblibc" then netbsd.headers + else if stdenv.targetPlatform.libc == "nblibc" then targetPackages.netbsdCross.headers else null; binutils1 = wrapBintoolsWith { bintools = binutils-unwrapped; @@ -14553,7 +14553,7 @@ in else if name == "msvcrt" then targetPackages.windows.mingw_w64 or windows.mingw_w64 else if stdenv.targetPlatform.useiOSPrebuilt then targetPackages.darwin.iosSdkPkgs.libraries or darwin.iosSdkPkgs.libraries else if name == "libSystem" then targetPackages.darwin.xcode - else if name == "nblibc" then targetPackages.netbsdCross.libc + else if name == "nblibc" then targetPackages.netbsdCross.libc or netbsdCross.libc else if name == "wasilibc" then targetPackages.wasilibc or wasilibc else if name == "relibc" then targetPackages.relibc or relibc else if stdenv.targetPlatform.isGhcjs then null @@ -30977,8 +30977,8 @@ in name = "bsd-setup-hook"; } ../os-specific/bsd/setup-hook.sh; - netbsd = callPackages ../os-specific/bsd/netbsd {}; - netbsdCross = callPackages ../os-specific/bsd/netbsd { + netbsd = callPackage ../os-specific/bsd/netbsd {}; + netbsdCross = callPackage ../os-specific/bsd/netbsd { stdenv = crossLibcStdenv; }; From 5c24380395afd3ad50cf7446f483678fdaab121c Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Thu, 22 Apr 2021 19:10:32 +0000 Subject: [PATCH 084/263] netbsd.libm: fix build Tested building pkgsCross.x86_64-netbsd.netbsd.libm from x86_64-linux. At some point we should probably set SHLIBINSTALLDIR in the setupHook, but I think I'd like to get everything working first, and then make changes that affect all the builds like that. It's easier to spot regressions when you know _everything_ worked before. --- pkgs/os-specific/bsd/netbsd/default.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkgs/os-specific/bsd/netbsd/default.nix b/pkgs/os-specific/bsd/netbsd/default.nix index 61f3a6e58d2..5492ba9087e 100644 --- a/pkgs/os-specific/bsd/netbsd/default.nix +++ b/pkgs/os-specific/bsd/netbsd/default.nix @@ -704,7 +704,9 @@ in lib.makeScopeWithSplicing path = "lib/libm"; version = "8.0"; sha256 = "0i22603cgj6n00gn2m446v4kn1pk109qs1g6ylrslmihfmiy2h1d"; + SHLIBINSTALLDIR = "$(out)/lib"; meta.platforms = lib.platforms.netbsd; + extraPaths = with self; [ sys.src ]; }; i18n_module = mkDerivation { From 05d334cfe265f021b16c41375e3e5a4c4a07fc74 Mon Sep 17 00:00:00 2001 From: Julien Moutinho Date: Sun, 18 Oct 2020 15:36:24 +0200 Subject: [PATCH 085/263] Revert "Revert "apparmor: fix and improve the service"" This reverts commit 420f89ceb267b461eed5d025b6c3c0e57703cc5c. --- maintainers/maintainer-list.nix | 2 +- nixos/doc/manual/release-notes/rl-2009.xml | 18 ++ nixos/modules/config/fonts/fontconfig.nix | 34 ++ nixos/modules/config/malloc.nix | 7 + nixos/modules/module-list.nix | 1 - nixos/modules/security/apparmor-suid.nix | 49 --- nixos/modules/security/apparmor.nix | 235 +++++++++++--- nixos/modules/security/apparmor/includes.nix | 301 ++++++++++++++++++ nixos/modules/security/apparmor/profiles.nix | 11 + nixos/modules/security/pam.nix | 55 ++++ nixos/modules/security/wrappers/default.nix | 8 + .../modules/services/torrent/transmission.nix | 63 +--- nixos/modules/tasks/network-interfaces.nix | 15 + nixos/modules/virtualisation/lxc.nix | 12 +- nixos/modules/virtualisation/lxd.nix | 16 +- pkgs/os-specific/linux/apparmor/default.nix | 64 +++- .../apparmor/fix-rc.apparmor.functions.sh | 32 ++ pkgs/os-specific/linux/iputils/default.nix | 22 ++ pkgs/tools/networking/inetutils/default.nix | 22 +- pkgs/top-level/all-packages.nix | 2 +- 20 files changed, 805 insertions(+), 164 deletions(-) delete mode 100644 nixos/modules/security/apparmor-suid.nix create mode 100644 nixos/modules/security/apparmor/includes.nix create mode 100644 nixos/modules/security/apparmor/profiles.nix create mode 100644 pkgs/os-specific/linux/apparmor/fix-rc.apparmor.functions.sh diff --git a/maintainers/maintainer-list.nix b/maintainers/maintainer-list.nix index b8de823c9af..e0256e98a2b 100644 --- a/maintainers/maintainer-list.nix +++ b/maintainers/maintainer-list.nix @@ -4937,7 +4937,7 @@ name = "Julien Dehos"; }; julm = { - email = "julm+nix@sourcephile.fr"; + email = "julm+nixpkgs@sourcephile.fr"; github = "ju1m"; githubId = 21160136; name = "Julien Moutinho"; diff --git a/nixos/doc/manual/release-notes/rl-2009.xml b/nixos/doc/manual/release-notes/rl-2009.xml index 49446afdead..1f1e785021b 100644 --- a/nixos/doc/manual/release-notes/rl-2009.xml +++ b/nixos/doc/manual/release-notes/rl-2009.xml @@ -1513,6 +1513,24 @@ services.transmission.settings.rpc-bind-address = "0.0.0.0"; to get the previous behavior of listening on all network interfaces. + + + The security.apparmor module, + for the AppArmor + Mandatory Access Control system, + has been substantialy improved along with related tools, + so that module maintainers can now more easily write AppArmor profiles for NixOS. + The most notable change on the user-side is the new option , + replacing the previous profiles option + to provide a way to disable a profile + and to select whether to confine in enforce mode (default) + or in complain mode (see journalctl -b --grep apparmor). + Before enabling this module, either directly + or by importing <nixpkgs/nixos/modules/profiles/hardened.nix>, + please be sure to read the documentation of security.apparmor.enable, + and especially the part about . + + With this release systemd-networkd (when enabled through ) diff --git a/nixos/modules/config/fonts/fontconfig.nix b/nixos/modules/config/fonts/fontconfig.nix index 6e7b8c4b88a..72827c5abaa 100644 --- a/nixos/modules/config/fonts/fontconfig.nix +++ b/nixos/modules/config/fonts/fontconfig.nix @@ -448,6 +448,40 @@ in (mkIf cfg.enable { environment.systemPackages = [ pkgs.fontconfig ]; environment.etc.fonts.source = "${fontconfigEtc}/etc/fonts/"; + security.apparmor.includes."abstractions/fonts" = '' + # fonts.conf + r ${pkg.out}/etc/fonts/fonts.conf, + + # fontconfig default config files + r ${pkg.out}/etc/fonts/conf.d/*.conf, + + # 00-nixos-cache.conf + r ${cacheConf}, + + # 10-nixos-rendering.conf + r ${renderConf}, + + # 50-user.conf + ${optionalString cfg.includeUserConf '' + r ${pkg.out}/etc/fonts/conf.d.bak/50-user.conf, + ''} + + # local.conf (indirect priority 51) + ${optionalString (cfg.localConf != "") '' + r ${localConf}, + ''} + + # 52-nixos-default-fonts.conf + r ${defaultFontsConf}, + + # 53-no-bitmaps.conf + r ${rejectBitmaps}, + + ${optionalString (!cfg.allowType1) '' + # 53-nixos-reject-type1.conf + r ${rejectType1}, + ''} + ''; }) (mkIf cfg.enable { fonts.fontconfig.confPackages = [ confPkg ]; diff --git a/nixos/modules/config/malloc.nix b/nixos/modules/config/malloc.nix index a3eb55d8a42..fc35993b5a8 100644 --- a/nixos/modules/config/malloc.nix +++ b/nixos/modules/config/malloc.nix @@ -87,5 +87,12 @@ in environment.etc."ld-nix.so.preload".text = '' ${providerLibPath} ''; + security.apparmor.includes = { + "abstractions/base" = '' + r /etc/ld-nix.so.preload, + r ${config.environment.etc."ld-nix.so.preload".source}, + mr ${providerLibPath}, + ''; + }; }; } diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix index 0cd0659d1da..220515fb2ea 100644 --- a/nixos/modules/module-list.nix +++ b/nixos/modules/module-list.nix @@ -205,7 +205,6 @@ ./rename.nix ./security/acme.nix ./security/apparmor.nix - ./security/apparmor-suid.nix ./security/audit.nix ./security/auditd.nix ./security/ca.nix diff --git a/nixos/modules/security/apparmor-suid.nix b/nixos/modules/security/apparmor-suid.nix deleted file mode 100644 index 6c479e070e2..00000000000 --- a/nixos/modules/security/apparmor-suid.nix +++ /dev/null @@ -1,49 +0,0 @@ -{ config, lib, pkgs, ... }: -let - cfg = config.security.apparmor; -in -with lib; -{ - imports = [ - (mkRenamedOptionModule [ "security" "virtualization" "flushL1DataCache" ] [ "security" "virtualisation" "flushL1DataCache" ]) - ]; - - options.security.apparmor.confineSUIDApplications = mkOption { - type = types.bool; - default = true; - description = '' - Install AppArmor profiles for commonly-used SUID application - to mitigate potential privilege escalation attacks due to bugs - in such applications. - - Currently available profiles: ping - ''; - }; - - config = mkIf (cfg.confineSUIDApplications) { - security.apparmor.profiles = [ (pkgs.writeText "ping" '' - #include - /run/wrappers/bin/ping { - #include - #include - #include - - capability net_raw, - capability setuid, - network inet raw, - - ${pkgs.stdenv.cc.libc.out}/lib/*.so mr, - ${pkgs.libcap.lib}/lib/libcap.so* mr, - ${pkgs.attr.out}/lib/libattr.so* mr, - - ${pkgs.iputils}/bin/ping mixr, - - #/etc/modules.conf r, - - ## Site-specific additions and overrides. See local/README for details. - ##include - } - '') ]; - }; - -} diff --git a/nixos/modules/security/apparmor.nix b/nixos/modules/security/apparmor.nix index cfc65b347bc..3bf1e0fefc3 100644 --- a/nixos/modules/security/apparmor.nix +++ b/nixos/modules/security/apparmor.nix @@ -1,59 +1,198 @@ { config, lib, pkgs, ... }: let - inherit (lib) mkIf mkOption types concatMapStrings; + inherit (builtins) attrNames head map match readFile; + inherit (lib) types; + inherit (config.environment) etc; cfg = config.security.apparmor; + mkDisableOption = name: lib.mkEnableOption name // { + default = true; + example = false; + }; + enabledPolicies = lib.filterAttrs (n: p: p.enable) cfg.policies; in { - options = { - security.apparmor = { - enable = mkOption { - type = types.bool; - default = false; - description = "Enable the AppArmor Mandatory Access Control system."; - }; - profiles = mkOption { - type = types.listOf types.path; - default = []; - description = "List of files containing AppArmor profiles."; - }; - packages = mkOption { - type = types.listOf types.package; - default = []; - description = "List of packages to be added to apparmor's include path"; - }; - }; - }; + imports = [ + (lib.mkRenamedOptionModule [ "security" "virtualization" "flushL1DataCache" ] [ "security" "virtualisation" "flushL1DataCache" ]) + (lib.mkRemovedOptionModule [ "security" "apparmor" "confineSUIDApplications" ] "Please use the new options: `security.apparmor.policies..enable'.") + (lib.mkRemovedOptionModule [ "security" "apparmor" "profiles" ] "Please use the new option: `security.apparmor.policies'.") + apparmor/includes.nix + apparmor/profiles.nix + ]; - config = mkIf cfg.enable { - environment.systemPackages = [ pkgs.apparmor-utils ]; + options = { + security.apparmor = { + enable = lib.mkEnableOption ''the AppArmor Mandatory Access Control system. - boot.kernelParams = [ "apparmor=1" "security=apparmor" ]; + If you're enabling this module on a running system, + note that a reboot will be required to activate AppArmor in the kernel. - systemd.services.apparmor = let - paths = concatMapStrings (s: " -I ${s}/etc/apparmor.d") - ([ pkgs.apparmor-profiles ] ++ cfg.packages); - in { - after = [ "local-fs.target" ]; - before = [ "sysinit.target" ]; - wantedBy = [ "multi-user.target" ]; - unitConfig = { - DefaultDependencies = "no"; - }; - serviceConfig = { - Type = "oneshot"; - RemainAfterExit = "yes"; - ExecStart = map (p: - ''${pkgs.apparmor-parser}/bin/apparmor_parser -rKv ${paths} "${p}"'' - ) cfg.profiles; - ExecStop = map (p: - ''${pkgs.apparmor-parser}/bin/apparmor_parser -Rv "${p}"'' - ) cfg.profiles; - ExecReload = map (p: - ''${pkgs.apparmor-parser}/bin/apparmor_parser --reload ${paths} "${p}"'' - ) cfg.profiles; - }; - }; - }; + Also, beware that enabling this module will by default + try to kill unconfined but confinable running processes, + in order to obtain a confinement matching what is declared in the NixOS configuration. + This will happen when upgrading to a NixOS revision + introducing an AppArmor profile for the executable of a running process. + This is because enabling an AppArmor profile for an executable + can only confine new or already confined processes of that executable, + but leaves already running processes unconfined. + Set killUnconfinedConfinables + to false if you prefer to leave those processes running''; + policies = lib.mkOption { + description = '' + AppArmor policies. + ''; + type = types.attrsOf (types.submodule ({ name, config, ... }: { + options = { + enable = mkDisableOption "loading of the profile into the kernel"; + enforce = mkDisableOption "enforcing of the policy or only complain in the logs"; + profile = lib.mkOption { + description = "The policy of the profile."; + type = types.lines; + apply = pkgs.writeText name; + }; + }; + })); + default = {}; + }; + includes = lib.mkOption { + type = types.attrsOf types.lines; + default = {}; + description = '' + List of paths to be added to AppArmor's searched paths + when resolving include directives. + ''; + apply = lib.mapAttrs pkgs.writeText; + }; + packages = lib.mkOption { + type = types.listOf types.package; + default = []; + description = "List of packages to be added to AppArmor's include path"; + }; + enableCache = lib.mkEnableOption ''caching of AppArmor policies + in /var/cache/apparmor/. + + Beware that AppArmor policies almost always contain Nix store paths, + and thus produce at each change of these paths + a new cached version accumulating in the cache''; + killUnconfinedConfinables = mkDisableOption ''killing of processes + which have an AppArmor profile enabled + (in policies) + but are not confined (because AppArmor can only confine new processes). + Beware that due to a current limitation of AppArmor, + only profiles with exact paths (and no name) can enable such kills''; + }; + }; + + config = lib.mkIf cfg.enable { + assertions = map (policy: + { assertion = match ".*/.*" policy == null; + message = "`security.apparmor.policies.\"${policy}\"' must not contain a slash."; + # Because, for instance, aa-remove-unknown uses profiles_names_list() in rc.apparmor.functions + # which does not recurse into sub-directories. + } + ) (attrNames cfg.policies); + + environment.systemPackages = [ pkgs.apparmor-utils ]; + environment.etc."apparmor.d".source = pkgs.linkFarm "apparmor.d" ( + # It's important to put only enabledPolicies here and not all cfg.policies + # because aa-remove-unknown reads profiles from all /etc/apparmor.d/* + lib.mapAttrsToList (name: p: {inherit name; path=p.profile;}) enabledPolicies ++ + lib.mapAttrsToList (name: path: {inherit name path;}) cfg.includes + ); + environment.etc."apparmor/parser.conf".text = '' + ${if cfg.enableCache then "write-cache" else "skip-cache"} + cache-loc /var/cache/apparmor + Include /etc/apparmor.d + '' + + lib.concatMapStrings (p: "Include ${p}/etc/apparmor.d\n") cfg.packages; + # For aa-logprof + environment.etc."apparmor/apparmor.conf".text = '' + ''; + # For aa-logprof + environment.etc."apparmor/severity.db".source = pkgs.apparmor-utils + "/etc/apparmor/severity.db"; + environment.etc."apparmor/logprof.conf".text = '' + [settings] + # /etc/apparmor.d/ is read-only on NixOS + profiledir = /var/cache/apparmor/logprof + inactive_profiledir = /etc/apparmor.d/disable + # Use: journalctl -b --since today --grep audit: | aa-logprof + logfiles = /dev/stdin + + parser = ${pkgs.apparmor-parser}/bin/apparmor_parser + ldd = ${pkgs.glibc.bin}/bin/ldd + logger = ${pkgs.utillinux}/bin/logger + + # customize how file ownership permissions are presented + # 0 - off + # 1 - default of what ever mode the log reported + # 2 - force the new permissions to be user + # 3 - force all perms on the rule to be user + default_owner_prompt = 1 + + custom_includes = /etc/apparmor.d ${lib.concatMapStringsSep " " (p: "${p}/etc/apparmor.d") cfg.packages} + + [qualifiers] + ${pkgs.runtimeShell} = icnu + ${pkgs.bashInteractive}/bin/sh = icnu + ${pkgs.bashInteractive}/bin/bash = icnu + '' + head (match "^.*\\[qualifiers](.*)" # Drop the original [settings] section. + (readFile "${pkgs.apparmor-utils}/etc/apparmor/logprof.conf")); + + boot.kernelParams = [ "apparmor=1" "security=apparmor" ]; + + systemd.services.apparmor = { + after = [ + "local-fs.target" + "systemd-journald-audit.socket" + ]; + before = [ "sysinit.target" ]; + wantedBy = [ "multi-user.target" ]; + unitConfig = { + Description="Load AppArmor policies"; + DefaultDependencies = "no"; + ConditionSecurity = "apparmor"; + }; + # Reloading instead of restarting enables to load new AppArmor profiles + # without necessarily restarting all services which have Requires=apparmor.service + reloadIfChanged = true; + restartTriggers = [ + etc."apparmor/parser.conf".source + etc."apparmor.d".source + ]; + serviceConfig = let + killUnconfinedConfinables = pkgs.writeShellScript "apparmor-kill" '' + set -eu + ${pkgs.apparmor-utils}/bin/aa-status --json | + ${pkgs.jq}/bin/jq --raw-output '.processes | .[] | .[] | select (.status == "unconfined") | .pid' | + xargs --verbose --no-run-if-empty --delimiter='\n' \ + kill + ''; + commonOpts = p: "--verbose --show-cache ${lib.optionalString (!p.enforce) "--complain "}${p.profile}"; + in { + Type = "oneshot"; + RemainAfterExit = "yes"; + ExecStartPre = "${pkgs.apparmor-utils}/bin/aa-teardown"; + ExecStart = lib.mapAttrsToList (n: p: "${pkgs.apparmor-parser}/bin/apparmor_parser --add ${commonOpts p}") enabledPolicies; + ExecStartPost = lib.optional cfg.killUnconfinedConfinables killUnconfinedConfinables; + ExecReload = + # Add or replace into the kernel profiles in enabledPolicies + # (because AppArmor can do that without stopping the processes already confined). + lib.mapAttrsToList (n: p: "${pkgs.apparmor-parser}/bin/apparmor_parser --replace ${commonOpts p}") enabledPolicies ++ + # Remove from the kernel any profile whose name is not + # one of the names within the content of the profiles in enabledPolicies + # (indirectly read from /etc/apparmor.d/*, without recursing into sub-directory). + # Note that this does not remove profiles dynamically generated by libvirt. + [ "${pkgs.apparmor-utils}/bin/aa-remove-unknown" ] ++ + # Optionaly kill the processes which are unconfined but now have a profile loaded + # (because AppArmor can only start to confine new processes). + lib.optional cfg.killUnconfinedConfinables killUnconfinedConfinables; + ExecStop = "${pkgs.apparmor-utils}/bin/aa-teardown"; + CacheDirectory = [ "apparmor" "apparmor/logprof" ]; + CacheDirectoryMode = "0700"; + }; + }; + }; + + meta.maintainers = with lib.maintainers; [ julm ]; } diff --git a/nixos/modules/security/apparmor/includes.nix b/nixos/modules/security/apparmor/includes.nix new file mode 100644 index 00000000000..498d7e77650 --- /dev/null +++ b/nixos/modules/security/apparmor/includes.nix @@ -0,0 +1,301 @@ +{ config, lib, pkgs, ... }: +let + inherit (builtins) attrNames hasAttr isAttrs; + inherit (lib) getLib; + inherit (config.environment) etc; + etcRule = arg: + let go = {path ? null, mode ? "r", trail ? ""}: + lib.optionalString (hasAttr path etc) + "${mode} ${config.environment.etc.${path}.source}${trail},"; + in if isAttrs arg + then go arg + else go {path=arg;}; +in +{ +# FIXME: most of the etcRule calls below have been +# written systematically by converting from apparmor-profiles's profiles +# without testing nor deep understanding of their uses, +# and thus may need more rules or can have less rules; +# this remains to be determined case by case, +# some may even be completely useless. +config.security.apparmor.includes = { + # This one is included by + # which is usualy included before any profile. + "abstractions/tunables/alias" = '' + alias /bin -> /run/current-system/sw/bin, + alias /lib/modules -> /run/current-system/kernel/lib/modules, + alias /sbin -> /run/current-system/sw/sbin, + alias /usr -> /run/current-system/sw, + ''; + "abstractions/audio" = '' + include "${pkgs.apparmor-profiles}/etc/apparmor.d/abstractions/audio" + ${etcRule "asound.conf"} + ${etcRule "esound/esd.conf"} + ${etcRule "libao.conf"} + ${etcRule {path="pulse"; trail="/";}} + ${etcRule {path="pulse"; trail="/**";}} + ${etcRule {path="sound"; trail="/";}} + ${etcRule {path="sound"; trail="/**";}} + ${etcRule {path="alsa/conf.d"; trail="/";}} + ${etcRule {path="alsa/conf.d"; trail="/*";}} + ${etcRule "openal/alsoft.conf"} + ${etcRule "wildmidi/wildmidi.conf"} + ''; + "abstractions/authentication" = '' + include "${pkgs.apparmor-profiles}/etc/apparmor.d/abstractions/authentication" + # Defined in security.pam + include + ${etcRule "nologin"} + ${etcRule "securetty"} + ${etcRule {path="security"; trail="/*";}} + ${etcRule "shadow"} + ${etcRule "gshadow"} + ${etcRule "pwdb.conf"} + ${etcRule "default/passwd"} + ${etcRule "login.defs"} + ''; + "abstractions/base" = '' + include "${pkgs.apparmor-profiles}/etc/apparmor.d/abstractions/base" + r ${pkgs.stdenv.cc.libc}/share/locale/**, + r ${pkgs.stdenv.cc.libc}/share/locale.alias, + ${lib.optionalString (pkgs.glibcLocales != null) "r ${pkgs.glibcLocales}/lib/locale/locale-archive,"} + ${etcRule "localtime"} + r ${pkgs.tzdata}/share/zoneinfo/**, + r ${pkgs.stdenv.cc.libc}/share/i18n/**, + ''; + "abstractions/bash" = '' + include "${pkgs.apparmor-profiles}/etc/apparmor.d/abstractions/bash" + # system-wide bash configuration + ${etcRule "profile.dos"} + ${etcRule "profile"} + ${etcRule "profile.d"} + ${etcRule {path="profile.d"; trail="/*";}} + ${etcRule "bashrc"} + ${etcRule "bash.bashrc"} + ${etcRule "bash.bashrc.local"} + ${etcRule "bash_completion"} + ${etcRule "bash_completion.d"} + ${etcRule {path="bash_completion.d"; trail="/*";}} + # bash relies on system-wide readline configuration + ${etcRule "inputrc"} + # bash inspects filesystems at startup + # and /etc/mtab is linked to /proc/mounts + @{PROC}/mounts + + # run out of /etc/bash.bashrc + ${etcRule "DIR_COLORS"} + ''; + "abstractions/cups-client" = '' + include "${pkgs.apparmor-profiles}/etc/apparmor.d/abstractions/cpus-client" + ${etcRule "cups/cups-client.conf"} + ''; + "abstractions/consoles" = '' + include "${pkgs.apparmor-profiles}/etc/apparmor.d/abstractions/consoles" + ''; + "abstractions/dbus-session-strict" = '' + include "${pkgs.apparmor-profiles}/etc/apparmor.d/abstractions/dbus-session-strict" + ${etcRule "machine-id"} + ''; + "abstractions/dconf" = '' + include "${pkgs.apparmor-profiles}/etc/apparmor.d/abstractions/dconf" + ${etcRule {path="dconf"; trail="/**";}} + ''; + "abstractions/dri-common" = '' + include "${pkgs.apparmor-profiles}/etc/apparmor.d/abstractions/dri-common" + ${etcRule "drirc"} + ''; + # The config.fonts.fontconfig NixOS module adds many files to /etc/fonts/ + # by symlinking them but without exporting them outside of its NixOS module, + # those are therefore added there to this "abstractions/fonts". + "abstractions/fonts" = '' + include "${pkgs.apparmor-profiles}/etc/apparmor.d/abstractions/fonts" + ${etcRule {path="fonts"; trail="/**";}} + ''; + "abstractions/gnome" = '' + include "${pkgs.apparmor-profiles}/etc/apparmor.d/abstractions/gnome" + ${etcRule {path="gnome"; trail="/gtkrc*";}} + ${etcRule {path="gtk"; trail="/*";}} + ${etcRule {path="gtk-2.0"; trail="/*";}} + ${etcRule {path="gtk-3.0"; trail="/*";}} + ${etcRule "orbitrc"} + include + ${etcRule {path="pango"; trail="/*";}} + ${etcRule {path="/etc/gnome-vfs-2.0"; trail="/modules/";}} + ${etcRule {path="/etc/gnome-vfs-2.0"; trail="/modules/*";}} + ${etcRule "papersize"} + ${etcRule {path="cups"; trail="/lpoptions";}} + ${etcRule {path="gnome"; trail="/defaults.list";}} + ${etcRule {path="xdg"; trail="/{,*-}mimeapps.list";}} + ${etcRule "xdg/mimeapps.list"} + ''; + "abstractions/kde" = '' + include "${pkgs.apparmor-profiles}/etc/apparmor.d/abstractions/kde" + ${etcRule {path="qt3"; trail="/kstylerc";}} + ${etcRule {path="qt3"; trail="/qt_plugins_3.3rc";}} + ${etcRule {path="qt3"; trail="/qtrc";}} + ${etcRule "kderc"} + ${etcRule {path="kde3"; trail="/*";}} + ${etcRule "kde4rc"} + ${etcRule {path="xdg"; trail="/kdeglobals";}} + ${etcRule {path="xdg"; trail="/Trolltech.conf";}} + ''; + "abstractions/kerberosclient" = '' + include "${pkgs.apparmor-profiles}/etc/apparmor.d/abstractions/kerberosclient" + ${etcRule {path="krb5.keytab"; mode="rk";}} + ${etcRule "krb5.conf"} + ${etcRule "krb5.conf.d"} + ${etcRule {path="krb5.conf.d"; trail="/*";}} + + # config files found via strings on libs + ${etcRule "krb.conf"} + ${etcRule "krb.realms"} + ${etcRule "srvtab"} + ''; + "abstractions/ldapclient" = '' + include "${pkgs.apparmor-profiles}/etc/apparmor.d/abstractions/ldapclient" + ${etcRule "ldap.conf"} + ${etcRule "ldap.secret"} + ${etcRule {path="openldap"; trail="/*";}} + ${etcRule {path="openldap"; trail="/cacerts/*";}} + ${etcRule {path="sasl2"; trail="/*";}} + ''; + "abstractions/likewise" = '' + include "${pkgs.apparmor-profiles}/etc/apparmor.d/abstractions/likewise" + ''; + "abstractions/mdns" = '' + include "${pkgs.apparmor-profiles}/etc/apparmor.d/abstractions/mdns" + ${etcRule "nss_mdns.conf"} + ''; + "abstractions/nameservice" = '' + include "${pkgs.apparmor-profiles}/etc/apparmor.d/abstractions/nameservice" + + # Many programs wish to perform nameservice-like operations, such as + # looking up users by name or id, groups by name or id, hosts by name + # or IP, etc. These operations may be performed through files, dns, + # NIS, NIS+, LDAP, hesiod, wins, etc. Allow them all here. + ${etcRule "group"} + ${etcRule "host.conf"} + ${etcRule "hosts"} + ${etcRule "nsswitch.conf"} + ${etcRule "gai.conf"} + ${etcRule "passwd"} + ${etcRule "protocols"} + + # libtirpc (used for NIS/YP login) needs this + ${etcRule "netconfig"} + + ${etcRule "resolv.conf"} + + ${etcRule {path="samba"; trail="/lmhosts";}} + ${etcRule "services"} + + ${etcRule "default/nss"} + + # libnl-3-200 via libnss-gw-name + ${etcRule {path="libnl"; trail="/classid";}} + ${etcRule {path="libnl-3"; trail="/classid";}} + + mr ${getLib pkgs.nss}/lib/libnss_*.so*, + mr ${getLib pkgs.nss}/lib64/libnss_*.so*, + ''; + "abstractions/nis" = '' + include "${pkgs.apparmor-profiles}/etc/apparmor.d/abstractions/nis" + ''; + "abstractions/nvidia" = '' + include "${pkgs.apparmor-profiles}/etc/apparmor.d/abstractions/nvidia" + ${etcRule "vdpau_wrapper.cfg"} + ''; + "abstractions/opencl-common" = '' + include "${pkgs.apparmor-profiles}/etc/apparmor.d/abstractions/opencl-common" + ${etcRule {path="OpenCL"; trail="/**";}} + ''; + "abstractions/opencl-mesa" = '' + include "${pkgs.apparmor-profiles}/etc/apparmor.d/abstractions/opencl-mesa" + ${etcRule "default/drirc"} + ''; + "abstractions/openssl" = '' + include "${pkgs.apparmor-profiles}/etc/apparmor.d/abstractions/openssl" + ${etcRule {path="ssl"; trail="/openssl.cnf";}} + ''; + "abstractions/p11-kit" = '' + include "${pkgs.apparmor-profiles}/etc/apparmor.d/abstractions/p11-kit" + ${etcRule {path="pkcs11"; trail="/";}} + ${etcRule {path="pkcs11"; trail="/pkcs11.conf";}} + ${etcRule {path="pkcs11"; trail="/modules/";}} + ${etcRule {path="pkcs11"; trail="/modules/*";}} + ''; + "abstractions/perl" = '' + include "${pkgs.apparmor-profiles}/etc/apparmor.d/abstractions/perl" + ${etcRule {path="perl"; trail="/**";}} + ''; + "abstractions/php" = '' + include "${pkgs.apparmor-profiles}/etc/apparmor.d/abstractions/php" + ${etcRule {path="php"; trail="/**/";}} + ${etcRule {path="php5"; trail="/**/";}} + ${etcRule {path="php7"; trail="/**/";}} + ${etcRule {path="php"; trail="/**.ini";}} + ${etcRule {path="php5"; trail="/**.ini";}} + ${etcRule {path="php7"; trail="/**.ini";}} + ''; + "abstractions/postfix-common" = '' + include "${pkgs.apparmor-profiles}/etc/apparmor.d/abstractions/postfix-common" + ${etcRule "mailname"} + ${etcRule {path="postfix"; trail="/*.cf";}} + ${etcRule "postfix/main.cf"} + ${etcRule "postfix/master.cf"} + ''; + "abstractions/python" = '' + include "${pkgs.apparmor-profiles}/etc/apparmor.d/abstractions/python" + ''; + "abstractions/qt5" = '' + include "${pkgs.apparmor-profiles}/etc/apparmor.d/abstractions/qt5" + ${etcRule {path="xdg"; trail="/QtProject/qtlogging.ini";}} + ${etcRule {path="xdg/QtProject"; trail="/qtlogging.ini";}} + ${etcRule "xdg/QtProject/qtlogging.ini"} + ''; + "abstractions/samba" = '' + include "${pkgs.apparmor-profiles}/etc/apparmor.d/abstractions/samba" + ${etcRule {path="samba"; trail="/*";}} + ''; + "abstractions/ssl_certs" = '' + include "${pkgs.apparmor-profiles}/etc/apparmor.d/abstractions/ssl_certs" + ${etcRule "ssl/certs/ca-certificates.crt"} + ${etcRule "ssl/certs/ca-bundle.crt"} + ${etcRule "pki/tls/certs/ca-bundle.crt"} + + ${etcRule {path="ssl/trust"; trail="/";}} + ${etcRule {path="ssl/trust"; trail="/*";}} + ${etcRule {path="ssl/trust/anchors"; trail="/";}} + ${etcRule {path="ssl/trust/anchors"; trail="/**";}} + ${etcRule {path="pki/trust"; trail="/";}} + ${etcRule {path="pki/trust"; trail="/*";}} + ${etcRule {path="pki/trust/anchors"; trail="/";}} + ${etcRule {path="pki/trust/anchors"; trail="/**";}} + + # security.acme NixOS module + r /var/lib/acme/*/cert.pem, + r /var/lib/acme/*/chain.pem, + r /var/lib/acme/*/fullchain.pem, + ''; + "abstractions/ssl_keys" = '' + # security.acme NixOS module + r /var/lib/acme/*/full.pem, + r /var/lib/acme/*/key.pem, + ''; + "abstractions/vulkan" = '' + include "${pkgs.apparmor-profiles}/etc/apparmor.d/abstractions/vulkan" + ${etcRule {path="vulkan/icd.d"; trail="/";}} + ${etcRule {path="vulkan/icd.d"; trail="/*.json";}} + ''; + "abstractions/winbind" = '' + include "${pkgs.apparmor-profiles}/etc/apparmor.d/abstractions/winbind" + ${etcRule {path="samba"; trail="/smb.conf";}} + ${etcRule {path="samba"; trail="/dhcp.conf";}} + ''; + "abstractions/X" = '' + include "${pkgs.apparmor-profiles}/etc/apparmor.d/abstractions/X" + ${etcRule {path="X11/cursors"; trail="/";}} + ${etcRule {path="X11/cursors"; trail="/**";}} + ''; +}; +} diff --git a/nixos/modules/security/apparmor/profiles.nix b/nixos/modules/security/apparmor/profiles.nix new file mode 100644 index 00000000000..8eb630b5a48 --- /dev/null +++ b/nixos/modules/security/apparmor/profiles.nix @@ -0,0 +1,11 @@ +{ config, lib, pkgs, ... }: +let apparmor = config.security.apparmor; in +{ +config.security.apparmor.packages = [ pkgs.apparmor-profiles ]; +config.security.apparmor.policies."bin.ping".profile = lib.mkIf apparmor.policies."bin.ping".enable '' + include "${pkgs.iputils.apparmor}/bin.ping" + include "${pkgs.inetutils.apparmor}/bin.ping" + # Note that including those two profiles in the same profile + # would not work if the second one were to re-include . +''; +} diff --git a/nixos/modules/security/pam.nix b/nixos/modules/security/pam.nix index 103cf205012..8216c03795a 100644 --- a/nixos/modules/security/pam.nix +++ b/nixos/modules/security/pam.nix @@ -895,6 +895,61 @@ in runuser-l = { rootOK = true; unixAuth = false; }; }; + security.apparmor.includes."abstractions/pam" = let + isEnabled = test: fold or false (map test (attrValues config.security.pam.services)); + in '' + ${lib.concatMapStringsSep "\n" + (name: "r ${config.environment.etc."pam.d/${name}".source},") + (attrNames config.security.pam.services)} + mr ${getLib pkgs.pam}/lib/security/pam_filter/*, + mr ${getLib pkgs.pam}/lib/security/pam_*.so, + r ${getLib pkgs.pam}/lib/security/, + ${optionalString use_ldap + "mr ${pam_ldap}/lib/security/pam_ldap.so,"} + ${optionalString config.services.sssd.enable + "mr ${pkgs.sssd}/lib/security/pam_sss.so,"} + ${optionalString config.krb5.enable '' + mr ${pam_krb5}/lib/security/pam_krb5.so, + mr ${pam_ccreds}/lib/security/pam_ccreds.so, + ''} + ${optionalString (isEnabled (cfg: cfg.googleOsLoginAccountVerification)) '' + mr ${pkgs.google-compute-engine-oslogin}/lib/pam_oslogin_login.so, + mr ${pkgs.google-compute-engine-oslogin}/lib/pam_oslogin_admin.so, + ''} + ${optionalString (isEnabled (cfg: cfg.googleOsLoginAuthentication)) + "mr ${pkgs.google-compute-engine-oslogin}/lib/pam_oslogin_login.so,"} + ${optionalString (config.security.pam.enableSSHAgentAuth && isEnabled (cfg: cfg.sshAgentAuth)) + "mr ${pkgs.pam_ssh_agent_auth}/libexec/pam_ssh_agent_auth.so,"} + ${optionalString (isEnabled (cfg: cfg.fprintAuth)) + "mr ${pkgs.fprintd}/lib/security/pam_fprintd.so,"} + ${optionalString (isEnabled (cfg: cfg.u2fAuth)) + "mr ${pkgs.pam_u2f}/lib/security/pam_u2f.so,"} + ${optionalString (isEnabled (cfg: cfg.usbAuth)) + "mr ${pkgs.pam_usb}/lib/security/pam_usb.so,"} + ${optionalString (isEnabled (cfg: cfg.oathAuth)) + "mr ${pkgs.oathToolkit}/lib/security/pam_oath.so,"} + ${optionalString (isEnabled (cfg: cfg.yubicoAuth)) + "mr ${pkgs.yubico-pam}/lib/security/pam_yubico.so,"} + ${optionalString (isEnabled (cfg: cfg.duoSecurity.enable)) + "mr ${pkgs.duo-unix}/lib/security/pam_duo.so,"} + ${optionalString (isEnabled (cfg: cfg.otpwAuth)) + "mr ${pkgs.otpw}/lib/security/pam_otpw.so,"} + ${optionalString config.security.pam.enableEcryptfs + "mr ${pkgs.ecryptfs}/lib/security/pam_ecryptfs.so,"} + ${optionalString (isEnabled (cfg: cfg.pamMount)) + "mr ${pkgs.pam_mount}/lib/security/pam_mount.so,"} + ${optionalString (isEnabled (cfg: cfg.enableGnomeKeyring)) + "mr ${pkgs.gnome3.gnome-keyring}/lib/security/pam_gnome_keyring.so,"} + ${optionalString (isEnabled (cfg: cfg.startSession)) + "mr ${pkgs.systemd}/lib/security/pam_systemd.so,"} + ${optionalString (isEnabled (cfg: cfg.enableAppArmor) && config.security.apparmor.enable) + "mr ${pkgs.apparmor-pam}/lib/security/pam_apparmor.so,"} + ${optionalString (isEnabled (cfg: cfg.enableKwallet)) + "mr ${pkgs.plasma5.kwallet-pam}/lib/security/pam_kwallet5.so,"} + ${optionalString config.virtualisation.lxc.lxcfs.enable + "mr ${pkgs.lxc}/lib/security/pam_cgfs.so"} + ''; + }; } diff --git a/nixos/modules/security/wrappers/default.nix b/nixos/modules/security/wrappers/default.nix index 3cbf22fea7a..1e65f451515 100644 --- a/nixos/modules/security/wrappers/default.nix +++ b/nixos/modules/security/wrappers/default.nix @@ -171,6 +171,14 @@ in export PATH="${wrapperDir}:$PATH" ''; + security.apparmor.includes."nixos/security.wrappers" = '' + include "${pkgs.apparmorRulesFromClosure { name="security.wrappers"; } [ + securityWrapper + pkgs.stdenv.cc.cc + pkgs.stdenv.cc.libc + ]}" + ''; + ###### setcap activation script system.activationScripts.wrappers = lib.stringAfter [ "specialfs" "users" ] diff --git a/nixos/modules/services/torrent/transmission.nix b/nixos/modules/services/torrent/transmission.nix index 7bec073e26f..e9b5834dab4 100644 --- a/nixos/modules/services/torrent/transmission.nix +++ b/nixos/modules/services/torrent/transmission.nix @@ -5,7 +5,7 @@ with lib; let cfg = config.services.transmission; inherit (config.environment) etc; - apparmor = config.security.apparmor.enable; + apparmor = config.security.apparmor; rootDir = "/run/transmission"; homeDir = "/var/lib/transmission"; settingsDir = ".config/transmission-daemon"; @@ -184,8 +184,8 @@ in systemd.services.transmission = { description = "Transmission BitTorrent Service"; - after = [ "network.target" ] ++ optional apparmor "apparmor.service"; - requires = optional apparmor "apparmor.service"; + after = [ "network.target" ] ++ optional apparmor.enable "apparmor.service"; + requires = optional apparmor.enable "apparmor.service"; wantedBy = [ "multi-user.target" ]; environment.CURL_CA_BUNDLE = etc."ssl/certs/ca-certificates.crt".source; @@ -358,62 +358,26 @@ in }) ]; - security.apparmor.profiles = mkIf apparmor [ - (pkgs.writeText "apparmor-transmission-daemon" '' + security.apparmor.policies."bin.transmission-daemon".profile = '' include - ${pkgs.transmission}/bin/transmission-daemon { include include - - # NOTE: https://github.com/NixOS/nixpkgs/pull/93457 - # will remove the need for these by fixing - r ${etc."hosts".source}, - r /etc/ld-nix.so.preload, - ${lib.optionalString (builtins.hasAttr "ld-nix.so.preload" etc) '' - r ${etc."ld-nix.so.preload".source}, - ${concatMapStrings (p: optionalString (p != "") ("mr ${p},\n")) - (splitString "\n" config.environment.etc."ld-nix.so.preload".text)} - ''} - r ${etc."ssl/certs/ca-certificates.crt".source}, - r ${pkgs.tzdata}/share/zoneinfo/**, - r ${pkgs.stdenv.cc.libc}/share/i18n/**, - r ${pkgs.stdenv.cc.libc}/share/locale/**, - - mr ${getLib pkgs.stdenv.cc.cc}/lib/*.so*, - mr ${getLib pkgs.stdenv.cc.libc}/lib/*.so*, - mr ${getLib pkgs.attr}/lib/libattr*.so*, - mr ${getLib pkgs.c-ares}/lib/libcares*.so*, - mr ${getLib pkgs.curl}/lib/libcurl*.so*, - mr ${getLib pkgs.keyutils}/lib/libkeyutils*.so*, - mr ${getLib pkgs.libcap}/lib/libcap*.so*, - mr ${getLib pkgs.libevent}/lib/libevent*.so*, - mr ${getLib pkgs.libgcrypt}/lib/libgcrypt*.so*, - mr ${getLib pkgs.libgpgerror}/lib/libgpg-error*.so*, - mr ${getLib pkgs.libkrb5}/lib/lib*.so*, - mr ${getLib pkgs.libssh2}/lib/libssh2*.so*, - mr ${getLib pkgs.lz4}/lib/liblz4*.so*, - mr ${getLib pkgs.nghttp2}/lib/libnghttp2*.so*, - mr ${getLib pkgs.openssl}/lib/libcrypto*.so*, - mr ${getLib pkgs.openssl}/lib/libssl*.so*, - mr ${getLib pkgs.systemd}/lib/libsystemd*.so*, - mr ${getLib pkgs.util-linuxMinimal.out}/lib/libblkid.so*, - mr ${getLib pkgs.util-linuxMinimal.out}/lib/libmount.so*, - mr ${getLib pkgs.util-linuxMinimal.out}/lib/libuuid.so*, - mr ${getLib pkgs.xz}/lib/liblzma*.so*, - mr ${getLib pkgs.zlib}/lib/libz*.so*, + include + include "${pkgs.apparmorRulesFromClosure + { name = "transmission-daemon"; } + [ pkgs.transmission ]}" + include r @{PROC}/sys/kernel/random/uuid, r @{PROC}/sys/vm/overcommit_memory, - # @{pid} is not a kernel variable yet but a regexp - #r @{PROC}/@{pid}/environ, + r @{PROC}/@{pid}/environ, r @{PROC}/@{pid}/mounts, rwk /tmp/tr_session_id_*, r /run/systemd/resolve/stub-resolv.conf, r ${pkgs.openssl.out}/etc/**, r ${config.systemd.services.transmission.environment.CURL_CA_BUNDLE}, - r ${pkgs.transmission}/share/transmission/**, owner rw ${cfg.home}/${settingsDir}/**, rw ${cfg.settings.download-dir}/**, @@ -441,12 +405,9 @@ in # https://gitlab.com/apparmor/apparmor/-/wikis/AppArmorStacking#seccomp-and-no_new_privs px ${cfg.settings.script-torrent-done-filename} -> &@{dirs}, ''} - - # FIXME: enable customizing using https://github.com/NixOS/nixpkgs/pull/93457 - # include } - '') - ]; + ''; + security.apparmor.includes."local/bin.transmission-daemon" = ""; }; meta.maintainers = with lib.maintainers; [ julm ]; diff --git a/nixos/modules/tasks/network-interfaces.nix b/nixos/modules/tasks/network-interfaces.nix index f501f85b2a9..448ff842f18 100644 --- a/nixos/modules/tasks/network-interfaces.nix +++ b/nixos/modules/tasks/network-interfaces.nix @@ -1111,6 +1111,21 @@ in } else { ping.source = "${pkgs.iputils.out}/bin/ping"; }; + security.apparmor.policies."bin.ping".profile = lib.mkIf config.security.apparmor.policies."bin.ping".enable (lib.mkAfter '' + /run/wrappers/bin/ping { + include + include + rpx /run/wrappers/wrappers.*/ping, + } + /run/wrappers/wrappers.*/ping { + include + include + r /run/wrappers/wrappers.*/ping.real, + mrpx ${config.security.wrappers.ping.source}, + capability net_raw, + capability setpcap, + } + ''); # Set the host and domain names in the activation script. Don't # clear it if it's not configured in the NixOS configuration, diff --git a/nixos/modules/virtualisation/lxc.nix b/nixos/modules/virtualisation/lxc.nix index f484d5ee59a..0f8b22a45df 100644 --- a/nixos/modules/virtualisation/lxc.nix +++ b/nixos/modules/virtualisation/lxc.nix @@ -74,9 +74,13 @@ in systemd.tmpfiles.rules = [ "d /var/lib/lxc/rootfs 0755 root root -" ]; security.apparmor.packages = [ pkgs.lxc ]; - security.apparmor.profiles = [ - "${pkgs.lxc}/etc/apparmor.d/lxc-containers" - "${pkgs.lxc}/etc/apparmor.d/usr.bin.lxc-start" - ]; + security.apparmor.policies = { + "bin.lxc-start".profile = '' + include ${pkgs.lxc}/etc/apparmor.d/usr.bin.lxc-start + ''; + "lxc-containers".profile = '' + include ${pkgs.lxc}/etc/apparmor.d/lxc-containers + ''; + }; }; } diff --git a/nixos/modules/virtualisation/lxd.nix b/nixos/modules/virtualisation/lxd.nix index 96e8d68ae50..6b6f4b6e652 100644 --- a/nixos/modules/virtualisation/lxd.nix +++ b/nixos/modules/virtualisation/lxd.nix @@ -97,11 +97,17 @@ in { # does a bunch of unrelated things. systemd.tmpfiles.rules = [ "d /var/lib/lxc/rootfs 0755 root root -" ]; - security.apparmor.packages = [ cfg.lxcPackage ]; - security.apparmor.profiles = [ - "${cfg.lxcPackage}/etc/apparmor.d/lxc-containers" - "${cfg.lxcPackage}/etc/apparmor.d/usr.bin.lxc-start" - ]; + security.apparmor = { + packages = [ cfg.lxcPackage ]; + policies = { + "bin.lxc-start".profile = '' + include ${cfg.lxcPackage}/etc/apparmor.d/usr.bin.lxc-start + ''; + "lxc-containers".profile = '' + include ${cfg.lxcPackage}/etc/apparmor.d/lxc-containers + ''; + }; + }; # TODO: remove once LXD gets proper support for cgroupsv2 # (currently most of the e.g. CPU accounting stuff doesn't work) diff --git a/pkgs/os-specific/linux/apparmor/default.nix b/pkgs/os-specific/linux/apparmor/default.nix index bb0c0b45d6e..1ab02a51156 100644 --- a/pkgs/os-specific/linux/apparmor/default.nix +++ b/pkgs/os-specific/linux/apparmor/default.nix @@ -10,6 +10,13 @@ , pam , libnotify , buildPackages +, coreutils +, gnugrep +, gnused +, kmod +, writeShellScript +, closureInfo +, runCommand }: let @@ -30,6 +37,12 @@ let sha256 = "13xshy7905d9q9n8d8i0jmdi9m36wr525g4wlsp8k21n7yvvh9j4"; }; + aa-teardown = writeShellScript "aa-teardown" '' + PATH="${lib.makeBinPath [coreutils gnused gnugrep]}:$PATH" + . ${apparmor-parser}/lib/apparmor/rc.apparmor.functions + remove_profiles + ''; + prePatchCommon = '' chmod a+x ./common/list_capabilities.sh ./common/list_af_names.sh patchShebangs ./common/list_capabilities.sh ./common/list_af_names.sh @@ -121,7 +134,11 @@ let libapparmor.python ]; - prePatch = prePatchCommon + '' + prePatch = prePatchCommon + + # Do not build vim file + lib.optionalString stdenv.hostPlatform.isMusl '' + sed -i ./utils/Makefile -e "/\/d" + '' + '' substituteInPlace ./utils/apparmor/easyprof.py --replace "/sbin/apparmor_parser" "${apparmor-parser}/bin/apparmor_parser" substituteInPlace ./utils/apparmor/aa.py --replace "/sbin/apparmor_parser" "${apparmor-parser}/bin/apparmor_parser" substituteInPlace ./utils/logprof.conf --replace "/sbin/apparmor_parser" "${apparmor-parser}/bin/apparmor_parser" @@ -132,6 +149,7 @@ let installFlags = [ "DESTDIR=$(out)" "BINDIR=$(out)/bin" "VIM_INSTALL_PATH=$(out)/share" "PYPREFIX=" ]; postInstall = '' + sed -i $out/bin/aa-unconfined -e "/my_env\['PATH'\]/d" for prog in aa-audit aa-autodep aa-cleanprof aa-complain aa-disable aa-enforce aa-genprof aa-logprof aa-mergeprof aa-status aa-unconfined ; do wrapProgram $out/bin/$prog --prefix PYTHONPATH : "$out/lib/${python.libPrefix}/site-packages:$PYTHONPATH" done @@ -139,6 +157,15 @@ let substituteInPlace $out/bin/aa-notify \ --replace /usr/bin/notify-send ${libnotify}/bin/notify-send \ --replace /usr/bin/perl "${perl}/bin/perl -I ${libapparmor}/${perl.libPrefix}" + + substituteInPlace $out/bin/aa-remove-unknown \ + --replace "/usr/bin/aa-status" "$out/bin/aa-status" \ + --replace "/sbin/modprobe" "${kmod}/bin/modprobe" \ + --replace "/lib/apparmor/rc.apparmor.functions" "${apparmor-parser}/lib/apparmor/rc.apparmor.functions" + wrapProgram $out/bin/aa-remove-unknown \ + --prefix PATH : ${lib.makeBinPath [gawk]} + + ln -s ${aa-teardown} $out/bin/aa-teardown ''; inherit doCheck; @@ -187,6 +214,9 @@ let substituteInPlace ./parser/Makefile --replace "/usr/include/linux/capability.h" "${linuxHeaders}/include/linux/capability.h" ## techdoc.pdf still doesn't build ... substituteInPlace ./parser/Makefile --replace "manpages htmlmanpages pdf" "manpages htmlmanpages" + substituteInPlace parser/rc.apparmor.functions \ + --replace "/sbin/apparmor_parser" "$out/bin/apparmor_parser" + sed -i parser/rc.apparmor.functions -e '2i . ${./fix-rc.apparmor.functions.sh}' ''; inherit patches; postPatch = "cd ./parser"; @@ -248,8 +278,35 @@ let meta = apparmor-meta "kernel patches"; }; + # Generate generic AppArmor rules in a file, + # from the closure of given rootPaths. + # To be included in an AppArmor profile like so: + # include "$(apparmorRulesFromClosure {} [pkgs.hello]}" + apparmorRulesFromClosure = + { # The store path of the derivation is given in $path + additionalRules ? [] + # TODO: factorize here some other common paths + # that may emerge from use cases. + , baseRules ? [ + "r $path" + "r $path/etc/**" + "r $path/share/**" + # Note that not all libraries are prefixed with "lib", + # eg. glibc-2.30/lib/ld-2.30.so + "mr $path/lib/**.so*" + # eg. glibc-2.30/lib/gconv/gconv-modules + "r $path/lib/**" + ] + , name ? "" + }: rootPaths: runCommand + ( "apparmor-closure-rules" + + lib.optionalString (name != "") "-${name}") {} '' + touch $out + while read -r path + do printf >>$out "%s,\n" ${lib.concatMapStringsSep " " (x: "\"${x}\"") (baseRules ++ additionalRules)} + done <${closureInfo {inherit rootPaths;}}/store-paths + ''; in - { inherit libapparmor @@ -258,5 +315,6 @@ in apparmor-parser apparmor-pam apparmor-profiles - apparmor-kernel-patches; + apparmor-kernel-patches + apparmorRulesFromClosure; } diff --git a/pkgs/os-specific/linux/apparmor/fix-rc.apparmor.functions.sh b/pkgs/os-specific/linux/apparmor/fix-rc.apparmor.functions.sh new file mode 100644 index 00000000000..ebc1baaa92d --- /dev/null +++ b/pkgs/os-specific/linux/apparmor/fix-rc.apparmor.functions.sh @@ -0,0 +1,32 @@ +aa_action() { + STRING=$1 + shift + $* + rc=$? + if [ $rc -eq 0 ] ; then + aa_log_success_msg $"$STRING " + else + aa_log_failure_msg $"$STRING " + fi + return $rc +} + +aa_log_success_msg() { + [ -n "$1" ] && echo -n $1 + echo ": done." +} + +aa_log_warning_msg() { + [ -n "$1" ] && echo -n $1 + echo ": Warning." +} + +aa_log_failure_msg() { + [ -n "$1" ] && echo -n $1 + echo ": Failed." +} + +aa_log_skipped_msg() { + [ -n "$1" ] && echo -n $1 + echo ": Skipped." +} diff --git a/pkgs/os-specific/linux/iputils/default.nix b/pkgs/os-specific/linux/iputils/default.nix index 56942d6d420..122a9ca1b7b 100644 --- a/pkgs/os-specific/linux/iputils/default.nix +++ b/pkgs/os-specific/linux/iputils/default.nix @@ -1,6 +1,7 @@ { lib, stdenv, fetchFromGitHub , meson, ninja, pkg-config, gettext, libxslt, docbook_xsl_ns , libcap, libidn2 +, apparmorRulesFromClosure }: let @@ -20,6 +21,8 @@ in stdenv.mkDerivation rec { sha256 = "08j2hfgnfh31vv9rn1ml7090j2lsvm9wdpdz13rz60rmyzrx9dq3"; }; + outputs = ["out" "apparmor"]; + mesonFlags = [ "-DBUILD_RARPD=true" "-DBUILD_TRACEROUTE6=true" @@ -34,6 +37,25 @@ in stdenv.mkDerivation rec { nativeBuildInputs = [ meson ninja pkg-config gettext libxslt.bin docbook_xsl_ns ]; buildInputs = [ libcap ] ++ lib.optional (!stdenv.hostPlatform.isMusl) libidn2; + postInstall = '' + install -D -m 644 /dev/stdin $apparmor/bin.ping < + $out/bin/ping { + include + include + include + include "${apparmorRulesFromClosure { name = "ping"; } + ([libcap] ++ lib.optional (!stdenv.hostPlatform.isMusl) libidn2)}" + include + capability net_raw, + network inet raw, + network inet6 raw, + mr $out/bin/ping, + r $out/share/locale/**, + r @{PROC}/@{pid}/environ, + } + EOF + ''; meta = with lib; { description = "A set of small useful utilities for Linux networking"; diff --git a/pkgs/tools/networking/inetutils/default.nix b/pkgs/tools/networking/inetutils/default.nix index 1290ec2bdb1..fe5a0d91585 100644 --- a/pkgs/tools/networking/inetutils/default.nix +++ b/pkgs/tools/networking/inetutils/default.nix @@ -1,4 +1,6 @@ -{ stdenv, lib, fetchurl, ncurses, perl, help2man }: +{ stdenv, lib, fetchurl, ncurses, perl, help2man +, apparmorRulesFromClosure +}: stdenv.mkDerivation rec { name = "inetutils-1.9.4"; @@ -8,6 +10,8 @@ stdenv.mkDerivation rec { sha256 = "05n65k4ixl85dc6rxc51b1b732gnmm8xnqi424dy9f1nz7ppb3xy"; }; + outputs = ["out" "apparmor"]; + patches = [ ./whois-Update-Canadian-TLD-server.patch ./service-name.patch @@ -41,6 +45,22 @@ stdenv.mkDerivation rec { installFlags = [ "SUIDMODE=" ]; + postInstall = '' + install -D -m 644 /dev/stdin $apparmor/bin.ping < + include + include + include "${apparmorRulesFromClosure { name = "ping"; } [stdenv.cc.libc]}" + include + capability net_raw, + network inet raw, + network inet6 raw, + mr $out/bin/ping, + } + EOF + ''; + meta = with lib; { description = "Collection of common network programs"; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 29858e94c9c..a8c267a438e 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -19482,7 +19482,7 @@ in inherit (callPackages ../os-specific/linux/apparmor { python = python3; }) libapparmor apparmor-utils apparmor-bin-utils apparmor-parser apparmor-pam - apparmor-profiles apparmor-kernel-patches; + apparmor-profiles apparmor-kernel-patches apparmorRulesFromClosure; aseq2json = callPackage ../os-specific/linux/aseq2json {}; From fca06b142a92ce9aaca6f0a1759de719cfa42d68 Mon Sep 17 00:00:00 2001 From: Tony Olagbaiye Date: Thu, 3 Dec 2020 13:45:43 +0000 Subject: [PATCH 086/263] nixos/apparmor: remove an IFD First because IFD (import-from-derivation) is not allowed on hydra.nixos.org, and second because without https://github.com/NixOS/hydra/pull/825 hydra-eval-jobs crashes instead of skipping aggregated jobs which fail (here because they required an IFD). --- nixos/modules/security/apparmor.nix | 52 ++++++++++++++++------------- 1 file changed, 29 insertions(+), 23 deletions(-) diff --git a/nixos/modules/security/apparmor.nix b/nixos/modules/security/apparmor.nix index 3bf1e0fefc3..f5d5e4a9fd1 100644 --- a/nixos/modules/security/apparmor.nix +++ b/nixos/modules/security/apparmor.nix @@ -111,33 +111,39 @@ in ''; # For aa-logprof environment.etc."apparmor/severity.db".source = pkgs.apparmor-utils + "/etc/apparmor/severity.db"; - environment.etc."apparmor/logprof.conf".text = '' - [settings] - # /etc/apparmor.d/ is read-only on NixOS - profiledir = /var/cache/apparmor/logprof - inactive_profiledir = /etc/apparmor.d/disable - # Use: journalctl -b --since today --grep audit: | aa-logprof - logfiles = /dev/stdin + environment.etc."apparmor/logprof.conf".source = pkgs.runCommand "logprof.conf" { + header = '' + [settings] + # /etc/apparmor.d/ is read-only on NixOS + profiledir = /var/cache/apparmor/logprof + inactive_profiledir = /etc/apparmor.d/disable + # Use: journalctl -b --since today --grep audit: | aa-logprof + logfiles = /dev/stdin - parser = ${pkgs.apparmor-parser}/bin/apparmor_parser - ldd = ${pkgs.glibc.bin}/bin/ldd - logger = ${pkgs.utillinux}/bin/logger + parser = ${pkgs.apparmor-parser}/bin/apparmor_parser + ldd = ${pkgs.glibc.bin}/bin/ldd + logger = ${pkgs.utillinux}/bin/logger - # customize how file ownership permissions are presented - # 0 - off - # 1 - default of what ever mode the log reported - # 2 - force the new permissions to be user - # 3 - force all perms on the rule to be user - default_owner_prompt = 1 + # customize how file ownership permissions are presented + # 0 - off + # 1 - default of what ever mode the log reported + # 2 - force the new permissions to be user + # 3 - force all perms on the rule to be user + default_owner_prompt = 1 - custom_includes = /etc/apparmor.d ${lib.concatMapStringsSep " " (p: "${p}/etc/apparmor.d") cfg.packages} + custom_includes = /etc/apparmor.d ${lib.concatMapStringsSep " " (p: "${p}/etc/apparmor.d") cfg.packages} - [qualifiers] - ${pkgs.runtimeShell} = icnu - ${pkgs.bashInteractive}/bin/sh = icnu - ${pkgs.bashInteractive}/bin/bash = icnu - '' + head (match "^.*\\[qualifiers](.*)" # Drop the original [settings] section. - (readFile "${pkgs.apparmor-utils}/etc/apparmor/logprof.conf")); + [qualifiers] + ${pkgs.runtimeShell} = icnu + ${pkgs.bashInteractive}/bin/sh = icnu + ${pkgs.bashInteractive}/bin/bash = icnu + ''; + footer = "${pkgs.apparmor-utils}/etc/apparmor/logprof.conf"; + passAsFile = [ "header" ]; + } '' + cp $headerPath $out + sed -n '/\\[qualifiers\\]/,''${n;p}' $footer > $out + ''; boot.kernelParams = [ "apparmor=1" "security=apparmor" ]; From 27032f4dd6027abf103cabea60180e0205bb2d12 Mon Sep 17 00:00:00 2001 From: Julien Moutinho Date: Thu, 3 Dec 2020 16:25:44 +0100 Subject: [PATCH 087/263] nixos/apparmor: fix logprof.conf generation --- nixos/modules/security/apparmor.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nixos/modules/security/apparmor.nix b/nixos/modules/security/apparmor.nix index f5d5e4a9fd1..ad0cf2fbd7e 100644 --- a/nixos/modules/security/apparmor.nix +++ b/nixos/modules/security/apparmor.nix @@ -142,7 +142,7 @@ in passAsFile = [ "header" ]; } '' cp $headerPath $out - sed -n '/\\[qualifiers\\]/,''${n;p}' $footer > $out + sed '1,/\[qualifiers\]/d' $footer >> $out ''; boot.kernelParams = [ "apparmor=1" "security=apparmor" ]; From 8f9b29d1689018c95316a0f657b5707c32119515 Mon Sep 17 00:00:00 2001 From: Julien Moutinho Date: Tue, 1 Dec 2020 17:35:56 +0100 Subject: [PATCH 088/263] apparmor: 2.13.5 -> 3.0.0 --- nixos/modules/security/apparmor.nix | 7 +++++-- pkgs/os-specific/linux/apparmor/default.nix | 20 ++++++-------------- 2 files changed, 11 insertions(+), 16 deletions(-) diff --git a/nixos/modules/security/apparmor.nix b/nixos/modules/security/apparmor.nix index ad0cf2fbd7e..dfa695b81bb 100644 --- a/nixos/modules/security/apparmor.nix +++ b/nixos/modules/security/apparmor.nix @@ -93,7 +93,10 @@ in } ) (attrNames cfg.policies); - environment.systemPackages = [ pkgs.apparmor-utils ]; + environment.systemPackages = [ + pkgs.apparmor-utils + pkgs.apparmor-bin-utils + ]; environment.etc."apparmor.d".source = pkgs.linkFarm "apparmor.d" ( # It's important to put only enabledPolicies here and not all cfg.policies # because aa-remove-unknown reads profiles from all /etc/apparmor.d/* @@ -169,7 +172,7 @@ in serviceConfig = let killUnconfinedConfinables = pkgs.writeShellScript "apparmor-kill" '' set -eu - ${pkgs.apparmor-utils}/bin/aa-status --json | + ${pkgs.apparmor-bin-utils}/bin/aa-status --json | ${pkgs.jq}/bin/jq --raw-output '.processes | .[] | .[] | select (.status == "unconfined") | .pid' | xargs --verbose --no-run-if-empty --delimiter='\n' \ kill diff --git a/pkgs/os-specific/linux/apparmor/default.nix b/pkgs/os-specific/linux/apparmor/default.nix index 1ab02a51156..1b65f80802f 100644 --- a/pkgs/os-specific/linux/apparmor/default.nix +++ b/pkgs/os-specific/linux/apparmor/default.nix @@ -20,8 +20,8 @@ }: let - apparmor-series = "2.13"; - apparmor-patchver = "6"; + apparmor-series = "3.0"; + apparmor-patchver = "0"; apparmor-version = apparmor-series + "." + apparmor-patchver; apparmor-meta = component: with lib; { @@ -33,8 +33,8 @@ let }; apparmor-sources = fetchurl { - url = "https://launchpad.net/apparmor/${apparmor-series}/${apparmor-version}/+download/apparmor-${apparmor-version}.tar.gz"; - sha256 = "13xshy7905d9q9n8d8i0jmdi9m36wr525g4wlsp8k21n7yvvh9j4"; + url = "https://launchpad.net/apparmor/${apparmor-series}/${apparmor-series}/+download/apparmor-${apparmor-version}.tar.gz"; + sha256 = "0pkm8f619c0ra8kpjmarzl9d409dn4sy0kl6mb92gd0ywlgpbzb6"; }; aa-teardown = writeShellScript "aa-teardown" '' @@ -58,12 +58,6 @@ let name = "0003-Added-missing-typedef-definitions-on-parser.patch"; sha256 = "0yyaqz8jlmn1bm37arggprqz0njb4lhjni2d9c8qfqj0kll0bam0"; }) - (fetchpatch { - url = "https://git.alpinelinux.org/aports/plain/testing/apparmor/0007-Do-not-build-install-vim-file-with-utils-package.patch?id=74b8427cc21f04e32030d047ae92caa618105b53"; - name = "0007-Do-not-build-install-vim-file-with-utils-package.patch"; - sha256 = "1m4dx901biqgnr4w4wz8a2z9r9dxyw7wv6m6mqglqwf2lxinqmp4"; - }) - # (alpine patches {1,4,5,6,8} are needed for apparmor 2.11, but not 2.12) ]; # Set to `true` after the next FIXME gets fixed or this gets some @@ -150,7 +144,7 @@ let postInstall = '' sed -i $out/bin/aa-unconfined -e "/my_env\['PATH'\]/d" - for prog in aa-audit aa-autodep aa-cleanprof aa-complain aa-disable aa-enforce aa-genprof aa-logprof aa-mergeprof aa-status aa-unconfined ; do + for prog in aa-audit aa-autodep aa-cleanprof aa-complain aa-disable aa-enforce aa-genprof aa-logprof aa-mergeprof aa-unconfined ; do wrapProgram $out/bin/$prog --prefix PYTHONPATH : "$out/lib/${python.libPrefix}/site-packages:$PYTHONPATH" done @@ -159,8 +153,6 @@ let --replace /usr/bin/perl "${perl}/bin/perl -I ${libapparmor}/${perl.libPrefix}" substituteInPlace $out/bin/aa-remove-unknown \ - --replace "/usr/bin/aa-status" "$out/bin/aa-status" \ - --replace "/sbin/modprobe" "${kmod}/bin/modprobe" \ --replace "/lib/apparmor/rc.apparmor.functions" "${apparmor-parser}/lib/apparmor/rc.apparmor.functions" wrapProgram $out/bin/aa-remove-unknown \ --prefix PATH : ${lib.makeBinPath [gawk]} @@ -193,7 +185,7 @@ let prePatch = prePatchCommon; postPatch = "cd ./binutils"; makeFlags = [ "LANGS=" "USE_SYSTEM=1" ]; - installFlags = [ "DESTDIR=$(out)" "BINDIR=$(out)/bin" ]; + installFlags = [ "DESTDIR=$(out)" "BINDIR=$(out)/bin" "SBINDIR=$(out)/bin" ]; inherit doCheck; From 7996dfb1a1f4b776d8e36aa6e901cb76cdf7685c Mon Sep 17 00:00:00 2001 From: Julien Moutinho Date: Fri, 25 Dec 2020 15:40:02 +0100 Subject: [PATCH 089/263] apparmor: 3.0.0 -> 3.0.1 --- pkgs/os-specific/linux/apparmor/default.nix | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/pkgs/os-specific/linux/apparmor/default.nix b/pkgs/os-specific/linux/apparmor/default.nix index 1b65f80802f..67d354b42bc 100644 --- a/pkgs/os-specific/linux/apparmor/default.nix +++ b/pkgs/os-specific/linux/apparmor/default.nix @@ -20,21 +20,19 @@ }: let - apparmor-series = "3.0"; - apparmor-patchver = "0"; - apparmor-version = apparmor-series + "." + apparmor-patchver; + apparmor-version = "3.0.1"; apparmor-meta = component: with lib; { homepage = "https://apparmor.net/"; description = "A mandatory access control system - ${component}"; license = licenses.gpl2; - maintainers = with maintainers; [ phreedom thoughtpolice joachifm ]; + maintainers = with maintainers; [ joachifm julm phreedom thoughtpolice ]; platforms = platforms.linux; }; apparmor-sources = fetchurl { - url = "https://launchpad.net/apparmor/${apparmor-series}/${apparmor-series}/+download/apparmor-${apparmor-version}.tar.gz"; - sha256 = "0pkm8f619c0ra8kpjmarzl9d409dn4sy0kl6mb92gd0ywlgpbzb6"; + url = "https://launchpad.net/apparmor/${lib.versions.majorMinor apparmor-version}/${apparmor-version}/+download/apparmor-${apparmor-version}.tar.gz"; + sha256 = "096zbg3v7b51x7f1ly61mzd3iy9alad6sd4lam98j2d6v5ragbcg"; }; aa-teardown = writeShellScript "aa-teardown" '' From 03b2156d269ed9d50b359b4362a094725b275f2d Mon Sep 17 00:00:00 2001 From: Julien Moutinho Date: Mon, 4 Jan 2021 00:13:30 +0100 Subject: [PATCH 090/263] nixos/apparmor: move release note to 21.05 --- nixos/doc/manual/release-notes/rl-2009.xml | 18 ------------------ nixos/doc/manual/release-notes/rl-2105.xml | 18 ++++++++++++++++++ 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/nixos/doc/manual/release-notes/rl-2009.xml b/nixos/doc/manual/release-notes/rl-2009.xml index 1f1e785021b..49446afdead 100644 --- a/nixos/doc/manual/release-notes/rl-2009.xml +++ b/nixos/doc/manual/release-notes/rl-2009.xml @@ -1513,24 +1513,6 @@ services.transmission.settings.rpc-bind-address = "0.0.0.0"; to get the previous behavior of listening on all network interfaces. - - - The security.apparmor module, - for the AppArmor - Mandatory Access Control system, - has been substantialy improved along with related tools, - so that module maintainers can now more easily write AppArmor profiles for NixOS. - The most notable change on the user-side is the new option , - replacing the previous profiles option - to provide a way to disable a profile - and to select whether to confine in enforce mode (default) - or in complain mode (see journalctl -b --grep apparmor). - Before enabling this module, either directly - or by importing <nixpkgs/nixos/modules/profiles/hardened.nix>, - please be sure to read the documentation of security.apparmor.enable, - and especially the part about . - - With this release systemd-networkd (when enabled through ) diff --git a/nixos/doc/manual/release-notes/rl-2105.xml b/nixos/doc/manual/release-notes/rl-2105.xml index e0552c25a85..6a738214096 100644 --- a/nixos/doc/manual/release-notes/rl-2105.xml +++ b/nixos/doc/manual/release-notes/rl-2105.xml @@ -857,6 +857,24 @@ environment.systemPackages = [ Note that users defined with an explicit UID below 500 are exempted from this check, as has no effect for those. + + + The security.apparmor module, + for the AppArmor + Mandatory Access Control system, + has been substantialy improved along with related tools, + so that module maintainers can now more easily write AppArmor profiles for NixOS. + The most notable change on the user-side is the new option , + replacing the previous profiles option + to provide a way to disable a profile + and to select whether to confine in enforce mode (default) + or in complain mode (see journalctl -b --grep apparmor). + Before enabling this module, either directly + or by importing <nixpkgs/nixos/modules/profiles/hardened.nix>, + please be sure to read the documentation of security.apparmor.enable, + and especially the part about . + + The GNOME desktop manager once again installs gnome3.epiphany by default. From b280e64078d69c59cf4fccfcaa9d56a59d789dc9 Mon Sep 17 00:00:00 2001 From: Julien Moutinho Date: Thu, 3 Dec 2020 18:03:32 +0100 Subject: [PATCH 091/263] transmission: move apparmor profile to Nixpkgs --- .../modules/services/torrent/transmission.nix | 79 ++++++++----------- .../networking/p2p/transmission/default.nix | 27 +++++++ 2 files changed, 58 insertions(+), 48 deletions(-) diff --git a/nixos/modules/services/torrent/transmission.nix b/nixos/modules/services/torrent/transmission.nix index e9b5834dab4..34a5219c959 100644 --- a/nixos/modules/services/torrent/transmission.nix +++ b/nixos/modules/services/torrent/transmission.nix @@ -359,55 +359,38 @@ in ]; security.apparmor.policies."bin.transmission-daemon".profile = '' - include - ${pkgs.transmission}/bin/transmission-daemon { - include - include - include - include "${pkgs.apparmorRulesFromClosure - { name = "transmission-daemon"; } - [ pkgs.transmission ]}" - include - - r @{PROC}/sys/kernel/random/uuid, - r @{PROC}/sys/vm/overcommit_memory, - r @{PROC}/@{pid}/environ, - r @{PROC}/@{pid}/mounts, - rwk /tmp/tr_session_id_*, - r /run/systemd/resolve/stub-resolv.conf, - - r ${pkgs.openssl.out}/etc/**, - r ${config.systemd.services.transmission.environment.CURL_CA_BUNDLE}, - - owner rw ${cfg.home}/${settingsDir}/**, - rw ${cfg.settings.download-dir}/**, - ${optionalString cfg.settings.incomplete-dir-enabled '' - rw ${cfg.settings.incomplete-dir}/**, - ''} - ${optionalString cfg.settings.watch-dir-enabled '' - rw ${cfg.settings.watch-dir}/**, - ''} - profile dirs { - rw ${cfg.settings.download-dir}/**, - ${optionalString cfg.settings.incomplete-dir-enabled '' - rw ${cfg.settings.incomplete-dir}/**, - ''} - ${optionalString cfg.settings.watch-dir-enabled '' - rw ${cfg.settings.watch-dir}/**, - ''} - } - - ${optionalString (cfg.settings.script-torrent-done-enabled && - cfg.settings.script-torrent-done-filename != "") '' - # Stack transmission_directories profile on top of - # any existing profile for script-torrent-done-filename - # FIXME: to be tested as I'm not sure it works well with NoNewPrivileges= - # https://gitlab.com/apparmor/apparmor/-/wikis/AppArmorStacking#seccomp-and-no_new_privs - px ${cfg.settings.script-torrent-done-filename} -> &@{dirs}, - ''} - } + include "${pkgs.transmission.apparmor}/bin.transmission-daemon" + ''; + security.apparmor.includes."local/bin.transmission-daemon" = '' + r ${config.systemd.services.transmission.environment.CURL_CA_BUNDLE}, + + owner rw ${cfg.home}/${settingsDir}/**, + rw ${cfg.settings.download-dir}/**, + ${optionalString cfg.settings.incomplete-dir-enabled '' + rw ${cfg.settings.incomplete-dir}/**, + ''} + ${optionalString cfg.settings.watch-dir-enabled '' + rw ${cfg.settings.watch-dir}/**, + ''} + profile dirs { + rw ${cfg.settings.download-dir}/**, + ${optionalString cfg.settings.incomplete-dir-enabled '' + rw ${cfg.settings.incomplete-dir}/**, + ''} + ${optionalString cfg.settings.watch-dir-enabled '' + rw ${cfg.settings.watch-dir}/**, + ''} + } + + ${optionalString (cfg.settings.script-torrent-done-enabled && + cfg.settings.script-torrent-done-filename != "") '' + # Stack transmission_directories profile on top of + # any existing profile for script-torrent-done-filename + # FIXME: to be tested as I'm not sure it works well with NoNewPrivileges= + # https://gitlab.com/apparmor/apparmor/-/wikis/AppArmorStacking#seccomp-and-no_new_privs + px ${cfg.settings.script-torrent-done-filename} -> &@{dirs}, + ''} ''; - security.apparmor.includes."local/bin.transmission-daemon" = ""; }; meta.maintainers = with lib.maintainers; [ julm ]; diff --git a/pkgs/applications/networking/p2p/transmission/default.nix b/pkgs/applications/networking/p2p/transmission/default.nix index 363e5f7cfbe..b3a2a3eb212 100644 --- a/pkgs/applications/networking/p2p/transmission/default.nix +++ b/pkgs/applications/networking/p2p/transmission/default.nix @@ -21,6 +21,7 @@ , enableDaemon ? true , enableCli ? true , installLib ? false +, apparmorRulesFromClosure }: let @@ -38,6 +39,8 @@ in stdenv.mkDerivation { fetchSubmodules = true; }; + outputs = [ "out" "apparmor" ]; + cmakeFlags = let mkFlag = opt: if opt then "ON" else "OFF"; @@ -74,6 +77,30 @@ in stdenv.mkDerivation { NIX_LDFLAGS = lib.optionalString stdenv.isDarwin "-framework CoreFoundation"; + postInstall = '' + install -D -m 644 /dev/stdin $apparmor/bin.transmission-daemon < + $out/bin/transmission-daemon { + include + include + include + include "${apparmorRulesFromClosure { name = "transmission-daemon"; } ([ + curl libevent openssl pcre zlib + ] ++ lib.optionals enableSystemd [ systemd ] + ++ lib.optionals stdenv.isLinux [ inotify-tools ] + )}" + r @{PROC}/sys/kernel/random/uuid, + r @{PROC}/sys/vm/overcommit_memory, + r @{PROC}/@{pid}/environ, + r @{PROC}/@{pid}/mounts, + rwk /tmp/tr_session_id_*, + r /run/systemd/resolve/stub-resolv.conf, + + include + } + EOF + ''; + meta = { description = "A fast, easy and free BitTorrent client"; longDescription = '' From 45e5d726b22db783731f0460870e9ab4f06bc5c4 Mon Sep 17 00:00:00 2001 From: Julien Moutinho Date: Sat, 27 Feb 2021 21:26:47 +0100 Subject: [PATCH 092/263] nixos/apparmor: improve code readability --- nixos/modules/security/apparmor.nix | 62 ++-- nixos/modules/security/apparmor/includes.nix | 328 ++++++++++--------- nixos/modules/security/misc.nix | 4 + nixos/modules/security/pam.nix | 112 ++++--- pkgs/os-specific/linux/apparmor/default.nix | 2 +- 5 files changed, 276 insertions(+), 232 deletions(-) diff --git a/nixos/modules/security/apparmor.nix b/nixos/modules/security/apparmor.nix index dfa695b81bb..68bc3f126cb 100644 --- a/nixos/modules/security/apparmor.nix +++ b/nixos/modules/security/apparmor.nix @@ -1,29 +1,31 @@ { config, lib, pkgs, ... }: +with lib; + let inherit (builtins) attrNames head map match readFile; inherit (lib) types; inherit (config.environment) etc; cfg = config.security.apparmor; - mkDisableOption = name: lib.mkEnableOption name // { + mkDisableOption = name: mkEnableOption name // { default = true; example = false; }; - enabledPolicies = lib.filterAttrs (n: p: p.enable) cfg.policies; + enabledPolicies = filterAttrs (n: p: p.enable) cfg.policies; in { imports = [ - (lib.mkRenamedOptionModule [ "security" "virtualization" "flushL1DataCache" ] [ "security" "virtualisation" "flushL1DataCache" ]) - (lib.mkRemovedOptionModule [ "security" "apparmor" "confineSUIDApplications" ] "Please use the new options: `security.apparmor.policies..enable'.") - (lib.mkRemovedOptionModule [ "security" "apparmor" "profiles" ] "Please use the new option: `security.apparmor.policies'.") + (mkRemovedOptionModule [ "security" "apparmor" "confineSUIDApplications" ] "Please use the new options: `security.apparmor.policies..enable'.") + (mkRemovedOptionModule [ "security" "apparmor" "profiles" ] "Please use the new option: `security.apparmor.policies'.") apparmor/includes.nix apparmor/profiles.nix ]; options = { security.apparmor = { - enable = lib.mkEnableOption ''the AppArmor Mandatory Access Control system. + enable = mkEnableOption '' + the AppArmor Mandatory Access Control system. If you're enabling this module on a running system, note that a reboot will be required to activate AppArmor in the kernel. @@ -38,7 +40,7 @@ in but leaves already running processes unconfined. Set killUnconfinedConfinables to false if you prefer to leave those processes running''; - policies = lib.mkOption { + policies = mkOption { description = '' AppArmor policies. ''; @@ -46,7 +48,7 @@ in options = { enable = mkDisableOption "loading of the profile into the kernel"; enforce = mkDisableOption "enforcing of the policy or only complain in the logs"; - profile = lib.mkOption { + profile = mkOption { description = "The policy of the profile."; type = types.lines; apply = pkgs.writeText name; @@ -55,28 +57,29 @@ in })); default = {}; }; - includes = lib.mkOption { + includes = mkOption { type = types.attrsOf types.lines; default = {}; description = '' List of paths to be added to AppArmor's searched paths when resolving include directives. ''; - apply = lib.mapAttrs pkgs.writeText; + apply = mapAttrs pkgs.writeText; }; - packages = lib.mkOption { + packages = mkOption { type = types.listOf types.package; default = []; description = "List of packages to be added to AppArmor's include path"; }; - enableCache = lib.mkEnableOption ''caching of AppArmor policies + enableCache = mkEnableOption '' + caching of AppArmor policies in /var/cache/apparmor/. Beware that AppArmor policies almost always contain Nix store paths, and thus produce at each change of these paths a new cached version accumulating in the cache''; - killUnconfinedConfinables = mkDisableOption ''killing of processes - which have an AppArmor profile enabled + killUnconfinedConfinables = mkDisableOption '' + killing of processes which have an AppArmor profile enabled (in policies) but are not confined (because AppArmor can only confine new processes). Beware that due to a current limitation of AppArmor, @@ -84,7 +87,7 @@ in }; }; - config = lib.mkIf cfg.enable { + config = mkIf cfg.enable { assertions = map (policy: { assertion = match ".*/.*" policy == null; message = "`security.apparmor.policies.\"${policy}\"' must not contain a slash."; @@ -100,15 +103,15 @@ in environment.etc."apparmor.d".source = pkgs.linkFarm "apparmor.d" ( # It's important to put only enabledPolicies here and not all cfg.policies # because aa-remove-unknown reads profiles from all /etc/apparmor.d/* - lib.mapAttrsToList (name: p: {inherit name; path=p.profile;}) enabledPolicies ++ - lib.mapAttrsToList (name: path: {inherit name path;}) cfg.includes + mapAttrsToList (name: p: { inherit name; path = p.profile; }) enabledPolicies ++ + mapAttrsToList (name: path: { inherit name path; }) cfg.includes ); environment.etc."apparmor/parser.conf".text = '' - ${if cfg.enableCache then "write-cache" else "skip-cache"} - cache-loc /var/cache/apparmor - Include /etc/apparmor.d - '' + - lib.concatMapStrings (p: "Include ${p}/etc/apparmor.d\n") cfg.packages; + ${if cfg.enableCache then "write-cache" else "skip-cache"} + cache-loc /var/cache/apparmor + Include /etc/apparmor.d + '' + + concatMapStrings (p: "Include ${p}/etc/apparmor.d\n") cfg.packages; # For aa-logprof environment.etc."apparmor/apparmor.conf".text = '' ''; @@ -134,12 +137,13 @@ in # 3 - force all perms on the rule to be user default_owner_prompt = 1 - custom_includes = /etc/apparmor.d ${lib.concatMapStringsSep " " (p: "${p}/etc/apparmor.d") cfg.packages} + custom_includes = /etc/apparmor.d ${concatMapStringsSep " " (p: "${p}/etc/apparmor.d") cfg.packages} [qualifiers] ${pkgs.runtimeShell} = icnu ${pkgs.bashInteractive}/bin/sh = icnu ${pkgs.bashInteractive}/bin/bash = icnu + ${config.users.defaultUserShell} = icnu ''; footer = "${pkgs.apparmor-utils}/etc/apparmor/logprof.conf"; passAsFile = [ "header" ]; @@ -177,17 +181,17 @@ in xargs --verbose --no-run-if-empty --delimiter='\n' \ kill ''; - commonOpts = p: "--verbose --show-cache ${lib.optionalString (!p.enforce) "--complain "}${p.profile}"; + commonOpts = p: "--verbose --show-cache ${optionalString (!p.enforce) "--complain "}${p.profile}"; in { Type = "oneshot"; RemainAfterExit = "yes"; ExecStartPre = "${pkgs.apparmor-utils}/bin/aa-teardown"; - ExecStart = lib.mapAttrsToList (n: p: "${pkgs.apparmor-parser}/bin/apparmor_parser --add ${commonOpts p}") enabledPolicies; - ExecStartPost = lib.optional cfg.killUnconfinedConfinables killUnconfinedConfinables; + ExecStart = mapAttrsToList (n: p: "${pkgs.apparmor-parser}/bin/apparmor_parser --add ${commonOpts p}") enabledPolicies; + ExecStartPost = optional cfg.killUnconfinedConfinables killUnconfinedConfinables; ExecReload = # Add or replace into the kernel profiles in enabledPolicies # (because AppArmor can do that without stopping the processes already confined). - lib.mapAttrsToList (n: p: "${pkgs.apparmor-parser}/bin/apparmor_parser --replace ${commonOpts p}") enabledPolicies ++ + mapAttrsToList (n: p: "${pkgs.apparmor-parser}/bin/apparmor_parser --replace ${commonOpts p}") enabledPolicies ++ # Remove from the kernel any profile whose name is not # one of the names within the content of the profiles in enabledPolicies # (indirectly read from /etc/apparmor.d/*, without recursing into sub-directory). @@ -195,7 +199,7 @@ in [ "${pkgs.apparmor-utils}/bin/aa-remove-unknown" ] ++ # Optionaly kill the processes which are unconfined but now have a profile loaded # (because AppArmor can only start to confine new processes). - lib.optional cfg.killUnconfinedConfinables killUnconfinedConfinables; + optional cfg.killUnconfinedConfinables killUnconfinedConfinables; ExecStop = "${pkgs.apparmor-utils}/bin/aa-teardown"; CacheDirectory = [ "apparmor" "apparmor/logprof" ]; CacheDirectoryMode = "0700"; @@ -203,5 +207,5 @@ in }; }; - meta.maintainers = with lib.maintainers; [ julm ]; + meta.maintainers = with maintainers; [ julm ]; } diff --git a/nixos/modules/security/apparmor/includes.nix b/nixos/modules/security/apparmor/includes.nix index 498d7e77650..e3dd410b3bb 100644 --- a/nixos/modules/security/apparmor/includes.nix +++ b/nixos/modules/security/apparmor/includes.nix @@ -3,13 +3,15 @@ let inherit (builtins) attrNames hasAttr isAttrs; inherit (lib) getLib; inherit (config.environment) etc; + # Utility to generate an AppArmor rule + # only when the given path exists in config.environment.etc etcRule = arg: - let go = {path ? null, mode ? "r", trail ? ""}: + let go = { path ? null, mode ? "r", trail ? "" }: lib.optionalString (hasAttr path etc) "${mode} ${config.environment.etc.${path}.source}${trail},"; in if isAttrs arg then go arg - else go {path=arg;}; + else go { path = arg; }; in { # FIXME: most of the etcRule calls below have been @@ -29,76 +31,80 @@ config.security.apparmor.includes = { ''; "abstractions/audio" = '' include "${pkgs.apparmor-profiles}/etc/apparmor.d/abstractions/audio" - ${etcRule "asound.conf"} - ${etcRule "esound/esd.conf"} - ${etcRule "libao.conf"} - ${etcRule {path="pulse"; trail="/";}} - ${etcRule {path="pulse"; trail="/**";}} - ${etcRule {path="sound"; trail="/";}} - ${etcRule {path="sound"; trail="/**";}} - ${etcRule {path="alsa/conf.d"; trail="/";}} - ${etcRule {path="alsa/conf.d"; trail="/*";}} - ${etcRule "openal/alsoft.conf"} - ${etcRule "wildmidi/wildmidi.conf"} - ''; + '' + lib.concatMapStringsSep "\n" etcRule [ + "asound.conf" + "esound/esd.conf" + "libao.conf" + { path = "pulse"; trail = "/"; } + { path = "pulse"; trail = "/**"; } + { path = "sound"; trail = "/"; } + { path = "sound"; trail = "/**"; } + { path = "alsa/conf.d"; trail = "/"; } + { path = "alsa/conf.d"; trail = "/*"; } + "openal/alsoft.conf" + "wildmidi/wildmidi.conf" + ]; "abstractions/authentication" = '' include "${pkgs.apparmor-profiles}/etc/apparmor.d/abstractions/authentication" # Defined in security.pam include - ${etcRule "nologin"} - ${etcRule "securetty"} - ${etcRule {path="security"; trail="/*";}} - ${etcRule "shadow"} - ${etcRule "gshadow"} - ${etcRule "pwdb.conf"} - ${etcRule "default/passwd"} - ${etcRule "login.defs"} - ''; + '' + lib.concatMapStringsSep "\n" etcRule [ + "nologin" + "securetty" + { path = "security"; trail = "/*"; } + "shadow" + "gshadow" + "pwdb.conf" + "default/passwd" + "login.defs" + ]; "abstractions/base" = '' - include "${pkgs.apparmor-profiles}/etc/apparmor.d/abstractions/base" - r ${pkgs.stdenv.cc.libc}/share/locale/**, - r ${pkgs.stdenv.cc.libc}/share/locale.alias, - ${lib.optionalString (pkgs.glibcLocales != null) "r ${pkgs.glibcLocales}/lib/locale/locale-archive,"} - ${etcRule "localtime"} - r ${pkgs.tzdata}/share/zoneinfo/**, - r ${pkgs.stdenv.cc.libc}/share/i18n/**, + include "${pkgs.apparmor-profiles}/etc/apparmor.d/abstractions/base" + r ${pkgs.stdenv.cc.libc}/share/locale/**, + r ${pkgs.stdenv.cc.libc}/share/locale.alias, + ${lib.optionalString (pkgs.glibcLocales != null) "r ${pkgs.glibcLocales}/lib/locale/locale-archive,"} + ${etcRule "localtime"} + r ${pkgs.tzdata}/share/zoneinfo/**, + r ${pkgs.stdenv.cc.libc}/share/i18n/**, ''; "abstractions/bash" = '' include "${pkgs.apparmor-profiles}/etc/apparmor.d/abstractions/bash" - # system-wide bash configuration - ${etcRule "profile.dos"} - ${etcRule "profile"} - ${etcRule "profile.d"} - ${etcRule {path="profile.d"; trail="/*";}} - ${etcRule "bashrc"} - ${etcRule "bash.bashrc"} - ${etcRule "bash.bashrc.local"} - ${etcRule "bash_completion"} - ${etcRule "bash_completion.d"} - ${etcRule {path="bash_completion.d"; trail="/*";}} - # bash relies on system-wide readline configuration - ${etcRule "inputrc"} + # bash inspects filesystems at startup # and /etc/mtab is linked to /proc/mounts @{PROC}/mounts - # run out of /etc/bash.bashrc - ${etcRule "DIR_COLORS"} + # system-wide bash configuration + '' + lib.concatMapStringsSep "\n" etcRule [ + "profile.dos" + "profile" + "profile.d" + { path = "profile.d"; trail = "/*"; } + "bashrc" + "bash.bashrc" + "bash.bashrc.local" + "bash_completion" + "bash_completion.d" + { path = "bash_completion.d"; trail = "/*"; } + # bash relies on system-wide readline configuration + "inputrc" + # run out of /etc/bash.bashrc + "DIR_COLORS" + ]; + "abstractions/consoles" = '' + include "${pkgs.apparmor-profiles}/etc/apparmor.d/abstractions/consoles" ''; "abstractions/cups-client" = '' include "${pkgs.apparmor-profiles}/etc/apparmor.d/abstractions/cpus-client" ${etcRule "cups/cups-client.conf"} ''; - "abstractions/consoles" = '' - include "${pkgs.apparmor-profiles}/etc/apparmor.d/abstractions/consoles" - ''; "abstractions/dbus-session-strict" = '' include "${pkgs.apparmor-profiles}/etc/apparmor.d/abstractions/dbus-session-strict" ${etcRule "machine-id"} ''; "abstractions/dconf" = '' include "${pkgs.apparmor-profiles}/etc/apparmor.d/abstractions/dconf" - ${etcRule {path="dconf"; trail="/**";}} + ${etcRule { path = "dconf"; trail = "/**"; }} ''; "abstractions/dri-common" = '' include "${pkgs.apparmor-profiles}/etc/apparmor.d/abstractions/dri-common" @@ -109,62 +115,66 @@ config.security.apparmor.includes = { # those are therefore added there to this "abstractions/fonts". "abstractions/fonts" = '' include "${pkgs.apparmor-profiles}/etc/apparmor.d/abstractions/fonts" - ${etcRule {path="fonts"; trail="/**";}} + ${etcRule { path = "fonts"; trail = "/**"; }} ''; "abstractions/gnome" = '' include "${pkgs.apparmor-profiles}/etc/apparmor.d/abstractions/gnome" - ${etcRule {path="gnome"; trail="/gtkrc*";}} - ${etcRule {path="gtk"; trail="/*";}} - ${etcRule {path="gtk-2.0"; trail="/*";}} - ${etcRule {path="gtk-3.0"; trail="/*";}} - ${etcRule "orbitrc"} include - ${etcRule {path="pango"; trail="/*";}} - ${etcRule {path="/etc/gnome-vfs-2.0"; trail="/modules/";}} - ${etcRule {path="/etc/gnome-vfs-2.0"; trail="/modules/*";}} - ${etcRule "papersize"} - ${etcRule {path="cups"; trail="/lpoptions";}} - ${etcRule {path="gnome"; trail="/defaults.list";}} - ${etcRule {path="xdg"; trail="/{,*-}mimeapps.list";}} - ${etcRule "xdg/mimeapps.list"} - ''; + '' + lib.concatMapStringsSep "\n" etcRule [ + { path = "gnome"; trail = "/gtkrc*"; } + { path = "gtk"; trail = "/*"; } + { path = "gtk-2.0"; trail = "/*"; } + { path = "gtk-3.0"; trail = "/*"; } + "orbitrc" + { path = "pango"; trail = "/*"; } + { path = "/etc/gnome-vfs-2.0"; trail = "/modules/"; } + { path = "/etc/gnome-vfs-2.0"; trail = "/modules/*"; } + "papersize" + { path = "cups"; trail = "/lpoptions"; } + { path = "gnome"; trail = "/defaults.list"; } + { path = "xdg"; trail = "/{,*-}mimeapps.list"; } + "xdg/mimeapps.list" + ]; "abstractions/kde" = '' include "${pkgs.apparmor-profiles}/etc/apparmor.d/abstractions/kde" - ${etcRule {path="qt3"; trail="/kstylerc";}} - ${etcRule {path="qt3"; trail="/qt_plugins_3.3rc";}} - ${etcRule {path="qt3"; trail="/qtrc";}} - ${etcRule "kderc"} - ${etcRule {path="kde3"; trail="/*";}} - ${etcRule "kde4rc"} - ${etcRule {path="xdg"; trail="/kdeglobals";}} - ${etcRule {path="xdg"; trail="/Trolltech.conf";}} - ''; + '' + lib.concatMapStringsSep "\n" etcRule [ + { path = "qt3"; trail = "/kstylerc"; } + { path = "qt3"; trail = "/qt_plugins_3.3rc"; } + { path = "qt3"; trail = "/qtrc"; } + "kderc" + { path = "kde3"; trail = "/*"; } + "kde4rc" + { path = "xdg"; trail = "/kdeglobals"; } + { path = "xdg"; trail = "/Trolltech.conf"; } + ]; "abstractions/kerberosclient" = '' include "${pkgs.apparmor-profiles}/etc/apparmor.d/abstractions/kerberosclient" - ${etcRule {path="krb5.keytab"; mode="rk";}} - ${etcRule "krb5.conf"} - ${etcRule "krb5.conf.d"} - ${etcRule {path="krb5.conf.d"; trail="/*";}} + '' + lib.concatMapStringsSep "\n" etcRule [ + { path = "krb5.keytab"; mode="rk"; } + "krb5.conf" + "krb5.conf.d" + { path = "krb5.conf.d"; trail = "/*"; } # config files found via strings on libs - ${etcRule "krb.conf"} - ${etcRule "krb.realms"} - ${etcRule "srvtab"} - ''; + "krb.conf" + "krb.realms" + "srvtab" + ]; "abstractions/ldapclient" = '' include "${pkgs.apparmor-profiles}/etc/apparmor.d/abstractions/ldapclient" - ${etcRule "ldap.conf"} - ${etcRule "ldap.secret"} - ${etcRule {path="openldap"; trail="/*";}} - ${etcRule {path="openldap"; trail="/cacerts/*";}} - ${etcRule {path="sasl2"; trail="/*";}} - ''; + '' + lib.concatMapStringsSep "\n" etcRule [ + "ldap.conf" + "ldap.secret" + { path = "openldap"; trail = "/*"; } + { path = "openldap"; trail = "/cacerts/*"; } + { path = "sasl2"; trail = "/*"; } + ]; "abstractions/likewise" = '' include "${pkgs.apparmor-profiles}/etc/apparmor.d/abstractions/likewise" ''; "abstractions/mdns" = '' include "${pkgs.apparmor-profiles}/etc/apparmor.d/abstractions/mdns" - ${etcRule "nss_mdns.conf"} + ${etcRule "nss_mdns.conf"} ''; "abstractions/nameservice" = '' include "${pkgs.apparmor-profiles}/etc/apparmor.d/abstractions/nameservice" @@ -173,31 +183,31 @@ config.security.apparmor.includes = { # looking up users by name or id, groups by name or id, hosts by name # or IP, etc. These operations may be performed through files, dns, # NIS, NIS+, LDAP, hesiod, wins, etc. Allow them all here. - ${etcRule "group"} - ${etcRule "host.conf"} - ${etcRule "hosts"} - ${etcRule "nsswitch.conf"} - ${etcRule "gai.conf"} - ${etcRule "passwd"} - ${etcRule "protocols"} - - # libtirpc (used for NIS/YP login) needs this - ${etcRule "netconfig"} - - ${etcRule "resolv.conf"} - - ${etcRule {path="samba"; trail="/lmhosts";}} - ${etcRule "services"} - - ${etcRule "default/nss"} - - # libnl-3-200 via libnss-gw-name - ${etcRule {path="libnl"; trail="/classid";}} - ${etcRule {path="libnl-3"; trail="/classid";}} - mr ${getLib pkgs.nss}/lib/libnss_*.so*, mr ${getLib pkgs.nss}/lib64/libnss_*.so*, - ''; + '' + lib.concatMapStringsSep "\n" etcRule [ + "group" + "host.conf" + "hosts" + "nsswitch.conf" + "gai.conf" + "passwd" + "protocols" + + # libtirpc (used for NIS/YP login) needs this + "netconfig" + + "resolv.conf" + + { path = "samba"; trail = "/lmhosts"; } + "services" + + "default/nss" + + # libnl-3-200 via libnss-gw-name + { path = "libnl"; trail = "/classid"; } + { path = "libnl-3"; trail = "/classid"; } + ]; "abstractions/nis" = '' include "${pkgs.apparmor-profiles}/etc/apparmor.d/abstractions/nis" ''; @@ -207,7 +217,7 @@ config.security.apparmor.includes = { ''; "abstractions/opencl-common" = '' include "${pkgs.apparmor-profiles}/etc/apparmor.d/abstractions/opencl-common" - ${etcRule {path="OpenCL"; trail="/**";}} + ${etcRule { path = "OpenCL"; trail = "/**"; }} ''; "abstractions/opencl-mesa" = '' include "${pkgs.apparmor-profiles}/etc/apparmor.d/abstractions/opencl-mesa" @@ -215,68 +225,74 @@ config.security.apparmor.includes = { ''; "abstractions/openssl" = '' include "${pkgs.apparmor-profiles}/etc/apparmor.d/abstractions/openssl" - ${etcRule {path="ssl"; trail="/openssl.cnf";}} + ${etcRule { path = "ssl"; trail = "/openssl.cnf"; }} ''; "abstractions/p11-kit" = '' include "${pkgs.apparmor-profiles}/etc/apparmor.d/abstractions/p11-kit" - ${etcRule {path="pkcs11"; trail="/";}} - ${etcRule {path="pkcs11"; trail="/pkcs11.conf";}} - ${etcRule {path="pkcs11"; trail="/modules/";}} - ${etcRule {path="pkcs11"; trail="/modules/*";}} - ''; + '' + lib.concatMapStringsSep "\n" etcRule [ + { path = "pkcs11"; trail = "/"; } + { path = "pkcs11"; trail = "/pkcs11.conf"; } + { path = "pkcs11"; trail = "/modules/"; } + { path = "pkcs11"; trail = "/modules/*"; } + ]; "abstractions/perl" = '' include "${pkgs.apparmor-profiles}/etc/apparmor.d/abstractions/perl" - ${etcRule {path="perl"; trail="/**";}} + ${etcRule { path = "perl"; trail = "/**"; }} ''; "abstractions/php" = '' include "${pkgs.apparmor-profiles}/etc/apparmor.d/abstractions/php" - ${etcRule {path="php"; trail="/**/";}} - ${etcRule {path="php5"; trail="/**/";}} - ${etcRule {path="php7"; trail="/**/";}} - ${etcRule {path="php"; trail="/**.ini";}} - ${etcRule {path="php5"; trail="/**.ini";}} - ${etcRule {path="php7"; trail="/**.ini";}} - ''; + '' + lib.concatMapStringsSep "\n" etcRule [ + { path = "php"; trail = "/**/"; } + { path = "php5"; trail = "/**/"; } + { path = "php7"; trail = "/**/"; } + { path = "php"; trail = "/**.ini"; } + { path = "php5"; trail = "/**.ini"; } + { path = "php7"; trail = "/**.ini"; } + ]; "abstractions/postfix-common" = '' include "${pkgs.apparmor-profiles}/etc/apparmor.d/abstractions/postfix-common" - ${etcRule "mailname"} - ${etcRule {path="postfix"; trail="/*.cf";}} - ${etcRule "postfix/main.cf"} - ${etcRule "postfix/master.cf"} - ''; + '' + lib.concatMapStringsSep "\n" etcRule [ + "mailname" + { path = "postfix"; trail = "/*.cf"; } + "postfix/main.cf" + "postfix/master.cf" + ]; "abstractions/python" = '' include "${pkgs.apparmor-profiles}/etc/apparmor.d/abstractions/python" ''; "abstractions/qt5" = '' include "${pkgs.apparmor-profiles}/etc/apparmor.d/abstractions/qt5" - ${etcRule {path="xdg"; trail="/QtProject/qtlogging.ini";}} - ${etcRule {path="xdg/QtProject"; trail="/qtlogging.ini";}} - ${etcRule "xdg/QtProject/qtlogging.ini"} - ''; + '' + lib.concatMapStringsSep "\n" etcRule [ + { path = "xdg"; trail = "/QtProject/qtlogging.ini"; } + { path = "xdg/QtProject"; trail = "/qtlogging.ini"; } + "xdg/QtProject/qtlogging.ini" + ]; "abstractions/samba" = '' include "${pkgs.apparmor-profiles}/etc/apparmor.d/abstractions/samba" - ${etcRule {path="samba"; trail="/*";}} + ${etcRule { path = "samba"; trail = "/*"; }} ''; "abstractions/ssl_certs" = '' include "${pkgs.apparmor-profiles}/etc/apparmor.d/abstractions/ssl_certs" - ${etcRule "ssl/certs/ca-certificates.crt"} - ${etcRule "ssl/certs/ca-bundle.crt"} - ${etcRule "pki/tls/certs/ca-bundle.crt"} - ${etcRule {path="ssl/trust"; trail="/";}} - ${etcRule {path="ssl/trust"; trail="/*";}} - ${etcRule {path="ssl/trust/anchors"; trail="/";}} - ${etcRule {path="ssl/trust/anchors"; trail="/**";}} - ${etcRule {path="pki/trust"; trail="/";}} - ${etcRule {path="pki/trust"; trail="/*";}} - ${etcRule {path="pki/trust/anchors"; trail="/";}} - ${etcRule {path="pki/trust/anchors"; trail="/**";}} - - # security.acme NixOS module + # For the NixOS module: security.acme r /var/lib/acme/*/cert.pem, r /var/lib/acme/*/chain.pem, r /var/lib/acme/*/fullchain.pem, - ''; + + '' + lib.concatMapStringsSep "\n" etcRule [ + "ssl/certs/ca-certificates.crt" + "ssl/certs/ca-bundle.crt" + "pki/tls/certs/ca-bundle.crt" + + { path = "ssl/trust"; trail = "/"; } + { path = "ssl/trust"; trail = "/*"; } + { path = "ssl/trust/anchors"; trail = "/"; } + { path = "ssl/trust/anchors"; trail = "/**"; } + { path = "pki/trust"; trail = "/"; } + { path = "pki/trust"; trail = "/*"; } + { path = "pki/trust/anchors"; trail = "/"; } + { path = "pki/trust/anchors"; trail = "/**"; } + ]; "abstractions/ssl_keys" = '' # security.acme NixOS module r /var/lib/acme/*/full.pem, @@ -284,18 +300,18 @@ config.security.apparmor.includes = { ''; "abstractions/vulkan" = '' include "${pkgs.apparmor-profiles}/etc/apparmor.d/abstractions/vulkan" - ${etcRule {path="vulkan/icd.d"; trail="/";}} - ${etcRule {path="vulkan/icd.d"; trail="/*.json";}} + ${etcRule { path = "vulkan/icd.d"; trail = "/"; }} + ${etcRule { path = "vulkan/icd.d"; trail = "/*.json"; }} ''; "abstractions/winbind" = '' include "${pkgs.apparmor-profiles}/etc/apparmor.d/abstractions/winbind" - ${etcRule {path="samba"; trail="/smb.conf";}} - ${etcRule {path="samba"; trail="/dhcp.conf";}} + ${etcRule { path = "samba"; trail = "/smb.conf"; }} + ${etcRule { path = "samba"; trail = "/dhcp.conf"; }} ''; "abstractions/X" = '' include "${pkgs.apparmor-profiles}/etc/apparmor.d/abstractions/X" - ${etcRule {path="X11/cursors"; trail="/";}} - ${etcRule {path="X11/cursors"; trail="/**";}} + ${etcRule { path = "X11/cursors"; trail = "/"; }} + ${etcRule { path = "X11/cursors"; trail = "/**"; }} ''; }; } diff --git a/nixos/modules/security/misc.nix b/nixos/modules/security/misc.nix index d51dbbb77f7..e7abc1e0d59 100644 --- a/nixos/modules/security/misc.nix +++ b/nixos/modules/security/misc.nix @@ -7,6 +7,10 @@ with lib; maintainers = [ maintainers.joachifm ]; }; + imports = [ + (lib.mkRenamedOptionModule [ "security" "virtualization" "flushL1DataCache" ] [ "security" "virtualisation" "flushL1DataCache" ]) + ]; + options = { security.allowUserNamespaces = mkOption { type = types.bool; diff --git a/nixos/modules/security/pam.nix b/nixos/modules/security/pam.nix index 8216c03795a..1c49131d789 100644 --- a/nixos/modules/security/pam.nix +++ b/nixos/modules/security/pam.nix @@ -897,59 +897,79 @@ in security.apparmor.includes."abstractions/pam" = let isEnabled = test: fold or false (map test (attrValues config.security.pam.services)); - in '' - ${lib.concatMapStringsSep "\n" - (name: "r ${config.environment.etc."pam.d/${name}".source},") - (attrNames config.security.pam.services)} + in + lib.concatMapStringsSep "\n" + (name: "r ${config.environment.etc."pam.d/${name}".source},") + (attrNames config.security.pam.services) + + '' mr ${getLib pkgs.pam}/lib/security/pam_filter/*, mr ${getLib pkgs.pam}/lib/security/pam_*.so, r ${getLib pkgs.pam}/lib/security/, - ${optionalString use_ldap - "mr ${pam_ldap}/lib/security/pam_ldap.so,"} - ${optionalString config.services.sssd.enable - "mr ${pkgs.sssd}/lib/security/pam_sss.so,"} - ${optionalString config.krb5.enable '' + '' + + optionalString use_ldap '' + mr ${pam_ldap}/lib/security/pam_ldap.so, + '' + + optionalString config.services.sssd.enable '' + mr ${pkgs.sssd}/lib/security/pam_sss.so, + '' + + optionalString config.krb5.enable '' mr ${pam_krb5}/lib/security/pam_krb5.so, mr ${pam_ccreds}/lib/security/pam_ccreds.so, - ''} - ${optionalString (isEnabled (cfg: cfg.googleOsLoginAccountVerification)) '' + '' + + optionalString (isEnabled (cfg: cfg.googleOsLoginAccountVerification)) '' mr ${pkgs.google-compute-engine-oslogin}/lib/pam_oslogin_login.so, mr ${pkgs.google-compute-engine-oslogin}/lib/pam_oslogin_admin.so, - ''} - ${optionalString (isEnabled (cfg: cfg.googleOsLoginAuthentication)) - "mr ${pkgs.google-compute-engine-oslogin}/lib/pam_oslogin_login.so,"} - ${optionalString (config.security.pam.enableSSHAgentAuth && isEnabled (cfg: cfg.sshAgentAuth)) - "mr ${pkgs.pam_ssh_agent_auth}/libexec/pam_ssh_agent_auth.so,"} - ${optionalString (isEnabled (cfg: cfg.fprintAuth)) - "mr ${pkgs.fprintd}/lib/security/pam_fprintd.so,"} - ${optionalString (isEnabled (cfg: cfg.u2fAuth)) - "mr ${pkgs.pam_u2f}/lib/security/pam_u2f.so,"} - ${optionalString (isEnabled (cfg: cfg.usbAuth)) - "mr ${pkgs.pam_usb}/lib/security/pam_usb.so,"} - ${optionalString (isEnabled (cfg: cfg.oathAuth)) - "mr ${pkgs.oathToolkit}/lib/security/pam_oath.so,"} - ${optionalString (isEnabled (cfg: cfg.yubicoAuth)) - "mr ${pkgs.yubico-pam}/lib/security/pam_yubico.so,"} - ${optionalString (isEnabled (cfg: cfg.duoSecurity.enable)) - "mr ${pkgs.duo-unix}/lib/security/pam_duo.so,"} - ${optionalString (isEnabled (cfg: cfg.otpwAuth)) - "mr ${pkgs.otpw}/lib/security/pam_otpw.so,"} - ${optionalString config.security.pam.enableEcryptfs - "mr ${pkgs.ecryptfs}/lib/security/pam_ecryptfs.so,"} - ${optionalString (isEnabled (cfg: cfg.pamMount)) - "mr ${pkgs.pam_mount}/lib/security/pam_mount.so,"} - ${optionalString (isEnabled (cfg: cfg.enableGnomeKeyring)) - "mr ${pkgs.gnome3.gnome-keyring}/lib/security/pam_gnome_keyring.so,"} - ${optionalString (isEnabled (cfg: cfg.startSession)) - "mr ${pkgs.systemd}/lib/security/pam_systemd.so,"} - ${optionalString (isEnabled (cfg: cfg.enableAppArmor) && config.security.apparmor.enable) - "mr ${pkgs.apparmor-pam}/lib/security/pam_apparmor.so,"} - ${optionalString (isEnabled (cfg: cfg.enableKwallet)) - "mr ${pkgs.plasma5.kwallet-pam}/lib/security/pam_kwallet5.so,"} - ${optionalString config.virtualisation.lxc.lxcfs.enable - "mr ${pkgs.lxc}/lib/security/pam_cgfs.so"} - ''; - + '' + + optionalString (isEnabled (cfg: cfg.googleOsLoginAuthentication)) '' + mr ${pkgs.google-compute-engine-oslogin}/lib/pam_oslogin_login.so, + '' + + optionalString (config.security.pam.enableSSHAgentAuth + && isEnabled (cfg: cfg.sshAgentAuth)) '' + mr ${pkgs.pam_ssh_agent_auth}/libexec/pam_ssh_agent_auth.so, + '' + + optionalString (isEnabled (cfg: cfg.fprintAuth)) '' + mr ${pkgs.fprintd}/lib/security/pam_fprintd.so, + '' + + optionalString (isEnabled (cfg: cfg.u2fAuth)) '' + mr ${pkgs.pam_u2f}/lib/security/pam_u2f.so, + '' + + optionalString (isEnabled (cfg: cfg.usbAuth)) '' + mr ${pkgs.pam_usb}/lib/security/pam_usb.so, + '' + + optionalString (isEnabled (cfg: cfg.oathAuth)) '' + "mr ${pkgs.oathToolkit}/lib/security/pam_oath.so, + '' + + optionalString (isEnabled (cfg: cfg.yubicoAuth)) '' + mr ${pkgs.yubico-pam}/lib/security/pam_yubico.so, + '' + + optionalString (isEnabled (cfg: cfg.duoSecurity.enable)) '' + mr ${pkgs.duo-unix}/lib/security/pam_duo.so, + '' + + optionalString (isEnabled (cfg: cfg.otpwAuth)) '' + mr ${pkgs.otpw}/lib/security/pam_otpw.so, + '' + + optionalString config.security.pam.enableEcryptfs '' + mr ${pkgs.ecryptfs}/lib/security/pam_ecryptfs.so, + '' + + optionalString (isEnabled (cfg: cfg.pamMount)) '' + mr ${pkgs.pam_mount}/lib/security/pam_mount.so, + '' + + optionalString (isEnabled (cfg: cfg.enableGnomeKeyring)) '' + mr ${pkgs.gnome3.gnome-keyring}/lib/security/pam_gnome_keyring.so, + '' + + optionalString (isEnabled (cfg: cfg.startSession)) '' + mr ${pkgs.systemd}/lib/security/pam_systemd.so, + '' + + optionalString (isEnabled (cfg: cfg.enableAppArmor) + && config.security.apparmor.enable) '' + mr ${pkgs.apparmor-pam}/lib/security/pam_apparmor.so, + '' + + optionalString (isEnabled (cfg: cfg.enableKwallet)) '' + mr ${pkgs.plasma5.kwallet-pam}/lib/security/pam_kwallet5.so, + '' + + optionalString config.virtualisation.lxc.lxcfs.enable '' + mr ${pkgs.lxc}/lib/security/pam_cgfs.so + ''; }; } diff --git a/pkgs/os-specific/linux/apparmor/default.nix b/pkgs/os-specific/linux/apparmor/default.nix index 67d354b42bc..5804a33c485 100644 --- a/pkgs/os-specific/linux/apparmor/default.nix +++ b/pkgs/os-specific/linux/apparmor/default.nix @@ -290,7 +290,7 @@ let , name ? "" }: rootPaths: runCommand ( "apparmor-closure-rules" - + lib.optionalString (name != "") "-${name}") {} '' + + lib.optionalString (name != "") "-${name}" ) {} '' touch $out while read -r path do printf >>$out "%s,\n" ${lib.concatMapStringsSep " " (x: "\"${x}\"") (baseRules ++ additionalRules)} From 76887d750b042796f4c3b054a2df4ba401194908 Mon Sep 17 00:00:00 2001 From: Julien Moutinho Date: Sun, 28 Feb 2021 22:18:01 +0100 Subject: [PATCH 093/263] nixos/apparmor: add test for apparmorRulesFromClosure --- nixos/tests/all-tests.nix | 1 + nixos/tests/apparmor.nix | 82 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 83 insertions(+) create mode 100644 nixos/tests/apparmor.nix diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix index 1ce55e1eac4..019b9c6223c 100644 --- a/nixos/tests/all-tests.nix +++ b/nixos/tests/all-tests.nix @@ -25,6 +25,7 @@ in acme = handleTest ./acme.nix {}; agda = handleTest ./agda.nix {}; ammonite = handleTest ./ammonite.nix {}; + apparmor = handleTest ./apparmor.nix {}; atd = handleTest ./atd.nix {}; avahi = handleTest ./avahi.nix {}; avahi-with-resolved = handleTest ./avahi.nix { networkd = true; }; diff --git a/nixos/tests/apparmor.nix b/nixos/tests/apparmor.nix new file mode 100644 index 00000000000..c6daa8e67de --- /dev/null +++ b/nixos/tests/apparmor.nix @@ -0,0 +1,82 @@ +import ./make-test-python.nix ({ pkgs, ... } : { + name = "apparmor"; + meta = with pkgs.lib.maintainers; { + maintainers = [ julm ]; + }; + + machine = + { lib, pkgs, config, ... }: + with lib; + { + security.apparmor.enable = mkDefault true; + }; + + testScript = + '' + machine.wait_for_unit("multi-user.target") + + with subtest("AppArmor profiles are loaded"): + machine.succeed("systemctl status apparmor.service") + + # AppArmor securityfs + with subtest("AppArmor securityfs is mounted"): + machine.succeed("mountpoint -q /sys/kernel/security") + machine.succeed("cat /sys/kernel/security/apparmor/profiles") + + # Test apparmorRulesFromClosure by: + # 1. Prepending a string of the relevant packages' name and version on each line. + # 2. Sorting according to those strings. + # 3. Removing those prepended strings. + # 4. Using `diff` against the expected output. + with subtest("apparmorRulesFromClosure"): + machine.succeed( + "${pkgs.diffutils}/bin/diff ${pkgs.writeText "expected.rules" '' + mr ${pkgs.bash}/lib/**.so*, + r ${pkgs.bash}, + r ${pkgs.bash}/etc/**, + r ${pkgs.bash}/lib/**, + r ${pkgs.bash}/share/**, + x ${pkgs.bash}/foo/**, + mr ${pkgs.glibc}/lib/**.so*, + r ${pkgs.glibc}, + r ${pkgs.glibc}/etc/**, + r ${pkgs.glibc}/lib/**, + r ${pkgs.glibc}/share/**, + x ${pkgs.glibc}/foo/**, + mr ${pkgs.libcap}/lib/**.so*, + r ${pkgs.libcap}, + r ${pkgs.libcap}/etc/**, + r ${pkgs.libcap}/lib/**, + r ${pkgs.libcap}/share/**, + x ${pkgs.libcap}/foo/**, + mr ${pkgs.libcap.lib}/lib/**.so*, + r ${pkgs.libcap.lib}, + r ${pkgs.libcap.lib}/etc/**, + r ${pkgs.libcap.lib}/lib/**, + r ${pkgs.libcap.lib}/share/**, + x ${pkgs.libcap.lib}/foo/**, + mr ${pkgs.libidn2.out}/lib/**.so*, + r ${pkgs.libidn2.out}, + r ${pkgs.libidn2.out}/etc/**, + r ${pkgs.libidn2.out}/lib/**, + r ${pkgs.libidn2.out}/share/**, + x ${pkgs.libidn2.out}/foo/**, + mr ${pkgs.libunistring}/lib/**.so*, + r ${pkgs.libunistring}, + r ${pkgs.libunistring}/etc/**, + r ${pkgs.libunistring}/lib/**, + r ${pkgs.libunistring}/share/**, + x ${pkgs.libunistring}/foo/**, + ''} ${pkgs.runCommand "actual.rules" { preferLocalBuild = true; } '' + ${pkgs.gnused}/bin/sed -e 's:^[^ ]* ${builtins.storeDir}/[^,/-]*-\([^/,]*\):\1 \0:' ${ + pkgs.apparmorRulesFromClosure { + name = "ping"; + additionalRules = ["x $path/foo/**"]; + } [ pkgs.libcap ] + } | + ${pkgs.coreutils}/bin/sort -n -k1 | + ${pkgs.gnused}/bin/sed -e 's:^[^ ]* ::' >$out + ''}" + ) + ''; +}) From b42a0e205d567b96970386a7cd442dc4816bd840 Mon Sep 17 00:00:00 2001 From: Julien Moutinho Date: Mon, 1 Mar 2021 00:24:54 +0100 Subject: [PATCH 094/263] nixos/apparmor: disable killUnconfinedConfinables by default --- nixos/doc/manual/release-notes/rl-2105.xml | 7 +++--- nixos/modules/profiles/hardened.nix | 1 + nixos/modules/security/apparmor.nix | 29 +++++++++++++--------- 3 files changed, 21 insertions(+), 16 deletions(-) diff --git a/nixos/doc/manual/release-notes/rl-2105.xml b/nixos/doc/manual/release-notes/rl-2105.xml index 6a738214096..0384727ac25 100644 --- a/nixos/doc/manual/release-notes/rl-2105.xml +++ b/nixos/doc/manual/release-notes/rl-2105.xml @@ -869,10 +869,9 @@ environment.systemPackages = [ to provide a way to disable a profile and to select whether to confine in enforce mode (default) or in complain mode (see journalctl -b --grep apparmor). - Before enabling this module, either directly - or by importing <nixpkgs/nixos/modules/profiles/hardened.nix>, - please be sure to read the documentation of security.apparmor.enable, - and especially the part about . + Security-minded users may also want to enable , + at the cost of having some of their processes killed + when updating to a NixOS version introducing new AppArmor profiles. diff --git a/nixos/modules/profiles/hardened.nix b/nixos/modules/profiles/hardened.nix index 00aafc6831b..3f8f78f012a 100644 --- a/nixos/modules/profiles/hardened.nix +++ b/nixos/modules/profiles/hardened.nix @@ -36,6 +36,7 @@ with lib; security.virtualisation.flushL1DataCache = mkDefault "always"; security.apparmor.enable = mkDefault true; + security.apparmor.killUnconfinedConfinables = mkDefault true; boot.kernelParams = [ # Slab/slub sanity checks, redzoning, and poisoning diff --git a/nixos/modules/security/apparmor.nix b/nixos/modules/security/apparmor.nix index 68bc3f126cb..9bd909aa50b 100644 --- a/nixos/modules/security/apparmor.nix +++ b/nixos/modules/security/apparmor.nix @@ -30,16 +30,17 @@ in If you're enabling this module on a running system, note that a reboot will be required to activate AppArmor in the kernel. - Also, beware that enabling this module will by default - try to kill unconfined but confinable running processes, - in order to obtain a confinement matching what is declared in the NixOS configuration. - This will happen when upgrading to a NixOS revision - introducing an AppArmor profile for the executable of a running process. - This is because enabling an AppArmor profile for an executable - can only confine new or already confined processes of that executable, - but leaves already running processes unconfined. - Set killUnconfinedConfinables - to false if you prefer to leave those processes running''; + Also, beware that enabling this module privileges stability over security + by not trying to kill unconfined but newly confinable running processes by default, + though it would be needed because AppArmor can only confine new + or already confined processes of an executable. + This killing would for instance be necessary when upgrading to a NixOS revision + introducing for the first time an AppArmor profile for the executable + of a running process. + + Enable + if you want this service to do such killing + by sending a SIGTERM to those running processes''; policies = mkOption { description = '' AppArmor policies. @@ -78,10 +79,14 @@ in Beware that AppArmor policies almost always contain Nix store paths, and thus produce at each change of these paths a new cached version accumulating in the cache''; - killUnconfinedConfinables = mkDisableOption '' + killUnconfinedConfinables = mkEnableOption '' killing of processes which have an AppArmor profile enabled - (in policies) + (in ) but are not confined (because AppArmor can only confine new processes). + + This is only sending a gracious SIGTERM signal to the processes, + not a SIGKILL. + Beware that due to a current limitation of AppArmor, only profiles with exact paths (and no name) can enable such kills''; }; From b4373892ced47bb816c9fe2f971cc868d09af3d1 Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Fri, 23 Apr 2021 12:30:48 +0000 Subject: [PATCH 095/263] netbsd.libterminfo: add missing bsdSetupHook dep 82c231d17e5 ("netbsd: Generalize builder to any-bsd setup hook") missed libterminfo when it added bsdSetupHook to every other package. (I checked it didn't miss anything else.) It also didn't change a NETBSDSRCDIR to BSDSRCDIR, but in fairness that line was added about half an hour before the setupHook change was merged in a16384e1186. Fixes: 82c231d17e5 ("netbsd: Generalize builder to any-bsd setup hook") --- pkgs/os-specific/bsd/netbsd/default.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkgs/os-specific/bsd/netbsd/default.nix b/pkgs/os-specific/bsd/netbsd/default.nix index 5492ba9087e..64cf3214d5e 100644 --- a/pkgs/os-specific/bsd/netbsd/default.nix +++ b/pkgs/os-specific/bsd/netbsd/default.nix @@ -591,6 +591,7 @@ in lib.makeScopeWithSplicing version = "8.0"; sha256 = "14gp0d6fh6zjnbac2yjhyq5m6rca7gm6q1s9gilhzpdgl9m7vb9r"; nativeBuildInputs = with buildPackages.netbsd; [ + bsdSetupHook makeMinimal install tsort lorder mandoc statHook nbperf tic ]; buildInputs = with self; compatIfNeeded; @@ -601,7 +602,7 @@ in lib.makeScopeWithSplicing --replace '#include ' 'void use_env(bool);' ''; postBuild = '' - make -C $NETBSDSRCDIR/share/terminfo BINDIR=$out/share + make -C $BSDSRCDIR/share/terminfo BINDIR=$out/share ''; postInstall = '' make -C $BSDSRCDIR/share/terminfo BINDIR=$out/share install From 7cdc46f4e3cccd17b04ebe120a02e0906a91761f Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Fri, 23 Apr 2021 12:41:20 +0000 Subject: [PATCH 096/263] netbsd.libterminfo: add missing $makeFlags --- pkgs/os-specific/bsd/netbsd/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/os-specific/bsd/netbsd/default.nix b/pkgs/os-specific/bsd/netbsd/default.nix index 64cf3214d5e..13ae4fa3749 100644 --- a/pkgs/os-specific/bsd/netbsd/default.nix +++ b/pkgs/os-specific/bsd/netbsd/default.nix @@ -602,10 +602,10 @@ in lib.makeScopeWithSplicing --replace '#include ' 'void use_env(bool);' ''; postBuild = '' - make -C $BSDSRCDIR/share/terminfo BINDIR=$out/share + make -C $BSDSRCDIR/share/terminfo $makeFlags BINDIR=$out/share ''; postInstall = '' - make -C $BSDSRCDIR/share/terminfo BINDIR=$out/share install + make -C $BSDSRCDIR/share/terminfo $makeFlags BINDIR=$out/share install ''; extraPaths = with self; [ (fetchNetBSD "share/terminfo" "8.0" "18db0fk1dw691vk6lsm6dksm4cf08g8kdm0gc4052ysdagg2m6sm") From d83b116910b7cc15f1e3bc1ae1fc4a47f06b4beb Mon Sep 17 00:00:00 2001 From: davidak Date: Sun, 11 Apr 2021 02:04:08 +0200 Subject: [PATCH 097/263] kbd: 2.0.4 -> 2.4.0 --- pkgs/os-specific/linux/kbd/default.nix | 32 ++------- pkgs/os-specific/linux/kbd/search-paths.patch | 71 ------------------- 2 files changed, 6 insertions(+), 97 deletions(-) delete mode 100644 pkgs/os-specific/linux/kbd/search-paths.patch diff --git a/pkgs/os-specific/linux/kbd/default.nix b/pkgs/os-specific/linux/kbd/default.nix index 2119c10b9cf..e709523f452 100644 --- a/pkgs/os-specific/linux/kbd/default.nix +++ b/pkgs/os-specific/linux/kbd/default.nix @@ -1,15 +1,14 @@ { lib, stdenv, fetchurl, autoreconfHook, - gzip, bzip2, pkg-config, flex, check, - pam, coreutils + pkg-config, flex, check, pam, coreutils }: stdenv.mkDerivation rec { pname = "kbd"; - version = "2.0.4"; + version = "2.4.0"; src = fetchurl { url = "mirror://kernel/linux/utils/kbd/${pname}-${version}.tar.xz"; - sha256 = "124swm93dm4ca0pifgkrand3r9gvj3019d4zkfxsj9djpvv0mnaz"; + sha256 = "17wvrqz2kk0w87idinhyvd31ih1dp7ldfl2yfx7ailygb0279w2m"; }; configureFlags = [ @@ -18,13 +17,8 @@ stdenv.mkDerivation rec { "--disable-nls" ]; - patches = [ ./search-paths.patch ]; - postPatch = '' - # Add Neo keymap subdirectory - sed -i -e 's,^KEYMAPSUBDIRS *= *,&i386/neo ,' data/Makefile.am - # Renaming keymaps with name clashes, because loadkeys just picks # the first keymap it sees. The clashing names lead to e.g. # "loadkeys no" defaulting to a norwegian dvorak map instead of @@ -33,21 +27,9 @@ stdenv.mkDerivation rec { mv qwertz/cz{,-qwertz}.map mv olpc/es{,-olpc}.map mv olpc/pt{,-olpc}.map - mv dvorak/{no.map,dvorak-no.map} mv fgGIod/trf{,-fgGIod}.map mv colemak/{en-latin9,colemak}.map popd - - # Fix the path to gzip/bzip2. - substituteInPlace src/libkeymap/findfile.c \ - --replace gzip ${gzip}/bin/gzip \ - --replace bzip2 ${bzip2.bin}/bin/bzip2 \ - - # We get a warning in armv5tel-linux and the fuloong2f, so we - # disable -Werror in it. - ${lib.optionalString (stdenv.isAarch32 || stdenv.hostPlatform.isMips) '' - sed -i s/-Werror// src/Makefile.am - ''} ''; postInstall = '' @@ -57,16 +39,14 @@ stdenv.mkDerivation rec { done ''; - buildInputs = [ check pam ]; nativeBuildInputs = [ autoreconfHook pkg-config flex ]; - makeFlags = [ "setowner=" ]; - meta = with lib; { - homepage = "ftp://ftp.altlinux.org/pub/people/legion/kbd/"; - description = "Linux keyboard utilities and keyboard maps"; + homepage = "https://kbd-project.org/"; + description = "Linux keyboard tools and keyboard maps"; platforms = platforms.linux; license = licenses.gpl2Plus; + maintainers = with maintainers; [ ]; }; } diff --git a/pkgs/os-specific/linux/kbd/search-paths.patch b/pkgs/os-specific/linux/kbd/search-paths.patch deleted file mode 100644 index c9405a56721..00000000000 --- a/pkgs/os-specific/linux/kbd/search-paths.patch +++ /dev/null @@ -1,71 +0,0 @@ ---- a/src/libkeymap/analyze.l -+++ b/src/libkeymap/analyze.l -@@ -101,6 +101,9 @@ stack_pop(struct lk_ctx *ctx, void *scan - static const char *const include_dirpath0[] = { "", 0 }; - static const char *const include_dirpath1[] = { "", "../include/", "../../include/", 0 }; - static const char *const include_dirpath3[] = { -+ "/etc/kbd/" KEYMAPDIR "/include/", -+ "/etc/kbd/" KEYMAPDIR "/i386/include/", -+ "/etc/kbd/" KEYMAPDIR "/mac/include/", - DATADIR "/" KEYMAPDIR "/include/", - DATADIR "/" KEYMAPDIR "/i386/include/", - DATADIR "/" KEYMAPDIR "/mac/include/", 0 ---- a/src/loadkeys.c -+++ b/src/loadkeys.c -@@ -27,7 +27,7 @@ - #include "keymap.h" - - static const char *progname = NULL; --static const char *const dirpath1[] = { "", DATADIR "/" KEYMAPDIR "/**", KERNDIR "/", 0 }; -+static const char *const dirpath1[] = { "", "/etc/kbd/" KEYMAPDIR "/**", DATADIR "/" KEYMAPDIR "/**", 0 }; - static const char *const suffixes[] = { "", ".kmap", ".map", 0 }; - - static void __attribute__((noreturn)) ---- a/src/loadunimap.c -+++ b/src/loadunimap.c -@@ -30,7 +30,7 @@ - extern char *progname; - extern int force; - --static const char *const unidirpath[] = { "", DATADIR "/" UNIMAPDIR "/", 0 }; -+static const char *const unidirpath[] = { "", "/etc/kbd/" UNIMAPDIR "/", DATADIR "/" UNIMAPDIR "/", 0 }; - static const char *const unisuffixes[] = { "", ".uni", ".sfm", 0 }; - - #ifdef MAIN ---- a/src/mapscrn.c -+++ b/src/mapscrn.c -@@ -27,7 +27,7 @@ void loadnewmap(int fd, char *mfil); - static int ctoi(char *); - - /* search for the map file in these directories (with trailing /) */ --static const char *const mapdirpath[] = { "", DATADIR "/" TRANSDIR "/", 0 }; -+static const char *const mapdirpath[] = { "", "/etc/kbd/" TRANSDIR "/", DATADIR "/" TRANSDIR "/", 0 }; - static const char *const mapsuffixes[] = { "", ".trans", "_to_uni.trans", ".acm", 0 }; - - #ifdef MAIN ---- a/src/resizecons.c -+++ b/src/resizecons.c -@@ -101,7 +101,7 @@ static int vga_get_fontheight(void); - static void vga_set_cursor(int, int); - static void vga_set_verticaldisplayend_lowbyte(int); - --const char *const dirpath[] = { "", DATADIR "/" VIDEOMODEDIR "/", 0 }; -+const char *const dirpath[] = { "", "/etc/kbd/" VIDEOMODEDIR "/", DATADIR "/" VIDEOMODEDIR "/", 0}; - const char *const suffixes[] = { "", 0 }; - - int main(int argc, char **argv) ---- a/src/setfont.c -+++ b/src/setfont.c -@@ -53,10 +53,10 @@ int force = 0; - int debug = 0; - - /* search for the font in these directories (with trailing /) */ --const char *const fontdirpath[] = { "", DATADIR "/" FONTDIR "/", 0 }; -+const char *const fontdirpath[] = { "", "/etc/kbd/" FONTDIR "/", DATADIR "/" FONTDIR "/", 0 }; - const char *const fontsuffixes[] = { "", ".psfu", ".psf", ".cp", ".fnt", 0 }; - /* hide partial fonts a bit - loading a single one is a bad idea */ --const char *const partfontdirpath[] = { "", DATADIR "/" FONTDIR "/" PARTIALDIR "/", 0 }; -+const char *const partfontdirpath[] = { "", "/etc/kbd/" FONTDIR "/" PARTIALDIR "/", DATADIR "/" FONTDIR "/" PARTIALDIR "/", 0 }; - const char *const partfontsuffixes[] = { "", 0 }; - - static inline int From fabdd4650344ba93d657a643466c027f40ef3c87 Mon Sep 17 00:00:00 2001 From: davidak Date: Sun, 11 Apr 2021 02:09:07 +0200 Subject: [PATCH 098/263] kbdKeymaps: remove dvp and neo are now included in kbd includes documentation in release notes and alias --- nixos/doc/manual/release-notes/rl-2105.xml | 11 +++++++ nixos/modules/config/console.nix | 3 +- pkgs/os-specific/linux/kbd/keymaps.nix | 36 ---------------------- pkgs/top-level/aliases.nix | 1 + pkgs/top-level/all-packages.nix | 2 -- 5 files changed, 13 insertions(+), 40 deletions(-) delete mode 100644 pkgs/os-specific/linux/kbd/keymaps.nix diff --git a/nixos/doc/manual/release-notes/rl-2105.xml b/nixos/doc/manual/release-notes/rl-2105.xml index e0552c25a85..1efc60060b8 100644 --- a/nixos/doc/manual/release-notes/rl-2105.xml +++ b/nixos/doc/manual/release-notes/rl-2105.xml @@ -680,6 +680,17 @@ environment.systemPackages = [ All CUDA toolkit versions prior to CUDA 10 have been removed. + + + The kbdKeymaps package was removed since dvp and neo + are now included in kbd. + + If you want to use the Programmer Dvorak Keyboard Layout, you have to use + dvorak-programmer in + now instead of dvp. + In it's still dvp. + + diff --git a/nixos/modules/config/console.nix b/nixos/modules/config/console.nix index 84ad76246fd..5be7f06c05d 100644 --- a/nixos/modules/config/console.nix +++ b/nixos/modules/config/console.nix @@ -82,8 +82,7 @@ in packages = mkOption { type = types.listOf types.package; - default = with pkgs.kbdKeymaps; [ dvp neo ]; - defaultText = "with pkgs.kbdKeymaps; [ dvp neo ]"; + default = [ ]; description = '' List of additional packages that provide console fonts, keymaps and other resources for virtual consoles use. diff --git a/pkgs/os-specific/linux/kbd/keymaps.nix b/pkgs/os-specific/linux/kbd/keymaps.nix deleted file mode 100644 index b3d5fe1b63c..00000000000 --- a/pkgs/os-specific/linux/kbd/keymaps.nix +++ /dev/null @@ -1,36 +0,0 @@ -{ stdenv, lib, fetchurl, gzip }: - -{ - dvp = stdenv.mkDerivation rec { - pname = "dvp"; - version = "1.2.1"; - - src = fetchurl { - url = "http://kaufmann.no/downloads/linux/dvp-${lib.replaceStrings ["."] ["_"] version}.map.gz"; - sha256 = "0e859211cfe16a18a3b9cbf2ca3e280a23a79b4e40b60d8d01d0fde7336b6d50"; - }; - - nativeBuildInputs = [ gzip ]; - - buildCommand = '' - mkdir -p $out/share/keymaps/i386/dvorak - gzip -c -d $src > $out/share/keymaps/i386/dvorak/dvp.map - ''; - }; - - neo = stdenv.mkDerivation { - pname = "neo"; - version = "2476"; - - src = fetchurl { - name = "neo.map"; - url = "https://raw.githubusercontent.com/neo-layout/neo-layout/" - + "a0dee06fed824abfad658b7f10e6d907b270be0a/linux/console/neo.map"; - sha256 = "19mfrd31vzpsjiwc7pshxm0b0sz5dd17xrz6k079cy4im1vf0r4g"; - }; - - buildCommand = '' - install -D $src $out/share/keymaps/i386/neo/neo.map - ''; - }; -} diff --git a/pkgs/top-level/aliases.nix b/pkgs/top-level/aliases.nix index 5097794b16c..309d2ab58e2 100644 --- a/pkgs/top-level/aliases.nix +++ b/pkgs/top-level/aliases.nix @@ -338,6 +338,7 @@ mapAliases ({ kodiPlainWayland = kodi-wayland; julia_07 = throw "julia_07 is deprecated in favor of julia_10 LTS"; # added 2020-09-15 julia_11 = throw "julia_11 is deprecated in favor of latest Julia version"; # added 2020-09-15 + kbdKeymaps = throw "kbdKeymaps is not needed anymore since dvp and neo are now part of kbd"; # added 2021-04-11 kdeconnect = plasma5Packages.kdeconnect-kde; # added 2020-10-28 kdiff3-qt5 = kdiff3; # added 2017-02-18 keepass-keefox = keepass-keepassrpc; # backwards compatibility alias, added 2018-02 diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 440bdb97fd7..7ef9f066a99 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -19766,8 +19766,6 @@ in kbd = callPackage ../os-specific/linux/kbd { }; - kbdKeymaps = callPackage ../os-specific/linux/kbd/keymaps.nix { }; - kbdlight = callPackage ../os-specific/linux/kbdlight { }; kmscon = callPackage ../os-specific/linux/kmscon { }; From 513143fe4ef0734483640945250b39d1732f7298 Mon Sep 17 00:00:00 2001 From: davidak Date: Sun, 11 Apr 2021 05:25:53 +0200 Subject: [PATCH 099/263] kbd: add tests and update them --- nixos/tests/keymap.nix | 27 +++++++++++++++++++++++--- pkgs/os-specific/linux/kbd/default.nix | 4 +++- 2 files changed, 27 insertions(+), 4 deletions(-) diff --git a/nixos/tests/keymap.nix b/nixos/tests/keymap.nix index 09d5d2a6c9e..a18a05f90c6 100644 --- a/nixos/tests/keymap.nix +++ b/nixos/tests/keymap.nix @@ -107,17 +107,32 @@ in pkgs.lib.mapAttrs mkKeyboardTest { altgr.expect = [ "~" "#" "{" "[" "|" ]; }; - extraConfig.console.keyMap = "azerty/fr"; + extraConfig.console.keyMap = "fr"; extraConfig.services.xserver.layout = "fr"; }; + bone = { + tests = { + layer1.qwerty = [ "f" "j" ]; + layer1.expect = [ "e" "n" ]; + layer2.qwerty = [ "shift-f" "shift-j" "shift-6" ]; + layer2.expect = [ "E" "N" "$" ]; + layer3.qwerty = [ "caps_lock-d" "caps_lock-f" ]; + layer3.expect = [ "{" "}" ]; + }; + + extraConfig.console.keyMap = "bone"; + extraConfig.services.xserver.layout = "de"; + extraConfig.services.xserver.xkbVariant = "bone"; + }; + colemak = { tests = { homerow.qwerty = [ "a" "s" "d" "f" "j" "k" "l" "semicolon" ]; homerow.expect = [ "a" "r" "s" "t" "n" "e" "i" "o" ]; }; - extraConfig.console.keyMap = "colemak/colemak"; + extraConfig.console.keyMap = "colemak"; extraConfig.services.xserver.layout = "us"; extraConfig.services.xserver.xkbVariant = "colemak"; }; @@ -129,9 +144,13 @@ in pkgs.lib.mapAttrs mkKeyboardTest { symbols.qwerty = [ "q" "w" "e" "minus" "equal" ]; symbols.expect = [ "'" "," "." "[" "]" ]; }; + + extraConfig.console.keyMap = "dvorak"; + extraConfig.services.xserver.layout = "us"; + extraConfig.services.xserver.xkbVariant = "dvorak"; }; - dvp = { + dvorak-programmer = { tests = { homerow.qwerty = [ "a" "s" "d" "f" "j" "k" "l" "semicolon" ]; homerow.expect = [ "a" "o" "e" "u" "h" "t" "n" "s" ]; @@ -142,6 +161,7 @@ in pkgs.lib.mapAttrs mkKeyboardTest { symbols.expect = [ "&" "[" "{" "}" "(" "=" "*" ")" "+" "]" "!" ]; }; + extraConfig.console.keyMap = "dvorak-programmer"; extraConfig.services.xserver.layout = "us"; extraConfig.services.xserver.xkbVariant = "dvp"; }; @@ -156,6 +176,7 @@ in pkgs.lib.mapAttrs mkKeyboardTest { layer3.expect = [ "{" "}" ]; }; + extraConfig.console.keyMap = "neo"; extraConfig.services.xserver.layout = "de"; extraConfig.services.xserver.xkbVariant = "neo"; }; diff --git a/pkgs/os-specific/linux/kbd/default.nix b/pkgs/os-specific/linux/kbd/default.nix index e709523f452..396546eec9f 100644 --- a/pkgs/os-specific/linux/kbd/default.nix +++ b/pkgs/os-specific/linux/kbd/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, fetchurl, autoreconfHook, +{ lib, stdenv, fetchurl, nixosTests, autoreconfHook, pkg-config, flex, check, pam, coreutils }: @@ -42,6 +42,8 @@ stdenv.mkDerivation rec { buildInputs = [ check pam ]; nativeBuildInputs = [ autoreconfHook pkg-config flex ]; + passthru.tests = nixosTests.keymap; + meta = with lib; { homepage = "https://kbd-project.org/"; description = "Linux keyboard tools and keyboard maps"; From f250c8f6df3a9edb6550ecb69b0ebcf1ddb83562 Mon Sep 17 00:00:00 2001 From: davidak Date: Tue, 13 Apr 2021 07:29:11 +0200 Subject: [PATCH 100/263] kbd: format using nixpkgs-fmt --- pkgs/os-specific/linux/kbd/default.nix | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/pkgs/os-specific/linux/kbd/default.nix b/pkgs/os-specific/linux/kbd/default.nix index 396546eec9f..20e46b743ec 100644 --- a/pkgs/os-specific/linux/kbd/default.nix +++ b/pkgs/os-specific/linux/kbd/default.nix @@ -1,5 +1,13 @@ -{ lib, stdenv, fetchurl, nixosTests, autoreconfHook, - pkg-config, flex, check, pam, coreutils +{ lib +, stdenv +, fetchurl +, nixosTests +, autoreconfHook +, pkg-config +, flex +, check +, pam +, coreutils }: stdenv.mkDerivation rec { @@ -49,6 +57,6 @@ stdenv.mkDerivation rec { description = "Linux keyboard tools and keyboard maps"; platforms = platforms.linux; license = licenses.gpl2Plus; - maintainers = with maintainers; [ ]; + maintainers = with maintainers; [ ]; }; } From 77c103298c813166e9b6d631e66173ee86e838c1 Mon Sep 17 00:00:00 2001 From: davidak Date: Tue, 13 Apr 2021 07:30:11 +0200 Subject: [PATCH 101/263] kbd: add myself as maintainer --- pkgs/os-specific/linux/kbd/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/os-specific/linux/kbd/default.nix b/pkgs/os-specific/linux/kbd/default.nix index 20e46b743ec..467de4b029a 100644 --- a/pkgs/os-specific/linux/kbd/default.nix +++ b/pkgs/os-specific/linux/kbd/default.nix @@ -57,6 +57,6 @@ stdenv.mkDerivation rec { description = "Linux keyboard tools and keyboard maps"; platforms = platforms.linux; license = licenses.gpl2Plus; - maintainers = with maintainers; [ ]; + maintainers = with maintainers; [ davidak ]; }; } From be7a9bab0fad716d56611791d6959e29c494772f Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Fri, 23 Apr 2021 14:48:35 +0000 Subject: [PATCH 102/263] netbsd.librt: fix build This is another one of those packages that's just a rebuild of a certain part of libc... Tested by building pkgsCross.x86_64-netbsd.netbsd.librt on x86_64-linux. libc's postPatch was entirely fixes for librt, so move that to librt and inherit it in libc. --- pkgs/os-specific/bsd/netbsd/default.nix | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/pkgs/os-specific/bsd/netbsd/default.nix b/pkgs/os-specific/bsd/netbsd/default.nix index 5492ba9087e..90080b152b0 100644 --- a/pkgs/os-specific/bsd/netbsd/default.nix +++ b/pkgs/os-specific/bsd/netbsd/default.nix @@ -665,6 +665,11 @@ in lib.makeScopeWithSplicing version = "8.0"; sha256 = "078qsi4mg1hyyxr1awvjs9b0c2gicg3zw4vl603g1m9vm8gfxw9l"; meta.platforms = lib.platforms.netbsd; + extraPaths = with self; [ common.src libc.src ]; + postPatch = '' + sed -i 's,/usr\(/include/sys/syscall.h\),${self.headers}\1,g' \ + $BSDSRCDIR/lib/{libc,librt}/sys/Makefile.inc + ''; }; libcrypt = mkDerivation { @@ -807,10 +812,7 @@ in lib.makeScopeWithSplicing make -C $BSDSRCDIR/lib/libcrypt $makeFlags make -C $BSDSRCDIR/lib/libcrypt $makeFlags install ''; - postPatch = '' - sed -i 's,/usr\(/include/sys/syscall.h\),${self.headers}\1,g' \ - sys/Makefile.inc ../librt/sys/Makefile.inc - ''; + inherit (self.librt) postPatch; }; # # END LIBRARIES From 152179f71dc14ae999a1ff52c9ee9f8232e60c72 Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Fri, 23 Apr 2021 14:59:58 +0000 Subject: [PATCH 103/263] netbsd.librpcsvc: fix build Tested by building pkgsCross.x86_64-netbsd.netbsd.librpcsvc on x86_64-linux. --- pkgs/os-specific/bsd/netbsd/default.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkgs/os-specific/bsd/netbsd/default.nix b/pkgs/os-specific/bsd/netbsd/default.nix index 5492ba9087e..3b303eb5064 100644 --- a/pkgs/os-specific/bsd/netbsd/default.nix +++ b/pkgs/os-specific/bsd/netbsd/default.nix @@ -658,6 +658,11 @@ in lib.makeScopeWithSplicing sha256 = "14ri9w6gdhsm4id5ck133syyvbmkbknfa8w0xkklm726nskhfkj7"; makeFlags = [ "INCSDIR=$(out)/include/rpcsvc" ]; meta.platforms = lib.platforms.netbsd; + nativeBuildInputs = with buildPackages.netbsd; [ + bsdSetupHook + makeMinimal + install tsort lorder rpcgen statHook + ]; }; librt = mkDerivation { From 870ce0999b1bce14c38b6c220c53811a5ccf447d Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Fri, 23 Apr 2021 15:15:30 +0000 Subject: [PATCH 104/263] netbsd.libpthread: fix build Tested by building pkgsCross.x86_64-netbsd.netbsd.libpthread on x86_64-linux. --- pkgs/os-specific/bsd/netbsd/default.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkgs/os-specific/bsd/netbsd/default.nix b/pkgs/os-specific/bsd/netbsd/default.nix index 13ae4fa3749..59badf75f36 100644 --- a/pkgs/os-specific/bsd/netbsd/default.nix +++ b/pkgs/os-specific/bsd/netbsd/default.nix @@ -691,6 +691,8 @@ in lib.makeScopeWithSplicing installPhase = null; noCC = false; dontBuild = false; + buildInputs = with self; [ headers ]; + extraPaths = with self; [ common.src libc.src sys.src ]; }; libresolv = mkDerivation { From e8a81f2f99a9673f66be848f3200f35a5560e0ae Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Fri, 23 Apr 2021 15:20:41 +0000 Subject: [PATCH 105/263] netbsd.libcrypt: fix build Tested by building pkgsCross.x86_64-netbsd.netbsd.libcrypt on x86_64-linux. --- pkgs/os-specific/bsd/netbsd/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/os-specific/bsd/netbsd/default.nix b/pkgs/os-specific/bsd/netbsd/default.nix index 13ae4fa3749..f21e0ce1731 100644 --- a/pkgs/os-specific/bsd/netbsd/default.nix +++ b/pkgs/os-specific/bsd/netbsd/default.nix @@ -672,6 +672,7 @@ in lib.makeScopeWithSplicing path = "lib/libcrypt"; version = "8.0"; sha256 = "0siqan1wdqmmhchh2n8w6a8x1abbff8n4yb6jrqxap3hqn8ay54g"; + SHLIBINSTALLDIR = "$(out)/lib"; meta.platforms = lib.platforms.netbsd; }; From 01ea399625058f55e5bac354a4edc8411851f0f7 Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Fri, 23 Apr 2021 15:52:30 +0000 Subject: [PATCH 106/263] netbsd.libutil: fix build Tested by building pkgsCross.x86_64-netbsd.netbsd.libutil on x86_64-linux. --- pkgs/os-specific/bsd/netbsd/default.nix | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/pkgs/os-specific/bsd/netbsd/default.nix b/pkgs/os-specific/bsd/netbsd/default.nix index 13ae4fa3749..1a3d1161129 100644 --- a/pkgs/os-specific/bsd/netbsd/default.nix +++ b/pkgs/os-specific/bsd/netbsd/default.nix @@ -564,7 +564,14 @@ in lib.makeScopeWithSplicing path = "lib/libutil"; version = "8.0"; sha256 = "077syyxd303m4x7avs5nxzk4c9n13d5lyk5aicsacqjvx79qrk3i"; - extraPaths = with self; [ common.src ]; + extraPaths = with self; [ common.src libc.src sys.src ]; + nativeBuildInputs = with buildPackages.netbsd; [ + bsdSetupHook + makeMinimal + byacc install tsort lorder mandoc statHook + ]; + buildInputs = with self; [ headers ]; + SHLIBINSTALLDIR = "$(out)/lib"; }; libedit = mkDerivation { From 7134116d6b09a8a6b03691fd1f16af36884970d6 Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Fri, 23 Apr 2021 16:01:33 +0000 Subject: [PATCH 107/263] netbsd.common: just export the sources "common" is just a lot of shared code, not a component in and of itself. There's no Makefile, so if we try to build it Make will go up a directory and try to build all of NetBSD. --- pkgs/os-specific/bsd/netbsd/default.nix | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/pkgs/os-specific/bsd/netbsd/default.nix b/pkgs/os-specific/bsd/netbsd/default.nix index aa55088a4a3..fe13145e86b 100644 --- a/pkgs/os-specific/bsd/netbsd/default.nix +++ b/pkgs/os-specific/bsd/netbsd/default.nix @@ -479,19 +479,14 @@ in lib.makeScopeWithSplicing makeMinimal install mandoc groff nbperf rpcgen ]; - extraPaths = with self; [ common.src ]; + extraPaths = with self; [ common ]; headersOnly = true; noCC = true; meta.platforms = lib.platforms.netbsd; makeFlags = [ "RPCGEN_CPP=${buildPackages.stdenv.cc.cc}/bin/cpp" ]; }; - common = mkDerivation { - path = "common"; - version = "8.0"; - sha256 = "1fsm2b7p7zkhiz523jw75088cq2h39iknp0fp3di9a64bikwbhi1"; - noCC = true; - }; + common = fetchNetBSD "common" "8.0" "1fsm2b7p7zkhiz523jw75088cq2h39iknp0fp3di9a64bikwbhi1"; sys-headers = mkDerivation { pname = "sys-headers"; @@ -527,7 +522,7 @@ in lib.makeScopeWithSplicing ''; meta.platforms = lib.platforms.netbsd; - extraPaths = with self; [ common.src ]; + extraPaths = with self; [ common ]; installPhase = "includesPhase"; dontBuild = true; @@ -564,7 +559,7 @@ in lib.makeScopeWithSplicing path = "lib/libutil"; version = "8.0"; sha256 = "077syyxd303m4x7avs5nxzk4c9n13d5lyk5aicsacqjvx79qrk3i"; - extraPaths = with self; [ common.src libc.src sys.src ]; + extraPaths = with self; [ common libc.src sys.src ]; nativeBuildInputs = with buildPackages.netbsd; [ bsdSetupHook makeMinimal @@ -678,7 +673,7 @@ in lib.makeScopeWithSplicing version = "8.0"; sha256 = "078qsi4mg1hyyxr1awvjs9b0c2gicg3zw4vl603g1m9vm8gfxw9l"; meta.platforms = lib.platforms.netbsd; - extraPaths = with self; [ common.src libc.src ]; + extraPaths = with self; [ common libc.src ]; postPatch = '' sed -i 's,/usr\(/include/sys/syscall.h\),${self.headers}\1,g' \ $BSDSRCDIR/lib/{libc,librt}/sys/Makefile.inc @@ -710,7 +705,7 @@ in lib.makeScopeWithSplicing noCC = false; dontBuild = false; buildInputs = with self; [ headers ]; - extraPaths = with self; [ common.src libc.src sys.src ]; + extraPaths = with self; [ common libc.src sys.src ]; }; libresolv = mkDerivation { @@ -773,7 +768,7 @@ in lib.makeScopeWithSplicing USE_FORT = "yes"; MKPROFILE = "no"; extraPaths = with self; [ - common.src i18n_module.src sys.src + common i18n_module.src sys.src ld_elf_so.src libpthread.src libm.src libresolv.src librpcsvc.src libutil.src librt.src libcrypt.src ]; From f684c917a6c3919e8dff6b79f317da8ad148e44b Mon Sep 17 00:00:00 2001 From: John Ericson Date: Fri, 23 Apr 2021 21:47:28 +0000 Subject: [PATCH 108/263] stdenvNoCC: Fix `hasCC` attr during cross, remove `noCC` `hasCC` was getting overridden in the cross bootstrapping (for GHCJS), which preventing the default logic from re-triggering for `stdenvNoCC`. Also remove `stdenv.noCC` which is obseleted by `stdenv.hasCC`. --- pkgs/stdenv/generic/make-derivation.nix | 2 +- pkgs/top-level/all-packages.nix | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/stdenv/generic/make-derivation.nix b/pkgs/stdenv/generic/make-derivation.nix index 74609412782..4fc58238e5e 100644 --- a/pkgs/stdenv/generic/make-derivation.nix +++ b/pkgs/stdenv/generic/make-derivation.nix @@ -104,7 +104,7 @@ in rec { ++ depsHostHost ++ depsHostHostPropagated ++ buildInputs ++ propagatedBuildInputs ++ depsTargetTarget ++ depsTargetTargetPropagated) == 0; - dontAddHostSuffix = attrs ? outputHash && !noNonNativeDeps || (stdenv.noCC or false); + dontAddHostSuffix = attrs ? outputHash && !noNonNativeDeps || !stdenv.hasCC; supportedHardeningFlags = [ "fortify" "stackprotector" "pie" "pic" "strictoverflow" "format" "relro" "bindnow" ]; # Musl-based platforms will keep "pie", other platforms will not. defaultHardeningFlags = if stdenv.hostPlatform.isMusl && diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 7ef9f066a99..5740ce52095 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -30,7 +30,7 @@ in # just the plain stdenv. stdenv_32bit = lowPrio (if stdenv.hostPlatform.is32bit then stdenv else multiStdenv); - stdenvNoCC = stdenv.override { cc = null; extraAttrs.noCC = true; }; + stdenvNoCC = stdenv.override { cc = null; hasCC = false; }; mkStdenvNoLibs = stdenv: let bintools = stdenv.cc.bintools.override { From b867117b86d55c89b5a06565023824c38d446ac5 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Mon, 9 Mar 2020 02:10:06 -0400 Subject: [PATCH 109/263] netbsd: Remove some env vars that are probably not needed. Tool setup hooks will set most. --- pkgs/os-specific/bsd/netbsd/default.nix | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/pkgs/os-specific/bsd/netbsd/default.nix b/pkgs/os-specific/bsd/netbsd/default.nix index aa55088a4a3..ca2f65036a2 100644 --- a/pkgs/os-specific/bsd/netbsd/default.nix +++ b/pkgs/os-specific/bsd/netbsd/default.nix @@ -63,8 +63,7 @@ in lib.makeScopeWithSplicing ]; buildInputs = with self; compatIfNeeded; - OBJCOPY = if stdenv.isDarwin then "true" else "objcopy"; - HOST_SH = "${buildPackages.bash}/bin/sh"; + HOST_SH = stdenv'.shell; MACHINE_ARCH = { i686 = "i386"; @@ -78,13 +77,6 @@ in lib.makeScopeWithSplicing }.${stdenv'.hostPlatform.parsed.cpu.name} or stdenv'.hostPlatform.parsed.cpu.name; - AR = "${stdenv'.cc.targetPrefix or ""}ar"; - CC = "${stdenv'.cc.targetPrefix or ""}cc"; - CPP = "${stdenv'.cc.targetPrefix or ""}cpp"; - CXX = "${stdenv'.cc.targetPrefix or ""}c++"; - LD = "${stdenv'.cc.targetPrefix or ""}ld"; - STRIP = "${stdenv'.cc.targetPrefix or ""}strip"; - BSD_PATH = attrs.path; strictDeps = true; @@ -94,6 +86,9 @@ in lib.makeScopeWithSplicing platforms = platforms.unix; license = licenses.bsd2; }; + } // lib.optionalAttrs stdenv'.hasCC { + # TODO should CC wrapper set this? + CPP = "${stdenv'.cc.targetPrefix}cpp"; } // lib.optionalAttrs stdenv'.isDarwin { MKRELRO = "no"; } // lib.optionalAttrs (stdenv'.cc.isClang or false) { From 4a931be54327207e1b4a2ccc27c55f184b83255f Mon Sep 17 00:00:00 2001 From: Max Hausch Date: Mon, 8 Mar 2021 12:42:53 +0100 Subject: [PATCH 110/263] python3Packages.Babel: 2.7.0 -> 2.9.0 Update babel as the current release is over a year old and some packages need >=2.8.0. Also migrate to pytestCheckHook. --- .../python-modules/Babel/default.nix | 29 +++---------------- 1 file changed, 4 insertions(+), 25 deletions(-) diff --git a/pkgs/development/python-modules/Babel/default.nix b/pkgs/development/python-modules/Babel/default.nix index 1074d2eef48..183478396eb 100644 --- a/pkgs/development/python-modules/Babel/default.nix +++ b/pkgs/development/python-modules/Babel/default.nix @@ -1,38 +1,17 @@ -{ stdenv, lib, buildPythonPackage, fetchPypi, fetchpatch, pytz, pytest, freezegun, glibcLocales }: +{ stdenv, lib, buildPythonPackage, fetchPypi, pytz, pytestCheckHook, freezegun }: buildPythonPackage rec { pname = "Babel"; - version = "2.7.0"; + version = "2.9.0"; src = fetchPypi { inherit pname version; - sha256 = "e86135ae101e31e2c8ec20a4e0c5220f4eed12487d5cf3f78be7e98d3a57fc28"; + sha256 = "018yg7g2pa6vjixx1nx41cfispgfi0azzp0a1chlycbj8jsil0ys"; }; - patches = [ - # The following 2 patches fix the test suite failing on nix < 2.3 with - # Python < 3 because those nix versions do not run in a pseudoterminal, - # which makes Python 2 not set the default encoding to UTF-8, and the - # Babel code crashes when printing a warning in that case. - # See #75676 and https://github.com/python-babel/babel/pull/691. - # It is important to fix this because otherwise Babel is not buildable - # with older nix versions (e.g. on machines used as --builders). - # TODO: Remove at release > 2.8.0. - (fetchpatch { - name = "Babel-Introduce-invariant-that-invalid_pofile-takes-unicode-line.patch"; - url = "https://github.com/python-babel/babel/commit/f4f6653e6aa053724d2c6dc0ee71dcb928013352.patch"; - sha256 = "1kyknwn9blspcf9yxmgdiaxdii1dnkblyhcflqwhxyl1mss1dxv5"; - }) - (fetchpatch { - name = "Babel-Fix-unicode-printing-error-on-Python-2-without-TTY.patch"; - url = "https://github.com/python-babel/babel/commit/da7f31143847659b6b74d802618b03438aceb350.patch"; - sha256 = "09yny8614knr8ngrrddmqzkxk70am135rccv2ncc6dji4xbqbfln"; - }) - ]; - propagatedBuildInputs = [ pytz ]; - checkInputs = [ pytest freezegun ]; + checkInputs = [ pytestCheckHook freezegun ]; doCheck = !stdenv.isDarwin; From 380bb617c06c862234e18bd5ca881e0fd2b6536d Mon Sep 17 00:00:00 2001 From: Thomas Gerbet Date: Fri, 23 Apr 2021 13:51:43 +0200 Subject: [PATCH 111/263] dnsmasq: 2.84 -> 2.85 Fixes CVE-2021-3448. https://lists.thekelleys.org.uk/pipermail/dnsmasq-discuss/2021q1/014835.html --- pkgs/tools/networking/dnsmasq/default.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkgs/tools/networking/dnsmasq/default.nix b/pkgs/tools/networking/dnsmasq/default.nix index a9e4b1390a1..131a645d838 100644 --- a/pkgs/tools/networking/dnsmasq/default.nix +++ b/pkgs/tools/networking/dnsmasq/default.nix @@ -13,11 +13,11 @@ let in stdenv.mkDerivation rec { pname = "dnsmasq"; - version = "2.84"; + version = "2.85"; src = fetchurl { - url = "http://www.thekelleys.org.uk/dnsmasq/${pname}-${version}.tar.xz"; - sha256 = "sha256-YDGVxktzE3YJsH4QJK4LN/ZSsvX+Rn3OZphbPRhQBQw="; + url = "https://www.thekelleys.org.uk/dnsmasq/${pname}-${version}.tar.xz"; + sha256 = "sha256-rZjTgD32h+W5OAgPPSXGKP5ByHh1LQP7xhmXh/7jEvo="; }; postPatch = lib.optionalString stdenv.hostPlatform.isLinux '' @@ -73,7 +73,7 @@ stdenv.mkDerivation rec { meta = { description = "An integrated DNS, DHCP and TFTP server for small networks"; - homepage = "http://www.thekelleys.org.uk/dnsmasq/doc.html"; + homepage = "https://www.thekelleys.org.uk/dnsmasq/doc.html"; license = licenses.gpl2; platforms = with platforms; linux ++ darwin; maintainers = with maintainers; [ eelco fpletz globin ]; From ac309027ab81a8a9a9e9c7e7c924340dac7ca86e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Sat, 24 Apr 2021 08:59:55 +0200 Subject: [PATCH 112/263] unbound: wrap unbound-control-setup with openssl --- pkgs/tools/networking/unbound/default.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkgs/tools/networking/unbound/default.nix b/pkgs/tools/networking/unbound/default.nix index 3c28133a2db..a0c774fb734 100644 --- a/pkgs/tools/networking/unbound/default.nix +++ b/pkgs/tools/networking/unbound/default.nix @@ -7,6 +7,7 @@ , libevent , dns-root-data , pkg-config +, makeWrapper # # By default unbound will not be built with systemd support. Unbound is a very # commmon dependency. The transitive dependency closure of systemd also @@ -34,6 +35,8 @@ stdenv.mkDerivation rec { outputs = [ "out" "lib" "man" ]; # "dev" would only split ~20 kB + nativeBuildInputs = [ makeWrapper ]; + buildInputs = [ openssl nettle expat libevent ] ++ lib.optionals withSystemd [ pkg-config systemd ] ++ lib.optionals withDoH [ libnghttp2 ]; @@ -60,6 +63,8 @@ stdenv.mkDerivation rec { postInstall = '' make unbound-event-install + wrapProgram $out/bin/unbound-control-setup \ + --prefix PATH : ${lib.makeBinPath [ openssl ]} ''; preFixup = lib.optionalString (stdenv.isLinux && !stdenv.hostPlatform.isMusl) # XXX: revisit From 1f3560bb683b13c309ca22f012c8f33d0c98bea3 Mon Sep 17 00:00:00 2001 From: Izorkin Date: Wed, 21 Apr 2021 12:02:43 +0300 Subject: [PATCH 113/263] mariadb-connector-c: 3.1.8 -> 3.1.12 --- pkgs/servers/sql/mariadb/connector-c/3_1.nix | 4 ++-- pkgs/servers/sql/mariadb/connector-c/default.nix | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pkgs/servers/sql/mariadb/connector-c/3_1.nix b/pkgs/servers/sql/mariadb/connector-c/3_1.nix index fb6835775fb..477d6113b7a 100644 --- a/pkgs/servers/sql/mariadb/connector-c/3_1.nix +++ b/pkgs/servers/sql/mariadb/connector-c/3_1.nix @@ -1,6 +1,6 @@ { callPackage, ... } @ args: callPackage ./. (args // { - version = "3.1.8"; - sha256 = "0yrzhsxmjiwkhchagx8dymzhvxl3k5h40wn9wpicqjvgjb9k8523"; + version = "3.1.12"; + sha256 = "0qzyahr8x9l1xz0l79wz3iahxz7648n1azc5yr7kx0dl113y2nig"; }) diff --git a/pkgs/servers/sql/mariadb/connector-c/default.nix b/pkgs/servers/sql/mariadb/connector-c/default.nix index 22110f3b4f0..0767828461f 100644 --- a/pkgs/servers/sql/mariadb/connector-c/default.nix +++ b/pkgs/servers/sql/mariadb/connector-c/default.nix @@ -29,8 +29,8 @@ stdenv.mkDerivation { postPatch = '' substituteInPlace mariadb_config/mariadb_config.c.in \ - --replace '@CMAKE_SYSROOT@@CMAKE_INSTALL_PREFIX@/@INSTALL_INCLUDEDIR@' "$dev/include" \ - --replace '@CMAKE_SYSROOT@@CMAKE_INSTALL_PREFIX@/@INSTALL_LIBDIR@' "$out/lib/mariadb" + --replace '-I%s/@INSTALL_INCLUDEDIR@' "-I$dev/include" \ + --replace '-L%s/@INSTALL_LIBDIR@' "-L$out/lib/mariadb" ''; # The cmake setup-hook uses $out/lib by default, this is not the case here. From c22c6dfc119beff6355081ed9e93db8736e620a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Sat, 24 Apr 2021 11:17:13 +0200 Subject: [PATCH 114/263] python3.pkgs.dask-glm: fix evaluation --- pkgs/development/python-modules/dask-glm/default.nix | 2 -- 1 file changed, 2 deletions(-) diff --git a/pkgs/development/python-modules/dask-glm/default.nix b/pkgs/development/python-modules/dask-glm/default.nix index 85196369512..44bc8fda4b1 100644 --- a/pkgs/development/python-modules/dask-glm/default.nix +++ b/pkgs/development/python-modules/dask-glm/default.nix @@ -5,7 +5,6 @@ , dask , numpy, toolz # dask[array] , multipledispatch -, setuptools-scm , scipy , scikitlearn , pytest @@ -23,7 +22,6 @@ buildPythonPackage rec { nativeBuildInputs = [ setuptools-scm ]; checkInputs = [ pytest ]; - nativeBuildInputs = [ setuptools-scm ]; propagatedBuildInputs = [ cloudpickle dask numpy toolz multipledispatch scipy scikitlearn ]; checkPhase = '' From 909ab9b66014861b73f4f382270c0b04c4753e66 Mon Sep 17 00:00:00 2001 From: Ron B Date: Sat, 24 Apr 2021 17:36:06 +0300 Subject: [PATCH 115/263] ffmpeg-full: add vulkan and glslang features These two features are in one commit as ffmpeg's Vulkan filters require glslang: https://bugs.gentoo.org/750260 --- pkgs/development/libraries/ffmpeg-full/default.nix | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pkgs/development/libraries/ffmpeg-full/default.nix b/pkgs/development/libraries/ffmpeg-full/default.nix index 4cfaa9ebff2..e9c9f2fdf6a 100644 --- a/pkgs/development/libraries/ffmpeg-full/default.nix +++ b/pkgs/development/libraries/ffmpeg-full/default.nix @@ -132,6 +132,8 @@ , xvidcore ? null # Xvid encoder, native encoder exists , zeromq4 ? null # Message passing , zlib ? null +, vulkan-loader ? null +, glslang ? null #, zvbi ? null # Teletext support /* * Developer options @@ -401,6 +403,8 @@ stdenv.mkDerivation rec { (enableFeature (xvidcore != null && gplLicensing) "libxvid") (enableFeature (zeromq4 != null) "libzmq") (enableFeature (zlib != null) "zlib") + (enableFeature (isLinux && vulkan-loader != null) "vulkan") + (enableFeature (glslang != null) "libglslang") #(enableFeature (zvbi != null && gplLicensing) "libzvbi") /* * Developer flags @@ -422,12 +426,12 @@ stdenv.mkDerivation rec { libogg libopus librsvg libssh libtheora libvdpau libvorbis libvpx libwebp libX11 libxcb libXv libXext xz openal openjpeg libpulseaudio rav1e svt-av1 rtmpdump opencore-amr samba SDL2 soxr speex srt vid-stab vo-amrwbenc x264 x265 xavs xvidcore - zeromq4 zlib + zeromq4 zlib glslang ] ++ optionals openglExtlib [ libGL libGLU ] ++ optionals nonfreeLicensing [ fdk_aac openssl ] ++ optional ((isLinux || isFreeBSD) && libva != null) libva ++ optional (!isAarch64 && libvmaf != null && version3Licensing) libvmaf - ++ optionals isLinux [ alsaLib libraw1394 libv4l ] + ++ optionals isLinux [ alsaLib libraw1394 libv4l vulkan-loader ] ++ optional (isLinux && !isAarch64 && libmfx != null) libmfx ++ optional nvenc nv-codec-headers ++ optionals stdenv.isDarwin [ Cocoa CoreServices CoreAudio AVFoundation From 3349d99e260d095c8f0a1e5ba79b949c85f125d1 Mon Sep 17 00:00:00 2001 From: Peter Hoeg Date: Tue, 6 Apr 2021 10:58:27 +0800 Subject: [PATCH 116/263] libxkbcommon: build the wayland tools on linux --- .../libraries/libxkbcommon/default.nix | 26 ++++++++++++++----- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/pkgs/development/libraries/libxkbcommon/default.nix b/pkgs/development/libraries/libxkbcommon/default.nix index 8c37bb0c173..a4e1b125e64 100644 --- a/pkgs/development/libraries/libxkbcommon/default.nix +++ b/pkgs/development/libraries/libxkbcommon/default.nix @@ -1,9 +1,21 @@ -{ lib, stdenv, fetchurl, meson, ninja, pkg-config, bison, doxygen -, xkeyboard_config, libxcb, libxml2 +{ lib +, stdenv +, fetchurl +, meson +, ninja +, pkg-config +, bison +, doxygen +, xkeyboard_config +, libxcb +, libxml2 , python3 , libX11 -# To enable the "interactive-wayland" subcommand of xkbcli: -, withWaylandSupport ? false, wayland, wayland-protocols + # To enable the "interactive-wayland" subcommand of xkbcli. This is the + # wayland equivalent of `xev` on X11. +, withWaylandTools ? stdenv.isLinux +, wayland +, wayland-protocols }: stdenv.mkDerivation rec { @@ -19,16 +31,16 @@ stdenv.mkDerivation rec { depsBuildBuild = [ pkg-config ]; nativeBuildInputs = [ meson ninja pkg-config bison doxygen ] - ++ lib.optional withWaylandSupport wayland; + ++ lib.optional withWaylandTools wayland; buildInputs = [ xkeyboard_config libxcb libxml2 ] - ++ lib.optionals withWaylandSupport [ wayland wayland-protocols ]; + ++ lib.optionals withWaylandTools [ wayland wayland-protocols ]; checkInputs = [ python3 ]; mesonFlags = [ "-Dxkb-config-root=${xkeyboard_config}/etc/X11/xkb" "-Dxkb-config-extra-path=/etc/xkb" # default=$sysconfdir/xkb ($out/etc) "-Dx-locale-root=${libX11.out}/share/X11/locale" - "-Denable-wayland=${lib.boolToString withWaylandSupport}" + "-Denable-wayland=${lib.boolToString withWaylandTools}" ]; doCheck = true; From f2ab8d299290170b7738c372be680da49df6d593 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20=C4=8Cun=C3=A1t?= Date: Mon, 26 Apr 2021 13:19:27 +0200 Subject: [PATCH 117/263] python*Packages.dask-glm: fix evaluation I'm not sure why this again, maybe some kind of merge conflict, as the code around this is being changed a lot now. --- pkgs/development/python-modules/dask-glm/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/development/python-modules/dask-glm/default.nix b/pkgs/development/python-modules/dask-glm/default.nix index fba20c29d5c..ca25e05bb1e 100644 --- a/pkgs/development/python-modules/dask-glm/default.nix +++ b/pkgs/development/python-modules/dask-glm/default.nix @@ -5,6 +5,7 @@ , dask , numpy, toolz # dask[array] , multipledispatch +, setuptools-scm , scipy , scikitlearn , pytest From 7ac9fcb01bdb1dee8aec192ef57e578ab7695db0 Mon Sep 17 00:00:00 2001 From: TredwellGit Date: Mon, 26 Apr 2021 09:57:53 +0000 Subject: [PATCH 118/263] linuxHeaders: 5.11 -> 5.12 --- pkgs/os-specific/linux/kernel-headers/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/os-specific/linux/kernel-headers/default.nix b/pkgs/os-specific/linux/kernel-headers/default.nix index a2a63e2bcab..34e80ac8222 100644 --- a/pkgs/os-specific/linux/kernel-headers/default.nix +++ b/pkgs/os-specific/linux/kernel-headers/default.nix @@ -69,12 +69,12 @@ let in { inherit makeLinuxHeaders; - linuxHeaders = let version = "5.11"; in + linuxHeaders = let version = "5.12"; in makeLinuxHeaders { inherit version; src = fetchurl { url = "mirror://kernel/linux/kernel/v5.x/linux-${version}.tar.xz"; - sha256 = "1d37w0zvmf8c1l99xvy1hy6p55icjhmbsv7f0amxy2nly1a7pw04"; + sha256 = "sha256-fQ328r8jhNaNC9jh/j4HHWQ2Tc3GAC57XIfJLUj6w2Y="; }; patches = [ ./no-relocs.patch # for building x86 kernel headers on non-ELF platforms From ed8f7c60cd46824990e8d8106cb881c2e3386a86 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Mon, 26 Apr 2021 17:23:53 +0200 Subject: [PATCH 119/263] python3Packages.dotmap: init at 1.3.23 --- .../python-modules/dotmap/default.nix | 30 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 ++ 2 files changed, 32 insertions(+) create mode 100644 pkgs/development/python-modules/dotmap/default.nix diff --git a/pkgs/development/python-modules/dotmap/default.nix b/pkgs/development/python-modules/dotmap/default.nix new file mode 100644 index 00000000000..cb5f032a6f2 --- /dev/null +++ b/pkgs/development/python-modules/dotmap/default.nix @@ -0,0 +1,30 @@ +{ lib +, buildPythonPackage +, fetchPypi +, pytestCheckHook +}: + +buildPythonPackage rec { + pname = "dotmap"; + version = "1.3.23"; + + src = fetchPypi { + inherit pname version; + sha256 = "0hy88kzzb7zhxfr7iyvl6rhmvz02538pbna7zypaard4a88bbbka"; + }; + + checkInputs = [ + pytestCheckHook + ]; + + pytestFlagsArray = [ "dotmap/test.py" ]; + + pythonImportsCheck = [ "dotmap" ]; + + meta = with lib; { + description = "Python for dot-access dictionaries"; + homepage = "https://github.com/drgrib/dotmap"; + license = with licenses; [ mit ]; + maintainers = with maintainers; [ fab ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index adb4a4aa403..64c618dffe7 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -2030,6 +2030,8 @@ in { inherit (pkgs) graphviz; }; + dotmap = callPackage ../development/python-modules/dotmap { }; + dparse = callPackage ../development/python-modules/dparse { }; dpath = callPackage ../development/python-modules/dpath { }; From dd1ca470dbc083d98e4b2180a2b72c7dec3a7835 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Mon, 26 Apr 2021 18:09:28 +0200 Subject: [PATCH 120/263] python3Packages.timeago: init at 1.0.15 --- .../python-modules/timeago/default.nix | 32 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 ++ 2 files changed, 34 insertions(+) create mode 100644 pkgs/development/python-modules/timeago/default.nix diff --git a/pkgs/development/python-modules/timeago/default.nix b/pkgs/development/python-modules/timeago/default.nix new file mode 100644 index 00000000000..0c2a688f674 --- /dev/null +++ b/pkgs/development/python-modules/timeago/default.nix @@ -0,0 +1,32 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub +, pytestCheckHook +}: + +buildPythonPackage rec { + pname = "timeago"; + version = "1.0.15"; + + src = fetchFromGitHub { + owner = "hustcc"; + repo = pname; + rev = version; + sha256 = "03vm7c02l4g2d1x33w382i1psk8i3an7xchk69yinha33fjj1cag"; + }; + + checkInputs = [ + pytestCheckHook + ]; + + pytestFlagsArray = [ "test/testcase.py" ]; + + pythonImportsCheck = [ "timeago" ]; + + meta = with lib; { + description = "Python module to format past datetime output"; + homepage = "https://github.com/hustcc/timeago"; + license = with licenses; [ mit ]; + maintainers = with maintainers; [ fab ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 64c618dffe7..76ae19d29f4 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -8014,6 +8014,8 @@ in { tilestache = callPackage ../development/python-modules/tilestache { }; + timeago = callPackage ../development/python-modules/timeago { }; + timelib = callPackage ../development/python-modules/timelib { }; timeout-decorator = callPackage ../development/python-modules/timeout-decorator { }; From 4832930b8d0a1e7295217ceb658b84862abfa6b6 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Mon, 26 Apr 2021 18:47:55 +0200 Subject: [PATCH 121/263] python3Packages.meshtastic: init at 1.2.30 --- .../python-modules/meshtastic/default.nix | 57 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 59 insertions(+) create mode 100644 pkgs/development/python-modules/meshtastic/default.nix diff --git a/pkgs/development/python-modules/meshtastic/default.nix b/pkgs/development/python-modules/meshtastic/default.nix new file mode 100644 index 00000000000..c8a9d78e7c1 --- /dev/null +++ b/pkgs/development/python-modules/meshtastic/default.nix @@ -0,0 +1,57 @@ +{ lib +, buildPythonPackage +, dotmap +, fetchPypi +, pexpect +, protobuf +, pygatt +, pypubsub +, pyqrcode +, pyserial +, pythonOlder +, tabulate +, timeago +}: + +buildPythonPackage rec { + pname = "meshtastic"; + version = "1.2.30"; + disabled = pythonOlder "3.6"; + + src = fetchPypi { + inherit pname version; + sha256 = "1kjflc2jwnsgxyr2zx1gyykhak9fsgy6hxaxlggsz5sw9b8rdrby"; + }; + + propagatedBuildInputs = [ + dotmap + pexpect + protobuf + pygatt + pypubsub + pyqrcode + pyserial + tabulate + timeago + ]; + + postPatch = '' + # https://github.com/meshtastic/Meshtastic-python/pull/87 + substituteInPlace setup.py \ + --replace 'with open("README.md", "r") as fh:' "" \ + --replace "long_description = fh.read()" "" \ + --replace "long_description=long_description," 'long_description="",' + ''; + + # Project only provides PyPI releases which don't contain the tests + # https://github.com/meshtastic/Meshtastic-python/issues/86 + doCheck = false; + pythonImportsCheck = [ "meshtastic" ]; + + meta = with lib; { + description = "Python API for talking to Meshtastic devices"; + homepage = "https://meshtastic.github.io/Meshtastic-python/"; + license = with licenses; [ asl20 ]; + maintainers = with maintainers; [ fab ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 76ae19d29f4..3be9ab1f776 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -4111,6 +4111,8 @@ in { meshlabxml = callPackage ../development/python-modules/meshlabxml { }; + meshtastic = callPackage ../development/python-modules/meshtastic { }; + meson = toPythonModule ((pkgs.meson.override { python3 = python; }).overrideAttrs (oldAttrs: { # We do not want the setup hook in Python packages because the build is performed differently. setupHook = null; From 92d26e18f4ea5fc9c4d36f9add4be43bdc181e4b Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Mon, 26 Apr 2021 17:57:30 +0200 Subject: [PATCH 122/263] python3Packages.pygatt: init at 4.0.5 --- .../python-modules/pygatt/default.nix | 48 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 50 insertions(+) create mode 100644 pkgs/development/python-modules/pygatt/default.nix diff --git a/pkgs/development/python-modules/pygatt/default.nix b/pkgs/development/python-modules/pygatt/default.nix new file mode 100644 index 00000000000..9d596e17236 --- /dev/null +++ b/pkgs/development/python-modules/pygatt/default.nix @@ -0,0 +1,48 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub +, mock +, nose +, pexpect +, pyserial +, pytestCheckHook +, pythonOlder +}: + +buildPythonPackage rec { + pname = "pygatt"; + version = "4.0.5"; + disabled = pythonOlder "3.5"; + + src = fetchFromGitHub { + owner = "peplin"; + repo = pname; + rev = "v${version}"; + sha256 = "1zdfxidiw0l8n498sy0l33n90lz49n25x889cx6jamjr7frlcihd"; + }; + + propagatedBuildInputs = [ + pexpect + pyserial + ]; + + checkInputs = [ + mock + nose + pytestCheckHook + ]; + + postPatch = '' + # Not support for Python < 3.4 + substituteInPlace setup.py --replace "'enum-compat'" "" + ''; + + pythonImportsCheck = [ "pygatt" ]; + + meta = with lib; { + description = "Python wrapper the BGAPI for accessing Bluetooth LE Devices"; + homepage = "https://github.com/peplin/pygatt"; + license = with licenses; [ asl20 mit ]; + maintainers = with maintainers; [ fab ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 3be9ab1f776..ab7af0a4d50 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -5539,6 +5539,8 @@ in { pygame_sdl2 = callPackage ../development/python-modules/pygame_sdl2 { }; + pygatt = callPackage ../development/python-modules/pygatt { }; + pygbm = callPackage ../development/python-modules/pygbm { }; pygccxml = callPackage ../development/python-modules/pygccxml { }; From 774d7e5fa259066b342e2b28ace0c47e8fbc3fa9 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Mon, 26 Apr 2021 09:49:51 +0200 Subject: [PATCH 123/263] python3Packages.iso8601: switch to pytestCheckHook --- .../python-modules/iso8601/default.nix | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/pkgs/development/python-modules/iso8601/default.nix b/pkgs/development/python-modules/iso8601/default.nix index 783f6f1eb30..40483390460 100644 --- a/pkgs/development/python-modules/iso8601/default.nix +++ b/pkgs/development/python-modules/iso8601/default.nix @@ -1,7 +1,7 @@ { lib , buildPythonPackage , fetchPypi -, pytest +, pytestCheckHook }: buildPythonPackage rec { @@ -13,15 +13,18 @@ buildPythonPackage rec { sha256 = "8aafd56fa0290496c5edbb13c311f78fa3a241f0853540da09d9363eae3ebd79"; }; - checkInputs = [ pytest ]; + checkInputs = [ + pytestCheckHook + ]; - checkPhase = '' - py.test iso8601 - ''; + pytestFlagsArray = [ "iso8601" ]; - meta = { - homepage = "https://bitbucket.org/micktwomey/pyiso8601/"; + pythonImportsCheck = [ "iso8601" ]; + + meta = with lib; { description = "Simple module to parse ISO 8601 dates"; - maintainers = with lib.maintainers; [ phreedom ]; + homepage = "https://pyiso8601.readthedocs.io/"; + license = with licenses; [ mit ]; + maintainers = with maintainers; [ phreedom ]; }; } From 5567ea0a0aea03c0b2a8b0c2ca60d63041d819e1 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Mon, 26 Apr 2021 20:12:11 +0200 Subject: [PATCH 124/263] python3Packages.iso8601: update maintainer --- pkgs/development/python-modules/iso8601/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/python-modules/iso8601/default.nix b/pkgs/development/python-modules/iso8601/default.nix index 40483390460..d0a74f400bb 100644 --- a/pkgs/development/python-modules/iso8601/default.nix +++ b/pkgs/development/python-modules/iso8601/default.nix @@ -25,6 +25,6 @@ buildPythonPackage rec { description = "Simple module to parse ISO 8601 dates"; homepage = "https://pyiso8601.readthedocs.io/"; license = with licenses; [ mit ]; - maintainers = with maintainers; [ phreedom ]; + maintainers = with maintainers; [ fab ]; }; } From 8252d032c59a6e50b39dc7ba9e71ce618cc7a5a1 Mon Sep 17 00:00:00 2001 From: "R. RyanTM" Date: Wed, 28 Apr 2021 03:10:33 +0000 Subject: [PATCH 125/263] btrfs-progs: 5.11 -> 5.11.1 --- pkgs/tools/filesystems/btrfs-progs/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/tools/filesystems/btrfs-progs/default.nix b/pkgs/tools/filesystems/btrfs-progs/default.nix index 0e135d41a4b..9a05a0d67fe 100644 --- a/pkgs/tools/filesystems/btrfs-progs/default.nix +++ b/pkgs/tools/filesystems/btrfs-progs/default.nix @@ -4,11 +4,11 @@ stdenv.mkDerivation rec { pname = "btrfs-progs"; - version = "5.11"; + version = "5.11.1"; src = fetchurl { url = "mirror://kernel/linux/kernel/people/kdave/btrfs-progs/btrfs-progs-v${version}.tar.xz"; - sha256 = "sha256-1BlhsKkhYMgPiUrZoYgoIoicLh0ITL8+CLjCFKXPATc="; + sha256 = "sha256-46rMxHVuxOVQLLKp+Ftn1SiWZE9MPA+IprxZjHC96/4="; }; nativeBuildInputs = [ From a49df973fca357de19f34a829c7bd51a5bb6df4a Mon Sep 17 00:00:00 2001 From: "R. RyanTM" Date: Tue, 27 Apr 2021 19:59:35 +0000 Subject: [PATCH 126/263] cointop: 1.6.3 -> 1.6.5 --- pkgs/applications/misc/cointop/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/misc/cointop/default.nix b/pkgs/applications/misc/cointop/default.nix index d62d96e530e..66d73c94b46 100644 --- a/pkgs/applications/misc/cointop/default.nix +++ b/pkgs/applications/misc/cointop/default.nix @@ -2,13 +2,13 @@ buildGoPackage rec { pname = "cointop"; - version = "1.6.3"; + version = "1.6.5"; src = fetchFromGitHub { owner = "miguelmota"; repo = pname; rev = "v${version}"; - sha256 = "sha256-h4102oWYSuY4uq/Pyo9u25Pdsai7AK2W9yUmS/zdjrw="; + sha256 = "sha256-pnh4z7vk8xazdBPNbwR5BrKFbi8df8UTM2SOU+KDvsk="; }; goPackagePath = "github.com/miguelmota/cointop"; From c3e1af4ba5b6bb182fd027d4aa3db179d1edea2b Mon Sep 17 00:00:00 2001 From: "R. RyanTM" Date: Tue, 27 Apr 2021 19:51:56 +0000 Subject: [PATCH 127/263] chezmoi: 2.0.10 -> 2.0.11 --- pkgs/tools/misc/chezmoi/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/tools/misc/chezmoi/default.nix b/pkgs/tools/misc/chezmoi/default.nix index cec900189c4..b2916dab33c 100644 --- a/pkgs/tools/misc/chezmoi/default.nix +++ b/pkgs/tools/misc/chezmoi/default.nix @@ -2,16 +2,16 @@ buildGoModule rec { pname = "chezmoi"; - version = "2.0.10"; + version = "2.0.11"; src = fetchFromGitHub { owner = "twpayne"; repo = "chezmoi"; rev = "v${version}"; - sha256 = "sha256-WVG4rww9Wd1H6zw5lRBErX9VwnA21dhvith9BQFYqxw="; + sha256 = "sha256-z9ALpoF2ZLigAG/uvoYVG1YTy+EM4bDQDDtxd3PgQW8="; }; - vendorSha256 = "sha256-khYcNP3xAXeQR9vaghkGq8x6KB1k5hLEcE7Zx8H+CfA="; + vendorSha256 = "sha256-CYDFEVZ04csn4BjvwUvfOafEjucnDHyeYU7gNwO1xTQ="; doCheck = false; From 8fb7796a463126da39c8fff147ad56271593f790 Mon Sep 17 00:00:00 2001 From: "R. RyanTM" Date: Wed, 28 Apr 2021 06:55:59 +0000 Subject: [PATCH 128/263] dpkg: 1.20.7.1 -> 1.20.9 --- pkgs/tools/package-management/dpkg/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/tools/package-management/dpkg/default.nix b/pkgs/tools/package-management/dpkg/default.nix index 0026dd37ca4..a4e9ef41fc9 100644 --- a/pkgs/tools/package-management/dpkg/default.nix +++ b/pkgs/tools/package-management/dpkg/default.nix @@ -2,11 +2,11 @@ stdenv.mkDerivation rec { pname = "dpkg"; - version = "1.20.7.1"; + version = "1.20.9"; src = fetchurl { url = "mirror://debian/pool/main/d/dpkg/dpkg_${version}.tar.xz"; - sha256 = "sha256-Cq0t5of3l++OvavHuv0W3BSX8c4jvZFG+apz85alY28="; + sha256 = "sha256-XOJCgw8hO1Yg8I5sQYOtse9Nydoo0xmIonyHxx/lNM4="; }; configureFlags = [ From 67be794a7f1102c752ab0d00c6ca58652009e67e Mon Sep 17 00:00:00 2001 From: Jonathan del Strother Date: Wed, 28 Apr 2021 09:28:19 +0100 Subject: [PATCH 129/263] nodejs: Fix build by pinning to icu68 Node 12/14/15 don't build against icu69, failing with: ``` ../deps/v8/src/objects/js-list-format.cc:172:55: error: 'createInstance' is a private member of 'icu_69::ListFormatter' ``` --- pkgs/development/web/nodejs/v12.nix | 4 ++-- pkgs/development/web/nodejs/v14.nix | 4 ++-- pkgs/development/web/nodejs/v15.nix | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/pkgs/development/web/nodejs/v12.nix b/pkgs/development/web/nodejs/v12.nix index 54f4352c53e..7fad6a020a8 100644 --- a/pkgs/development/web/nodejs/v12.nix +++ b/pkgs/development/web/nodejs/v12.nix @@ -1,8 +1,8 @@ -{ callPackage, openssl, icu, python2, lib, stdenv, enableNpm ? true }: +{ callPackage, icu68, python2, lib, stdenv, enableNpm ? true }: let buildNodejs = callPackage ./nodejs.nix { - inherit openssl icu; + icu = icu68; python = python2; }; in diff --git a/pkgs/development/web/nodejs/v14.nix b/pkgs/development/web/nodejs/v14.nix index 0d48003268c..535bfab7123 100644 --- a/pkgs/development/web/nodejs/v14.nix +++ b/pkgs/development/web/nodejs/v14.nix @@ -1,8 +1,8 @@ -{ callPackage, openssl, python3, lib, stdenv, enableNpm ? true }: +{ callPackage, icu68, python3, lib, stdenv, enableNpm ? true }: let buildNodejs = callPackage ./nodejs.nix { - inherit openssl; + icu = icu68; python = python3; }; in diff --git a/pkgs/development/web/nodejs/v15.nix b/pkgs/development/web/nodejs/v15.nix index d22c2f213b9..e6903098b30 100644 --- a/pkgs/development/web/nodejs/v15.nix +++ b/pkgs/development/web/nodejs/v15.nix @@ -1,8 +1,8 @@ -{ callPackage, openssl, python3, enableNpm ? true }: +{ callPackage, icu68, python3, enableNpm ? true }: let buildNodejs = callPackage ./nodejs.nix { - inherit openssl; + icu = icu68; python = python3; }; in From 873d22fc896541dff8d9799593241649f4274cc5 Mon Sep 17 00:00:00 2001 From: Pavol Rusnak Date: Sun, 25 Apr 2021 23:40:04 +0200 Subject: [PATCH 130/263] libfido2: 1.5.0 -> 1.7.0 --- .../libraries/libfido2/default.nix | 30 +++++++++++++++---- 1 file changed, 24 insertions(+), 6 deletions(-) diff --git a/pkgs/development/libraries/libfido2/default.nix b/pkgs/development/libraries/libfido2/default.nix index f44ae4d01f2..64c16e92c44 100644 --- a/pkgs/development/libraries/libfido2/default.nix +++ b/pkgs/development/libraries/libfido2/default.nix @@ -1,4 +1,5 @@ -{ lib, stdenv +{ lib +, stdenv , fetchurl , fetchpatch , cmake @@ -7,30 +8,47 @@ , libcbor , openssl , udev +, zlib }: stdenv.mkDerivation rec { pname = "libfido2"; - version = "1.5.0"; + version = "1.7.0"; + + # releases on https://developers.yubico.com/libfido2/Releases/ are signed src = fetchurl { url = "https://developers.yubico.com/${pname}/Releases/${pname}-${version}.tar.gz"; - sha256 = "08iizxq3w8mpkwfrfpl59csffc20yz8x398bl3kf23rrr4izk42r"; + sha256 = "13khkp2q8g447797l09p83qxy0z8vgmzr54l8dcnapy9lsr4jrqi"; }; + patches = [ + # fix log truncation + # https://github.com/Yubico/libfido2/issues/318 + # https://github.com/Yubico/libfido2/pull/319 + (fetchpatch { + url = "https://github.com/Yubico/libfido2/commit/8edb9a204b2f4aeb487e282908c3187f1d02d606.patch"; + sha256 = "1i360bghwbdccgkzjfzvhilscnwsj9lhfiviy000n928698l4wan"; + }) + ]; + nativeBuildInputs = [ cmake pkg-config ]; - buildInputs = [ hidapi libcbor openssl ] + buildInputs = [ libcbor openssl zlib ] + ++ lib.optionals stdenv.isDarwin [ hidapi ] ++ lib.optionals stdenv.isLinux [ udev ]; cmakeFlags = [ "-DUDEV_RULES_DIR=${placeholder "out"}/etc/udev/rules.d" - "-DUSE_HIDAPI=1" "-DCMAKE_INSTALL_LIBDIR=lib" + ] ++ lib.optionals stdenv.isDarwin [ + "-DUSE_HIDAPI=1" + ] ++ lib.optionals stdenv.isLinux [ + "-DNFC_LINUX=1" ]; meta = with lib; { description = '' - Provides library functionality for FIDO 2.0, including communication with a device over USB. + Provides library functionality for FIDO 2.0, including communication with a device over USB. ''; homepage = "https://github.com/Yubico/libfido2"; license = licenses.bsd2; From 0bfa1a65384b7dfd7968aabb03f8be681750cc86 Mon Sep 17 00:00:00 2001 From: "R. RyanTM" Date: Wed, 28 Apr 2021 14:24:57 +0000 Subject: [PATCH 131/263] jove: 4.17.3.6 -> 4.17.3.7 --- pkgs/applications/editors/jove/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/editors/jove/default.nix b/pkgs/applications/editors/jove/default.nix index 0b60b9474bd..c2625271665 100644 --- a/pkgs/applications/editors/jove/default.nix +++ b/pkgs/applications/editors/jove/default.nix @@ -6,13 +6,13 @@ stdenv.mkDerivation rec { pname = "jove"; - version = "4.17.3.6"; + version = "4.17.3.7"; src = fetchFromGitHub { owner = "jonmacs"; repo = "jove"; rev = version; - sha256 = "sha256-uQRNKV06ipOHrOsvsceqIFGGlRv5qOQy18q0tFkR6Kg="; + sha256 = "sha256-fD87FIWZlfJE2tVX+0QaiGGqu+tJFHheXe1guJR/Hxg="; }; nativeBuildInputs = [ makeWrapper ]; From 6fec0dfca0e8f5bbda399d72dbe7f294b64d31b6 Mon Sep 17 00:00:00 2001 From: "R. RyanTM" Date: Wed, 28 Apr 2021 14:27:39 +0000 Subject: [PATCH 132/263] jruby: 9.2.16.0 -> 9.2.17.0 --- pkgs/development/interpreters/jruby/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/interpreters/jruby/default.nix b/pkgs/development/interpreters/jruby/default.nix index be1a1a15c84..4e540dc8aac 100644 --- a/pkgs/development/interpreters/jruby/default.nix +++ b/pkgs/development/interpreters/jruby/default.nix @@ -6,11 +6,11 @@ rubyVersion = callPackage ../ruby/ruby-version.nix {} "2" "5" "7" ""; jruby = stdenv.mkDerivation rec { pname = "jruby"; - version = "9.2.16.0"; + version = "9.2.17.0"; src = fetchurl { url = "https://s3.amazonaws.com/jruby.org/downloads/${version}/jruby-bin-${version}.tar.gz"; - sha256 = "sha256-WuJ/FJ9z8/6k80NZy7dzwl2dmH5yte3snouTlXmX6zA="; + sha256 = "sha256-dwHTU3s6YG0nZaxtXEDmdd2qAdPOutJqIaZuOq3VwgI="; }; nativeBuildInputs = [ makeWrapper ]; From 40f2138e291e0a1b8ad79cb3aad66b2802ed934f Mon Sep 17 00:00:00 2001 From: "R. RyanTM" Date: Wed, 28 Apr 2021 18:06:48 +0000 Subject: [PATCH 133/263] iproute2: 5.11.0 -> 5.12.0 --- pkgs/os-specific/linux/iproute/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/os-specific/linux/iproute/default.nix b/pkgs/os-specific/linux/iproute/default.nix index affc18e8f37..638983d6c17 100644 --- a/pkgs/os-specific/linux/iproute/default.nix +++ b/pkgs/os-specific/linux/iproute/default.nix @@ -5,11 +5,11 @@ stdenv.mkDerivation rec { pname = "iproute2"; - version = "5.11.0"; + version = "5.12.0"; src = fetchurl { url = "mirror://kernel/linux/utils/net/${pname}/${pname}-${version}.tar.xz"; - sha256 = "0m2wa14rhmdb6k07minmw5lk97vz4vn56ndka5849cqjh88fmqn5"; + sha256 = "sha256-nSaNuYo27ioOP/O5Ky7/9m/BE4pR5Am972qzz+FfMm8="; }; preConfigure = '' From 3466530d666b699171f78e437576d0903be5431b Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Wed, 28 Apr 2021 23:06:31 +0200 Subject: [PATCH 134/263] openldap: Enable argon2 hash support by default argon2 is the recommended password hashing function, and the module is included with OpenLDAP contrib. This change enables argon2 hashes by default in our OpenLDAP package. The install command for argon2 needs to be install-lib, as it otherwise tries to install manpages to /usr, which fails. --- pkgs/development/libraries/openldap/default.nix | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/pkgs/development/libraries/openldap/default.nix b/pkgs/development/libraries/openldap/default.nix index 39831a3baf0..fe4704341ef 100644 --- a/pkgs/development/libraries/openldap/default.nix +++ b/pkgs/development/libraries/openldap/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, fetchurl, openssl, db, groff, libtool +{ lib, stdenv, fetchurl, openssl, db, groff, libtool, libsodium , withCyrusSasl ? true , cyrus_sasl }: @@ -19,7 +19,7 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ groff ]; - buildInputs = [ openssl cyrus_sasl db libtool ]; + buildInputs = [ openssl cyrus_sasl db libsodium libtool ]; # Disable install stripping as it breaks cross-compiling. # We strip binaries anyway in fixupPhase. @@ -46,6 +46,7 @@ stdenv.mkDerivation rec { postBuild = '' make $makeFlags CC=$CC -C contrib/slapd-modules/passwd/sha2 make $makeFlags CC=$CC -C contrib/slapd-modules/passwd/pbkdf2 + make $makeFlags CC=$CC -C contrib/slapd-modules/passwd/argon2 ''; doCheck = false; # needs a running LDAP server @@ -54,6 +55,9 @@ stdenv.mkDerivation rec { "sysconfdir=$(out)/etc" "localstatedir=$(out)/var" "moduledir=$(out)/lib/modules" + # The argon2 module hardcodes /usr/bin/install as the path for the + # `install` binary, which is overridden here. + "INSTALL=install" ]; # 1. Libraries left in the build location confuse `patchelf --shrink-rpath` @@ -76,6 +80,7 @@ stdenv.mkDerivation rec { postInstall = '' make $installFlags install -C contrib/slapd-modules/passwd/sha2 make $installFlags install -C contrib/slapd-modules/passwd/pbkdf2 + make $installFlags install-lib -C contrib/slapd-modules/passwd/argon2 chmod +x "$out"/lib/*.{so,dylib} ''; From 52851b3f8c4d99ed8127fdab2bf08c51bc0ce383 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Thu, 29 Apr 2021 01:01:34 +0200 Subject: [PATCH 135/263] gstreamer: 1.18.2 -> 1.18.4 Fixes: CVE-2021-3497, CVE-2021-3498 --- pkgs/development/libraries/gstreamer/base/default.nix | 4 ++-- pkgs/development/libraries/gstreamer/core/default.nix | 4 ++-- pkgs/development/libraries/gstreamer/devtools/default.nix | 4 ++-- pkgs/development/libraries/gstreamer/ges/default.nix | 4 ++-- pkgs/development/libraries/gstreamer/good/default.nix | 4 ++-- pkgs/development/libraries/gstreamer/libav/default.nix | 4 ++-- pkgs/development/libraries/gstreamer/rtsp-server/default.nix | 4 ++-- pkgs/development/libraries/gstreamer/ugly/default.nix | 4 ++-- pkgs/development/libraries/gstreamer/vaapi/default.nix | 4 ++-- pkgs/development/python-modules/gst-python/default.nix | 4 ++-- 10 files changed, 20 insertions(+), 20 deletions(-) diff --git a/pkgs/development/libraries/gstreamer/base/default.nix b/pkgs/development/libraries/gstreamer/base/default.nix index 4f392622065..7e9095ef0ed 100644 --- a/pkgs/development/libraries/gstreamer/base/default.nix +++ b/pkgs/development/libraries/gstreamer/base/default.nix @@ -41,13 +41,13 @@ stdenv.mkDerivation rec { pname = "gst-plugins-base"; - version = "1.18.2"; + version = "1.18.4"; outputs = [ "out" "dev" ]; src = fetchurl { url = "https://gstreamer.freedesktop.org/src/${pname}/${pname}-${version}.tar.xz"; - sha256 = "1b05kg46azrxxvq42c71071lfsnc34pw4vynnkczdqi6g0gzn16x"; + sha256 = "08w3ivbc6n4vdds2ap6q7l8zdk9if8417nznyqidf0adm0lk5r99"; }; patches = [ diff --git a/pkgs/development/libraries/gstreamer/core/default.nix b/pkgs/development/libraries/gstreamer/core/default.nix index 84badf30410..2d43a02725f 100644 --- a/pkgs/development/libraries/gstreamer/core/default.nix +++ b/pkgs/development/libraries/gstreamer/core/default.nix @@ -21,7 +21,7 @@ stdenv.mkDerivation rec { pname = "gstreamer"; - version = "1.18.2"; + version = "1.18.4"; outputs = [ "out" @@ -34,7 +34,7 @@ stdenv.mkDerivation rec { src = fetchurl { url = "https://gstreamer.freedesktop.org/src/${pname}/${pname}-${version}.tar.xz"; - sha256 = "0ijlmvr660m8zn09xlmnq1ajrziqsivp2hig5a9mabhcjx7ypkb6"; + sha256 = "1igv9l4hm21kp1jmlwlagzs7ly1vaxv1sbda29q8247372dwkvls"; }; patches = [ diff --git a/pkgs/development/libraries/gstreamer/devtools/default.nix b/pkgs/development/libraries/gstreamer/devtools/default.nix index a39eadafb0b..517fe9b302d 100644 --- a/pkgs/development/libraries/gstreamer/devtools/default.nix +++ b/pkgs/development/libraries/gstreamer/devtools/default.nix @@ -12,11 +12,11 @@ stdenv.mkDerivation rec { pname = "gst-devtools"; - version = "1.18.2"; + version = "1.18.4"; src = fetchurl { url = "https://gstreamer.freedesktop.org/src/${pname}/${pname}-${version}.tar.xz"; - sha256 = "0mhascwvgirgh7b5dykpnk06f7f5g62gh3sl30i6kygiidqkv9vf"; + sha256 = "1kvcabcfzm7wqih3lzgrg9xjbn4xpx43d1m2zkkvab4i8161kggz"; }; patches = [ diff --git a/pkgs/development/libraries/gstreamer/ges/default.nix b/pkgs/development/libraries/gstreamer/ges/default.nix index 774fefbc358..6ada053ea01 100644 --- a/pkgs/development/libraries/gstreamer/ges/default.nix +++ b/pkgs/development/libraries/gstreamer/ges/default.nix @@ -16,7 +16,7 @@ stdenv.mkDerivation rec { pname = "gst-editing-services"; - version = "1.18.2"; + version = "1.18.4"; outputs = [ "out" @@ -26,7 +26,7 @@ stdenv.mkDerivation rec { src = fetchurl { url = "https://gstreamer.freedesktop.org/src/${pname}/${pname}-${version}.tar.xz"; - sha256 = "0pv2k8zlpn3vv2sdlspi3m63ixcwzi90pjly2ypbkg59ab97rb15"; + sha256 = "010xg960qsh5dwmf0y9l1q13h0cymmrgapzla2zsw66ylxqbi1s6"; }; patches = [ diff --git a/pkgs/development/libraries/gstreamer/good/default.nix b/pkgs/development/libraries/gstreamer/good/default.nix index b08759b8dba..86684893efd 100644 --- a/pkgs/development/libraries/gstreamer/good/default.nix +++ b/pkgs/development/libraries/gstreamer/good/default.nix @@ -48,13 +48,13 @@ assert raspiCameraSupport -> (stdenv.isLinux && stdenv.isAarch64); stdenv.mkDerivation rec { pname = "gst-plugins-good"; - version = "1.18.2"; + version = "1.18.4"; outputs = [ "out" "dev" ]; src = fetchurl { url = "https://gstreamer.freedesktop.org/src/${pname}/${pname}-${version}.tar.xz"; - sha256 = "1929nhjsvbl4bw37nfagnfsnxz737cm2x3ayz9ayrn9lwkfm45zp"; + sha256 = "1c1rpq709cy8maaykyn1n0kckj9c6fl3mhvixkk6xmdwkcx0xrdn"; }; nativeBuildInputs = [ diff --git a/pkgs/development/libraries/gstreamer/libav/default.nix b/pkgs/development/libraries/gstreamer/libav/default.nix index f0755f201d4..009a1555f77 100644 --- a/pkgs/development/libraries/gstreamer/libav/default.nix +++ b/pkgs/development/libraries/gstreamer/libav/default.nix @@ -15,11 +15,11 @@ stdenv.mkDerivation rec { pname = "gst-libav"; - version = "1.18.2"; + version = "1.18.4"; src = fetchurl { url = "https://gstreamer.freedesktop.org/src/${pname}/${pname}-${version}.tar.xz"; - sha256 = "0jbzams9ggk3sq9ywv4gsl9rghyn203l2582m6l5c1sz9ka9m5in"; + sha256 = "15n3x3vhshqa3icw93g4vqmqd46122anzqvfxwn6q8famlxlcjil"; }; outputs = [ "out" "dev" ]; diff --git a/pkgs/development/libraries/gstreamer/rtsp-server/default.nix b/pkgs/development/libraries/gstreamer/rtsp-server/default.nix index 037face3d12..56596960019 100644 --- a/pkgs/development/libraries/gstreamer/rtsp-server/default.nix +++ b/pkgs/development/libraries/gstreamer/rtsp-server/default.nix @@ -12,11 +12,11 @@ stdenv.mkDerivation rec { pname = "gst-rtsp-server"; - version = "1.18.2"; + version = "1.18.4"; src = fetchurl { url = "https://gstreamer.freedesktop.org/src/${pname}/${pname}-${version}.tar.xz"; - sha256 = "1qjlp7az0hkzxvq53hwnp55sp6xhbybfwzaj66hp45jslsmj4fcp"; + sha256 = "153c78klvzlmi86d0gmdf7w9crv11rkd4y82b14a0wdr83gbhsx4"; }; outputs = [ diff --git a/pkgs/development/libraries/gstreamer/ugly/default.nix b/pkgs/development/libraries/gstreamer/ugly/default.nix index 7c70b7ead1a..049e8a99f09 100644 --- a/pkgs/development/libraries/gstreamer/ugly/default.nix +++ b/pkgs/development/libraries/gstreamer/ugly/default.nix @@ -23,13 +23,13 @@ stdenv.mkDerivation rec { pname = "gst-plugins-ugly"; - version = "1.18.2"; + version = "1.18.4"; outputs = [ "out" "dev" ]; src = fetchurl { url = "https://gstreamer.freedesktop.org/src/${pname}/${pname}-${version}.tar.xz"; - sha256 = "1nwbcv5yaib3d8icvyja3zf6lyjf5zf1hndbijrhj8j7xlia0dx3"; + sha256 = "0g6i4db1883q3j0l2gdv46fcqwiiaw63n6mhvsfcms1i1p7g1391"; }; nativeBuildInputs = [ diff --git a/pkgs/development/libraries/gstreamer/vaapi/default.nix b/pkgs/development/libraries/gstreamer/vaapi/default.nix index 2c92cd2236f..19e65c5a75e 100644 --- a/pkgs/development/libraries/gstreamer/vaapi/default.nix +++ b/pkgs/development/libraries/gstreamer/vaapi/default.nix @@ -21,11 +21,11 @@ stdenv.mkDerivation rec { pname = "gstreamer-vaapi"; - version = "1.18.2"; + version = "1.18.4"; src = fetchurl { url = "https://gstreamer.freedesktop.org/src/${pname}/${pname}-${version}.tar.xz"; - sha256 = "1h67n7wk1297rzynknbyv44gdacblvkcvb37x8yxi5d0zms2qywc"; + sha256 = "1sia4l88z7kkxm2z9j20l43rqkrnsa47xccski10s5gkhsprinwj"; }; outputs = [ diff --git a/pkgs/development/python-modules/gst-python/default.nix b/pkgs/development/python-modules/gst-python/default.nix index ea89f7214c6..a391d993cf0 100644 --- a/pkgs/development/python-modules/gst-python/default.nix +++ b/pkgs/development/python-modules/gst-python/default.nix @@ -14,7 +14,7 @@ buildPythonPackage rec { pname = "gst-python"; - version = "1.18.0"; + version = "1.18.4"; format = "other"; @@ -22,7 +22,7 @@ buildPythonPackage rec { src = fetchurl { url = "${meta.homepage}/src/gst-python/${pname}-${version}.tar.xz"; - sha256 = "0ifx2s2j24sj2w5jm7cxyg1kinnhbxiz4x0qp3gnsjlwbawfigvn"; + sha256 = "13h9qzfz8s1gyj2ar9q2gf5346sgdv6jv8hj7aw0hpl2gs5f0s6b"; }; # Python 2.x is not supported. From 922271cc19bed6218015c9416a0a3d6062e86c07 Mon Sep 17 00:00:00 2001 From: "R. RyanTM" Date: Thu, 29 Apr 2021 11:09:37 +0000 Subject: [PATCH 136/263] imagemagick: 7.0.11-8 -> 7.0.11-9 --- pkgs/applications/graphics/ImageMagick/7.0.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/graphics/ImageMagick/7.0.nix b/pkgs/applications/graphics/ImageMagick/7.0.nix index b2c665258cd..40ba49ff796 100644 --- a/pkgs/applications/graphics/ImageMagick/7.0.nix +++ b/pkgs/applications/graphics/ImageMagick/7.0.nix @@ -16,13 +16,13 @@ in stdenv.mkDerivation rec { pname = "imagemagick"; - version = "7.0.11-8"; + version = "7.0.11-9"; src = fetchFromGitHub { owner = "ImageMagick"; repo = "ImageMagick"; rev = version; - sha256 = "sha256-h9hoFXnxuLVQRVtEh83P7efz2KFLLqOXKD6nVJEhqiM="; + sha256 = "sha256-eL9zFrgkLb3pS8/UlQB5+p50UG8j3Q7TNDwcO/3BuXo="; }; outputs = [ "out" "dev" "doc" ]; # bin/ isn't really big From 332402884f8448dbd2aaae966a00e32d1b41040f Mon Sep 17 00:00:00 2001 From: "R. RyanTM" Date: Fri, 30 Apr 2021 02:11:38 +0000 Subject: [PATCH 137/263] k9s: 0.24.6 -> 0.24.8 --- pkgs/applications/networking/cluster/k9s/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/applications/networking/cluster/k9s/default.nix b/pkgs/applications/networking/cluster/k9s/default.nix index ee16f923b78..8d515528a02 100644 --- a/pkgs/applications/networking/cluster/k9s/default.nix +++ b/pkgs/applications/networking/cluster/k9s/default.nix @@ -2,13 +2,13 @@ buildGoModule rec { pname = "k9s"; - version = "0.24.6"; + version = "0.24.8"; src = fetchFromGitHub { owner = "derailed"; repo = "k9s"; rev = "v${version}"; - sha256 = "sha256-uqtjAvtsF+4cz3M60Xj9sCNotaoPzaeeTKnXQUB4CIo="; + sha256 = "sha256-6RGm2uiYvsdpWdhNwDTw4z1O6uNErkWTuyOiwKIvXOY="; }; buildFlagsArray = '' @@ -18,7 +18,7 @@ buildGoModule rec { -X github.com/derailed/k9s/cmd.commit=${src.rev} ''; - vendorSha256 = "sha256-/4Aof09MYHPc4VJJV2EyB7T9zNFtYY4JeDGJi67FQic="; + vendorSha256 = "sha256-lzxGTubm+qQes5QKaamfmSkXs4qquHHjIhts8YmKlYI="; doCheck = false; From 17a8c9c4bfd9042b92b1d07d638a3dc1157b11d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Fri, 30 Apr 2021 03:13:20 +0100 Subject: [PATCH 138/263] Deterministic stdenv (#120775) Co-authored-by: Atemu Co-authored-by: Sandro --- pkgs/top-level/all-packages.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 13a25f86520..328358c6e90 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -10320,6 +10320,9 @@ in gcc9Stdenv = overrideCC gccStdenv buildPackages.gcc9; gcc10Stdenv = overrideCC gccStdenv buildPackages.gcc10; + # This is not intended for use in nixpkgs but for providing a faster-running + # compiler to nixpkgs users by building gcc with reproducibility-breaking + # profile-guided optimizations fastStdenv = overrideCC gccStdenv (wrapNonDeterministicGcc gccStdenv buildPackages.gcc10); wrapCCMulti = cc: From 39805ad19ccb2b89ed2382a0fe98dfb802bb599c Mon Sep 17 00:00:00 2001 From: "R. RyanTM" Date: Fri, 30 Apr 2021 02:27:54 +0000 Subject: [PATCH 139/263] kube3d: 4.4.2 -> 4.4.3 --- pkgs/applications/networking/cluster/kube3d/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/networking/cluster/kube3d/default.nix b/pkgs/applications/networking/cluster/kube3d/default.nix index decb586045d..1265448fc61 100644 --- a/pkgs/applications/networking/cluster/kube3d/default.nix +++ b/pkgs/applications/networking/cluster/kube3d/default.nix @@ -2,13 +2,13 @@ buildGoModule rec { pname = "kube3d"; - version = "4.4.2"; + version = "4.4.3"; src = fetchFromGitHub { owner = "rancher"; repo = "k3d"; rev = "v${version}"; - sha256 = "sha256-6BDetNPWyAVZOsnCWs90HljVpfUlAytFDPQ/SqPxwgg="; + sha256 = "sha256-G8oaJtfsbSi5WaJobxUpNu9DchHfzbkpPvq23GYM99s="; }; vendorSha256 = null; From fe563d71a37c2d05ebfc3d73b67e4758d781a61c Mon Sep 17 00:00:00 2001 From: "R. RyanTM" Date: Fri, 30 Apr 2021 04:07:35 +0000 Subject: [PATCH 140/263] apacheHttpd: 2.4.46 -> 2.4.47 --- pkgs/servers/http/apache-httpd/2.4.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/servers/http/apache-httpd/2.4.nix b/pkgs/servers/http/apache-httpd/2.4.nix index 46e1d7643d5..164293a5b5e 100644 --- a/pkgs/servers/http/apache-httpd/2.4.nix +++ b/pkgs/servers/http/apache-httpd/2.4.nix @@ -16,12 +16,12 @@ assert ldapSupport -> aprutil.ldapSupport && openldap != null; assert http2Support -> nghttp2 != null; stdenv.mkDerivation rec { - version = "2.4.46"; + version = "2.4.47"; pname = "apache-httpd"; src = fetchurl { url = "mirror://apache/httpd/httpd-${version}.tar.bz2"; - sha256 = "1sj1rwgbcjgkzac3ybjy7j68c9b3dv3ap71m48mrjhf6w7vds3kl"; + sha256 = "sha256-I9AG28jleBFqETj6RX7qgkBIRY6JyECHIZ8DcogMA8o="; }; # FIXME: -dev depends on -doc From 7869d1654517c028aa76fc1dedc9b5ac301a867a Mon Sep 17 00:00:00 2001 From: Andrew Childs Date: Thu, 15 Oct 2020 17:23:57 +0900 Subject: [PATCH 141/263] llvmPackages: Multuple outputs for everythting Also begin to start work on cross compilation, though that will have to be finished later. The patches are based on the first version of https://reviews.llvm.org/D99484. It's very annoying to do the back-porting but the review has uncovered nothing super major so I'm fine sticking with what I've got. Beyond making the outputs work, I also strove to re-sync the packages, as they have been drifting pointlessly apart for some time. ---- Other misc notes, highly incomplete - lvm-config-native and llvm-config are put in `dev` because they are tools just for build time. - Clang no longer has an lld dep. That was introduced in db29857eb391ed002046090851a44c452b80bdbd, but if clang needs help finding lld when it is used we should just pass it flags / put in the resource dir. Providing it at build time increases critical path length for no good reason. ---- A note on `nativeCC`: `stdenv` takes tools from the previous stage, so: 1. `pkgsBuildBuild`: `(?1, x, x)` 2. `pkgsBuildBuild.stdenv.cc`: `(?0, ?1, x)` while: 1. `pkgsBuildBuild`: `(?1, x, x)` 2. `pkgsBuildBuild.targetPackages`: `(x, x, ?2)` 3. `pkgsBuildBuild.targetPackages.stdenv.cc`: `(?1, x, x)` --- pkgs/applications/blockchains/electrs.nix | 2 +- .../blockchains/openethereum/default.nix | 2 +- .../blockchains/polkadot/default.nix | 2 +- pkgs/applications/editors/jucipp/default.nix | 4 +- .../editors/kdevelop5/kdevelop.nix | 4 +- .../editors/rstudio/clang-location.patch | 2 +- pkgs/applications/editors/rstudio/default.nix | 4 +- pkgs/applications/misc/clipcat/default.nix | 2 +- pkgs/applications/misc/imag/default.nix | 2 +- .../networking/browsers/firefox/common.nix | 6 +- .../networking/mailreaders/thunderbird/68.nix | 2 +- .../mailreaders/thunderbird/default.nix | 2 +- pkgs/applications/science/math/R/default.nix | 4 +- pkgs/build-support/cc-wrapper/default.nix | 4 +- .../rust/default-crate-overrides.nix | 2 +- .../intel-graphics-compiler/default.nix | 4 +- .../compilers/llvm/10/clang/default.nix | 23 +- .../llvm/10/clang/gnu-install-dirs.patch | 248 +++++++++++ .../compilers/llvm/10/compiler-rt/default.nix | 8 +- .../10/compiler-rt/gnu-install-dirs.patch | 129 ++++++ .../development/compilers/llvm/10/default.nix | 23 +- .../compilers/llvm/10/libc++/default.nix | 6 +- .../llvm/10/libc++/gnu-install-dirs.patch | 99 +++++ .../compilers/llvm/10/libc++abi/default.nix | 33 +- .../llvm/10/libc++abi/gnu-install-dirs.patch | 34 ++ .../compilers/llvm/10/libunwind/default.nix | 6 + .../llvm/10/libunwind/gnu-install-dirs.patch | 34 ++ .../compilers/llvm/10/lld/default.nix | 20 +- .../llvm/10/lld/gnu-install-dirs.patch | 68 +++ .../compilers/llvm/10/lldb/default.nix | 47 +- .../llvm/10/lldb/gnu-install-dirs.patch | 65 +++ .../compilers/llvm/10/llvm/default.nix | 49 +- .../llvm/10/llvm/gnu-install-dirs-polly.patch | 106 +++++ .../llvm/10/llvm/gnu-install-dirs.patch | 416 +++++++++++++++++ .../compilers/llvm/11/clang/default.nix | 23 +- .../llvm/11/clang/gnu-install-dirs.patch | 235 ++++++++++ .../compilers/llvm/11/compiler-rt/default.nix | 19 +- .../11/compiler-rt/gnu-install-dirs.patch | 129 ++++++ .../llvm/11/compiler-rt/normalize-var.patch | 16 + .../development/compilers/llvm/11/default.nix | 23 +- .../compilers/llvm/11/libc++/default.nix | 3 + .../llvm/11/libc++/gnu-install-dirs.patch | 100 +++++ .../compilers/llvm/11/libc++abi/default.nix | 33 +- .../llvm/11/libc++abi/gnu-install-dirs.patch | 34 ++ .../compilers/llvm/11/libunwind/default.nix | 6 + .../llvm/11/libunwind/gnu-install-dirs.patch | 34 ++ .../compilers/llvm/11/lld/default.nix | 20 +- .../llvm/11/lld/gnu-install-dirs.patch | 68 +++ .../compilers/llvm/11/lldb/default.nix | 47 +- .../llvm/11/lldb/gnu-install-dirs.patch | 65 +++ .../compilers/llvm/11/llvm/default.nix | 51 ++- .../llvm/11/llvm/gnu-install-dirs-polly.patch | 106 +++++ .../llvm/11/llvm/gnu-install-dirs.patch | 417 ++++++++++++++++++ .../compilers/llvm/12/clang/default.nix | 23 +- .../llvm/12/clang/gnu-install-dirs.patch | 235 ++++++++++ ...sion.patch => X86-support-extension.patch} | 0 ...{compiler-rt-armv7l.patch => armv7l.patch} | 0 ...piler-rt-codesign.patch => codesign.patch} | 0 .../compilers/llvm/12/compiler-rt/default.nix | 24 +- .../12/compiler-rt/gnu-install-dirs.patch | 129 ++++++ .../llvm/12/compiler-rt/normalize-var.patch | 16 + .../development/compilers/llvm/12/default.nix | 22 +- .../compilers/llvm/12/libcxxabi/default.nix | 2 +- .../{libcxxabi-wasm.patch => wasm.patch} | 0 .../compilers/llvm/12/libunwind/default.nix | 6 + .../llvm/12/libunwind/gnu-install-dirs.patch | 34 ++ .../compilers/llvm/12/lld/default.nix | 24 +- .../llvm/12/lld/gnu-install-dirs.patch | 68 +++ .../compilers/llvm/12/lldb/default.nix | 35 +- .../llvm/12/lldb/gnu-install-dirs.patch | 65 +++ .../lldb/{lldb-procfs.patch => procfs.patch} | 0 .../compilers/llvm/12/lldb/resource-dir.patch | 13 + .../compilers/llvm/12/llvm/default.nix | 54 ++- .../llvm/12/llvm/gnu-install-dirs-polly.patch | 105 +++++ .../llvm/12/llvm/gnu-install-dirs.patch | 417 ++++++++++++++++++ .../{llvm-outputs.patch => outputs.patch} | 0 .../compilers/llvm/5/clang/default.nix | 25 +- .../llvm/5/clang/gnu-install-dirs.patch | 242 ++++++++++ .../compilers/llvm/5/compiler-rt/default.nix | 8 +- .../llvm/5/compiler-rt/gnu-install-dirs.patch | 103 +++++ pkgs/development/compilers/llvm/5/default.nix | 26 +- .../compilers/llvm/5/libc++/default.nix | 6 +- .../llvm/5/libc++/gnu-install-dirs.patch | 72 +++ .../compilers/llvm/5/libc++abi/default.nix | 10 +- .../llvm/5/libc++abi/gnu-install-dirs.patch | 28 ++ .../compilers/llvm/5/lld/default.nix | 20 +- .../llvm/5/lld/gnu-install-dirs.patch | 68 +++ .../compilers/llvm/5/lldb/default.nix | 35 +- .../llvm/5/lldb/gnu-install-dirs.patch | 76 ++++ .../compilers/llvm/5/llvm/default.nix | 60 ++- .../llvm/5/llvm/gnu-install-dirs-polly.patch | 106 +++++ .../llvm/5/llvm/gnu-install-dirs.patch | 386 ++++++++++++++++ .../compilers/llvm/6/clang/default.nix | 25 +- .../llvm/6/clang/gnu-install-dirs.patch | 258 +++++++++++ .../compilers/llvm/6/compiler-rt/default.nix | 8 +- .../llvm/6/compiler-rt/gnu-install-dirs.patch | 107 +++++ pkgs/development/compilers/llvm/6/default.nix | 26 +- .../compilers/llvm/6/libc++/default.nix | 6 +- .../llvm/6/libc++/gnu-install-dirs.patch | 72 +++ .../compilers/llvm/6/libc++abi/default.nix | 10 +- .../llvm/6/libc++abi/gnu-install-dirs.patch | 28 ++ .../compilers/llvm/6/lld/default.nix | 20 +- .../llvm/6/lld/gnu-install-dirs.patch | 68 +++ .../compilers/llvm/6/lldb/default.nix | 35 +- .../llvm/6/lldb/gnu-install-dirs.patch | 76 ++++ .../compilers/llvm/6/llvm/default.nix | 51 ++- .../llvm/6/llvm/gnu-install-dirs-polly.patch | 106 +++++ .../llvm/6/llvm/gnu-install-dirs.patch | 386 ++++++++++++++++ .../compilers/llvm/7/clang/default.nix | 21 +- .../llvm/7/clang/gnu-install-dirs.patch | 281 ++++++++++++ .../compilers/llvm/7/compiler-rt/default.nix | 8 +- .../llvm/7/compiler-rt/gnu-install-dirs.patch | 117 +++++ pkgs/development/compilers/llvm/7/default.nix | 30 +- .../compilers/llvm/7/libc++/default.nix | 6 +- .../llvm/7/libc++/gnu-install-dirs.patch | 72 +++ .../compilers/llvm/7/libc++abi/default.nix | 22 +- .../llvm/7/libc++abi/gnu-install-dirs.patch | 28 ++ .../compilers/llvm/7/libunwind/default.nix | 6 +- .../llvm/7/libunwind/gnu-install-dirs.patch | 28 ++ .../compilers/llvm/7/lld/default.nix | 20 +- .../llvm/7/lld/gnu-install-dirs.patch | 68 +++ .../compilers/llvm/7/lldb/default.nix | 45 +- .../llvm/7/lldb/gnu-install-dirs.patch | 76 ++++ .../compilers/llvm/7/llvm/default.nix | 46 +- .../llvm/7/llvm/gnu-install-dirs-polly.patch | 106 +++++ .../llvm/7/llvm/gnu-install-dirs.patch | 386 ++++++++++++++++ .../compilers/llvm/8/clang/default.nix | 23 +- .../llvm/8/clang/gnu-install-dirs.patch | 290 ++++++++++++ .../8/clang/{clang-xpc.patch => xpc.patch} | 0 .../compilers/llvm/8/compiler-rt/default.nix | 8 +- .../llvm/8/compiler-rt/gnu-install-dirs.patch | 117 +++++ pkgs/development/compilers/llvm/8/default.nix | 30 +- .../compilers/llvm/8/libc++/default.nix | 6 +- .../llvm/8/libc++/gnu-install-dirs.patch | 72 +++ .../compilers/llvm/8/libc++abi/default.nix | 33 +- .../llvm/8/libc++abi/gnu-install-dirs.patch | 28 ++ .../compilers/llvm/8/libunwind/default.nix | 11 +- .../llvm/8/libunwind/gnu-install-dirs.patch | 28 ++ .../compilers/llvm/8/lld/default.nix | 20 +- .../llvm/8/lld/gnu-install-dirs.patch | 68 +++ .../compilers/llvm/8/lldb/default.nix | 42 +- .../llvm/8/lldb/gnu-install-dirs.patch | 81 ++++ .../compilers/llvm/8/llvm/default.nix | 46 +- .../llvm/8/llvm/gnu-install-dirs-polly.patch | 106 +++++ .../llvm/8/llvm/gnu-install-dirs.patch | 394 +++++++++++++++++ .../compilers/llvm/9/clang/default.nix | 21 +- .../llvm/9/clang/gnu-install-dirs.patch | 278 ++++++++++++ .../compilers/llvm/9/compiler-rt/default.nix | 8 +- .../llvm/9/compiler-rt/gnu-install-dirs.patch | 117 +++++ pkgs/development/compilers/llvm/9/default.nix | 30 +- .../compilers/llvm/9/libc++/default.nix | 6 +- .../llvm/9/libc++/gnu-install-dirs.patch | 99 +++++ .../compilers/llvm/9/libc++abi/default.nix | 33 +- .../llvm/9/libc++abi/gnu-install-dirs.patch | 34 ++ .../compilers/llvm/9/libunwind/default.nix | 6 + .../llvm/9/libunwind/gnu-install-dirs.patch | 34 ++ .../compilers/llvm/9/lld/default.nix | 20 +- .../llvm/9/lld/gnu-install-dirs.patch | 68 +++ .../compilers/llvm/9/lldb/default.nix | 43 +- .../llvm/9/lldb/gnu-install-dirs.patch | 65 +++ .../compilers/llvm/9/llvm/default.nix | 47 +- .../llvm/9/llvm/gnu-install-dirs-polly.patch | 106 +++++ .../llvm/9/llvm/gnu-install-dirs.patch | 395 +++++++++++++++++ .../compilers/llvm/rocm/default.nix | 5 +- .../compilers/llvm/rocm/lld/default.nix | 12 +- .../compilers/llvm/rocm/llvm/default.nix | 2 +- pkgs/development/compilers/rust/1_45.nix | 6 +- pkgs/development/compilers/rust/1_51.nix | 6 +- .../interpreters/cling/default.nix | 4 +- .../development/interpreters/pure/default.nix | 8 +- .../interpreters/spidermonkey/68.nix | 2 +- .../interpreters/wasmer/default.nix | 2 +- .../interpreters/wasmtime/default.nix | 2 +- .../development/libraries/beignet/default.nix | 10 +- .../libraries/opencl-clang/default.nix | 10 +- .../libraries/qt-4.x/4.8/default.nix | 2 +- .../ocaml-modules/eigen/default.nix | 2 +- .../ocaml-modules/llvm/default.nix | 14 +- .../python-modules/datatable/default.nix | 2 +- .../python-modules/kiwisolver/1_1.nix | 2 +- .../python-modules/kiwisolver/default.nix | 2 +- .../python-modules/numba/default.nix | 2 +- pkgs/development/python-modules/pandas/2.nix | 2 +- .../python-modules/pandas/default.nix | 2 +- .../python-modules/py3exiv2/default.nix | 2 +- .../development/r-modules/generic-builder.nix | 2 +- .../build-managers/bazel/bazel_3/default.nix | 2 +- .../build-managers/bazel/bazel_4/default.nix | 2 +- pkgs/development/tools/castxml/default.nix | 4 +- .../tools/parinfer-rust/default.nix | 2 +- pkgs/development/tools/qtcreator/default.nix | 2 +- pkgs/development/tools/rq/default.nix | 4 +- .../tools/rust/bindgen/default.nix | 2 +- pkgs/misc/vim-plugins/overrides.nix | 2 +- pkgs/os-specific/darwin/maloader/default.nix | 2 +- pkgs/servers/nosql/influxdb2/default.nix | 2 +- pkgs/stdenv/darwin/default.nix | 14 +- pkgs/stdenv/darwin/make-bootstrap-tools.nix | 4 +- pkgs/tools/backup/rdedup/default.nix | 2 +- pkgs/tools/filesystems/irods/common.nix | 2 +- pkgs/tools/filesystems/supertag/default.nix | 2 +- pkgs/tools/inputmethods/kime/default.nix | 2 +- pkgs/tools/misc/gringo/default.nix | 4 +- pkgs/tools/misc/silicon/default.nix | 2 +- pkgs/tools/misc/tremor-rs/default.nix | 2 +- pkgs/tools/networking/innernet/default.nix | 2 +- pkgs/tools/security/fido2luks/default.nix | 2 +- pkgs/tools/security/sequoia/default.nix | 2 +- pkgs/top-level/all-packages.nix | 10 +- pkgs/top-level/ocaml-packages.nix | 2 +- 210 files changed, 10414 insertions(+), 660 deletions(-) create mode 100644 pkgs/development/compilers/llvm/10/clang/gnu-install-dirs.patch create mode 100644 pkgs/development/compilers/llvm/10/compiler-rt/gnu-install-dirs.patch create mode 100644 pkgs/development/compilers/llvm/10/libc++/gnu-install-dirs.patch create mode 100644 pkgs/development/compilers/llvm/10/libc++abi/gnu-install-dirs.patch create mode 100644 pkgs/development/compilers/llvm/10/libunwind/gnu-install-dirs.patch create mode 100644 pkgs/development/compilers/llvm/10/lld/gnu-install-dirs.patch create mode 100644 pkgs/development/compilers/llvm/10/lldb/gnu-install-dirs.patch create mode 100644 pkgs/development/compilers/llvm/10/llvm/gnu-install-dirs-polly.patch create mode 100644 pkgs/development/compilers/llvm/10/llvm/gnu-install-dirs.patch create mode 100644 pkgs/development/compilers/llvm/11/clang/gnu-install-dirs.patch create mode 100644 pkgs/development/compilers/llvm/11/compiler-rt/gnu-install-dirs.patch create mode 100644 pkgs/development/compilers/llvm/11/compiler-rt/normalize-var.patch create mode 100644 pkgs/development/compilers/llvm/11/libc++/gnu-install-dirs.patch create mode 100644 pkgs/development/compilers/llvm/11/libc++abi/gnu-install-dirs.patch create mode 100644 pkgs/development/compilers/llvm/11/libunwind/gnu-install-dirs.patch create mode 100644 pkgs/development/compilers/llvm/11/lld/gnu-install-dirs.patch create mode 100644 pkgs/development/compilers/llvm/11/lldb/gnu-install-dirs.patch create mode 100644 pkgs/development/compilers/llvm/11/llvm/gnu-install-dirs-polly.patch create mode 100644 pkgs/development/compilers/llvm/11/llvm/gnu-install-dirs.patch create mode 100644 pkgs/development/compilers/llvm/12/clang/gnu-install-dirs.patch rename pkgs/development/compilers/llvm/12/compiler-rt/{compiler-rt-X86-support-extension.patch => X86-support-extension.patch} (100%) rename pkgs/development/compilers/llvm/12/compiler-rt/{compiler-rt-armv7l.patch => armv7l.patch} (100%) rename pkgs/development/compilers/llvm/12/compiler-rt/{compiler-rt-codesign.patch => codesign.patch} (100%) create mode 100644 pkgs/development/compilers/llvm/12/compiler-rt/gnu-install-dirs.patch create mode 100644 pkgs/development/compilers/llvm/12/compiler-rt/normalize-var.patch rename pkgs/development/compilers/llvm/12/libcxxabi/{libcxxabi-wasm.patch => wasm.patch} (100%) create mode 100644 pkgs/development/compilers/llvm/12/libunwind/gnu-install-dirs.patch create mode 100644 pkgs/development/compilers/llvm/12/lld/gnu-install-dirs.patch create mode 100644 pkgs/development/compilers/llvm/12/lldb/gnu-install-dirs.patch rename pkgs/development/compilers/llvm/12/lldb/{lldb-procfs.patch => procfs.patch} (100%) create mode 100644 pkgs/development/compilers/llvm/12/lldb/resource-dir.patch create mode 100644 pkgs/development/compilers/llvm/12/llvm/gnu-install-dirs-polly.patch create mode 100644 pkgs/development/compilers/llvm/12/llvm/gnu-install-dirs.patch rename pkgs/development/compilers/llvm/12/llvm/{llvm-outputs.patch => outputs.patch} (100%) create mode 100644 pkgs/development/compilers/llvm/5/clang/gnu-install-dirs.patch create mode 100644 pkgs/development/compilers/llvm/5/compiler-rt/gnu-install-dirs.patch create mode 100644 pkgs/development/compilers/llvm/5/libc++/gnu-install-dirs.patch create mode 100644 pkgs/development/compilers/llvm/5/libc++abi/gnu-install-dirs.patch create mode 100644 pkgs/development/compilers/llvm/5/lld/gnu-install-dirs.patch create mode 100644 pkgs/development/compilers/llvm/5/lldb/gnu-install-dirs.patch create mode 100644 pkgs/development/compilers/llvm/5/llvm/gnu-install-dirs-polly.patch create mode 100644 pkgs/development/compilers/llvm/5/llvm/gnu-install-dirs.patch create mode 100644 pkgs/development/compilers/llvm/6/clang/gnu-install-dirs.patch create mode 100644 pkgs/development/compilers/llvm/6/compiler-rt/gnu-install-dirs.patch create mode 100644 pkgs/development/compilers/llvm/6/libc++/gnu-install-dirs.patch create mode 100644 pkgs/development/compilers/llvm/6/libc++abi/gnu-install-dirs.patch create mode 100644 pkgs/development/compilers/llvm/6/lld/gnu-install-dirs.patch create mode 100644 pkgs/development/compilers/llvm/6/lldb/gnu-install-dirs.patch create mode 100644 pkgs/development/compilers/llvm/6/llvm/gnu-install-dirs-polly.patch create mode 100644 pkgs/development/compilers/llvm/6/llvm/gnu-install-dirs.patch create mode 100644 pkgs/development/compilers/llvm/7/clang/gnu-install-dirs.patch create mode 100644 pkgs/development/compilers/llvm/7/compiler-rt/gnu-install-dirs.patch create mode 100644 pkgs/development/compilers/llvm/7/libc++/gnu-install-dirs.patch create mode 100644 pkgs/development/compilers/llvm/7/libc++abi/gnu-install-dirs.patch create mode 100644 pkgs/development/compilers/llvm/7/libunwind/gnu-install-dirs.patch create mode 100644 pkgs/development/compilers/llvm/7/lld/gnu-install-dirs.patch create mode 100644 pkgs/development/compilers/llvm/7/lldb/gnu-install-dirs.patch create mode 100644 pkgs/development/compilers/llvm/7/llvm/gnu-install-dirs-polly.patch create mode 100644 pkgs/development/compilers/llvm/7/llvm/gnu-install-dirs.patch create mode 100644 pkgs/development/compilers/llvm/8/clang/gnu-install-dirs.patch rename pkgs/development/compilers/llvm/8/clang/{clang-xpc.patch => xpc.patch} (100%) create mode 100644 pkgs/development/compilers/llvm/8/compiler-rt/gnu-install-dirs.patch create mode 100644 pkgs/development/compilers/llvm/8/libc++/gnu-install-dirs.patch create mode 100644 pkgs/development/compilers/llvm/8/libc++abi/gnu-install-dirs.patch create mode 100644 pkgs/development/compilers/llvm/8/libunwind/gnu-install-dirs.patch create mode 100644 pkgs/development/compilers/llvm/8/lld/gnu-install-dirs.patch create mode 100644 pkgs/development/compilers/llvm/8/lldb/gnu-install-dirs.patch create mode 100644 pkgs/development/compilers/llvm/8/llvm/gnu-install-dirs-polly.patch create mode 100644 pkgs/development/compilers/llvm/8/llvm/gnu-install-dirs.patch create mode 100644 pkgs/development/compilers/llvm/9/clang/gnu-install-dirs.patch create mode 100644 pkgs/development/compilers/llvm/9/compiler-rt/gnu-install-dirs.patch create mode 100644 pkgs/development/compilers/llvm/9/libc++/gnu-install-dirs.patch create mode 100644 pkgs/development/compilers/llvm/9/libc++abi/gnu-install-dirs.patch create mode 100644 pkgs/development/compilers/llvm/9/libunwind/gnu-install-dirs.patch create mode 100644 pkgs/development/compilers/llvm/9/lld/gnu-install-dirs.patch create mode 100644 pkgs/development/compilers/llvm/9/lldb/gnu-install-dirs.patch create mode 100644 pkgs/development/compilers/llvm/9/llvm/gnu-install-dirs-polly.patch create mode 100644 pkgs/development/compilers/llvm/9/llvm/gnu-install-dirs.patch diff --git a/pkgs/applications/blockchains/electrs.nix b/pkgs/applications/blockchains/electrs.nix index 30742f8d719..af0346196a3 100644 --- a/pkgs/applications/blockchains/electrs.nix +++ b/pkgs/applications/blockchains/electrs.nix @@ -17,7 +17,7 @@ rustPlatform.buildRustPackage rec { # needed for librocksdb-sys nativeBuildInputs = [ llvmPackages.clang ]; - LIBCLANG_PATH = "${llvmPackages.libclang}/lib"; + LIBCLANG_PATH = "${llvmPackages.libclang.lib}/lib"; cargoSha256 = "1rqpadlr9r4z2z825li6vi5a21hivc3bsn5ibxshrdrwiycyyxz8"; diff --git a/pkgs/applications/blockchains/openethereum/default.nix b/pkgs/applications/blockchains/openethereum/default.nix index 82b6f2c1adb..179c817abb8 100644 --- a/pkgs/applications/blockchains/openethereum/default.nix +++ b/pkgs/applications/blockchains/openethereum/default.nix @@ -23,7 +23,7 @@ rustPlatform.buildRustPackage rec { cargoSha256 = "1gm02pcfll362add8a0dcb0sk0mag8z0q23b87yb6fs870bqvhib"; - LIBCLANG_PATH = "${llvmPackages.libclang}/lib"; + LIBCLANG_PATH = "${llvmPackages.libclang.lib}/lib"; nativeBuildInputs = [ cmake llvmPackages.clang diff --git a/pkgs/applications/blockchains/polkadot/default.nix b/pkgs/applications/blockchains/polkadot/default.nix index abe7ab56431..c531cc3a88e 100644 --- a/pkgs/applications/blockchains/polkadot/default.nix +++ b/pkgs/applications/blockchains/polkadot/default.nix @@ -20,7 +20,7 @@ rustPlatform.buildRustPackage rec { nativeBuildInputs = [ clang ]; - LIBCLANG_PATH = "${llvmPackages.libclang}/lib"; + LIBCLANG_PATH = "${llvmPackages.libclang.lib}/lib"; PROTOC = "${protobuf}/bin/protoc"; # NOTE: We don't build the WASM runtimes since this would require a more diff --git a/pkgs/applications/editors/jucipp/default.nix b/pkgs/applications/editors/jucipp/default.nix index 7304219e236..140bf04c9f3 100644 --- a/pkgs/applications/editors/jucipp/default.nix +++ b/pkgs/applications/editors/jucipp/default.nix @@ -56,8 +56,8 @@ stdenv.mkDerivation rec { e = "\");"; v = lib.getVersion llvmPackages.clang; in - p+llvmPackages.libcxx+"/include/c++/v1"+e - +p+llvmPackages.clang-unwrapped+"/lib/clang/"+v+"/include/"+e + p+llvmPackages.libcxx.dev+"/include/c++/v1"+e + +p+llvmPackages.clang-unwrapped.lib+"/lib/clang/"+v+"/include/"+e +p+glibc.dev+"/include"+e; preConfigure = '' diff --git a/pkgs/applications/editors/kdevelop5/kdevelop.nix b/pkgs/applications/editors/kdevelop5/kdevelop.nix index b54015de7b8..8894707643a 100644 --- a/pkgs/applications/editors/kdevelop5/kdevelop.nix +++ b/pkgs/applications/editors/kdevelop5/kdevelop.nix @@ -23,7 +23,7 @@ mkDerivation rec { buildInputs = [ kdevelop-pg-qt - llvmPackages.llvm llvmPackages.clang-unwrapped + llvmPackages.llvm llvmPackages.libclang ]; propagatedBuildInputs = [ @@ -37,7 +37,7 @@ mkDerivation rec { # https://cgit.kde.org/kdevelop.git/commit/?id=716372ae2e8dff9c51e94d33443536786e4bd85b # required as nixos seems to be unable to find CLANG_BUILTIN_DIR cmakeFlags = [ - "-DCLANG_BUILTIN_DIR=${llvmPackages.clang-unwrapped}/lib/clang/${lib.getVersion llvmPackages.clang}/include" + "-DCLANG_BUILTIN_DIR=${llvmPackages.libclang.lib}/lib/clang/${lib.getVersion llvmPackages.clang}/include" ]; dontWrapQtApps = true; diff --git a/pkgs/applications/editors/rstudio/clang-location.patch b/pkgs/applications/editors/rstudio/clang-location.patch index 402abdd8563..700ed754d2b 100644 --- a/pkgs/applications/editors/rstudio/clang-location.patch +++ b/pkgs/applications/editors/rstudio/clang-location.patch @@ -7,7 +7,7 @@ index ec12a3a1ff..8c81b633ae 100644 // we need to add in the associated libclang headers as // they are not discovered / used by default during compilation - FilePath llvmPath = s_libraryPath.parent().parent(); -+ FilePath llvmPath("@clang@"); ++ FilePath llvmPath("@libclang@"); boost::format fmt("%1%/lib/clang/%2%/include"); fmt % llvmPath.absolutePath() % version.asString(); std::string includePath = fmt.str(); diff --git a/pkgs/applications/editors/rstudio/default.nix b/pkgs/applications/editors/rstudio/default.nix index 00d0259a7a9..76d9c2e594b 100644 --- a/pkgs/applications/editors/rstudio/default.nix +++ b/pkgs/applications/editors/rstudio/default.nix @@ -42,8 +42,8 @@ mkDerivation rec { postPatch = '' substituteInPlace src/cpp/core/r_util/REnvironmentPosix.cpp --replace '@R@' ${R} substituteInPlace src/cpp/core/libclang/LibClang.cpp \ - --replace '@clang@' ${llvmPackages.clang.cc} \ - --replace '@libclang.so@' ${llvmPackages.clang.cc.lib}/lib/libclang.so + --replace '@libclang@' ${llvmPackages.libclang.lib} \ + --replace '@libclang.so@' ${llvmPackages.libclang.lib}/lib/libclang.so ''; ginSrc = fetchurl { diff --git a/pkgs/applications/misc/clipcat/default.nix b/pkgs/applications/misc/clipcat/default.nix index 497e5616e80..95f50998f3f 100644 --- a/pkgs/applications/misc/clipcat/default.nix +++ b/pkgs/applications/misc/clipcat/default.nix @@ -14,7 +14,7 @@ rustPlatform.buildRustPackage rec { cargoSha256 = "1ffgvhkdj8wkhlgi0cj0njdm9ycxq2qda4b5qn8bmaygzr2zkwpd"; - LIBCLANG_PATH = "${llvmPackages.libclang}/lib"; + LIBCLANG_PATH = "${llvmPackages.libclang.lib}/lib"; # needed for internal protobuf c wrapper library PROTOC = "${protobuf}/bin/protoc"; diff --git a/pkgs/applications/misc/imag/default.nix b/pkgs/applications/misc/imag/default.nix index 09f734df9a1..5c1e87612e1 100644 --- a/pkgs/applications/misc/imag/default.nix +++ b/pkgs/applications/misc/imag/default.nix @@ -26,7 +26,7 @@ rustPlatform.buildRustPackage rec { ++ lib.optional stdenv.isDarwin Security; checkInputs = [ gitMinimal util-linuxMinimal ]; - LIBCLANG_PATH = "${llvmPackages.libclang}/lib"; + LIBCLANG_PATH = "${llvmPackages.libclang.lib}/lib"; cargoSha256 = "0n8cw70qh8g4hfwfaxwwxbrrx5hm2z037z8kdhvdpqkxljl9189x"; diff --git a/pkgs/applications/networking/browsers/firefox/common.nix b/pkgs/applications/networking/browsers/firefox/common.nix index 24195e578bd..48723249323 100644 --- a/pkgs/applications/networking/browsers/firefox/common.nix +++ b/pkgs/applications/networking/browsers/firefox/common.nix @@ -248,8 +248,8 @@ buildStdenv.mkDerivation ({ $(< ${buildStdenv.cc}/nix-support/libc-cflags) \ $(< ${buildStdenv.cc}/nix-support/cc-cflags) \ $(< ${buildStdenv.cc}/nix-support/libcxx-cxxflags) \ - ${lib.optionalString buildStdenv.cc.isClang "-idirafter ${buildStdenv.cc.cc}/lib/clang/${lib.getVersion buildStdenv.cc.cc}/include"} \ - ${lib.optionalString buildStdenv.cc.isGNU "-isystem ${buildStdenv.cc.cc}/include/c++/${lib.getVersion buildStdenv.cc.cc} -isystem ${buildStdenv.cc.cc}/include/c++/${lib.getVersion buildStdenv.cc.cc}/${buildStdenv.hostPlatform.config}"} \ + ${lib.optionalString buildStdenv.cc.isClang "-idirafter ${buildStdenv.cc.cc.lib}/lib/clang/${lib.getVersion buildStdenv.cc.cc}/include"} \ + ${lib.optionalString buildStdenv.cc.isGNU "-isystem ${lib.getDev buildStdenv.cc.cc}/include/c++/${lib.getVersion buildStdenv.cc.cc} -isystem ${buildStdenv.cc.cc}/include/c++/${lib.getVersion buildStdenv.cc.cc}/${buildStdenv.hostPlatform.config}"} \ $NIX_CFLAGS_COMPILE" echo "ac_add_options BINDGEN_CFLAGS='$BINDGEN_CFLAGS'" >> $MOZCONFIG @@ -282,7 +282,7 @@ buildStdenv.mkDerivation ({ "--disable-updater" "--enable-jemalloc" "--enable-default-toolkit=${default-toolkit}" - "--with-libclang-path=${llvmPackages.libclang}/lib" + "--with-libclang-path=${llvmPackages.libclang.lib}/lib" "--with-system-nspr" "--with-system-nss" ] diff --git a/pkgs/applications/networking/mailreaders/thunderbird/68.nix b/pkgs/applications/networking/mailreaders/thunderbird/68.nix index 4433551d2e1..f7713c41633 100644 --- a/pkgs/applications/networking/mailreaders/thunderbird/68.nix +++ b/pkgs/applications/networking/mailreaders/thunderbird/68.nix @@ -244,7 +244,7 @@ stdenv.mkDerivation rec { "--enable-strip" ]) ++ lib.optionals (!stdenv.hostPlatform.isi686) [ # on i686-linux: --with-libclang-path is not available in this configuration - "--with-libclang-path=${llvmPackages.libclang}/lib" + "--with-libclang-path=${llvmPackages.libclang.lib}/lib" "--with-clang-path=${llvmPackages.clang}/bin/clang" ] ++ lib.optional alsaSupport "--enable-alsa" ++ lib.optional calendarSupport "--enable-calendar" diff --git a/pkgs/applications/networking/mailreaders/thunderbird/default.nix b/pkgs/applications/networking/mailreaders/thunderbird/default.nix index 8e176638da6..72a4d92cabf 100644 --- a/pkgs/applications/networking/mailreaders/thunderbird/default.nix +++ b/pkgs/applications/networking/mailreaders/thunderbird/default.nix @@ -242,7 +242,7 @@ stdenv.mkDerivation rec { "--enable-strip" ]) ++ lib.optionals (!stdenv.hostPlatform.isi686) [ # on i686-linux: --with-libclang-path is not available in this configuration - "--with-libclang-path=${llvmPackages.libclang}/lib" + "--with-libclang-path=${llvmPackages.libclang.lib}/lib" "--with-clang-path=${llvmPackages.clang}/bin/clang" ] ++ lib.optional alsaSupport "--enable-alsa" ++ lib.optional calendarSupport "--enable-calendar" diff --git a/pkgs/applications/science/math/R/default.nix b/pkgs/applications/science/math/R/default.nix index 331faa6b147..62f3921afef 100644 --- a/pkgs/applications/science/math/R/default.nix +++ b/pkgs/applications/science/math/R/default.nix @@ -68,8 +68,8 @@ stdenv.mkDerivation rec { '' + lib.optionalString stdenv.isDarwin '' --disable-R-framework OBJC="clang" - CPPFLAGS="-isystem ${libcxx}/include/c++/v1" - LDFLAGS="-L${libcxx}/lib" + CPPFLAGS="-isystem ${lib.getDev libcxx}/include/c++/v1" + LDFLAGS="-L${lib.getLib libcxx}/lib" '' + '' ) echo >>etc/Renviron.in "TCLLIBPATH=${tk}/lib" diff --git a/pkgs/build-support/cc-wrapper/default.nix b/pkgs/build-support/cc-wrapper/default.nix index 14317cbe4cc..36a98a180b3 100644 --- a/pkgs/build-support/cc-wrapper/default.nix +++ b/pkgs/build-support/cc-wrapper/default.nix @@ -370,7 +370,7 @@ stdenv.mkDerivation { done '' + optionalString (libcxx.isLLVM or false) ('' - echo "-isystem ${libcxx}/include/c++/v1" >> $out/nix-support/libcxx-cxxflags + echo "-isystem ${lib.getDev libcxx}/include/c++/v1" >> $out/nix-support/libcxx-cxxflags echo "-stdlib=libc++" >> $out/nix-support/libcxx-ldflags '' + lib.optionalString stdenv.targetPlatform.isLinux '' echo "-lc++abi" >> $out/nix-support/libcxx-ldflags @@ -404,7 +404,7 @@ stdenv.mkDerivation { echo "$ccLDFlags" >> $out/nix-support/cc-ldflags echo "$ccCFlags" >> $out/nix-support/cc-cflags '' + optionalString (targetPlatform.isDarwin && (libcxx != null) && (cc.isClang or false)) '' - echo " -L${libcxx}/lib" >> $out/nix-support/cc-ldflags + echo " -L${lib.getLib libcxx}/lib" >> $out/nix-support/cc-ldflags '' ## diff --git a/pkgs/build-support/rust/default-crate-overrides.nix b/pkgs/build-support/rust/default-crate-overrides.nix index 3d2dc3733c2..61cec2a6aba 100644 --- a/pkgs/build-support/rust/default-crate-overrides.nix +++ b/pkgs/build-support/rust/default-crate-overrides.nix @@ -92,7 +92,7 @@ in nettle-sys = attrs: { nativeBuildInputs = [ pkg-config ]; buildInputs = [ nettle clang ]; - LIBCLANG_PATH = "${llvmPackages.libclang}/lib"; + LIBCLANG_PATH = "${llvmPackages.libclang.lib}/lib"; }; openssl = attrs: { diff --git a/pkgs/development/compilers/intel-graphics-compiler/default.nix b/pkgs/development/compilers/intel-graphics-compiler/default.nix index 51286582960..75687de4e9e 100644 --- a/pkgs/development/compilers/intel-graphics-compiler/default.nix +++ b/pkgs/development/compilers/intel-graphics-compiler/default.nix @@ -18,7 +18,7 @@ let inherit spirv-llvm-translator; }; inherit (llvmPkgs) llvm; - inherit (if buildWithPatches then opencl-clang else llvmPkgs) clang clang-unwrapped spirv-llvm-translator; + inherit (if buildWithPatches then opencl-clang else llvmPkgs) clang libclang spirv-llvm-translator; inherit (lib) getVersion optional optionals versionOlder versions; in @@ -55,7 +55,7 @@ stdenv.mkDerivation rec { ln -s ${clang}/bin/clang $out/ ln -s clang $out/clang-${versions.major (getVersion clang)} ln -s ${opencl-clang}/lib/* $out/ - ln -s ${clang-unwrapped}/lib/clang/${getVersion clang}/include/opencl-c.h $out/ + ln -s ${lib.getLib libclang}/lib/clang/${getVersion clang}/include/opencl-c.h $out/ ''; }; diff --git a/pkgs/development/compilers/llvm/10/clang/default.nix b/pkgs/development/compilers/llvm/10/clang/default.nix index 35b7ab313d8..d228c4261af 100644 --- a/pkgs/development/compilers/llvm/10/clang/default.nix +++ b/pkgs/development/compilers/llvm/10/clang/default.nix @@ -1,4 +1,5 @@ -{ lib, stdenv, fetch, cmake, libxml2, llvm, version, clang-tools-extra_src, python3, lld +{ lib, stdenv, fetch, cmake, libxml2, libllvm, version, clang-tools-extra_src, python3 +, buildLlvmTools , fixDarwinDylibNames , enableManpages ? false }: @@ -18,28 +19,33 @@ let mv clang-tools-extra-* $sourceRoot/tools/extra ''; - nativeBuildInputs = [ cmake python3 lld ] + nativeBuildInputs = [ cmake python3 ] ++ lib.optional enableManpages python3.pkgs.sphinx ++ lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames; - buildInputs = [ libxml2 llvm ]; + buildInputs = [ libxml2 libllvm ]; cmakeFlags = [ "-DCMAKE_CXX_FLAGS=-std=c++14" "-DCLANGD_BUILD_XPC=OFF" "-DLLVM_ENABLE_RTTI=ON" + "-DLLVM_CONFIG_PATH=${libllvm.dev}/bin/llvm-config${lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) "-native"}" ] ++ lib.optionals enableManpages [ "-DCLANG_INCLUDE_DOCS=ON" "-DLLVM_ENABLE_SPHINX=ON" "-DSPHINX_OUTPUT_MAN=ON" "-DSPHINX_OUTPUT_HTML=OFF" "-DSPHINX_WARNINGS_AS_ERRORS=OFF" + ] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ + "-DLLVM_TABLEGEN_EXE=${buildLlvmTools.llvm}/bin/llvm-tblgen" + "-DCLANG_TABLEGEN=${buildLlvmTools.libclang.dev}/bin/clang-tblgen" ]; patches = [ ./purity.patch # https://reviews.llvm.org/D51899 ./compiler-rt-baremetal.patch + ./gnu-install-dirs.patch ]; postPatch = '' @@ -56,12 +62,12 @@ let --replace "NOT HAVE_CXX_ATOMICS64_WITHOUT_LIB" FALSE ''; - outputs = [ "out" "lib" "python" ]; + outputs = [ "out" "lib" "dev" "python" ]; # Clang expects to find LLVMgold in its own prefix postInstall = '' - if [ -e ${llvm}/lib/LLVMgold.so ]; then - ln -sv ${llvm}/lib/LLVMgold.so $out/lib + 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 @@ -80,11 +86,14 @@ let fi mv $out/share/clang/*.py $python/share/clang rm $out/bin/c-index-test + + mkdir -p $dev/bin + cp bin/clang-tblgen $dev/bin ''; passthru = { isClang = true; - inherit llvm; + inherit libllvm; }; meta = { diff --git a/pkgs/development/compilers/llvm/10/clang/gnu-install-dirs.patch b/pkgs/development/compilers/llvm/10/clang/gnu-install-dirs.patch new file mode 100644 index 00000000000..454c81875ea --- /dev/null +++ b/pkgs/development/compilers/llvm/10/clang/gnu-install-dirs.patch @@ -0,0 +1,248 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index dc1413f4b597..c173531e624f 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -9,6 +9,8 @@ endif() + if( CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR ) + project(Clang) + ++ include(GNUInstallDirs) ++ + # Rely on llvm-config. + set(CONFIG_OUTPUT) + if(LLVM_CONFIG) +@@ -417,7 +419,7 @@ include_directories(BEFORE + + if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY) + install(DIRECTORY include/clang include/clang-c +- DESTINATION include ++ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} + COMPONENT clang-headers + FILES_MATCHING + PATTERN "*.def" +@@ -427,7 +429,7 @@ if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY) + ) + + install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/include/clang +- DESTINATION include ++ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} + COMPONENT clang-headers + FILES_MATCHING + PATTERN "CMakeFiles" EXCLUDE +@@ -447,7 +449,7 @@ if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY) + + add_custom_target(bash-autocomplete DEPENDS utils/bash-autocomplete.sh) + install(PROGRAMS utils/bash-autocomplete.sh +- DESTINATION share/clang ++ DESTINATION ${CMAKE_INSTALL_DATADIR}/clang + COMPONENT bash-autocomplete) + if(NOT LLVM_ENABLE_IDE) + add_llvm_install_targets(install-bash-autocomplete +diff --git a/cmake/modules/AddClang.cmake b/cmake/modules/AddClang.cmake +index 577cc11ab015..a4f4481d8442 100644 +--- a/cmake/modules/AddClang.cmake ++++ b/cmake/modules/AddClang.cmake +@@ -114,9 +114,9 @@ macro(add_clang_library name) + install(TARGETS ${name} + COMPONENT ${name} + ${export_to_clangtargets} +- LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX} +- ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX} +- RUNTIME DESTINATION bin) ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX} ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) + + if (NOT LLVM_ENABLE_IDE) + add_llvm_install_targets(install-${name} +@@ -160,7 +160,7 @@ macro(add_clang_tool name) + + install(TARGETS ${name} + ${export_to_clangtargets} +- RUNTIME DESTINATION bin ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + COMPONENT ${name}) + + if(NOT LLVM_ENABLE_IDE) +@@ -175,7 +175,7 @@ endmacro() + macro(add_clang_symlink name dest) + add_llvm_tool_symlink(${name} ${dest} ALWAYS_GENERATE) + # Always generate install targets +- llvm_install_symlink(${name} ${dest} ALWAYS_GENERATE) ++ llvm_install_symlink(${name} ${dest} ${CMAKE_INSTALL_FULL_BINDIR} ALWAYS_GENERATE) + endmacro() + + function(clang_target_link_libraries target type) +diff --git a/lib/Headers/CMakeLists.txt b/lib/Headers/CMakeLists.txt +index 85c3124234ad..64c48235d914 100644 +--- a/lib/Headers/CMakeLists.txt ++++ b/lib/Headers/CMakeLists.txt +@@ -191,7 +191,7 @@ set_target_properties(clang-resource-headers PROPERTIES + FOLDER "Misc" + RUNTIME_OUTPUT_DIRECTORY "${output_dir}") + +-set(header_install_dir lib${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION}/include) ++set(header_install_dir ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION}/include) + + install( + FILES ${files} ${generated_files} +diff --git a/tools/c-index-test/CMakeLists.txt b/tools/c-index-test/CMakeLists.txt +index ceef4b08637c..8efad5520ca4 100644 +--- a/tools/c-index-test/CMakeLists.txt ++++ b/tools/c-index-test/CMakeLists.txt +@@ -54,7 +54,7 @@ if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY) + set_property(TARGET c-index-test APPEND PROPERTY INSTALL_RPATH + "@executable_path/../../lib") + else() +- set(INSTALL_DESTINATION bin) ++ set(INSTALL_DESTINATION ${CMAKE_INSTALL_BINDIR}) + endif() + + install(TARGETS c-index-test +diff --git a/tools/clang-format/CMakeLists.txt b/tools/clang-format/CMakeLists.txt +index 35ecdb11253c..d77d75de0094 100644 +--- a/tools/clang-format/CMakeLists.txt ++++ b/tools/clang-format/CMakeLists.txt +@@ -21,20 +21,20 @@ if( LLVM_LIB_FUZZING_ENGINE OR LLVM_USE_SANITIZE_COVERAGE ) + endif() + + install(PROGRAMS clang-format-bbedit.applescript +- DESTINATION share/clang ++ DESTINATION ${CMAKE_INSTALL_DATADIR}/clang + COMPONENT clang-format) + install(PROGRAMS clang-format-diff.py +- DESTINATION share/clang ++ DESTINATION ${CMAKE_INSTALL_DATADIR}/clang + COMPONENT clang-format) + install(PROGRAMS clang-format-sublime.py +- DESTINATION share/clang ++ DESTINATION ${CMAKE_INSTALL_DATADIR}/clang + COMPONENT clang-format) + install(PROGRAMS clang-format.el +- DESTINATION share/clang ++ DESTINATION ${CMAKE_INSTALL_DATADIR}/clang + COMPONENT clang-format) + install(PROGRAMS clang-format.py +- DESTINATION share/clang ++ DESTINATION ${CMAKE_INSTALL_DATADIR}/clang + COMPONENT clang-format) + install(PROGRAMS git-clang-format +- DESTINATION bin ++ DESTINATION ${CMAKE_INSTALL_BINDIR} + COMPONENT clang-format) +diff --git a/tools/clang-rename/CMakeLists.txt b/tools/clang-rename/CMakeLists.txt +index cda8e29ec5b1..0134d8ccd70b 100644 +--- a/tools/clang-rename/CMakeLists.txt ++++ b/tools/clang-rename/CMakeLists.txt +@@ -19,8 +19,8 @@ clang_target_link_libraries(clang-rename + ) + + install(PROGRAMS clang-rename.py +- DESTINATION share/clang ++ DESTINATION ${CMAKE_INSTALL_DATADIR}/clang + COMPONENT clang-rename) + install(PROGRAMS clang-rename.el +- DESTINATION share/clang ++ DESTINATION ${CMAKE_INSTALL_DATADIR}/clang + COMPONENT clang-rename) +diff --git a/tools/diagtool/CMakeLists.txt b/tools/diagtool/CMakeLists.txt +index a95444be40ee..136d96d9bf5b 100644 +--- a/tools/diagtool/CMakeLists.txt ++++ b/tools/diagtool/CMakeLists.txt +@@ -21,7 +21,7 @@ clang_target_link_libraries(diagtool + if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY) + install(TARGETS diagtool + COMPONENT diagtool +- RUNTIME DESTINATION bin) ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) + + if (NOT LLVM_ENABLE_IDE) + add_llvm_install_targets(install-diagtool +diff --git a/tools/libclang/CMakeLists.txt b/tools/libclang/CMakeLists.txt +index 973655361f71..0181002e4e3b 100644 +--- a/tools/libclang/CMakeLists.txt ++++ b/tools/libclang/CMakeLists.txt +@@ -141,7 +141,7 @@ endif() + if(INTERNAL_INSTALL_PREFIX) + set(LIBCLANG_HEADERS_INSTALL_DESTINATION "${INTERNAL_INSTALL_PREFIX}/include") + else() +- set(LIBCLANG_HEADERS_INSTALL_DESTINATION include) ++ set(LIBCLANG_HEADERS_INSTALL_DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) + endif() + + install(DIRECTORY ../../include/clang-c +@@ -172,7 +172,7 @@ foreach(PythonVersion ${CLANG_PYTHON_BINDINGS_VERSIONS}) + COMPONENT + libclang-python-bindings + DESTINATION +- "lib${LLVM_LIBDIR_SUFFIX}/python${PythonVersion}/site-packages") ++ "${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}/python${PythonVersion}/site-packages") + endforeach() + if(NOT LLVM_ENABLE_IDE) + add_custom_target(libclang-python-bindings) +diff --git a/tools/scan-build/CMakeLists.txt b/tools/scan-build/CMakeLists.txt +index 28241245fcb7..d6b59f02fc2a 100644 +--- a/tools/scan-build/CMakeLists.txt ++++ b/tools/scan-build/CMakeLists.txt +@@ -42,7 +42,7 @@ if(CLANG_INSTALL_SCANBUILD) + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/bin/${BinFile}) + list(APPEND Depends ${CMAKE_BINARY_DIR}/bin/${BinFile}) + install(PROGRAMS bin/${BinFile} +- DESTINATION bin ++ DESTINATION ${CMAKE_INSTALL_BINDIR} + COMPONENT scan-build) + endforeach() + +@@ -56,7 +56,7 @@ if(CLANG_INSTALL_SCANBUILD) + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/libexec/${LibexecFile}) + list(APPEND Depends ${CMAKE_BINARY_DIR}/libexec/${LibexecFile}) + install(PROGRAMS libexec/${LibexecFile} +- DESTINATION libexec ++ DESTINATION ${CMAKE_INSTALL_LIBEXECDIR} + COMPONENT scan-build) + endforeach() + +@@ -84,7 +84,7 @@ if(CLANG_INSTALL_SCANBUILD) + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/share/scan-build/${ShareFile}) + list(APPEND Depends ${CMAKE_BINARY_DIR}/share/scan-build/${ShareFile}) + install(FILES share/scan-build/${ShareFile} +- DESTINATION share/scan-build ++ DESTINATION ${CMAKE_INSTALL_DATADIR}/scan-build + COMPONENT scan-build) + endforeach() + +diff --git a/tools/scan-view/CMakeLists.txt b/tools/scan-view/CMakeLists.txt +index 22edb974bac7..9f140a9a4538 100644 +--- a/tools/scan-view/CMakeLists.txt ++++ b/tools/scan-view/CMakeLists.txt +@@ -22,7 +22,7 @@ if(CLANG_INSTALL_SCANVIEW) + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/bin/${BinFile}) + list(APPEND Depends ${CMAKE_BINARY_DIR}/bin/${BinFile}) + install(PROGRAMS bin/${BinFile} +- DESTINATION bin ++ DESTINATION ${CMAKE_INSTALL_BINDIR} + COMPONENT scan-view) + endforeach() + +@@ -36,7 +36,7 @@ if(CLANG_INSTALL_SCANVIEW) + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/share/${ShareFile}) + list(APPEND Depends ${CMAKE_BINARY_DIR}/share/scan-view/${ShareFile}) + install(FILES share/${ShareFile} +- DESTINATION share/scan-view ++ DESTINATION ${CMAKE_INSTALL_DATADIR}/scan-view + COMPONENT scan-view) + endforeach() + +diff --git a/utils/hmaptool/CMakeLists.txt b/utils/hmaptool/CMakeLists.txt +index 62f2de0cb15c..6aa66825b6ec 100644 +--- a/utils/hmaptool/CMakeLists.txt ++++ b/utils/hmaptool/CMakeLists.txt +@@ -10,7 +10,7 @@ add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bin/${CLANG_HM + + list(APPEND Depends ${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bin/${CLANG_HMAPTOOL}) + install(PROGRAMS ${CLANG_HMAPTOOL} +- DESTINATION bin ++ DESTINATION ${CMAKE_INSTALL_BINDIR} + COMPONENT hmaptool) + + add_custom_target(hmaptool ALL DEPENDS ${Depends}) diff --git a/pkgs/development/compilers/llvm/10/compiler-rt/default.nix b/pkgs/development/compilers/llvm/10/compiler-rt/default.nix index 1d759c903fc..15fb0a7b910 100644 --- a/pkgs/development/compilers/llvm/10/compiler-rt/default.nix +++ b/pkgs/development/compilers/llvm/10/compiler-rt/default.nix @@ -13,7 +13,7 @@ stdenv.mkDerivation rec { inherit version; src = fetch pname "1yjqjri753w0fzmxcyz687nvd97sbc9rsqrxzpq720na47hwh3fr"; - nativeBuildInputs = [ cmake python3 llvm ]; + nativeBuildInputs = [ cmake python3 llvm.dev ]; buildInputs = lib.optional stdenv.hostPlatform.isDarwin libcxxabi; NIX_CFLAGS_COMPILE = [ @@ -21,6 +21,7 @@ stdenv.mkDerivation rec { ]; cmakeFlags = [ + "-DCOMPILER_RT_OS_DIR=" "-DCOMPILER_RT_DEFAULT_TARGET_ONLY=ON" "-DCMAKE_C_COMPILER_TARGET=${stdenv.hostPlatform.config}" "-DCMAKE_ASM_COMPILER_TARGET=${stdenv.hostPlatform.config}" @@ -54,6 +55,7 @@ stdenv.mkDerivation rec { patches = [ ./codesign.patch # Revert compiler-rt commit that makes codesign mandatory ./find-darwin-sdk-version.patch # don't test for macOS being >= 10.15 + ./gnu-install-dirs.patch ]# ++ lib.optional stdenv.hostPlatform.isMusl ./sanitizers-nongnu.patch ++ lib.optional stdenv.hostPlatform.isAarch32 ./armv7l.patch; @@ -79,9 +81,7 @@ stdenv.mkDerivation rec { ''; # Hack around weird upsream RPATH bug - postInstall = lib.optionalString (stdenv.hostPlatform.isDarwin || stdenv.hostPlatform.isWasm) '' - ln -s "$out/lib"/*/* "$out/lib" - '' + lib.optionalString (useLLVM) '' + postInstall = lib.optionalString (useLLVM) '' ln -s $out/lib/*/clang_rt.crtbegin-*.o $out/lib/crtbegin.o ln -s $out/lib/*/clang_rt.crtend-*.o $out/lib/crtend.o ln -s $out/lib/*/clang_rt.crtbegin_shared-*.o $out/lib/crtbeginS.o diff --git a/pkgs/development/compilers/llvm/10/compiler-rt/gnu-install-dirs.patch b/pkgs/development/compilers/llvm/10/compiler-rt/gnu-install-dirs.patch new file mode 100644 index 00000000000..7bc835914a3 --- /dev/null +++ b/pkgs/development/compilers/llvm/10/compiler-rt/gnu-install-dirs.patch @@ -0,0 +1,129 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 8d768a404f21..74551dc5a004 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -12,6 +12,7 @@ endif() + # Check if compiler-rt is built as a standalone project. + if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR OR COMPILER_RT_STANDALONE_BUILD) + project(CompilerRT C CXX ASM) ++ include(GNUInstallDirs) + set(COMPILER_RT_STANDALONE_BUILD TRUE) + set_property(GLOBAL PROPERTY USE_FOLDERS ON) + endif() +diff --git a/cmake/Modules/AddCompilerRT.cmake b/cmake/Modules/AddCompilerRT.cmake +index 35a48c6af29c..e4300f256091 100644 +--- a/cmake/Modules/AddCompilerRT.cmake ++++ b/cmake/Modules/AddCompilerRT.cmake +@@ -493,7 +493,7 @@ macro(add_compiler_rt_resource_file target_name file_name component) + add_custom_target(${target_name} DEPENDS ${dst_file}) + # Install in Clang resource directory. + install(FILES ${file_name} +- DESTINATION ${COMPILER_RT_INSTALL_PATH}/share ++ DESTINATION ${COMPILER_RT_INSTALL_PATH}/${CMAKE_INSTALL_FULL_INCLUDEDIR} + COMPONENT ${component}) + add_dependencies(${component} ${target_name}) + +@@ -510,7 +510,7 @@ macro(add_compiler_rt_script name) + add_custom_target(${name} DEPENDS ${dst}) + install(FILES ${dst} + PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE +- DESTINATION ${COMPILER_RT_INSTALL_PATH}/bin) ++ DESTINATION ${COMPILER_RT_INSTALL_PATH}/${CMAKE_INSTALL_FULL_BINDIR}) + endmacro(add_compiler_rt_script src name) + + # Builds custom version of libc++ and installs it in . +diff --git a/cmake/Modules/CompilerRTDarwinUtils.cmake b/cmake/Modules/CompilerRTDarwinUtils.cmake +index 9f501a61c4b6..f9a0d92dbca0 100644 +--- a/cmake/Modules/CompilerRTDarwinUtils.cmake ++++ b/cmake/Modules/CompilerRTDarwinUtils.cmake +@@ -440,7 +440,7 @@ macro(darwin_add_embedded_builtin_libraries) + set(DARWIN_macho_embedded_LIBRARY_OUTPUT_DIR + ${COMPILER_RT_OUTPUT_DIR}/lib/macho_embedded) + set(DARWIN_macho_embedded_LIBRARY_INSTALL_DIR +- ${COMPILER_RT_INSTALL_PATH}/lib/macho_embedded) ++ ${COMPILER_RT_INSTALL_PATH}/${CMAKE_INSTALL_FULL_LIBDIR}/macho_embedded) + + set(CFLAGS_armv7 "-target thumbv7-apple-darwin-eabi") + set(CFLAGS_i386 "-march=pentium") +diff --git a/cmake/Modules/CompilerRTUtils.cmake b/cmake/Modules/CompilerRTUtils.cmake +index 6e672b1e1818..64999709958e 100644 +--- a/cmake/Modules/CompilerRTUtils.cmake ++++ b/cmake/Modules/CompilerRTUtils.cmake +@@ -371,7 +371,7 @@ endfunction() + function(get_compiler_rt_install_dir arch install_dir) + if(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR AND NOT APPLE) + get_compiler_rt_target(${arch} target) +- set(${install_dir} ${COMPILER_RT_INSTALL_PATH}/lib/${target} PARENT_SCOPE) ++ set(${install_dir} ${COMPILER_RT_INSTALL_PATH}/${CMAKE_INSTALL_FULL_LIBDIR}/${target} PARENT_SCOPE) + else() + set(${install_dir} ${COMPILER_RT_LIBRARY_INSTALL_DIR} PARENT_SCOPE) + endif() +diff --git a/cmake/base-config-ix.cmake b/cmake/base-config-ix.cmake +index b4b87aa53073..f1ae8668837c 100644 +--- a/cmake/base-config-ix.cmake ++++ b/cmake/base-config-ix.cmake +@@ -65,11 +65,11 @@ if (LLVM_TREE_AVAILABLE) + else() + # Take output dir and install path from the user. + set(COMPILER_RT_OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR} CACHE PATH +- "Path where built compiler-rt libraries should be stored.") ++ "Path where built compiler-rt build artifacts should be stored.") + set(COMPILER_RT_EXEC_OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR}/bin CACHE PATH + "Path where built compiler-rt executables should be stored.") +- set(COMPILER_RT_INSTALL_PATH ${CMAKE_INSTALL_PREFIX} CACHE PATH +- "Path where built compiler-rt libraries should be installed.") ++ set(COMPILER_RT_INSTALL_PATH "" CACHE PATH ++ "Prefix where built compiler-rt artifacts should be installed, comes before CMAKE_INSTALL_PREFIX.") + option(COMPILER_RT_INCLUDE_TESTS "Generate and build compiler-rt unit tests." OFF) + option(COMPILER_RT_ENABLE_WERROR "Fail and stop if warning is triggered" OFF) + # Use a host compiler to compile/link tests. +@@ -97,7 +97,7 @@ else(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR) + set(COMPILER_RT_LIBRARY_OUTPUT_DIR + ${COMPILER_RT_OUTPUT_DIR}/lib/${COMPILER_RT_OS_DIR}) + set(COMPILER_RT_LIBRARY_INSTALL_DIR +- ${COMPILER_RT_INSTALL_PATH}/lib/${COMPILER_RT_OS_DIR}) ++ ${COMPILER_RT_INSTALL_PATH}/${CMAKE_INSTALL_FULL_LIBDIR}/${COMPILER_RT_OS_DIR}) + endif() + + if(APPLE) +diff --git a/include/CMakeLists.txt b/include/CMakeLists.txt +index d47d7baeb118..507c8e5c713e 100644 +--- a/include/CMakeLists.txt ++++ b/include/CMakeLists.txt +@@ -62,22 +62,22 @@ set_target_properties(compiler-rt-headers PROPERTIES FOLDER "Compiler-RT Misc") + install(FILES ${SANITIZER_HEADERS} + COMPONENT compiler-rt-headers + PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ +- DESTINATION ${COMPILER_RT_INSTALL_PATH}/include/sanitizer) ++ DESTINATION ${COMPILER_RT_INSTALL_PATH}/${CMAKE_INSTALL_FULL_INCLUDEDIR}/sanitizer) + # Install fuzzer headers. + install(FILES ${FUZZER_HEADERS} + COMPONENT compiler-rt-headers + PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ +- DESTINATION ${COMPILER_RT_INSTALL_PATH}/include/fuzzer) ++ DESTINATION ${COMPILER_RT_INSTALL_PATH}/${CMAKE_INSTALL_FULL_INCLUDEDIR}/fuzzer) + # Install xray headers. + install(FILES ${XRAY_HEADERS} + COMPONENT compiler-rt-headers + PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ +- DESTINATION ${COMPILER_RT_INSTALL_PATH}/include/xray) ++ DESTINATION ${COMPILER_RT_INSTALL_PATH}/${CMAKE_INSTALL_FULL_INCLUDEDIR}/xray) + # Install profile headers. + install(FILES ${PROFILE_HEADERS} + COMPONENT compiler-rt-headers + PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ +- DESTINATION ${COMPILER_RT_INSTALL_PATH}/include/profile) ++ DESTINATION ${COMPILER_RT_INSTALL_PATH}/${CMAKE_INSTALL_FULL_INCLUDEDIR}/profile) + + if (NOT CMAKE_CONFIGURATION_TYPES) # don't add this for IDEs. + add_custom_target(install-compiler-rt-headers +diff --git a/lib/dfsan/CMakeLists.txt b/lib/dfsan/CMakeLists.txt +index 051215edbeb7..ecce1f52efb0 100644 +--- a/lib/dfsan/CMakeLists.txt ++++ b/lib/dfsan/CMakeLists.txt +@@ -56,4 +56,4 @@ add_custom_command(OUTPUT ${dfsan_abilist_filename} + DEPENDS done_abilist.txt libc_ubuntu1404_abilist.txt) + add_dependencies(dfsan dfsan_abilist) + install(FILES ${dfsan_abilist_filename} +- DESTINATION ${COMPILER_RT_INSTALL_PATH}/share) ++ DESTINATION ${COMPILER_RT_INSTALL_PATH}/${CMAKE_INSTALL_FULL_DATADIR}) diff --git a/pkgs/development/compilers/llvm/10/default.nix b/pkgs/development/compilers/llvm/10/default.nix index 3fa91cd8374..9bc79b58693 100644 --- a/pkgs/development/compilers/llvm/10/default.nix +++ b/pkgs/development/compilers/llvm/10/default.nix @@ -1,6 +1,5 @@ { lowPrio, newScope, pkgs, lib, stdenv, cmake, gccForLibs , libxml2, python3, isl, fetchurl, overrideCC, wrapCCWith, wrapBintoolsWith -, buildPackages , buildLlvmTools # tools, but from the previous stage, for cross , targetLlvmLibraries # libraries, but from the next stage, for cross }: @@ -18,31 +17,37 @@ let clang-tools-extra_src = fetch "clang-tools-extra" "06n1yp638rh24xdxv9v2df0qajxbjz4w59b7dd4ky36drwmpi4yh"; tools = lib.makeExtensible (tools: let - callPackage = newScope (tools // { inherit stdenv cmake libxml2 python3 isl release_version version fetch; }); + callPackage = newScope (tools // { inherit stdenv cmake libxml2 python3 isl release_version version fetch buildLlvmTools; }); mkExtraBuildCommands = cc: '' rsrc="$out/resource-root" mkdir "$rsrc" - ln -s "${cc}/lib/clang/${release_version}/include" "$rsrc" + ln -s "${cc.lib}/lib/clang/${release_version}/include" "$rsrc" ln -s "${targetLlvmLibraries.compiler-rt.out}/lib" "$rsrc/lib" ln -s "${targetLlvmLibraries.compiler-rt.out}/share" "$rsrc/share" echo "-resource-dir=$rsrc" >> $out/nix-support/cc-cflags ''; + in { - llvm = callPackage ./llvm { }; + libllvm = callPackage ./llvm { }; - clang-unwrapped = callPackage ./clang { - inherit (tools) lld; + # `llvm` historically had the binaries. But this migration + # technique also impedes `lib.get*`. Perhaps we will revisit it. + llvm = tools.libllvm.out; + + libclang = callPackage ./clang { inherit clang-tools-extra_src; }; + clang-unwrapped = tools.libclang.out; + # disabled until recommonmark supports sphinx 3 - #Llvm-manpages = lowPrio (tools.llvm.override { + #Llvm-manpages = lowPrio (tools.libllvm.override { # enableManpages = true; # python3 = pkgs.python3; # don't use python-boot #}); - clang-manpages = lowPrio (tools.clang-unwrapped.override { + clang-manpages = lowPrio (tools.libclang.override { enableManpages = true; python3 = pkgs.python3; # don't use python-boot }); @@ -53,8 +58,6 @@ let # python3 = pkgs.python3; # don't use python-boot # }); - libclang = tools.clang-unwrapped.lib; - clang = if stdenv.cc.isGNU then tools.libstdcxxClang else tools.libcxxClang; libstdcxxClang = wrapCCWith rec { diff --git a/pkgs/development/compilers/llvm/10/libc++/default.nix b/pkgs/development/compilers/llvm/10/libc++/default.nix index a3fb0927345..1e5dc5b2dac 100644 --- a/pkgs/development/compilers/llvm/10/libc++/default.nix +++ b/pkgs/development/compilers/llvm/10/libc++/default.nix @@ -13,7 +13,11 @@ stdenv.mkDerivation { export LIBCXXABI_INCLUDE_DIR="$PWD/$(ls -d libcxxabi-${version}*)/include" ''; - patches = lib.optional stdenv.hostPlatform.isMusl ../../libcxx-0001-musl-hacks.patch; + outputs = [ "out" "dev" ]; + + patches = [ + ./gnu-install-dirs.patch + ] ++ lib.optional stdenv.hostPlatform.isMusl ../../libcxx-0001-musl-hacks.patch; preConfigure = '' # Get headers from the cxxabi source so we can see private headers not installed by the cxxabi package diff --git a/pkgs/development/compilers/llvm/10/libc++/gnu-install-dirs.patch b/pkgs/development/compilers/llvm/10/libc++/gnu-install-dirs.patch new file mode 100644 index 00000000000..4b031e90bdd --- /dev/null +++ b/pkgs/development/compilers/llvm/10/libc++/gnu-install-dirs.patch @@ -0,0 +1,99 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 60564dc96c7b..77d832ad5a44 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -26,6 +26,8 @@ set(CMAKE_MODULE_PATH + if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR OR LIBCXX_STANDALONE_BUILD) + project(libcxx CXX C) + ++ include(GNUInstallDirs) ++ + set(PACKAGE_NAME libcxx) + set(PACKAGE_VERSION 10.0.1) + set(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}") +@@ -415,7 +417,7 @@ string(REGEX MATCH "[0-9]+\\.[0-9]+(\\.[0-9]+)?" CLANG_VERSION + if(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR AND NOT APPLE) + set(LIBCXX_LIBRARY_DIR ${LLVM_LIBRARY_OUTPUT_INTDIR}/${LLVM_DEFAULT_TARGET_TRIPLE}/c++) + set(LIBCXX_HEADER_DIR ${LLVM_BINARY_DIR}) +- set(LIBCXX_INSTALL_LIBRARY_DIR lib${LLVM_LIBDIR_SUFFIX}/${LLVM_DEFAULT_TARGET_TRIPLE}/c++) ++ set(LIBCXX_INSTALL_LIBRARY_DIR ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}/${LLVM_DEFAULT_TARGET_TRIPLE}/c++) + if(LIBCXX_LIBDIR_SUBDIR) + string(APPEND LIBCXX_LIBRARY_DIR /${LIBCXX_LIBDIR_SUBDIR}) + string(APPEND LIBCXX_INSTALL_LIBRARY_DIR /${LIBCXX_LIBDIR_SUBDIR}) +@@ -423,10 +425,10 @@ if(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR AND NOT APPLE) + elseif(LLVM_LIBRARY_OUTPUT_INTDIR) + set(LIBCXX_LIBRARY_DIR ${LLVM_LIBRARY_OUTPUT_INTDIR}) + set(LIBCXX_HEADER_DIR ${LLVM_BINARY_DIR}) +- set(LIBCXX_INSTALL_LIBRARY_DIR lib${LIBCXX_LIBDIR_SUFFIX}) ++ set(LIBCXX_INSTALL_LIBRARY_DIR ${CMAKE_INSTALL_LIBDIR}${LIBCXX_LIBDIR_SUFFIX}) + else() + set(LIBCXX_LIBRARY_DIR ${CMAKE_BINARY_DIR}/lib${LIBCXX_LIBDIR_SUFFIX}) +- set(LIBCXX_INSTALL_LIBRARY_DIR lib${LIBCXX_LIBDIR_SUFFIX}) ++ set(LIBCXX_INSTALL_LIBRARY_DIR ${CMAKE_INSTALL_LIBDIR}${LIBCXX_LIBDIR_SUFFIX}) + endif() + + file(MAKE_DIRECTORY "${LIBCXX_BINARY_INCLUDE_DIR}") +diff --git a/cmake/Modules/HandleLibCXXABI.cmake b/cmake/Modules/HandleLibCXXABI.cmake +index 10f100f7f0fb..95ed3978ab73 100644 +--- a/cmake/Modules/HandleLibCXXABI.cmake ++++ b/cmake/Modules/HandleLibCXXABI.cmake +@@ -61,7 +61,7 @@ macro(setup_abi_lib abidefines abishared abistatic abifiles abidirs) + + if (LIBCXX_INSTALL_HEADERS) + install(FILES "${LIBCXX_BINARY_INCLUDE_DIR}/${fpath}" +- DESTINATION ${LIBCXX_INSTALL_HEADER_PREFIX}include/c++/v1/${dstdir} ++ DESTINATION ${LIBCXX_INSTALL_HEADER_PREFIX}${CMAKE_INSTALL_INCLUDEDIR}/c++/v1/${dstdir} + COMPONENT cxx-headers + PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ + ) +diff --git a/include/CMakeLists.txt b/include/CMakeLists.txt +index 302da8a131b4..4c6ab463f564 100644 +--- a/include/CMakeLists.txt ++++ b/include/CMakeLists.txt +@@ -244,7 +244,7 @@ if (LIBCXX_INSTALL_HEADERS) + foreach(file ${files}) + get_filename_component(dir ${file} DIRECTORY) + install(FILES ${file} +- DESTINATION ${LIBCXX_INSTALL_HEADER_PREFIX}include/c++/v1/${dir} ++ DESTINATION ${LIBCXX_INSTALL_HEADER_PREFIX}${CMAKE_INSTALL_INCLUDEDIR}/c++/v1/${dir} + COMPONENT ${CXX_HEADER_TARGET} + PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ + ) +@@ -253,7 +253,7 @@ if (LIBCXX_INSTALL_HEADERS) + if (LIBCXX_NEEDS_SITE_CONFIG) + # Install the generated header as __config. + install(FILES ${LIBCXX_BINARY_DIR}/__generated_config +- DESTINATION ${LIBCXX_INSTALL_HEADER_PREFIX}include/c++/v1 ++ DESTINATION ${LIBCXX_INSTALL_HEADER_PREFIX}${CMAKE_INSTALL_INCLUDEDIR}/c++/v1 + PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ + RENAME __config + COMPONENT ${CXX_HEADER_TARGET}) +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index 120505fe18da..9b8456d8405a 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -341,21 +341,21 @@ if (LIBCXX_INSTALL_LIBRARY) + install(TARGETS cxx_shared + ARCHIVE DESTINATION ${LIBCXX_INSTALL_PREFIX}${LIBCXX_INSTALL_LIBRARY_DIR} COMPONENT cxx + LIBRARY DESTINATION ${LIBCXX_INSTALL_PREFIX}${LIBCXX_INSTALL_LIBRARY_DIR} COMPONENT cxx +- RUNTIME DESTINATION ${LIBCXX_INSTALL_PREFIX}bin COMPONENT cxx) ++ RUNTIME DESTINATION ${LIBCXX_INSTALL_PREFIX}${CMAKE_INSTALL_BINDIR} COMPONENT cxx) + endif() + + if (LIBCXX_INSTALL_STATIC_LIBRARY) + install(TARGETS cxx_static + ARCHIVE DESTINATION ${LIBCXX_INSTALL_PREFIX}${LIBCXX_INSTALL_LIBRARY_DIR} COMPONENT cxx + LIBRARY DESTINATION ${LIBCXX_INSTALL_PREFIX}${LIBCXX_INSTALL_LIBRARY_DIR} COMPONENT cxx +- RUNTIME DESTINATION ${LIBCXX_INSTALL_PREFIX}bin COMPONENT cxx) ++ RUNTIME DESTINATION ${LIBCXX_INSTALL_PREFIX}${CMAKE_INSTALL_BINDIR} COMPONENT cxx) + endif() + + if(LIBCXX_INSTALL_EXPERIMENTAL_LIBRARY) + install(TARGETS ${LIBCXX_INSTALL_TARGETS} ${experimental_lib} + LIBRARY DESTINATION ${LIBCXX_INSTALL_PREFIX}${LIBCXX_INSTALL_LIBRARY_DIR} COMPONENT cxx + ARCHIVE DESTINATION ${LIBCXX_INSTALL_PREFIX}${LIBCXX_INSTALL_LIBRARY_DIR} COMPONENT cxx +- RUNTIME DESTINATION ${LIBCXX_INSTALL_PREFIX}bin COMPONENT cxx) ++ RUNTIME DESTINATION ${LIBCXX_INSTALL_PREFIX}${CMAKE_INSTALL_BINDIR} COMPONENT cxx) + endif() + + # NOTE: This install command must go after the cxx install command otherwise diff --git a/pkgs/development/compilers/llvm/10/libc++abi/default.nix b/pkgs/development/compilers/llvm/10/libc++abi/default.nix index 1909996614d..bc5e77b739d 100644 --- a/pkgs/development/compilers/llvm/10/libc++abi/default.nix +++ b/pkgs/development/compilers/llvm/10/libc++abi/default.nix @@ -8,6 +8,25 @@ stdenv.mkDerivation { src = fetch "libcxxabi" "0yqs722y76cwvmfsq0lb917r9m3fci7bf5z3yzl71yz9n88ghzm9"; + outputs = [ "out" "dev" ]; + + postUnpack = '' + unpackFile ${libcxx.src} + unpackFile ${llvm.src} + cmakeFlags+=" -DLLVM_PATH=$PWD/$(ls -d llvm-*) -DLIBCXXABI_LIBCXX_PATH=$PWD/$(ls -d libcxx-*)" + '' + lib.optionalString stdenv.isDarwin '' + export TRIPLE=x86_64-apple-darwin + '' + lib.optionalString stdenv.hostPlatform.isMusl '' + patch -p1 -d $(ls -d libcxx-*) -i ${../../libcxx-0001-musl-hacks.patch} + '' + lib.optionalString stdenv.hostPlatform.isWasm '' + patch -p1 -d $(ls -d llvm-*) -i ${./wasm.patch} + ''; + + patches = [ + ./no-threads.patch + ./gnu-install-dirs.patch + ]; + nativeBuildInputs = [ cmake ]; buildInputs = lib.optional (!stdenv.isDarwin && !stdenv.isFreeBSD && !stdenv.hostPlatform.isWasm) libunwind; @@ -21,20 +40,6 @@ stdenv.mkDerivation { "-DLIBCXXABI_ENABLE_SHARED=OFF" ]; - patches = [ ./no-threads.patch ]; - - postUnpack = '' - unpackFile ${libcxx.src} - unpackFile ${llvm.src} - cmakeFlags+=" -DLLVM_PATH=$PWD/$(ls -d llvm-*) -DLIBCXXABI_LIBCXX_PATH=$PWD/$(ls -d libcxx-*)" - '' + lib.optionalString stdenv.isDarwin '' - export TRIPLE=x86_64-apple-darwin - '' + lib.optionalString stdenv.hostPlatform.isMusl '' - patch -p1 -d $(ls -d libcxx-*) -i ${../../libcxx-0001-musl-hacks.patch} - '' + lib.optionalString stdenv.hostPlatform.isWasm '' - patch -p1 -d $(ls -d llvm-*) -i ${./wasm.patch} - ''; - installPhase = if stdenv.isDarwin then '' for file in lib/*.dylib; do diff --git a/pkgs/development/compilers/llvm/10/libc++abi/gnu-install-dirs.patch b/pkgs/development/compilers/llvm/10/libc++abi/gnu-install-dirs.patch new file mode 100644 index 00000000000..0f80ade7c38 --- /dev/null +++ b/pkgs/development/compilers/llvm/10/libc++abi/gnu-install-dirs.patch @@ -0,0 +1,34 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 8f9572586b4a..bf0e41dfc751 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -20,6 +20,8 @@ set(CMAKE_MODULE_PATH + if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR OR LIBCXXABI_STANDALONE_BUILD) + project(libcxxabi CXX C) + ++ include(GNUInstallDirs) ++ + set(PACKAGE_NAME libcxxabi) + set(PACKAGE_VERSION 10.0.1) + set(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}") +@@ -214,17 +216,17 @@ string(REGEX MATCH "[0-9]+\\.[0-9]+(\\.[0-9]+)?" CLANG_VERSION + + if(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR AND NOT APPLE) + set(LIBCXXABI_LIBRARY_DIR ${LLVM_LIBRARY_OUTPUT_INTDIR}/${LLVM_DEFAULT_TARGET_TRIPLE}/c++) +- set(LIBCXXABI_INSTALL_LIBRARY_DIR lib${LLVM_LIBDIR_SUFFIX}/${LLVM_DEFAULT_TARGET_TRIPLE}/c++) ++ set(LIBCXXABI_INSTALL_LIBRARY_DIR ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}/${LLVM_DEFAULT_TARGET_TRIPLE}/c++) + if(LIBCXX_LIBDIR_SUBDIR) + string(APPEND LIBCXXABI_LIBRARY_DIR /${LIBCXXABI_LIBDIR_SUBDIR}) + string(APPEND LIBCXXABI_INSTALL_LIBRARY_DIR /${LIBCXXABI_LIBDIR_SUBDIR}) + endif() + elseif(LLVM_LIBRARY_OUTPUT_INTDIR) + set(LIBCXXABI_LIBRARY_DIR ${LLVM_LIBRARY_OUTPUT_INTDIR}) +- set(LIBCXXABI_INSTALL_LIBRARY_DIR lib${LIBCXXABI_LIBDIR_SUFFIX}) ++ set(LIBCXXABI_INSTALL_LIBRARY_DIR ${CMAKE_INSTALL_LIBDIR}${LIBCXXABI_LIBDIR_SUFFIX}) + else() + set(LIBCXXABI_LIBRARY_DIR ${CMAKE_BINARY_DIR}/lib${LIBCXXABI_LIBDIR_SUFFIX}) +- set(LIBCXXABI_INSTALL_LIBRARY_DIR lib${LIBCXXABI_LIBDIR_SUFFIX}) ++ set(LIBCXXABI_INSTALL_LIBRARY_DIR ${CMAKE_INSTALL_LIBDIR}${LIBCXXABI_LIBDIR_SUFFIX}) + endif() + + set(LIBCXXABI_INSTALL_PREFIX "" CACHE STRING "Define libc++abi destination prefix.") diff --git a/pkgs/development/compilers/llvm/10/libunwind/default.nix b/pkgs/development/compilers/llvm/10/libunwind/default.nix index f0f45780a22..d010deb6618 100644 --- a/pkgs/development/compilers/llvm/10/libunwind/default.nix +++ b/pkgs/development/compilers/llvm/10/libunwind/default.nix @@ -8,6 +8,12 @@ stdenv.mkDerivation rec { src = fetch pname "09syx66idnm2pr46x2vmk0jn3iwdv0lkd04xy4zjbwmz3vn066bl"; + patches = [ + ./gnu-install-dirs.patch + ]; + + outputs = [ "out" "dev" ]; + nativeBuildInputs = [ cmake ]; cmakeFlags = lib.optional (!enableShared) "-DLIBUNWIND_ENABLE_SHARED=OFF"; diff --git a/pkgs/development/compilers/llvm/10/libunwind/gnu-install-dirs.patch b/pkgs/development/compilers/llvm/10/libunwind/gnu-install-dirs.patch new file mode 100644 index 00000000000..8cea7d3e334 --- /dev/null +++ b/pkgs/development/compilers/llvm/10/libunwind/gnu-install-dirs.patch @@ -0,0 +1,34 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index c033069ef1d0..e2846896eece 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -18,6 +18,8 @@ set(CMAKE_MODULE_PATH + if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR OR LIBUNWIND_STANDALONE_BUILD) + project(libunwind) + ++ include(GNUInstallDirs) ++ + # Rely on llvm-config. + set(CONFIG_OUTPUT) + if(NOT LLVM_CONFIG_PATH) +@@ -189,17 +191,17 @@ string(REGEX MATCH "[0-9]+\\.[0-9]+(\\.[0-9]+)?" CLANG_VERSION + + if(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR AND NOT APPLE) + set(LIBUNWIND_LIBRARY_DIR ${LLVM_LIBRARY_OUTPUT_INTDIR}/${LLVM_DEFAULT_TARGET_TRIPLE}/c++) +- set(LIBUNWIND_INSTALL_LIBRARY_DIR lib${LLVM_LIBDIR_SUFFIX}/${LLVM_DEFAULT_TARGET_TRIPLE}/c++) ++ set(LIBUNWIND_INSTALL_LIBRARY_DIR ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}/${LLVM_DEFAULT_TARGET_TRIPLE}/c++) + if(LIBCXX_LIBDIR_SUBDIR) + string(APPEND LIBUNWIND_LIBRARY_DIR /${LIBUNWIND_LIBDIR_SUBDIR}) + string(APPEND LIBUNWIND_INSTALL_LIBRARY_DIR /${LIBUNWIND_LIBDIR_SUBDIR}) + endif() + elseif(LLVM_LIBRARY_OUTPUT_INTDIR) + set(LIBUNWIND_LIBRARY_DIR ${LLVM_LIBRARY_OUTPUT_INTDIR}) +- set(LIBUNWIND_INSTALL_LIBRARY_DIR lib${LIBUNWIND_LIBDIR_SUFFIX}) ++ set(LIBUNWIND_INSTALL_LIBRARY_DIR ${CMAKE_INSTALL_LIBDIR}${LIBUNWIND_LIBDIR_SUFFIX}) + else() + set(LIBUNWIND_LIBRARY_DIR ${CMAKE_BINARY_DIR}/lib${LIBUNWIND_LIBDIR_SUFFIX}) +- set(LIBUNWIND_INSTALL_LIBRARY_DIR lib${LIBUNWIND_LIBDIR_SUFFIX}) ++ set(LIBUNWIND_INSTALL_LIBRARY_DIR ${CMAKE_INSTALL_LIBDIR}${LIBUNWIND_LIBDIR_SUFFIX}) + endif() + + set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${LIBUNWIND_LIBRARY_DIR}) diff --git a/pkgs/development/compilers/llvm/10/lld/default.nix b/pkgs/development/compilers/llvm/10/lld/default.nix index a94c1b5b0dd..03a48f02a0c 100644 --- a/pkgs/development/compilers/llvm/10/lld/default.nix +++ b/pkgs/development/compilers/llvm/10/lld/default.nix @@ -1,8 +1,9 @@ { lib, stdenv +, buildLlvmTools , fetch , cmake , libxml2 -, llvm +, libllvm , version }: @@ -12,15 +13,20 @@ stdenv.mkDerivation rec { src = fetch pname "0ynzi35r4fckvp6842alpd43qr810j3728yfslc66fk2mbh4j52r"; + patches = [ + ./gnu-install-dirs.patch + ]; + nativeBuildInputs = [ cmake ]; - buildInputs = [ llvm libxml2 ]; + buildInputs = [ libllvm libxml2 ]; - outputs = [ "out" "dev" ]; + cmakeFlags = [ + "-DLLVM_CONFIG_PATH=${libllvm.dev}/bin/llvm-config${lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) "-native"}" + ] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ + "-DLLVM_TABLEGEN_EXE=${buildLlvmTools.llvm}/bin/llvm-tblgen" + ]; - postInstall = '' - moveToOutput include "$dev" - moveToOutput lib "$dev" - ''; + outputs = [ "out" "lib" "dev" ]; meta = { description = "The LLVM Linker"; diff --git a/pkgs/development/compilers/llvm/10/lld/gnu-install-dirs.patch b/pkgs/development/compilers/llvm/10/lld/gnu-install-dirs.patch new file mode 100644 index 00000000000..232f5cbac9d --- /dev/null +++ b/pkgs/development/compilers/llvm/10/lld/gnu-install-dirs.patch @@ -0,0 +1,68 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 641f71c114ae..9d44c1463aff 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -6,6 +6,8 @@ if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR) + set(CMAKE_INCLUDE_CURRENT_DIR ON) + set(LLD_BUILT_STANDALONE TRUE) + ++ include(GNUInstallDirs) ++ + find_program(LLVM_CONFIG_PATH "llvm-config" DOC "Path to llvm-config binary") + if(NOT LLVM_CONFIG_PATH) + message(FATAL_ERROR "llvm-config not found: specify LLVM_CONFIG_PATH") +@@ -202,7 +204,7 @@ include_directories(BEFORE + + if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY) + install(DIRECTORY include/ +- DESTINATION include ++ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} + FILES_MATCHING + PATTERN "*.h" + PATTERN ".svn" EXCLUDE +diff --git a/cmake/modules/AddLLD.cmake b/cmake/modules/AddLLD.cmake +index fa48b428d26b..e7967aad3ceb 100644 +--- a/cmake/modules/AddLLD.cmake ++++ b/cmake/modules/AddLLD.cmake +@@ -20,9 +20,9 @@ macro(add_lld_library name) + install(TARGETS ${name} + COMPONENT ${name} + ${export_to_lldtargets} +- LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX} +- ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX} +- RUNTIME DESTINATION bin) ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX} ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) + + if (${ARG_SHARED} AND NOT CMAKE_CONFIGURATION_TYPES) + add_llvm_install_targets(install-${name} +@@ -54,7 +54,7 @@ macro(add_lld_tool name) + + install(TARGETS ${name} + ${export_to_lldtargets} +- RUNTIME DESTINATION bin ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + COMPONENT ${name}) + + if(NOT CMAKE_CONFIGURATION_TYPES) +@@ -69,5 +69,5 @@ endmacro() + macro(add_lld_symlink name dest) + add_llvm_tool_symlink(${name} ${dest} ALWAYS_GENERATE) + # Always generate install targets +- llvm_install_symlink(${name} ${dest} ALWAYS_GENERATE) ++ llvm_install_symlink(${name} ${dest} ${CMAKE_INSTALL_FULL_BINDIR} ALWAYS_GENERATE) + endmacro() +diff --git a/tools/lld/CMakeLists.txt b/tools/lld/CMakeLists.txt +index a15e296e31df..654c2cfdb9c0 100644 +--- a/tools/lld/CMakeLists.txt ++++ b/tools/lld/CMakeLists.txt +@@ -17,7 +17,7 @@ target_link_libraries(lld + ) + + install(TARGETS lld +- RUNTIME DESTINATION bin) ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) + + if(NOT LLD_SYMLINKS_TO_CREATE) + set(LLD_SYMLINKS_TO_CREATE lld-link ld.lld ld64.lld wasm-ld) diff --git a/pkgs/development/compilers/llvm/10/lldb/default.nix b/pkgs/development/compilers/llvm/10/lldb/default.nix index 7fb8ed57a01..ccca340b3e2 100644 --- a/pkgs/development/compilers/llvm/10/lldb/default.nix +++ b/pkgs/development/compilers/llvm/10/lldb/default.nix @@ -7,8 +7,8 @@ , which , libedit , libxml2 -, llvm -, clang-unwrapped +, libllvm +, libclang , python3 , version , darwin @@ -22,19 +22,22 @@ stdenv.mkDerivation (rec { src = fetch pname "051p5b04y6z3g730rmc2n2v71lipbw7k69riww3a6sl74myfiaq7"; - patches = [ ./procfs.patch ]; + patches = [ + ./procfs.patch + ./gnu-install-dirs.patch + ]; - nativeBuildInputs = [ cmake python3 which swig lit ] - ++ lib.optionals enableManpages [ python3.pkgs.sphinx python3.pkgs.recommonmark ]; + outputs = [ "out" "lib" "dev" ]; + + nativeBuildInputs = [ + cmake python3 which swig lit + ] ++ lib.optionals enableManpages [ + python3.pkgs.sphinx python3.pkgs.recommonmark + ]; buildInputs = [ - ncurses - zlib - libedit - libxml2 - llvm - ] - ++ lib.optionals stdenv.isDarwin [ + ncurses zlib libedit libxml2 libllvm + ] ++ lib.optionals stdenv.isDarwin [ darwin.libobjc darwin.apple_sdk.libs.xpc darwin.apple_sdk.frameworks.Foundation @@ -46,8 +49,9 @@ stdenv.mkDerivation (rec { hardeningDisable = [ "format" ]; cmakeFlags = [ + "-DLLDB_INCLUDE_TESTS=${if doCheck then "YES" else "NO"}" "-DLLVM_ENABLE_RTTI=OFF" - "-DClang_DIR=${clang-unwrapped}/lib/cmake" + "-DClang_DIR=${libclang.dev}/lib/cmake" "-DLLVM_EXTERNAL_LIT=${lit}/bin/lit" ] ++ lib.optionals stdenv.isDarwin [ "-DLLDB_USE_SYSTEM_DEBUGSERVER=ON" @@ -57,33 +61,38 @@ stdenv.mkDerivation (rec { "-DLLVM_ENABLE_SPHINX=ON" "-DSPHINX_OUTPUT_MAN=ON" "-DSPHINX_OUTPUT_HTML=OFF" + ] ++ lib.optionals doCheck [ + "-DLLDB_TEST_C_COMPILER=${stdenv.cc}/bin/${stdenv.cc.targetPrefix}cc" + "-DLLDB_TEST_CXX_COMPILER=${stdenv.cc}/bin/${stdenv.cc.targetPrefix}c++" ]; + doCheck = false; + postInstall = '' # Editor support # vscode: install -D ../tools/lldb-vscode/package.json $out/share/vscode/extensions/llvm-org.lldb-vscode-0.1.0/package.json mkdir -p $out/share/vscode/extensions/llvm-org.lldb-vscode-0.1.0/bin - ln -s $out/bin/lldb-vscode $out/share/vscode/extensions/llvm-org.lldb-vscode-0.1.0/bin + ln -s $out/bin/llvm-vscode $out/share/vscode/extensions/llvm-org.lldb-vscode-0.1.0/bin ''; meta = with lib; { description = "A next-generation high-performance debugger"; - homepage = "https://lldb.llvm.org"; - license = licenses.ncsa; - platforms = platforms.all; + homepage = "https://lldb.llvm.org"; + license = licenses.ncsa; + platforms = platforms.all; }; } // lib.optionalAttrs enableManpages { pname = "lldb-manpages"; buildPhase = '' - make docs-lldb-man + make docs-man ''; propagatedBuildInputs = []; + # manually install lldb man page installPhase = '' - # manually install lldb man page mkdir -p $out/share/man/man1 install docs/man/lldb.1 -t $out/share/man/man1/ ''; diff --git a/pkgs/development/compilers/llvm/10/lldb/gnu-install-dirs.patch b/pkgs/development/compilers/llvm/10/lldb/gnu-install-dirs.patch new file mode 100644 index 00000000000..053a580e45e --- /dev/null +++ b/pkgs/development/compilers/llvm/10/lldb/gnu-install-dirs.patch @@ -0,0 +1,65 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 573b8556989e..a12cc6f6ba77 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -17,6 +17,8 @@ set(CMAKE_MODULE_PATH + # If we are not building as part of LLVM, build LLDB as a standalone project, + # using LLVM as an external library. + if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR) ++ include(GNUInstallDirs) ++ + project(lldb) + include(LLDBStandalone) + +diff --git a/cmake/modules/AddLLDB.cmake b/cmake/modules/AddLLDB.cmake +index ecf0b66a41a3..6f2d97af7a11 100644 +--- a/cmake/modules/AddLLDB.cmake ++++ b/cmake/modules/AddLLDB.cmake +@@ -107,13 +107,13 @@ function(add_lldb_library name) + endif() + + if(PARAM_SHARED) +- set(install_dest lib${LLVM_LIBDIR_SUFFIX}) ++ set(install_dest ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}) + if(PARAM_INSTALL_PREFIX) + set(install_dest ${PARAM_INSTALL_PREFIX}) + endif() + # RUNTIME is relevant for DLL platforms, FRAMEWORK for macOS + install(TARGETS ${name} COMPONENT ${name} +- RUNTIME DESTINATION bin ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${install_dest} + ARCHIVE DESTINATION ${install_dest} + FRAMEWORK DESTINATION ${install_dest}) +diff --git a/cmake/modules/LLDBConfig.cmake b/cmake/modules/LLDBConfig.cmake +index 4a15a343ee1d..c74bbb6878d7 100644 +--- a/cmake/modules/LLDBConfig.cmake ++++ b/cmake/modules/LLDBConfig.cmake +@@ -238,7 +238,7 @@ include_directories(BEFORE + if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY) + install(DIRECTORY include/ + COMPONENT lldb-headers +- DESTINATION include ++ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} + FILES_MATCHING + PATTERN "*.h" + PATTERN ".svn" EXCLUDE +@@ -247,7 +247,7 @@ if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY) + + install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/include/ + COMPONENT lldb-headers +- DESTINATION include ++ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} + FILES_MATCHING + PATTERN "*.h" + PATTERN ".svn" EXCLUDE +diff --git a/tools/intel-features/CMakeLists.txt b/tools/intel-features/CMakeLists.txt +index aff75d7db334..98a527c5e761 100644 +--- a/tools/intel-features/CMakeLists.txt ++++ b/tools/intel-features/CMakeLists.txt +@@ -64,4 +64,4 @@ if (LLDB_ENABLE_PYTHON AND LLDB_BUILD_INTEL_PT) + endif() + + install(TARGETS lldbIntelFeatures +- LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX}) ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}) diff --git a/pkgs/development/compilers/llvm/10/llvm/default.nix b/pkgs/development/compilers/llvm/10/llvm/default.nix index 3100eaf4db4..22ed308486d 100644 --- a/pkgs/development/compilers/llvm/10/llvm/default.nix +++ b/pkgs/development/compilers/llvm/10/llvm/default.nix @@ -1,4 +1,5 @@ { lib, stdenv +, pkgsBuildBuild , fetch , cmake , python3 @@ -10,10 +11,10 @@ , version , release_version , zlib -, buildPackages +, buildLlvmTools , debugVersion ? false , enableManpages ? false -, enableSharedLibraries ? true +, enableSharedLibraries ? !stdenv.hostPlatform.isStatic , enablePFM ? !(stdenv.isDarwin || stdenv.isAarch64 # broken for Ampere eMAG 8180 (c2.large.arm on Packet) #56245 || stdenv.isAarch32 # broken for the armv7l builder @@ -44,8 +45,7 @@ in stdenv.mkDerivation (rec { mv polly-* $sourceRoot/tools/polly ''; - outputs = [ "out" "python" ] - ++ optional enableSharedLibraries "lib"; + outputs = [ "out" "lib" "dev" "python" ]; nativeBuildInputs = [ cmake python3 ] ++ optionals enableManpages [ python3.pkgs.sphinx python3.pkgs.recommonmark ]; @@ -55,10 +55,14 @@ in stdenv.mkDerivation (rec { propagatedBuildInputs = [ ncurses zlib ]; + patches = [ + ./gnu-install-dirs.patch + ] ++ lib.optional enablePolly ./gnu-install-dirs-polly.patch; + postPatch = optionalString stdenv.isDarwin '' substituteInPlace cmake/modules/AddLLVM.cmake \ --replace 'set(_install_name_dir INSTALL_NAME_DIR "@rpath")' "set(_install_name_dir)" \ - --replace 'set(_install_rpath "@loader_path/../lib''${LLVM_LIBDIR_SUFFIX}" ''${extra_libdir})' "" + --replace 'set(_install_rpath "@loader_path/../''${CMAKE_INSTALL_LIBDIR}''${LLVM_LIBDIR_SUFFIX}" ''${extra_libdir})' "" '' # Patch llvm-config to return correct library path based on --link-{shared,static}. + optionalString (enableSharedLibraries) '' @@ -97,6 +101,7 @@ in stdenv.mkDerivation (rec { ''; cmakeFlags = with stdenv; [ + "-DLLVM_INSTALL_CMAKE_DIR=${placeholder "dev"}/lib/cmake/llvm/" "-DCMAKE_BUILD_TYPE=${if debugVersion then "Debug" else "Release"}" "-DLLVM_INSTALL_UTILS=ON" # Needed by rustc "-DLLVM_BUILD_TESTS=ON" @@ -120,7 +125,20 @@ in stdenv.mkDerivation (rec { "-DCAN_TARGET_i386=false" ] ++ optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ "-DCMAKE_CROSSCOMPILING=True" - "-DLLVM_TABLEGEN=${buildPackages.llvm_10}/bin/llvm-tblgen" + "-DLLVM_TABLEGEN=${buildLlvmTools.llvm}/bin/llvm-tblgen" + ( + let + nativeCC = pkgsBuildBuild.targetPackages.stdenv.cc; + nativeBintools = nativeCC.bintools.bintools; + nativeToolchainFlags = [ + "-DCMAKE_C_COMPILER=${nativeCC}/bin/${nativeCC.targetPrefix}cc" + "-DCMAKE_CXX_COMPILER=${nativeCC}/bin/${nativeCC.targetPrefix}c++" + "-DCMAKE_AR=${nativeBintools}/bin/${nativeBintools.targetPrefix}ar" + "-DCMAKE_STRIP=${nativeBintools}/bin/${nativeBintools.targetPrefix}strip" + "-DCMAKE_RANLIB=${nativeBintools}/bin/${nativeBintools.targetPrefix}ranlib" + ]; + in "-DCROSS_TOOLCHAIN_FLAGS_NATIVE:list=${lib.concatStringsSep ";" nativeToolchainFlags}" + ) ]; postBuild = '' @@ -134,20 +152,19 @@ in stdenv.mkDerivation (rec { postInstall = '' mkdir -p $python/share mv $out/share/opt-viewer $python/share/opt-viewer - '' - + optionalString enableSharedLibraries '' - moveToOutput "lib/libLLVM-*" "$lib" - moveToOutput "lib/libLLVM${stdenv.hostPlatform.extensions.sharedLibrary}" "$lib" - '' - + optionalString (enableSharedLibraries && (!stdenv.isDarwin)) '' - substituteInPlace "$out/lib/cmake/llvm/LLVMExports-${if debugVersion then "debug" else "release"}.cmake" \ - --replace "\''${_IMPORT_PREFIX}/lib/libLLVM-" "$lib/lib/libLLVM-" + moveToOutput "bin/llvm-config*" "$dev" + substituteInPlace "$dev/lib/cmake/llvm/LLVMExports-${if debugVersion then "debug" else "release"}.cmake" \ + --replace "\''${_IMPORT_PREFIX}/lib/lib" "$lib/lib/lib" \ + --replace "$out/bin/llvm-config" "$dev/bin/llvm-config" + substituteInPlace "$dev/lib/cmake/llvm/LLVMConfig.cmake" \ + --replace 'set(LLVM_BINARY_DIR "''${LLVM_INSTALL_PREFIX}")' 'set(LLVM_BINARY_DIR "''${LLVM_INSTALL_PREFIX}'"$lib"'")' '' + optionalString (stdenv.isDarwin && enableSharedLibraries) '' - substituteInPlace "$out/lib/cmake/llvm/LLVMExports-${if debugVersion then "debug" else "release"}.cmake" \ - --replace "\''${_IMPORT_PREFIX}/lib/libLLVM.dylib" "$lib/lib/libLLVM.dylib" ln -s $lib/lib/libLLVM.dylib $lib/lib/libLLVM-${shortVersion}.dylib ln -s $lib/lib/libLLVM.dylib $lib/lib/libLLVM-${release_version}.dylib + '' + + optionalString (stdenv.buildPlatform != stdenv.hostPlatform) '' + cp NATIVE/bin/llvm-config $dev/bin/llvm-config-native ''; doCheck = stdenv.isLinux && (!stdenv.isx86_32); diff --git a/pkgs/development/compilers/llvm/10/llvm/gnu-install-dirs-polly.patch b/pkgs/development/compilers/llvm/10/llvm/gnu-install-dirs-polly.patch new file mode 100644 index 00000000000..3353058d8ab --- /dev/null +++ b/pkgs/development/compilers/llvm/10/llvm/gnu-install-dirs-polly.patch @@ -0,0 +1,106 @@ +diff --git a/tools/polly/CMakeLists.txt b/tools/polly/CMakeLists.txt +index 9939097f743e..8cc538da912a 100644 +--- a/tools/polly/CMakeLists.txt ++++ b/tools/polly/CMakeLists.txt +@@ -2,7 +2,11 @@ + if (NOT DEFINED LLVM_MAIN_SRC_DIR) + project(Polly) + cmake_minimum_required(VERSION 3.4.3) ++endif() ++ ++include(GNUInstallDirs) + ++if (NOT DEFINED LLVM_MAIN_SRC_DIR) + # Where is LLVM installed? + find_package(LLVM CONFIG REQUIRED) + set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${LLVM_CMAKE_DIR}) +@@ -145,14 +149,14 @@ include_directories( + + if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY) + install(DIRECTORY include/ +- DESTINATION include ++ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} + FILES_MATCHING + PATTERN "*.h" + PATTERN ".svn" EXCLUDE + ) + + install(DIRECTORY ${POLLY_BINARY_DIR}/include/ +- DESTINATION include ++ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} + FILES_MATCHING + PATTERN "*.h" + PATTERN "CMakeFiles" EXCLUDE +diff --git a/tools/polly/cmake/CMakeLists.txt b/tools/polly/cmake/CMakeLists.txt +index 211f95512717..f9e04a4844b6 100644 +--- a/tools/polly/cmake/CMakeLists.txt ++++ b/tools/polly/cmake/CMakeLists.txt +@@ -79,18 +79,18 @@ file(GENERATE + + # Generate PollyConfig.cmake for the install tree. + unset(POLLY_EXPORTS) +-set(POLLY_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}") ++set(POLLY_INSTALL_PREFIX "") + set(POLLY_CONFIG_LLVM_CMAKE_DIR "${LLVM_BINARY_DIR}/${LLVM_INSTALL_PACKAGE_DIR}") +-set(POLLY_CONFIG_CMAKE_DIR "${POLLY_INSTALL_PREFIX}/${POLLY_INSTALL_PACKAGE_DIR}") +-set(POLLY_CONFIG_LIBRARY_DIRS "${POLLY_INSTALL_PREFIX}/lib${LLVM_LIBDIR_SUFFIX}") ++set(POLLY_CONFIG_CMAKE_DIR "${POLLY_INSTALL_PREFIX}${CMAKE_INSTALL_PREFIX}/${POLLY_INSTALL_PACKAGE_DIR}") ++set(POLLY_CONFIG_LIBRARY_DIRS "${POLLY_INSTALL_PREFIX}${CMAKE_INSTALL_FULL_LIBDIR}${LLVM_LIBDIR_SUFFIX}") + if (POLLY_BUNDLED_ISL) + set(POLLY_CONFIG_INCLUDE_DIRS +- "${POLLY_INSTALL_PREFIX}/include" +- "${POLLY_INSTALL_PREFIX}/include/polly" ++ "${POLLY_INSTALL_PREFIX}${CMAKE_INSTALL_FULL_LIBDIR}" ++ "${POLLY_INSTALL_PREFIX}${CMAKE_INSTALL_FULL_LIBDIR}/polly" + ) + else() + set(POLLY_CONFIG_INCLUDE_DIRS +- "${POLLY_INSTALL_PREFIX}/include" ++ "${POLLY_INSTALL_PREFIX}${CMAKE_INSTALL_FULL_INCLUDEDIR}" + ${ISL_INCLUDE_DIRS} + ) + endif() +@@ -100,12 +100,12 @@ endif() + foreach(tgt IN LISTS POLLY_CONFIG_EXPORTED_TARGETS) + get_target_property(tgt_type ${tgt} TYPE) + if (tgt_type STREQUAL "EXECUTABLE") +- set(tgt_prefix "bin/") ++ set(tgt_prefix "${CMAKE_INSTALL_BINDIR}/") + else() +- set(tgt_prefix "lib/") ++ set(tgt_prefix "${CMAKE_INSTALL_LIBDIR}/") + endif() + +- set(tgt_path "${CMAKE_INSTALL_PREFIX}/${tgt_prefix}$") ++ set(tgt_path "${tgt_prefix}$") + file(RELATIVE_PATH tgt_path ${POLLY_CONFIG_CMAKE_DIR} ${tgt_path}) + + if (NOT tgt_type STREQUAL "INTERFACE_LIBRARY") +diff --git a/tools/polly/cmake/polly_macros.cmake b/tools/polly/cmake/polly_macros.cmake +index 86de6f10686e..91f30891ccbe 100644 +--- a/tools/polly/cmake/polly_macros.cmake ++++ b/tools/polly/cmake/polly_macros.cmake +@@ -44,8 +44,8 @@ macro(add_polly_library name) + if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY OR ${name} STREQUAL "LLVMPolly") + install(TARGETS ${name} + EXPORT LLVMExports +- LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX} +- ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX}) ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}) + endif() + set_property(GLOBAL APPEND PROPERTY LLVM_EXPORTS ${name}) + endmacro(add_polly_library) +diff --git a/tools/polly/lib/External/CMakeLists.txt b/tools/polly/lib/External/CMakeLists.txt +index 8ffd984e542b..261cc19f3238 100644 +--- a/tools/polly/lib/External/CMakeLists.txt ++++ b/tools/polly/lib/External/CMakeLists.txt +@@ -274,7 +274,7 @@ if (POLLY_BUNDLED_ISL) + install(DIRECTORY + ${ISL_SOURCE_DIR}/include/ + ${ISL_BINARY_DIR}/include/ +- DESTINATION include/polly ++ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/polly + FILES_MATCHING + PATTERN "*.h" + PATTERN "CMakeFiles" EXCLUDE diff --git a/pkgs/development/compilers/llvm/10/llvm/gnu-install-dirs.patch b/pkgs/development/compilers/llvm/10/llvm/gnu-install-dirs.patch new file mode 100644 index 00000000000..155bab32f43 --- /dev/null +++ b/pkgs/development/compilers/llvm/10/llvm/gnu-install-dirs.patch @@ -0,0 +1,416 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 0e85afa82c76..3e700d9c5fae 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -253,15 +253,21 @@ if (CMAKE_BUILD_TYPE AND + message(FATAL_ERROR "Invalid value for CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}") + endif() + ++include(GNUInstallDirs) ++ + set(LLVM_LIBDIR_SUFFIX "" CACHE STRING "Define suffix of library directory name (32/64)" ) + +-set(LLVM_TOOLS_INSTALL_DIR "bin" CACHE STRING "Path for binary subdirectory (defaults to 'bin')") ++set(LLVM_TOOLS_INSTALL_DIR "${CMAKE_INSTALL_BINDIR}" CACHE STRING ++ "Path for binary subdirectory (defaults to 'bin')") + mark_as_advanced(LLVM_TOOLS_INSTALL_DIR) + + set(LLVM_UTILS_INSTALL_DIR "${LLVM_TOOLS_INSTALL_DIR}" CACHE STRING + "Path to install LLVM utilities (enabled by LLVM_INSTALL_UTILS=ON) (defaults to LLVM_TOOLS_INSTALL_DIR)") + mark_as_advanced(LLVM_UTILS_INSTALL_DIR) + ++set(LLVM_INSTALL_CMAKE_DIR "${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}/cmake/llvm" CACHE STRING ++ "Path for CMake subdirectory (defaults to lib/cmake/llvm)" ) ++ + # They are used as destination of target generators. + set(LLVM_RUNTIME_OUTPUT_INTDIR ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bin) + set(LLVM_LIBRARY_OUTPUT_INTDIR ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/lib${LLVM_LIBDIR_SUFFIX}) +@@ -527,9 +533,9 @@ option (LLVM_ENABLE_SPHINX "Use Sphinx to generate llvm documentation." OFF) + option (LLVM_ENABLE_OCAMLDOC "Build OCaml bindings documentation." ON) + option (LLVM_ENABLE_BINDINGS "Build bindings." ON) + +-set(LLVM_INSTALL_DOXYGEN_HTML_DIR "share/doc/llvm/doxygen-html" ++set(LLVM_INSTALL_DOXYGEN_HTML_DIR "${CMAKE_INSTALL_DOCDIR}/${project}/doxygen-html" + CACHE STRING "Doxygen-generated HTML documentation install directory") +-set(LLVM_INSTALL_OCAMLDOC_HTML_DIR "share/doc/llvm/ocaml-html" ++set(LLVM_INSTALL_OCAMLDOC_HTML_DIR "${CMAKE_INSTALL_DOCDIR}/${project}/ocaml-html" + CACHE STRING "OCamldoc-generated HTML documentation install directory") + + option (LLVM_BUILD_EXTERNAL_COMPILER_RT +@@ -993,7 +999,7 @@ endif() + + if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY) + install(DIRECTORY include/llvm include/llvm-c +- DESTINATION include ++ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} + COMPONENT llvm-headers + FILES_MATCHING + PATTERN "*.def" +@@ -1005,7 +1011,7 @@ if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY) + ) + + install(DIRECTORY ${LLVM_INCLUDE_DIR}/llvm ${LLVM_INCLUDE_DIR}/llvm-c +- DESTINATION include ++ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} + COMPONENT llvm-headers + FILES_MATCHING + PATTERN "*.def" +@@ -1020,13 +1026,13 @@ if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY) + + if (LLVM_INSTALL_MODULEMAPS) + install(DIRECTORY include/llvm include/llvm-c +- DESTINATION include ++ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} + COMPONENT llvm-headers + FILES_MATCHING + PATTERN "module.modulemap" + ) + install(FILES include/llvm/module.install.modulemap +- DESTINATION include/llvm ++ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/llvm + COMPONENT llvm-headers + RENAME "module.extern.modulemap" + ) +diff --git a/cmake/modules/AddLLVM.cmake b/cmake/modules/AddLLVM.cmake +index f5a1b0d6f238..a7387224d68f 100644 +--- a/cmake/modules/AddLLVM.cmake ++++ b/cmake/modules/AddLLVM.cmake +@@ -729,9 +729,9 @@ macro(add_llvm_library name) + + install(TARGETS ${name} + ${export_to_llvmexports} +- LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX} COMPONENT ${name} +- ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX} COMPONENT ${name} +- RUNTIME DESTINATION bin COMPONENT ${name}) ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX} COMPONENT ${name} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX} COMPONENT ${name} ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT ${name}) + + if (NOT LLVM_ENABLE_IDE) + add_llvm_install_targets(install-${name} +@@ -934,7 +934,7 @@ function(process_llvm_pass_plugins) + "set(LLVM_STATIC_EXTENSIONS ${LLVM_STATIC_EXTENSIONS})") + install(FILES + ${llvm_cmake_builddir}/LLVMConfigExtensions.cmake +- DESTINATION ${LLVM_INSTALL_PACKAGE_DIR} ++ DESTINATION ${LLVM_INSTALL_CMAKE_DIR} + COMPONENT cmake-exports) + + set(ExtensionDef "${LLVM_BINARY_DIR}/include/llvm/Support/Extension.def") +@@ -1147,7 +1147,7 @@ macro(add_llvm_example name) + endif() + add_llvm_executable(${name} ${ARGN}) + if( LLVM_BUILD_EXAMPLES ) +- install(TARGETS ${name} RUNTIME DESTINATION examples) ++ install(TARGETS ${name} RUNTIME DESTINATION ${CMAKE_INSTALL_DOCDIR}/examples) + endif() + set_target_properties(${name} PROPERTIES FOLDER "Examples") + endmacro(add_llvm_example name) +@@ -1713,7 +1713,7 @@ function(llvm_install_library_symlink name dest type) + set(full_name ${CMAKE_${type}_LIBRARY_PREFIX}${name}${CMAKE_${type}_LIBRARY_SUFFIX}) + set(full_dest ${CMAKE_${type}_LIBRARY_PREFIX}${dest}${CMAKE_${type}_LIBRARY_SUFFIX}) + +- set(output_dir lib${LLVM_LIBDIR_SUFFIX}) ++ set(output_dir ${CMAKE_INSTALL_FULL_LIBDIR}${LLVM_LIBDIR_SUFFIX}) + if(WIN32 AND "${type}" STREQUAL "SHARED") + set(output_dir bin) + endif() +@@ -1730,7 +1730,7 @@ function(llvm_install_library_symlink name dest type) + endif() + endfunction() + +-function(llvm_install_symlink name dest) ++function(llvm_install_symlink name dest output_dir) + cmake_parse_arguments(ARG "ALWAYS_GENERATE" "COMPONENT" "" ${ARGN}) + foreach(path ${CMAKE_MODULE_PATH}) + if(EXISTS ${path}/LLVMInstallSymlink.cmake) +@@ -1753,7 +1753,7 @@ function(llvm_install_symlink name dest) + set(full_dest ${dest}${CMAKE_EXECUTABLE_SUFFIX}) + + install(SCRIPT ${INSTALL_SYMLINK} +- CODE "install_symlink(${full_name} ${full_dest} ${LLVM_TOOLS_INSTALL_DIR})" ++ CODE "install_symlink(${full_name} ${full_dest} ${output_dir})" + COMPONENT ${component}) + + if (NOT LLVM_ENABLE_IDE AND NOT ARG_ALWAYS_GENERATE) +@@ -1836,7 +1836,8 @@ function(add_llvm_tool_symlink link_name target) + endif() + + if ((TOOL_IS_TOOLCHAIN OR NOT LLVM_INSTALL_TOOLCHAIN_ONLY) AND LLVM_BUILD_TOOLS) +- llvm_install_symlink(${link_name} ${target}) ++ GNUInstallDirs_get_absolute_install_dir(output_dir LLVM_TOOLS_INSTALL_DIR) ++ llvm_install_symlink(${link_name} ${target} ${output_dir}) + endif() + endif() + endfunction() +@@ -1958,9 +1959,9 @@ function(llvm_setup_rpath name) + + if (APPLE) + set(_install_name_dir INSTALL_NAME_DIR "@rpath") +- set(_install_rpath "@loader_path/../lib${LLVM_LIBDIR_SUFFIX}" ${extra_libdir}) ++ set(_install_rpath "@loader_path/../${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}" ${extra_libdir}) + elseif(UNIX) +- set(_install_rpath "\$ORIGIN/../lib${LLVM_LIBDIR_SUFFIX}" ${extra_libdir}) ++ set(_install_rpath "\$ORIGIN/../${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}" ${extra_libdir}) + if(${CMAKE_SYSTEM_NAME} MATCHES "(FreeBSD|DragonFly)") + set_property(TARGET ${name} APPEND_STRING PROPERTY + LINK_FLAGS " -Wl,-z,origin ") +diff --git a/cmake/modules/AddOCaml.cmake b/cmake/modules/AddOCaml.cmake +index 554046b20edf..4d1ad980641e 100644 +--- a/cmake/modules/AddOCaml.cmake ++++ b/cmake/modules/AddOCaml.cmake +@@ -144,9 +144,9 @@ function(add_ocaml_library name) + endforeach() + + if( APPLE ) +- set(ocaml_rpath "@executable_path/../../../lib${LLVM_LIBDIR_SUFFIX}") ++ set(ocaml_rpath "@executable_path/../../../${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}") + elseif( UNIX ) +- set(ocaml_rpath "\\$ORIGIN/../../../lib${LLVM_LIBDIR_SUFFIX}") ++ set(ocaml_rpath "\\$ORIGIN/../../../${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}") + endif() + list(APPEND ocaml_flags "-ldopt" "-Wl,-rpath,${ocaml_rpath}") + +diff --git a/cmake/modules/AddSphinxTarget.cmake b/cmake/modules/AddSphinxTarget.cmake +index 2bf654b60c44..450ee45d86e6 100644 +--- a/cmake/modules/AddSphinxTarget.cmake ++++ b/cmake/modules/AddSphinxTarget.cmake +@@ -78,7 +78,7 @@ function (add_sphinx_target builder project) + endif() + elseif (builder STREQUAL html) + string(TOUPPER "${project}" project_upper) +- set(${project_upper}_INSTALL_SPHINX_HTML_DIR "share/doc/${project}/html" ++ set(${project_upper}_INSTALL_SPHINX_HTML_DIR "${CMAKE_INSTALL_DOCDIR}/${project}/html" + CACHE STRING "HTML documentation install directory for ${project}") + + # '/.' indicates: copy the contents of the directory directly into +diff --git a/cmake/modules/CMakeLists.txt b/cmake/modules/CMakeLists.txt +index af757d6199a8..b0fb7e7705d1 100644 +--- a/cmake/modules/CMakeLists.txt ++++ b/cmake/modules/CMakeLists.txt +@@ -1,4 +1,4 @@ +-set(LLVM_INSTALL_PACKAGE_DIR lib${LLVM_LIBDIR_SUFFIX}/cmake/llvm) ++set(LLVM_INSTALL_PACKAGE_DIR ${LLVM_INSTALL_CMAKE_DIR} CACHE STRING "Path for CMake subdirectory (defaults to 'cmake/llvm')") + set(llvm_cmake_builddir "${LLVM_BINARY_DIR}/${LLVM_INSTALL_PACKAGE_DIR}") + + # First for users who use an installed LLVM, create the LLVMExports.cmake file. +@@ -96,13 +96,13 @@ foreach(p ${_count}) + set(LLVM_CONFIG_CODE "${LLVM_CONFIG_CODE} + get_filename_component(LLVM_INSTALL_PREFIX \"\${LLVM_INSTALL_PREFIX}\" PATH)") + endforeach(p) +-set(LLVM_CONFIG_INCLUDE_DIRS "\${LLVM_INSTALL_PREFIX}/include") ++set(LLVM_CONFIG_INCLUDE_DIRS "\${LLVM_INSTALL_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR}") + set(LLVM_CONFIG_INCLUDE_DIR "${LLVM_CONFIG_INCLUDE_DIRS}") + set(LLVM_CONFIG_MAIN_INCLUDE_DIR "${LLVM_CONFIG_INCLUDE_DIRS}") +-set(LLVM_CONFIG_LIBRARY_DIRS "\${LLVM_INSTALL_PREFIX}/lib\${LLVM_LIBDIR_SUFFIX}") ++set(LLVM_CONFIG_LIBRARY_DIRS "\${LLVM_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}\${LLVM_LIBDIR_SUFFIX}") + set(LLVM_CONFIG_CMAKE_DIR "\${LLVM_INSTALL_PREFIX}/${LLVM_INSTALL_PACKAGE_DIR}") + set(LLVM_CONFIG_BINARY_DIR "\${LLVM_INSTALL_PREFIX}") +-set(LLVM_CONFIG_TOOLS_BINARY_DIR "\${LLVM_INSTALL_PREFIX}/bin") ++set(LLVM_CONFIG_TOOLS_BINARY_DIR "\${LLVM_INSTALL_PREFIX}/${CMAKE_INSTALL_BINDIR}") + set(LLVM_CONFIG_EXPORTS_FILE "\${LLVM_CMAKE_DIR}/LLVMExports.cmake") + set(LLVM_CONFIG_EXPORTS "${LLVM_EXPORTS}") + configure_file( +diff --git a/cmake/modules/LLVMInstallSymlink.cmake b/cmake/modules/LLVMInstallSymlink.cmake +index 09fed8085c23..aa79f192abf0 100644 +--- a/cmake/modules/LLVMInstallSymlink.cmake ++++ b/cmake/modules/LLVMInstallSymlink.cmake +@@ -10,7 +10,7 @@ function(install_symlink name target outdir) + set(LINK_OR_COPY copy) + endif() + +- set(bindir "${DESTDIR}${CMAKE_INSTALL_PREFIX}/${outdir}/") ++ set(bindir "${DESTDIR}${outdir}/") + + message(STATUS "Creating ${name}") + +diff --git a/docs/CMake.rst b/docs/CMake.rst +index a86ebb3a37bd..e720711e2b3c 100644 +--- a/docs/CMake.rst ++++ b/docs/CMake.rst +@@ -196,7 +196,7 @@ CMake manual, or execute ``cmake --help-variable VARIABLE_NAME``. + **LLVM_LIBDIR_SUFFIX**:STRING + Extra suffix to append to the directory where libraries are to be + installed. On a 64-bit architecture, one could use ``-DLLVM_LIBDIR_SUFFIX=64`` +- to install libraries to ``/usr/lib64``. ++ to install libraries to ``/usr/lib64``. See also ``CMAKE_INSTALL_LIBDIR``. + + **CMAKE_C_FLAGS**:STRING + Extra flags to use when compiling C source files. +@@ -516,8 +516,8 @@ LLVM-specific variables + + **LLVM_INSTALL_DOXYGEN_HTML_DIR**:STRING + The path to install Doxygen-generated HTML documentation to. This path can +- either be absolute or relative to the CMAKE_INSTALL_PREFIX. Defaults to +- `share/doc/llvm/doxygen-html`. ++ either be absolute or relative to the ``CMAKE_INSTALL_PREFIX``. Defaults to ++ `${CMAKE_INSTALL_DOCDIR}/${project}/doxygen-html`. + + **LLVM_ENABLE_SPHINX**:BOOL + If specified, CMake will search for the ``sphinx-build`` executable and will make +@@ -548,13 +548,33 @@ LLVM-specific variables + + **LLVM_INSTALL_SPHINX_HTML_DIR**:STRING + The path to install Sphinx-generated HTML documentation to. This path can +- either be absolute or relative to the CMAKE_INSTALL_PREFIX. Defaults to +- `share/doc/llvm/html`. ++ either be absolute or relative to the ``CMAKE_INSTALL_PREFIX``. Defaults to ++ `${CMAKE_INSTALL_DOCDIR}/${project}/html`. + + **LLVM_INSTALL_OCAMLDOC_HTML_DIR**:STRING + The path to install OCamldoc-generated HTML documentation to. This path can +- either be absolute or relative to the CMAKE_INSTALL_PREFIX. Defaults to +- `share/doc/llvm/ocaml-html`. ++ either be absolute or relative to the ``CMAKE_INSTALL_PREFIX``. Defaults to ++ `${CMAKE_INSTALL_DOCDIR}/${project}/ocaml-html`. ++ ++**CMAKE_INSTALL_BINDIR**:STRING ++ The path to install binary tools, relative to the ``CMAKE_INSTALL_PREFIX``. ++ Defaults to `bin`. ++ ++**CMAKE_INSTALL_LIBDIR**:STRING ++ The path to install libraries, relative to the ``CMAKE_INSTALL_PREFIX``. ++ Defaults to `lib`. ++ ++**CMAKE_INSTALL_INCLUDEDIR**:STRING ++ The path to install header files, relative to the ``CMAKE_INSTALL_PREFIX``. ++ Defaults to `include`. ++ ++**CMAKE_INSTALL_DOCDIR**:STRING ++ The path to install documentation, relative to the ``CMAKE_INSTALL_PREFIX``. ++ Defaults to `share/doc`. ++ ++**CMAKE_INSTALL_MANDIR**:STRING ++ The path to install manpage files, relative to the ``CMAKE_INSTALL_PREFIX``. ++ Defaults to `share/man`. + + **LLVM_CREATE_XCODE_TOOLCHAIN**:BOOL + macOS Only: If enabled CMake will generate a target named +@@ -740,9 +760,11 @@ the ``cmake`` command or by setting it directly in ``ccmake`` or ``cmake-gui``). + + This file is available in two different locations. + +-* ``/lib/cmake/llvm/LLVMConfig.cmake`` where +- ```` is the install prefix of an installed version of LLVM. +- On Linux typically this is ``/usr/lib/cmake/llvm/LLVMConfig.cmake``. ++* ``LLVMConfig.cmake`` where ++ ```` is the location where LLVM CMake modules are ++ installed as part of an installed version of LLVM. This is typically ++ ``cmake/llvm/`` within the lib directory. On Linux, this is typically ++ ``/usr/lib/cmake/llvm/LLVMConfig.cmake``. + + * ``/lib/cmake/llvm/LLVMConfig.cmake`` where + ```` is the root of the LLVM build tree. **Note: this is only +diff --git a/examples/Bye/CMakeLists.txt b/examples/Bye/CMakeLists.txt +index 3206f90d0916..1822965fc35f 100644 +--- a/examples/Bye/CMakeLists.txt ++++ b/examples/Bye/CMakeLists.txt +@@ -9,5 +9,5 @@ add_llvm_pass_plugin(Bye + BUILDTREE_ONLY + ) + +-install(TARGETS ${name} RUNTIME DESTINATION examples) ++install(TARGETS ${name} RUNTIME DESTINATION ${CMAKE_INSTALL_DOCDIR}/examples) + set_target_properties(${name} PROPERTIES FOLDER "Examples") +diff --git a/include/llvm/CMakeLists.txt b/include/llvm/CMakeLists.txt +index 1d5ca3ba92b0..026f5453c1da 100644 +--- a/include/llvm/CMakeLists.txt ++++ b/include/llvm/CMakeLists.txt +@@ -4,5 +4,5 @@ add_subdirectory(Support) + # If we're doing an out-of-tree build, copy a module map for generated + # header files into the build area. + if (NOT "${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}") +- configure_file(module.modulemap.build module.modulemap COPYONLY) ++ configure_file(module.modulemap.build ${LLVM_INCLUDE_DIR}/module.modulemap COPYONLY) + endif (NOT "${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}") +diff --git a/tools/llvm-config/BuildVariables.inc.in b/tools/llvm-config/BuildVariables.inc.in +index 63cef75368b7..6295478b1f3d 100644 +--- a/tools/llvm-config/BuildVariables.inc.in ++++ b/tools/llvm-config/BuildVariables.inc.in +@@ -23,6 +23,10 @@ + #define LLVM_CXXFLAGS "@LLVM_CXXFLAGS@" + #define LLVM_BUILDMODE "@LLVM_BUILDMODE@" + #define LLVM_LIBDIR_SUFFIX "@LLVM_LIBDIR_SUFFIX@" ++#define LLVM_INSTALL_BINDIR "@CMAKE_INSTALL_BINDIR@" ++#define LLVM_INSTALL_LIBDIR "@CMAKE_INSTALL_LIBDIR@" ++#define LLVM_INSTALL_INCLUDEDIR "@CMAKE_INSTALL_INCLUDEDIR@" ++#define LLVM_INSTALL_CMAKEDIR "@LLVM_INSTALL_CMAKE_DIR@" + #define LLVM_TARGETS_BUILT "@LLVM_TARGETS_BUILT@" + #define LLVM_SYSTEM_LIBS "@LLVM_SYSTEM_LIBS@" + #define LLVM_BUILD_SYSTEM "@LLVM_BUILD_SYSTEM@" +diff --git a/tools/llvm-config/llvm-config.cpp b/tools/llvm-config/llvm-config.cpp +index fb12e29a36a8..dbb6c2b90332 100644 +--- a/tools/llvm-config/llvm-config.cpp ++++ b/tools/llvm-config/llvm-config.cpp +@@ -358,12 +358,26 @@ int main(int argc, char **argv) { + ("-I" + ActiveIncludeDir + " " + "-I" + ActiveObjRoot + "/include"); + } else { + ActivePrefix = CurrentExecPrefix; +- ActiveIncludeDir = ActivePrefix + "/include"; +- SmallString<256> path(StringRef(LLVM_TOOLS_INSTALL_DIR)); +- sys::fs::make_absolute(ActivePrefix, path); +- ActiveBinDir = path.str(); +- ActiveLibDir = ActivePrefix + "/lib" + LLVM_LIBDIR_SUFFIX; +- ActiveCMakeDir = ActiveLibDir + "/cmake/llvm"; ++ { ++ SmallString<256> path(StringRef(LLVM_INSTALL_INCLUDEDIR)); ++ sys::fs::make_absolute(ActivePrefix, path); ++ ActiveIncludeDir = std::string(path.str()); ++ } ++ { ++ SmallString<256> path(StringRef(LLVM_INSTALL_BINDIR)); ++ sys::fs::make_absolute(ActivePrefix, path); ++ ActiveBinDir = std::string(path.str()); ++ } ++ { ++ SmallString<256> path(StringRef(LLVM_INSTALL_LIBDIR LLVM_LIBDIR_SUFFIX)); ++ sys::fs::make_absolute(ActivePrefix, path); ++ ActiveLibDir = std::string(path.str()); ++ } ++ { ++ SmallString<256> path(StringRef(LLVM_INSTALL_CMAKEDIR)); ++ sys::fs::make_absolute(ActivePrefix, path); ++ ActiveCMakeDir = std::string(path.str()); ++ } + ActiveIncludeOption = "-I" + ActiveIncludeDir; + } + +diff --git a/tools/lto/CMakeLists.txt b/tools/lto/CMakeLists.txt +index b86e4abd01a7..02ce5773f17d 100644 +--- a/tools/lto/CMakeLists.txt ++++ b/tools/lto/CMakeLists.txt +@@ -23,7 +23,7 @@ set(LLVM_EXPORTED_SYMBOL_FILE ${CMAKE_CURRENT_SOURCE_DIR}/lto.exports) + add_llvm_library(LTO SHARED INSTALL_WITH_TOOLCHAIN ${SOURCES} DEPENDS intrinsics_gen) + + install(FILES ${LLVM_MAIN_INCLUDE_DIR}/llvm-c/lto.h +- DESTINATION include/llvm-c ++ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/llvm-c + COMPONENT LTO) + + if (APPLE) +diff --git a/tools/opt-viewer/CMakeLists.txt b/tools/opt-viewer/CMakeLists.txt +index ead73ec13a8f..250362021f17 100644 +--- a/tools/opt-viewer/CMakeLists.txt ++++ b/tools/opt-viewer/CMakeLists.txt +@@ -8,7 +8,7 @@ set (files + + foreach (file ${files}) + install(PROGRAMS ${file} +- DESTINATION share/opt-viewer ++ DESTINATION ${CMAKE_INSTALL_DATADIR}/opt-viewer + COMPONENT opt-viewer) + endforeach (file) + +diff --git a/tools/remarks-shlib/CMakeLists.txt b/tools/remarks-shlib/CMakeLists.txt +index e948496c603a..1f4df8a98b10 100644 +--- a/tools/remarks-shlib/CMakeLists.txt ++++ b/tools/remarks-shlib/CMakeLists.txt +@@ -11,7 +11,7 @@ set(LLVM_EXPORTED_SYMBOL_FILE ${CMAKE_CURRENT_SOURCE_DIR}/Remarks.exports) + add_llvm_library(Remarks SHARED INSTALL_WITH_TOOLCHAIN ${SOURCES}) + + install(FILES ${LLVM_MAIN_INCLUDE_DIR}/llvm-c/Remarks.h +- DESTINATION include/llvm-c ++ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/llvm-c + COMPONENT Remarks) + + if (APPLE) diff --git a/pkgs/development/compilers/llvm/11/clang/default.nix b/pkgs/development/compilers/llvm/11/clang/default.nix index 2e03112d827..3b7accffbca 100644 --- a/pkgs/development/compilers/llvm/11/clang/default.nix +++ b/pkgs/development/compilers/llvm/11/clang/default.nix @@ -1,4 +1,5 @@ -{ lib, stdenv, fetch, cmake, libxml2, llvm, version, clang-tools-extra_src, python3, lld +{ lib, stdenv, fetch, cmake, libxml2, libllvm, version, clang-tools-extra_src, python3 +, buildLlvmTools , fixDarwinDylibNames , enableManpages ? false }: @@ -19,26 +20,31 @@ let mv clang-tools-extra-* $sourceRoot/tools/extra ''; - nativeBuildInputs = [ cmake python3 lld ] + nativeBuildInputs = [ cmake python3 ] ++ lib.optional enableManpages python3.pkgs.sphinx ++ lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames; - buildInputs = [ libxml2 llvm ]; + buildInputs = [ libxml2 libllvm ]; cmakeFlags = [ "-DCMAKE_CXX_FLAGS=-std=c++14" "-DCLANGD_BUILD_XPC=OFF" + "-DLLVM_CONFIG_PATH=${libllvm.dev}/bin/llvm-config${lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) "-native"}" ] ++ lib.optionals enableManpages [ "-DCLANG_INCLUDE_DOCS=ON" "-DLLVM_ENABLE_SPHINX=ON" "-DSPHINX_OUTPUT_MAN=ON" "-DSPHINX_OUTPUT_HTML=OFF" "-DSPHINX_WARNINGS_AS_ERRORS=OFF" + ] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ + "-DLLVM_TABLEGEN_EXE=${buildLlvmTools.llvm}/bin/llvm-tblgen" + "-DCLANG_TABLEGEN=${buildLlvmTools.libclang.dev}/bin/clang-tblgen" ]; patches = [ ./purity.patch # https://reviews.llvm.org/D51899 + ./gnu-install-dirs.patch ]; postPatch = '' @@ -55,12 +61,12 @@ let --replace "NOT HAVE_CXX_ATOMICS64_WITHOUT_LIB" FALSE ''; - outputs = [ "out" "lib" "python" ]; + outputs = [ "out" "lib" "dev" "python" ]; # Clang expects to find LLVMgold in its own prefix postInstall = '' - if [ -e ${llvm}/lib/LLVMgold.so ]; then - ln -sv ${llvm}/lib/LLVMgold.so $out/lib + 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 @@ -79,11 +85,14 @@ let fi mv $out/share/clang/*.py $python/share/clang rm $out/bin/c-index-test + + mkdir -p $dev/bin + cp bin/clang-tblgen $dev/bin ''; passthru = { isClang = true; - inherit llvm; + inherit libllvm; }; meta = { diff --git a/pkgs/development/compilers/llvm/11/clang/gnu-install-dirs.patch b/pkgs/development/compilers/llvm/11/clang/gnu-install-dirs.patch new file mode 100644 index 00000000000..98ea97e0580 --- /dev/null +++ b/pkgs/development/compilers/llvm/11/clang/gnu-install-dirs.patch @@ -0,0 +1,235 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index bb4b801f01c8..77a8b43b22c8 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -9,6 +9,8 @@ endif() + if( CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR ) + project(Clang) + ++ include(GNUInstallDirs) ++ + set(CMAKE_CXX_STANDARD 14 CACHE STRING "C++ standard to conform to") + set(CMAKE_CXX_STANDARD_REQUIRED YES) + set(CMAKE_CXX_EXTENSIONS NO) +@@ -447,7 +449,7 @@ include_directories(BEFORE + + if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY) + install(DIRECTORY include/clang include/clang-c +- DESTINATION include ++ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} + COMPONENT clang-headers + FILES_MATCHING + PATTERN "*.def" +@@ -457,7 +459,7 @@ if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY) + ) + + install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/include/clang +- DESTINATION include ++ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} + COMPONENT clang-headers + FILES_MATCHING + PATTERN "CMakeFiles" EXCLUDE +@@ -477,7 +479,7 @@ if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY) + + add_custom_target(bash-autocomplete DEPENDS utils/bash-autocomplete.sh) + install(PROGRAMS utils/bash-autocomplete.sh +- DESTINATION share/clang ++ DESTINATION ${CMAKE_INSTALL_DATADIR}/clang + COMPONENT bash-autocomplete) + if(NOT LLVM_ENABLE_IDE) + add_llvm_install_targets(install-bash-autocomplete +diff --git a/cmake/modules/AddClang.cmake b/cmake/modules/AddClang.cmake +index 704278a0e93b..d25c8d325c71 100644 +--- a/cmake/modules/AddClang.cmake ++++ b/cmake/modules/AddClang.cmake +@@ -123,9 +123,9 @@ macro(add_clang_library name) + install(TARGETS ${lib} + COMPONENT ${lib} + ${export_to_clangtargets} +- LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX} +- ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX} +- RUNTIME DESTINATION bin) ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX} ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) + + if (NOT LLVM_ENABLE_IDE) + add_llvm_install_targets(install-${lib} +@@ -170,7 +170,7 @@ macro(add_clang_tool name) + + install(TARGETS ${name} + ${export_to_clangtargets} +- RUNTIME DESTINATION bin ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + COMPONENT ${name}) + + if(NOT LLVM_ENABLE_IDE) +@@ -185,7 +185,7 @@ endmacro() + macro(add_clang_symlink name dest) + add_llvm_tool_symlink(${name} ${dest} ALWAYS_GENERATE) + # Always generate install targets +- llvm_install_symlink(${name} ${dest} ALWAYS_GENERATE) ++ llvm_install_symlink(${name} ${dest} ${CMAKE_INSTALL_FULL_BINDIR} ALWAYS_GENERATE) + endmacro() + + function(clang_target_link_libraries target type) +diff --git a/lib/Headers/CMakeLists.txt b/lib/Headers/CMakeLists.txt +index 0692fe75a441..6f201e7207d0 100644 +--- a/lib/Headers/CMakeLists.txt ++++ b/lib/Headers/CMakeLists.txt +@@ -208,7 +208,7 @@ set_target_properties(clang-resource-headers PROPERTIES + FOLDER "Misc" + RUNTIME_OUTPUT_DIRECTORY "${output_dir}") + +-set(header_install_dir lib${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION}/include) ++set(header_install_dir ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION}/include) + + install( + FILES ${files} ${generated_files} +diff --git a/tools/c-index-test/CMakeLists.txt b/tools/c-index-test/CMakeLists.txt +index ceef4b08637c..8efad5520ca4 100644 +--- a/tools/c-index-test/CMakeLists.txt ++++ b/tools/c-index-test/CMakeLists.txt +@@ -54,7 +54,7 @@ if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY) + set_property(TARGET c-index-test APPEND PROPERTY INSTALL_RPATH + "@executable_path/../../lib") + else() +- set(INSTALL_DESTINATION bin) ++ set(INSTALL_DESTINATION ${CMAKE_INSTALL_BINDIR}) + endif() + + install(TARGETS c-index-test +diff --git a/tools/clang-format/CMakeLists.txt b/tools/clang-format/CMakeLists.txt +index 35ecdb11253c..d77d75de0094 100644 +--- a/tools/clang-format/CMakeLists.txt ++++ b/tools/clang-format/CMakeLists.txt +@@ -21,20 +21,20 @@ if( LLVM_LIB_FUZZING_ENGINE OR LLVM_USE_SANITIZE_COVERAGE ) + endif() + + install(PROGRAMS clang-format-bbedit.applescript +- DESTINATION share/clang ++ DESTINATION ${CMAKE_INSTALL_DATADIR}/clang + COMPONENT clang-format) + install(PROGRAMS clang-format-diff.py +- DESTINATION share/clang ++ DESTINATION ${CMAKE_INSTALL_DATADIR}/clang + COMPONENT clang-format) + install(PROGRAMS clang-format-sublime.py +- DESTINATION share/clang ++ DESTINATION ${CMAKE_INSTALL_DATADIR}/clang + COMPONENT clang-format) + install(PROGRAMS clang-format.el +- DESTINATION share/clang ++ DESTINATION ${CMAKE_INSTALL_DATADIR}/clang + COMPONENT clang-format) + install(PROGRAMS clang-format.py +- DESTINATION share/clang ++ DESTINATION ${CMAKE_INSTALL_DATADIR}/clang + COMPONENT clang-format) + install(PROGRAMS git-clang-format +- DESTINATION bin ++ DESTINATION ${CMAKE_INSTALL_BINDIR} + COMPONENT clang-format) +diff --git a/tools/clang-rename/CMakeLists.txt b/tools/clang-rename/CMakeLists.txt +index cda8e29ec5b1..0134d8ccd70b 100644 +--- a/tools/clang-rename/CMakeLists.txt ++++ b/tools/clang-rename/CMakeLists.txt +@@ -19,8 +19,8 @@ clang_target_link_libraries(clang-rename + ) + + install(PROGRAMS clang-rename.py +- DESTINATION share/clang ++ DESTINATION ${CMAKE_INSTALL_DATADIR}/clang + COMPONENT clang-rename) + install(PROGRAMS clang-rename.el +- DESTINATION share/clang ++ DESTINATION ${CMAKE_INSTALL_DATADIR}/clang + COMPONENT clang-rename) +diff --git a/tools/libclang/CMakeLists.txt b/tools/libclang/CMakeLists.txt +index 5cd9ac5cddc1..a197676fedbd 100644 +--- a/tools/libclang/CMakeLists.txt ++++ b/tools/libclang/CMakeLists.txt +@@ -165,7 +165,7 @@ endif() + if(INTERNAL_INSTALL_PREFIX) + set(LIBCLANG_HEADERS_INSTALL_DESTINATION "${INTERNAL_INSTALL_PREFIX}/include") + else() +- set(LIBCLANG_HEADERS_INSTALL_DESTINATION include) ++ set(LIBCLANG_HEADERS_INSTALL_DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) + endif() + + install(DIRECTORY ../../include/clang-c +@@ -196,7 +196,7 @@ foreach(PythonVersion ${CLANG_PYTHON_BINDINGS_VERSIONS}) + COMPONENT + libclang-python-bindings + DESTINATION +- "lib${LLVM_LIBDIR_SUFFIX}/python${PythonVersion}/site-packages") ++ "${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}/python${PythonVersion}/site-packages") + endforeach() + if(NOT LLVM_ENABLE_IDE) + add_custom_target(libclang-python-bindings) +diff --git a/tools/scan-build/CMakeLists.txt b/tools/scan-build/CMakeLists.txt +index ec0702d76f18..d25d982f51da 100644 +--- a/tools/scan-build/CMakeLists.txt ++++ b/tools/scan-build/CMakeLists.txt +@@ -47,7 +47,7 @@ if(CLANG_INSTALL_SCANBUILD) + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/bin/${BinFile}) + list(APPEND Depends ${CMAKE_BINARY_DIR}/bin/${BinFile}) + install(PROGRAMS bin/${BinFile} +- DESTINATION bin ++ DESTINATION ${CMAKE_INSTALL_BINDIR} + COMPONENT scan-build) + endforeach() + +@@ -61,7 +61,7 @@ if(CLANG_INSTALL_SCANBUILD) + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/libexec/${LibexecFile}) + list(APPEND Depends ${CMAKE_BINARY_DIR}/libexec/${LibexecFile}) + install(PROGRAMS libexec/${LibexecFile} +- DESTINATION libexec ++ DESTINATION ${CMAKE_INSTALL_LIBEXECDIR} + COMPONENT scan-build) + endforeach() + +@@ -89,7 +89,7 @@ if(CLANG_INSTALL_SCANBUILD) + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/share/scan-build/${ShareFile}) + list(APPEND Depends ${CMAKE_BINARY_DIR}/share/scan-build/${ShareFile}) + install(FILES share/scan-build/${ShareFile} +- DESTINATION share/scan-build ++ DESTINATION ${CMAKE_INSTALL_DATADIR}/scan-build + COMPONENT scan-build) + endforeach() + +diff --git a/tools/scan-view/CMakeLists.txt b/tools/scan-view/CMakeLists.txt +index 22edb974bac7..9f140a9a4538 100644 +--- a/tools/scan-view/CMakeLists.txt ++++ b/tools/scan-view/CMakeLists.txt +@@ -22,7 +22,7 @@ if(CLANG_INSTALL_SCANVIEW) + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/bin/${BinFile}) + list(APPEND Depends ${CMAKE_BINARY_DIR}/bin/${BinFile}) + install(PROGRAMS bin/${BinFile} +- DESTINATION bin ++ DESTINATION ${CMAKE_INSTALL_BINDIR} + COMPONENT scan-view) + endforeach() + +@@ -36,7 +36,7 @@ if(CLANG_INSTALL_SCANVIEW) + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/share/${ShareFile}) + list(APPEND Depends ${CMAKE_BINARY_DIR}/share/scan-view/${ShareFile}) + install(FILES share/${ShareFile} +- DESTINATION share/scan-view ++ DESTINATION ${CMAKE_INSTALL_DATADIR}/scan-view + COMPONENT scan-view) + endforeach() + +diff --git a/utils/hmaptool/CMakeLists.txt b/utils/hmaptool/CMakeLists.txt +index 62f2de0cb15c..6aa66825b6ec 100644 +--- a/utils/hmaptool/CMakeLists.txt ++++ b/utils/hmaptool/CMakeLists.txt +@@ -10,7 +10,7 @@ add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bin/${CLANG_HM + + list(APPEND Depends ${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bin/${CLANG_HMAPTOOL}) + install(PROGRAMS ${CLANG_HMAPTOOL} +- DESTINATION bin ++ DESTINATION ${CMAKE_INSTALL_BINDIR} + COMPONENT hmaptool) + + add_custom_target(hmaptool ALL DEPENDS ${Depends}) diff --git a/pkgs/development/compilers/llvm/11/compiler-rt/default.nix b/pkgs/development/compilers/llvm/11/compiler-rt/default.nix index 6ab36063077..5ec37508c5e 100644 --- a/pkgs/development/compilers/llvm/11/compiler-rt/default.nix +++ b/pkgs/development/compilers/llvm/11/compiler-rt/default.nix @@ -13,7 +13,7 @@ stdenv.mkDerivation rec { inherit version; src = fetch pname "0x1j8ngf1zj63wlnns9vlibafq48qcm72p4jpaxkmkb4qw0grwfy"; - nativeBuildInputs = [ cmake python3 llvm ]; + nativeBuildInputs = [ cmake python3 llvm.dev ]; buildInputs = lib.optional stdenv.hostPlatform.isDarwin libcxxabi; NIX_CFLAGS_COMPILE = [ @@ -21,13 +21,10 @@ stdenv.mkDerivation rec { ]; cmakeFlags = [ + "-DCOMPILER_RT_OS_DIR=" "-DCOMPILER_RT_DEFAULT_TARGET_ONLY=ON" "-DCMAKE_C_COMPILER_TARGET=${stdenv.hostPlatform.config}" "-DCMAKE_ASM_COMPILER_TARGET=${stdenv.hostPlatform.config}" - ] ++ lib.optionals (stdenv.isDarwin) [ - "-DDARWIN_macosx_OVERRIDE_SDK_VERSION=ON" - "-DDARWIN_osx_ARCHS=${stdenv.hostPlatform.darwinArch}" - "-DDARWIN_osx_BUILTIN_ARCHS=${stdenv.hostPlatform.darwinArch}" ] ++ lib.optionals (useLLVM || bareMetal || isMusl) [ "-DCOMPILER_RT_BUILD_SANITIZERS=OFF" "-DCOMPILER_RT_BUILD_XRAY=OFF" @@ -45,6 +42,10 @@ stdenv.mkDerivation rec { "-DCMAKE_TRY_COMPILE_TARGET_TYPE=STATIC_LIBRARY" ] ++ lib.optionals (bareMetal) [ "-DCOMPILER_RT_OS_DIR=baremetal" + ] ++ lib.optionals (stdenv.hostPlatform.isDarwin) [ + "-DDARWIN_macosx_OVERRIDE_SDK_VERSION=ON" + "-DDARWIN_osx_ARCHS=${stdenv.hostPlatform.darwinArch}" + "-DDARWIN_osx_BUILTIN_ARCHS=${stdenv.hostPlatform.darwinArch}" ]; outputs = [ "out" "dev" ]; @@ -52,6 +53,10 @@ stdenv.mkDerivation rec { patches = [ ./codesign.patch # Revert compiler-rt commit that makes codesign mandatory ./X86-support-extension.patch # Add support for i486 i586 i686 by reusing i386 config + ./gnu-install-dirs.patch + # ld-wrapper dislikes `-rpath-link //nix/store`, so we normalize away the + # extra `/`. + ./normalize-var.patch ]# ++ lib.optional stdenv.hostPlatform.isMusl ./sanitizers-nongnu.patch ++ lib.optional stdenv.hostPlatform.isAarch32 ./armv7l.patch; @@ -79,9 +84,7 @@ stdenv.mkDerivation rec { ''; # Hack around weird upsream RPATH bug - postInstall = lib.optionalString (stdenv.hostPlatform.isDarwin || stdenv.hostPlatform.isWasm) '' - ln -s "$out/lib"/*/* "$out/lib" - '' + lib.optionalString (useLLVM) '' + postInstall = lib.optionalString (useLLVM) '' ln -s $out/lib/*/clang_rt.crtbegin-*.o $out/lib/crtbegin.o ln -s $out/lib/*/clang_rt.crtend-*.o $out/lib/crtend.o ln -s $out/lib/*/clang_rt.crtbegin_shared-*.o $out/lib/crtbeginS.o diff --git a/pkgs/development/compilers/llvm/11/compiler-rt/gnu-install-dirs.patch b/pkgs/development/compilers/llvm/11/compiler-rt/gnu-install-dirs.patch new file mode 100644 index 00000000000..1d1ebb570ce --- /dev/null +++ b/pkgs/development/compilers/llvm/11/compiler-rt/gnu-install-dirs.patch @@ -0,0 +1,129 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index fa62814b635d..6328614d829e 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -12,6 +12,7 @@ endif() + # Check if compiler-rt is built as a standalone project. + if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR OR COMPILER_RT_STANDALONE_BUILD) + project(CompilerRT C CXX ASM) ++ include(GNUInstallDirs) + set(COMPILER_RT_STANDALONE_BUILD TRUE) + set_property(GLOBAL PROPERTY USE_FOLDERS ON) + endif() +diff --git a/cmake/Modules/AddCompilerRT.cmake b/cmake/Modules/AddCompilerRT.cmake +index 7c127a93dfa7..6a95a65b70a7 100644 +--- a/cmake/Modules/AddCompilerRT.cmake ++++ b/cmake/Modules/AddCompilerRT.cmake +@@ -524,7 +524,7 @@ macro(add_compiler_rt_resource_file target_name file_name component) + add_custom_target(${target_name} DEPENDS ${dst_file}) + # Install in Clang resource directory. + install(FILES ${file_name} +- DESTINATION ${COMPILER_RT_INSTALL_PATH}/share ++ DESTINATION ${COMPILER_RT_INSTALL_PATH}/${CMAKE_INSTALL_FULL_INCLUDEDIR} + COMPONENT ${component}) + add_dependencies(${component} ${target_name}) + +@@ -541,7 +541,7 @@ macro(add_compiler_rt_script name) + add_custom_target(${name} DEPENDS ${dst}) + install(FILES ${dst} + PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE +- DESTINATION ${COMPILER_RT_INSTALL_PATH}/bin) ++ DESTINATION ${COMPILER_RT_INSTALL_PATH}/${CMAKE_INSTALL_FULL_BINDIR}) + endmacro(add_compiler_rt_script src name) + + # Builds custom version of libc++ and installs it in . +diff --git a/cmake/Modules/CompilerRTDarwinUtils.cmake b/cmake/Modules/CompilerRTDarwinUtils.cmake +index be8d7e733c7a..ab256bdff26c 100644 +--- a/cmake/Modules/CompilerRTDarwinUtils.cmake ++++ b/cmake/Modules/CompilerRTDarwinUtils.cmake +@@ -498,7 +498,7 @@ macro(darwin_add_embedded_builtin_libraries) + set(DARWIN_macho_embedded_LIBRARY_OUTPUT_DIR + ${COMPILER_RT_OUTPUT_DIR}/lib/macho_embedded) + set(DARWIN_macho_embedded_LIBRARY_INSTALL_DIR +- ${COMPILER_RT_INSTALL_PATH}/lib/macho_embedded) ++ ${COMPILER_RT_INSTALL_PATH}/${CMAKE_INSTALL_FULL_LIBDIR}/macho_embedded) + + set(CFLAGS_armv7 "-target thumbv7-apple-darwin-eabi") + set(CFLAGS_i386 "-march=pentium") +diff --git a/cmake/Modules/CompilerRTUtils.cmake b/cmake/Modules/CompilerRTUtils.cmake +index 99b9f0e4af44..c5183ffa746e 100644 +--- a/cmake/Modules/CompilerRTUtils.cmake ++++ b/cmake/Modules/CompilerRTUtils.cmake +@@ -375,7 +375,7 @@ endfunction() + function(get_compiler_rt_install_dir arch install_dir) + if(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR AND NOT APPLE) + get_compiler_rt_target(${arch} target) +- set(${install_dir} ${COMPILER_RT_INSTALL_PATH}/lib/${target} PARENT_SCOPE) ++ set(${install_dir} ${COMPILER_RT_INSTALL_PATH}/${CMAKE_INSTALL_FULL_LIBDIR}/${target} PARENT_SCOPE) + else() + set(${install_dir} ${COMPILER_RT_LIBRARY_INSTALL_DIR} PARENT_SCOPE) + endif() +diff --git a/cmake/base-config-ix.cmake b/cmake/base-config-ix.cmake +index 964dd598f102..2acaab87d349 100644 +--- a/cmake/base-config-ix.cmake ++++ b/cmake/base-config-ix.cmake +@@ -66,11 +66,11 @@ if (LLVM_TREE_AVAILABLE) + else() + # Take output dir and install path from the user. + set(COMPILER_RT_OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR} CACHE PATH +- "Path where built compiler-rt libraries should be stored.") ++ "Path where built compiler-rt build artifacts should be stored.") + set(COMPILER_RT_EXEC_OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR}/bin CACHE PATH + "Path where built compiler-rt executables should be stored.") +- set(COMPILER_RT_INSTALL_PATH ${CMAKE_INSTALL_PREFIX} CACHE PATH +- "Path where built compiler-rt libraries should be installed.") ++ set(COMPILER_RT_INSTALL_PATH "" CACHE PATH ++ "Prefix where built compiler-rt artifacts should be installed, comes before CMAKE_INSTALL_PREFIX.") + option(COMPILER_RT_INCLUDE_TESTS "Generate and build compiler-rt unit tests." OFF) + option(COMPILER_RT_ENABLE_WERROR "Fail and stop if warning is triggered" OFF) + # Use a host compiler to compile/link tests. +@@ -98,7 +98,7 @@ else(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR) + set(COMPILER_RT_LIBRARY_OUTPUT_DIR + ${COMPILER_RT_OUTPUT_DIR}/lib/${COMPILER_RT_OS_DIR}) + set(COMPILER_RT_LIBRARY_INSTALL_DIR +- ${COMPILER_RT_INSTALL_PATH}/lib/${COMPILER_RT_OS_DIR}) ++ ${COMPILER_RT_INSTALL_PATH}/${CMAKE_INSTALL_FULL_LIBDIR}/${COMPILER_RT_OS_DIR}) + endif() + + if(APPLE) +diff --git a/include/CMakeLists.txt b/include/CMakeLists.txt +index d47d7baeb118..507c8e5c713e 100644 +--- a/include/CMakeLists.txt ++++ b/include/CMakeLists.txt +@@ -62,22 +62,22 @@ set_target_properties(compiler-rt-headers PROPERTIES FOLDER "Compiler-RT Misc") + install(FILES ${SANITIZER_HEADERS} + COMPONENT compiler-rt-headers + PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ +- DESTINATION ${COMPILER_RT_INSTALL_PATH}/include/sanitizer) ++ DESTINATION ${COMPILER_RT_INSTALL_PATH}/${CMAKE_INSTALL_FULL_INCLUDEDIR}/sanitizer) + # Install fuzzer headers. + install(FILES ${FUZZER_HEADERS} + COMPONENT compiler-rt-headers + PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ +- DESTINATION ${COMPILER_RT_INSTALL_PATH}/include/fuzzer) ++ DESTINATION ${COMPILER_RT_INSTALL_PATH}/${CMAKE_INSTALL_FULL_INCLUDEDIR}/fuzzer) + # Install xray headers. + install(FILES ${XRAY_HEADERS} + COMPONENT compiler-rt-headers + PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ +- DESTINATION ${COMPILER_RT_INSTALL_PATH}/include/xray) ++ DESTINATION ${COMPILER_RT_INSTALL_PATH}/${CMAKE_INSTALL_FULL_INCLUDEDIR}/xray) + # Install profile headers. + install(FILES ${PROFILE_HEADERS} + COMPONENT compiler-rt-headers + PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ +- DESTINATION ${COMPILER_RT_INSTALL_PATH}/include/profile) ++ DESTINATION ${COMPILER_RT_INSTALL_PATH}/${CMAKE_INSTALL_FULL_INCLUDEDIR}/profile) + + if (NOT CMAKE_CONFIGURATION_TYPES) # don't add this for IDEs. + add_custom_target(install-compiler-rt-headers +diff --git a/lib/dfsan/CMakeLists.txt b/lib/dfsan/CMakeLists.txt +index 051215edbeb7..ecce1f52efb0 100644 +--- a/lib/dfsan/CMakeLists.txt ++++ b/lib/dfsan/CMakeLists.txt +@@ -56,4 +56,4 @@ add_custom_command(OUTPUT ${dfsan_abilist_filename} + DEPENDS done_abilist.txt libc_ubuntu1404_abilist.txt) + add_dependencies(dfsan dfsan_abilist) + install(FILES ${dfsan_abilist_filename} +- DESTINATION ${COMPILER_RT_INSTALL_PATH}/share) ++ DESTINATION ${COMPILER_RT_INSTALL_PATH}/${CMAKE_INSTALL_FULL_DATADIR}) diff --git a/pkgs/development/compilers/llvm/11/compiler-rt/normalize-var.patch b/pkgs/development/compilers/llvm/11/compiler-rt/normalize-var.patch new file mode 100644 index 00000000000..b9986910e51 --- /dev/null +++ b/pkgs/development/compilers/llvm/11/compiler-rt/normalize-var.patch @@ -0,0 +1,16 @@ +diff --git a/compiler-rt/cmake/Modules/CompilerRTUtils.cmake b/compiler-rt/cmake/Modules/CompilerRTUtils.cmake +index c5183ffa746e..e4e4a007335d 100644 +--- a/cmake/Modules/CompilerRTUtils.cmake ++++ b/cmake/Modules/CompilerRTUtils.cmake +@@ -299,8 +299,9 @@ macro(load_llvm_config) + # Get some LLVM variables from LLVMConfig. + include("${LLVM_CMAKE_PATH}/LLVMConfig.cmake") + +- set(LLVM_LIBRARY_OUTPUT_INTDIR +- ${LLVM_BINARY_DIR}/${CMAKE_CFG_INTDIR}/lib${LLVM_LIBDIR_SUFFIX}) ++ get_filename_component(LLVM_LIBRARY_OUTPUT_INTDIR ++ ${LLVM_BINARY_DIR}/${CMAKE_CFG_INTDIR}/lib${LLVM_LIBDIR_SUFFIX} ++ REALPATH) + endif() + endmacro() + diff --git a/pkgs/development/compilers/llvm/11/default.nix b/pkgs/development/compilers/llvm/11/default.nix index 22209ffb647..cb5d08d9ff0 100644 --- a/pkgs/development/compilers/llvm/11/default.nix +++ b/pkgs/development/compilers/llvm/11/default.nix @@ -1,6 +1,5 @@ { lowPrio, newScope, pkgs, lib, stdenv, cmake, gccForLibs , libxml2, python3, isl, fetchurl, overrideCC, wrapCCWith, wrapBintoolsWith -, buildPackages , buildLlvmTools # tools, but from the previous stage, for cross , targetLlvmLibraries # libraries, but from the next stage, for cross }: @@ -20,31 +19,37 @@ let clang-tools-extra_src = fetch "clang-tools-extra" "18n1w1hkv931xzq02b34wglbv6zd6sd0r5kb8piwvag7klj7qw3n"; tools = lib.makeExtensible (tools: let - callPackage = newScope (tools // { inherit stdenv cmake libxml2 python3 isl release_version version fetch; }); + callPackage = newScope (tools // { inherit stdenv cmake libxml2 python3 isl release_version version fetch buildLlvmTools; }); mkExtraBuildCommands = cc: '' rsrc="$out/resource-root" mkdir "$rsrc" - ln -s "${cc}/lib/clang/${release_version}/include" "$rsrc" + ln -s "${cc.lib}/lib/clang/${release_version}/include" "$rsrc" ln -s "${targetLlvmLibraries.compiler-rt.out}/lib" "$rsrc/lib" ln -s "${targetLlvmLibraries.compiler-rt.out}/share" "$rsrc/share" echo "-resource-dir=$rsrc" >> $out/nix-support/cc-cflags ''; + in { - llvm = callPackage ./llvm { }; + libllvm = callPackage ./llvm { }; - clang-unwrapped = callPackage ./clang { - inherit (tools) lld; + # `llvm` historically had the binaries. But this migration + # technique also impedes `lib.get*`. Perhaps we will revisit it. + llvm = tools.libllvm.out; + + libclang = callPackage ./clang { inherit clang-tools-extra_src; }; + clang-unwrapped = tools.libclang.out; + # disabled until recommonmark supports sphinx 3 - #Llvm-manpages = lowPrio (tools.llvm.override { + #Llvm-manpages = lowPrio (tools.libllvm.override { # enableManpages = true; # python3 = pkgs.python3; # don't use python-boot #}); - clang-manpages = lowPrio (tools.clang-unwrapped.override { + clang-manpages = lowPrio (tools.libclang.override { enableManpages = true; python3 = pkgs.python3; # don't use python-boot }); @@ -55,8 +60,6 @@ let # python3 = pkgs.python3; # don't use python-boot # }); - libclang = tools.clang-unwrapped.lib; - clang = if stdenv.cc.isGNU then tools.libstdcxxClang else tools.libcxxClang; libstdcxxClang = wrapCCWith rec { diff --git a/pkgs/development/compilers/llvm/11/libc++/default.nix b/pkgs/development/compilers/llvm/11/libc++/default.nix index 6adb824f539..e095350cea7 100644 --- a/pkgs/development/compilers/llvm/11/libc++/default.nix +++ b/pkgs/development/compilers/llvm/11/libc++/default.nix @@ -15,6 +15,8 @@ stdenv.mkDerivation { mv llvm-* llvm ''; + outputs = [ "out" "dev" ]; + patches = [ (fetchpatch { # Backported from LLVM 12, avoids clashes with commonly used "block.h" header. @@ -22,6 +24,7 @@ stdenv.mkDerivation { sha256 = "sha256-aWa66ogmPkG0xHzSfcpD0qZyZQcNKwLV44js4eiun78="; stripLen = 1; }) + ./gnu-install-dirs.patch ] ++ lib.optional stdenv.hostPlatform.isMusl ../../libcxx-0001-musl-hacks.patch; preConfigure = lib.optionalString stdenv.hostPlatform.isMusl '' diff --git a/pkgs/development/compilers/llvm/11/libc++/gnu-install-dirs.patch b/pkgs/development/compilers/llvm/11/libc++/gnu-install-dirs.patch new file mode 100644 index 00000000000..2b95d6a85d8 --- /dev/null +++ b/pkgs/development/compilers/llvm/11/libc++/gnu-install-dirs.patch @@ -0,0 +1,100 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 910d04b54b6d..80ef692d83eb 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -31,6 +31,8 @@ set(CMAKE_MODULE_PATH + if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR OR LIBCXX_STANDALONE_BUILD) + project(libcxx CXX C) + ++ include(GNUInstallDirs) ++ + set(PACKAGE_NAME libcxx) + set(PACKAGE_VERSION 11.1.0) + set(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}") +@@ -418,7 +420,7 @@ string(REGEX MATCH "[0-9]+\\.[0-9]+(\\.[0-9]+)?" CLANG_VERSION + if(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR AND NOT APPLE) + set(LIBCXX_LIBRARY_DIR ${LLVM_LIBRARY_OUTPUT_INTDIR}/${LLVM_DEFAULT_TARGET_TRIPLE}/c++) + set(LIBCXX_HEADER_DIR ${LLVM_BINARY_DIR}) +- set(LIBCXX_INSTALL_LIBRARY_DIR lib${LLVM_LIBDIR_SUFFIX}/${LLVM_DEFAULT_TARGET_TRIPLE}/c++) ++ set(LIBCXX_INSTALL_LIBRARY_DIR ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}/${LLVM_DEFAULT_TARGET_TRIPLE}/c++) + if(LIBCXX_LIBDIR_SUBDIR) + string(APPEND LIBCXX_LIBRARY_DIR /${LIBCXX_LIBDIR_SUBDIR}) + string(APPEND LIBCXX_INSTALL_LIBRARY_DIR /${LIBCXX_LIBDIR_SUBDIR}) +@@ -426,11 +428,11 @@ if(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR AND NOT APPLE) + elseif(LLVM_LIBRARY_OUTPUT_INTDIR) + set(LIBCXX_LIBRARY_DIR ${LLVM_LIBRARY_OUTPUT_INTDIR}) + set(LIBCXX_HEADER_DIR ${LLVM_BINARY_DIR}) +- set(LIBCXX_INSTALL_LIBRARY_DIR lib${LIBCXX_LIBDIR_SUFFIX}) ++ set(LIBCXX_INSTALL_LIBRARY_DIR ${CMAKE_INSTALL_LIBDIR}${LIBCXX_LIBDIR_SUFFIX}) + else() + set(LIBCXX_LIBRARY_DIR ${CMAKE_BINARY_DIR}/lib${LIBCXX_LIBDIR_SUFFIX}) + set(LIBCXX_HEADER_DIR ${CMAKE_BINARY_DIR}) +- set(LIBCXX_INSTALL_LIBRARY_DIR lib${LIBCXX_LIBDIR_SUFFIX}) ++ set(LIBCXX_INSTALL_LIBRARY_DIR ${CMAKE_INSTALL_LIBDIR}${LIBCXX_LIBDIR_SUFFIX}) + endif() + + file(MAKE_DIRECTORY "${LIBCXX_BINARY_INCLUDE_DIR}") +diff --git a/cmake/Modules/HandleLibCXXABI.cmake b/cmake/Modules/HandleLibCXXABI.cmake +index c5aa26739e36..8841c4a5252d 100644 +--- a/cmake/Modules/HandleLibCXXABI.cmake ++++ b/cmake/Modules/HandleLibCXXABI.cmake +@@ -63,7 +63,7 @@ macro(setup_abi_lib abidefines abishared abistatic abifiles abidirs) + + if (LIBCXX_INSTALL_HEADERS) + install(FILES "${LIBCXX_BINARY_INCLUDE_DIR}/${fpath}" +- DESTINATION ${LIBCXX_INSTALL_HEADER_PREFIX}include/c++/v1/${dstdir} ++ DESTINATION ${LIBCXX_INSTALL_HEADER_PREFIX}${CMAKE_INSTALL_INCLUDEDIR}/c++/v1/${dstdir} + COMPONENT cxx-headers + PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ + ) +diff --git a/include/CMakeLists.txt b/include/CMakeLists.txt +index be8141c98166..93847e5758cc 100644 +--- a/include/CMakeLists.txt ++++ b/include/CMakeLists.txt +@@ -257,7 +257,7 @@ if (LIBCXX_INSTALL_HEADERS) + foreach(file ${files}) + get_filename_component(dir ${file} DIRECTORY) + install(FILES ${file} +- DESTINATION ${LIBCXX_INSTALL_HEADER_PREFIX}include/c++/v1/${dir} ++ DESTINATION ${LIBCXX_INSTALL_HEADER_PREFIX}${CMAKE_INSTALL_INCLUDEDIR}/c++/v1/${dir} + COMPONENT ${CXX_HEADER_TARGET} + PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ + ) +@@ -265,7 +265,7 @@ if (LIBCXX_INSTALL_HEADERS) + + # Install the generated header as __config. + install(FILES ${LIBCXX_BINARY_DIR}/__generated_config +- DESTINATION ${LIBCXX_INSTALL_HEADER_PREFIX}include/c++/v1 ++ DESTINATION ${LIBCXX_INSTALL_HEADER_PREFIX}${CMAKE_INSTALL_INCLUDEDIR}/c++/v1 + PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ + RENAME __config + COMPONENT ${CXX_HEADER_TARGET}) +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index 2001c09761d9..5bd11ea6b400 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -344,21 +344,21 @@ if (LIBCXX_INSTALL_LIBRARY) + install(TARGETS cxx_shared + ARCHIVE DESTINATION ${LIBCXX_INSTALL_PREFIX}${LIBCXX_INSTALL_LIBRARY_DIR} COMPONENT cxx + LIBRARY DESTINATION ${LIBCXX_INSTALL_PREFIX}${LIBCXX_INSTALL_LIBRARY_DIR} COMPONENT cxx +- RUNTIME DESTINATION ${LIBCXX_INSTALL_PREFIX}bin COMPONENT cxx) ++ RUNTIME DESTINATION ${LIBCXX_INSTALL_PREFIX}${CMAKE_INSTALL_BINDIR} COMPONENT cxx) + endif() + + if (LIBCXX_INSTALL_STATIC_LIBRARY) + install(TARGETS cxx_static + ARCHIVE DESTINATION ${LIBCXX_INSTALL_PREFIX}${LIBCXX_INSTALL_LIBRARY_DIR} COMPONENT cxx + LIBRARY DESTINATION ${LIBCXX_INSTALL_PREFIX}${LIBCXX_INSTALL_LIBRARY_DIR} COMPONENT cxx +- RUNTIME DESTINATION ${LIBCXX_INSTALL_PREFIX}bin COMPONENT cxx) ++ RUNTIME DESTINATION ${LIBCXX_INSTALL_PREFIX}${CMAKE_INSTALL_BINDIR} COMPONENT cxx) + endif() + + if(LIBCXX_INSTALL_EXPERIMENTAL_LIBRARY) + install(TARGETS cxx_experimental + LIBRARY DESTINATION ${LIBCXX_INSTALL_PREFIX}${LIBCXX_INSTALL_LIBRARY_DIR} COMPONENT cxx + ARCHIVE DESTINATION ${LIBCXX_INSTALL_PREFIX}${LIBCXX_INSTALL_LIBRARY_DIR} COMPONENT cxx +- RUNTIME DESTINATION ${LIBCXX_INSTALL_PREFIX}bin COMPONENT cxx) ++ RUNTIME DESTINATION ${LIBCXX_INSTALL_PREFIX}${CMAKE_INSTALL_BINDIR} COMPONENT cxx) + endif() + + # NOTE: This install command must go after the cxx install command otherwise diff --git a/pkgs/development/compilers/llvm/11/libc++abi/default.nix b/pkgs/development/compilers/llvm/11/libc++abi/default.nix index c35ec706a02..a79a0d2f07a 100644 --- a/pkgs/development/compilers/llvm/11/libc++abi/default.nix +++ b/pkgs/development/compilers/llvm/11/libc++abi/default.nix @@ -8,20 +8,7 @@ stdenv.mkDerivation { src = fetch "libcxxabi" "1azcf31mxw59hb1x17xncnm3dyw90ylh8rqx462lvypqh3nr6c8l"; - nativeBuildInputs = [ cmake ]; - buildInputs = lib.optional (!stdenv.isDarwin && !stdenv.isFreeBSD && !stdenv.hostPlatform.isWasm) libunwind; - - cmakeFlags = lib.optionals (stdenv.hostPlatform.useLLVM or false) [ - "-DLLVM_ENABLE_LIBCXX=ON" - "-DLIBCXXABI_USE_LLVM_UNWINDER=ON" - ] ++ lib.optionals stdenv.hostPlatform.isWasm [ - "-DLIBCXXABI_ENABLE_THREADS=OFF" - "-DLIBCXXABI_ENABLE_EXCEPTIONS=OFF" - ] ++ lib.optionals (!enableShared) [ - "-DLIBCXXABI_ENABLE_SHARED=OFF" - ]; - - patches = [ ./no-threads.patch ]; + outputs = [ "out" "dev" ]; postUnpack = '' unpackFile ${libcxx.src} @@ -36,6 +23,24 @@ stdenv.mkDerivation { patch -p1 -d llvm -i ${./wasm.patch} ''; + patches = [ + ./no-threads.patch + ./gnu-install-dirs.patch + ]; + + nativeBuildInputs = [ cmake ]; + buildInputs = lib.optional (!stdenv.isDarwin && !stdenv.isFreeBSD && !stdenv.hostPlatform.isWasm) libunwind; + + cmakeFlags = lib.optionals (stdenv.hostPlatform.useLLVM or false) [ + "-DLLVM_ENABLE_LIBCXX=ON" + "-DLIBCXXABI_USE_LLVM_UNWINDER=ON" + ] ++ lib.optionals stdenv.hostPlatform.isWasm [ + "-DLIBCXXABI_ENABLE_THREADS=OFF" + "-DLIBCXXABI_ENABLE_EXCEPTIONS=OFF" + ] ++ lib.optionals (!enableShared) [ + "-DLIBCXXABI_ENABLE_SHARED=OFF" + ]; + installPhase = if stdenv.isDarwin then '' for file in lib/*.dylib; do diff --git a/pkgs/development/compilers/llvm/11/libc++abi/gnu-install-dirs.patch b/pkgs/development/compilers/llvm/11/libc++abi/gnu-install-dirs.patch new file mode 100644 index 00000000000..10651c1255e --- /dev/null +++ b/pkgs/development/compilers/llvm/11/libc++abi/gnu-install-dirs.patch @@ -0,0 +1,34 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 36c6b2249e2b..a93c13ccaed9 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -24,6 +24,8 @@ set(CMAKE_MODULE_PATH + if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR OR LIBCXXABI_STANDALONE_BUILD) + project(libcxxabi CXX C) + ++ include(GNUInstallDirs) ++ + set(PACKAGE_NAME libcxxabi) + set(PACKAGE_VERSION 11.1.0) + set(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}") +@@ -160,17 +162,17 @@ string(REGEX MATCH "[0-9]+\\.[0-9]+(\\.[0-9]+)?" CLANG_VERSION + + if(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR AND NOT APPLE) + set(LIBCXXABI_LIBRARY_DIR ${LLVM_LIBRARY_OUTPUT_INTDIR}/${LLVM_DEFAULT_TARGET_TRIPLE}/c++) +- set(LIBCXXABI_INSTALL_LIBRARY_DIR lib${LLVM_LIBDIR_SUFFIX}/${LLVM_DEFAULT_TARGET_TRIPLE}/c++) ++ set(LIBCXXABI_INSTALL_LIBRARY_DIR ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}/${LLVM_DEFAULT_TARGET_TRIPLE}/c++) + if(LIBCXX_LIBDIR_SUBDIR) + string(APPEND LIBCXXABI_LIBRARY_DIR /${LIBCXXABI_LIBDIR_SUBDIR}) + string(APPEND LIBCXXABI_INSTALL_LIBRARY_DIR /${LIBCXXABI_LIBDIR_SUBDIR}) + endif() + elseif(LLVM_LIBRARY_OUTPUT_INTDIR) + set(LIBCXXABI_LIBRARY_DIR ${LLVM_LIBRARY_OUTPUT_INTDIR}) +- set(LIBCXXABI_INSTALL_LIBRARY_DIR lib${LIBCXXABI_LIBDIR_SUFFIX}) ++ set(LIBCXXABI_INSTALL_LIBRARY_DIR ${CMAKE_INSTALL_LIBDIR}${LIBCXXABI_LIBDIR_SUFFIX}) + else() + set(LIBCXXABI_LIBRARY_DIR ${CMAKE_BINARY_DIR}/lib${LIBCXXABI_LIBDIR_SUFFIX}) +- set(LIBCXXABI_INSTALL_LIBRARY_DIR lib${LIBCXXABI_LIBDIR_SUFFIX}) ++ set(LIBCXXABI_INSTALL_LIBRARY_DIR ${CMAKE_INSTALL_LIBDIR}${LIBCXXABI_LIBDIR_SUFFIX}) + endif() + + set(LIBCXXABI_INSTALL_PREFIX "" CACHE STRING "Define libc++abi destination prefix.") diff --git a/pkgs/development/compilers/llvm/11/libunwind/default.nix b/pkgs/development/compilers/llvm/11/libunwind/default.nix index 0c635cabc0a..6b095f4feae 100644 --- a/pkgs/development/compilers/llvm/11/libunwind/default.nix +++ b/pkgs/development/compilers/llvm/11/libunwind/default.nix @@ -8,6 +8,12 @@ stdenv.mkDerivation rec { src = fetch pname "1vpqs2c358v8fbr1r8jmzkfqk12jllimjcfmgxga127ksq9b37nj"; + patches = [ + ./gnu-install-dirs.patch + ]; + + outputs = [ "out" "dev" ]; + nativeBuildInputs = [ cmake ]; cmakeFlags = lib.optional (!enableShared) "-DLIBUNWIND_ENABLE_SHARED=OFF"; diff --git a/pkgs/development/compilers/llvm/11/libunwind/gnu-install-dirs.patch b/pkgs/development/compilers/llvm/11/libunwind/gnu-install-dirs.patch new file mode 100644 index 00000000000..b5b9c209278 --- /dev/null +++ b/pkgs/development/compilers/llvm/11/libunwind/gnu-install-dirs.patch @@ -0,0 +1,34 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index e44a103648f9..aaf1f9555d7f 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -18,6 +18,8 @@ set(CMAKE_MODULE_PATH + if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR OR LIBUNWIND_STANDALONE_BUILD) + project(libunwind LANGUAGES C CXX ASM) + ++ include(GNUInstallDirs) ++ + # Rely on llvm-config. + set(CONFIG_OUTPUT) + if(NOT LLVM_CONFIG_PATH) +@@ -192,17 +194,17 @@ string(REGEX MATCH "[0-9]+\\.[0-9]+(\\.[0-9]+)?" CLANG_VERSION + + if(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR AND NOT APPLE) + set(LIBUNWIND_LIBRARY_DIR ${LLVM_LIBRARY_OUTPUT_INTDIR}/${LLVM_DEFAULT_TARGET_TRIPLE}/c++) +- set(LIBUNWIND_INSTALL_LIBRARY_DIR lib${LLVM_LIBDIR_SUFFIX}/${LLVM_DEFAULT_TARGET_TRIPLE}/c++) ++ set(LIBUNWIND_INSTALL_LIBRARY_DIR ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}/${LLVM_DEFAULT_TARGET_TRIPLE}/c++) + if(LIBCXX_LIBDIR_SUBDIR) + string(APPEND LIBUNWIND_LIBRARY_DIR /${LIBUNWIND_LIBDIR_SUBDIR}) + string(APPEND LIBUNWIND_INSTALL_LIBRARY_DIR /${LIBUNWIND_LIBDIR_SUBDIR}) + endif() + elseif(LLVM_LIBRARY_OUTPUT_INTDIR) + set(LIBUNWIND_LIBRARY_DIR ${LLVM_LIBRARY_OUTPUT_INTDIR}) +- set(LIBUNWIND_INSTALL_LIBRARY_DIR lib${LIBUNWIND_LIBDIR_SUFFIX}) ++ set(LIBUNWIND_INSTALL_LIBRARY_DIR ${CMAKE_INSTALL_LIBDIR}${LIBUNWIND_LIBDIR_SUFFIX}) + else() + set(LIBUNWIND_LIBRARY_DIR ${CMAKE_BINARY_DIR}/lib${LIBUNWIND_LIBDIR_SUFFIX}) +- set(LIBUNWIND_INSTALL_LIBRARY_DIR lib${LIBUNWIND_LIBDIR_SUFFIX}) ++ set(LIBUNWIND_INSTALL_LIBRARY_DIR ${CMAKE_INSTALL_LIBDIR}${LIBUNWIND_LIBDIR_SUFFIX}) + endif() + + set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${LIBUNWIND_LIBRARY_DIR}) diff --git a/pkgs/development/compilers/llvm/11/lld/default.nix b/pkgs/development/compilers/llvm/11/lld/default.nix index 1a16184a6e7..3ee5ba6e5a6 100644 --- a/pkgs/development/compilers/llvm/11/lld/default.nix +++ b/pkgs/development/compilers/llvm/11/lld/default.nix @@ -1,8 +1,9 @@ { lib, stdenv +, buildLlvmTools , fetch , cmake , libxml2 -, llvm +, libllvm , version }: @@ -12,15 +13,20 @@ stdenv.mkDerivation rec { src = fetch pname "1kk61i7z5bi9i11rzsd2b388d42if1c7a45zkaa4mk0yps67hyh1"; + patches = [ + ./gnu-install-dirs.patch + ]; + nativeBuildInputs = [ cmake ]; - buildInputs = [ llvm libxml2 ]; + buildInputs = [ libllvm libxml2 ]; - outputs = [ "out" "dev" ]; + cmakeFlags = [ + "-DLLVM_CONFIG_PATH=${libllvm.dev}/bin/llvm-config${lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) "-native"}" + ] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ + "-DLLVM_TABLEGEN_EXE=${buildLlvmTools.llvm}/bin/llvm-tblgen" + ]; - postInstall = '' - moveToOutput include "$dev" - moveToOutput lib "$dev" - ''; + outputs = [ "out" "lib" "dev" ]; meta = { description = "The LLVM Linker"; diff --git a/pkgs/development/compilers/llvm/11/lld/gnu-install-dirs.patch b/pkgs/development/compilers/llvm/11/lld/gnu-install-dirs.patch new file mode 100644 index 00000000000..19cf5526aa5 --- /dev/null +++ b/pkgs/development/compilers/llvm/11/lld/gnu-install-dirs.patch @@ -0,0 +1,68 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 040bb2c8f6d7..f765f0096d97 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -6,6 +6,8 @@ if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR) + set(CMAKE_INCLUDE_CURRENT_DIR ON) + set(LLD_BUILT_STANDALONE TRUE) + ++ include(GNUInstallDirs) ++ + find_program(LLVM_CONFIG_PATH "llvm-config" DOC "Path to llvm-config binary") + if(NOT LLVM_CONFIG_PATH) + message(FATAL_ERROR "llvm-config not found: specify LLVM_CONFIG_PATH") +@@ -205,7 +207,7 @@ include_directories(BEFORE + + if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY) + install(DIRECTORY include/ +- DESTINATION include ++ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} + FILES_MATCHING + PATTERN "*.h" + PATTERN ".svn" EXCLUDE +diff --git a/cmake/modules/AddLLD.cmake b/cmake/modules/AddLLD.cmake +index 23df41312403..d62372c88de7 100644 +--- a/cmake/modules/AddLLD.cmake ++++ b/cmake/modules/AddLLD.cmake +@@ -20,9 +20,9 @@ macro(add_lld_library name) + install(TARGETS ${name} + COMPONENT ${name} + ${export_to_lldtargets} +- LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX} +- ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX} +- RUNTIME DESTINATION bin) ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX} ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) + + if (${ARG_SHARED} AND NOT CMAKE_CONFIGURATION_TYPES) + add_llvm_install_targets(install-${name} +@@ -54,7 +54,7 @@ macro(add_lld_tool name) + + install(TARGETS ${name} + ${export_to_lldtargets} +- RUNTIME DESTINATION bin ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + COMPONENT ${name}) + + if(NOT CMAKE_CONFIGURATION_TYPES) +@@ -69,5 +69,5 @@ endmacro() + macro(add_lld_symlink name dest) + add_llvm_tool_symlink(${name} ${dest} ALWAYS_GENERATE) + # Always generate install targets +- llvm_install_symlink(${name} ${dest} ALWAYS_GENERATE) ++ llvm_install_symlink(${name} ${dest} ${CMAKE_INSTALL_FULL_BINDIR} ALWAYS_GENERATE) + endmacro() +diff --git a/tools/lld/CMakeLists.txt b/tools/lld/CMakeLists.txt +index e6f72fcd3488..d903609e6e4f 100644 +--- a/tools/lld/CMakeLists.txt ++++ b/tools/lld/CMakeLists.txt +@@ -21,7 +21,7 @@ target_link_libraries(lld + ) + + install(TARGETS lld +- RUNTIME DESTINATION bin) ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) + + if(NOT LLD_SYMLINKS_TO_CREATE) + set(LLD_SYMLINKS_TO_CREATE lld-link ld.lld ld64.lld wasm-ld) diff --git a/pkgs/development/compilers/llvm/11/lldb/default.nix b/pkgs/development/compilers/llvm/11/lldb/default.nix index fc9b471ec9a..2979a46a6cc 100644 --- a/pkgs/development/compilers/llvm/11/lldb/default.nix +++ b/pkgs/development/compilers/llvm/11/lldb/default.nix @@ -7,8 +7,8 @@ , which , libedit , libxml2 -, llvm -, clang-unwrapped +, libllvm +, libclang , python3 , version , darwin @@ -22,19 +22,22 @@ stdenv.mkDerivation (rec { src = fetch pname "1vlyg015dyng43xqb8cg2l6r9ix8klibxsajazbfnckdnh54hwxj"; - patches = [ ./procfs.patch ]; + patches = [ + ./procfs.patch + ./gnu-install-dirs.patch + ]; - nativeBuildInputs = [ cmake python3 which swig lit ] - ++ lib.optionals enableManpages [ python3.pkgs.sphinx python3.pkgs.recommonmark ]; + outputs = [ "out" "lib" "dev" ]; + + nativeBuildInputs = [ + cmake python3 which swig lit + ] ++ lib.optionals enableManpages [ + python3.pkgs.sphinx python3.pkgs.recommonmark + ]; buildInputs = [ - ncurses - zlib - libedit - libxml2 - llvm - ] - ++ lib.optionals stdenv.isDarwin [ + ncurses zlib libedit libxml2 libllvm + ] ++ lib.optionals stdenv.isDarwin [ darwin.libobjc darwin.apple_sdk.libs.xpc darwin.apple_sdk.frameworks.Foundation @@ -46,8 +49,9 @@ stdenv.mkDerivation (rec { hardeningDisable = [ "format" ]; cmakeFlags = [ + "-DLLDB_INCLUDE_TESTS=${if doCheck then "YES" else "NO"}" "-DLLVM_ENABLE_RTTI=OFF" - "-DClang_DIR=${clang-unwrapped}/lib/cmake" + "-DClang_DIR=${libclang.dev}/lib/cmake" "-DLLVM_EXTERNAL_LIT=${lit}/bin/lit" ] ++ lib.optionals stdenv.isDarwin [ "-DLLDB_USE_SYSTEM_DEBUGSERVER=ON" @@ -57,33 +61,38 @@ stdenv.mkDerivation (rec { "-DLLVM_ENABLE_SPHINX=ON" "-DSPHINX_OUTPUT_MAN=ON" "-DSPHINX_OUTPUT_HTML=OFF" + ] ++ lib.optionals doCheck [ + "-DLLDB_TEST_C_COMPILER=${stdenv.cc}/bin/${stdenv.cc.targetPrefix}cc" + "-DLLDB_TEST_CXX_COMPILER=${stdenv.cc}/bin/${stdenv.cc.targetPrefix}c++" ]; + doCheck = false; + postInstall = '' # Editor support # vscode: install -D ../tools/lldb-vscode/package.json $out/share/vscode/extensions/llvm-org.lldb-vscode-0.1.0/package.json mkdir -p $out/share/vscode/extensions/llvm-org.lldb-vscode-0.1.0/bin - ln -s $out/bin/lldb-vscode $out/share/vscode/extensions/llvm-org.lldb-vscode-0.1.0/bin + ln -s $out/bin/llvm-vscode $out/share/vscode/extensions/llvm-org.lldb-vscode-0.1.0/bin ''; meta = with lib; { description = "A next-generation high-performance debugger"; - homepage = "https://lldb.llvm.org"; - license = licenses.ncsa; - platforms = platforms.all; + homepage = "https://lldb.llvm.org"; + license = licenses.ncsa; + platforms = platforms.all; }; } // lib.optionalAttrs enableManpages { pname = "lldb-manpages"; buildPhase = '' - make docs-lldb-man + make docs-man ''; propagatedBuildInputs = []; + # manually install lldb man page installPhase = '' - # manually install lldb man page mkdir -p $out/share/man/man1 install docs/man/lldb.1 -t $out/share/man/man1/ ''; diff --git a/pkgs/development/compilers/llvm/11/lldb/gnu-install-dirs.patch b/pkgs/development/compilers/llvm/11/lldb/gnu-install-dirs.patch new file mode 100644 index 00000000000..a4769109523 --- /dev/null +++ b/pkgs/development/compilers/llvm/11/lldb/gnu-install-dirs.patch @@ -0,0 +1,65 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index bf748020ea40..34103d2b5e1a 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -17,6 +17,8 @@ set(CMAKE_MODULE_PATH + # If we are not building as part of LLVM, build LLDB as a standalone project, + # using LLVM as an external library. + if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR) ++ include(GNUInstallDirs) ++ + project(lldb) + include(LLDBStandalone) + +diff --git a/cmake/modules/AddLLDB.cmake b/cmake/modules/AddLLDB.cmake +index 4ed5c647c5d2..89f96e710d55 100644 +--- a/cmake/modules/AddLLDB.cmake ++++ b/cmake/modules/AddLLDB.cmake +@@ -107,13 +107,13 @@ function(add_lldb_library name) + endif() + + if(PARAM_SHARED) +- set(install_dest lib${LLVM_LIBDIR_SUFFIX}) ++ set(install_dest ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}) + if(PARAM_INSTALL_PREFIX) + set(install_dest ${PARAM_INSTALL_PREFIX}) + endif() + # RUNTIME is relevant for DLL platforms, FRAMEWORK for macOS + install(TARGETS ${name} COMPONENT ${name} +- RUNTIME DESTINATION bin ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${install_dest} + ARCHIVE DESTINATION ${install_dest} + FRAMEWORK DESTINATION ${install_dest}) +diff --git a/cmake/modules/LLDBConfig.cmake b/cmake/modules/LLDBConfig.cmake +index 8465cfe3b7b7..01b7eae136e2 100644 +--- a/cmake/modules/LLDBConfig.cmake ++++ b/cmake/modules/LLDBConfig.cmake +@@ -245,7 +245,7 @@ include_directories(BEFORE + if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY) + install(DIRECTORY include/ + COMPONENT lldb-headers +- DESTINATION include ++ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} + FILES_MATCHING + PATTERN "*.h" + PATTERN ".svn" EXCLUDE +@@ -254,7 +254,7 @@ if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY) + + install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/include/ + COMPONENT lldb-headers +- DESTINATION include ++ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} + FILES_MATCHING + PATTERN "*.h" + PATTERN ".svn" EXCLUDE +diff --git a/tools/intel-features/CMakeLists.txt b/tools/intel-features/CMakeLists.txt +index efba2f74904f..e08413b1dbb1 100644 +--- a/tools/intel-features/CMakeLists.txt ++++ b/tools/intel-features/CMakeLists.txt +@@ -65,4 +65,4 @@ if (LLDB_ENABLE_PYTHON AND LLDB_BUILD_INTEL_PT) + endif() + + install(TARGETS lldbIntelFeatures +- LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX}) ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}) diff --git a/pkgs/development/compilers/llvm/11/llvm/default.nix b/pkgs/development/compilers/llvm/11/llvm/default.nix index ee2fe9c90b2..c8033b585cb 100644 --- a/pkgs/development/compilers/llvm/11/llvm/default.nix +++ b/pkgs/development/compilers/llvm/11/llvm/default.nix @@ -1,4 +1,5 @@ { lib, stdenv +, pkgsBuildBuild , fetch , cmake , python3 @@ -10,15 +11,15 @@ , version , release_version , zlib -, buildPackages +, buildLlvmTools , debugVersion ? false , enableManpages ? false -, enableSharedLibraries ? true +, enableSharedLibraries ? !stdenv.hostPlatform.isStatic , enablePFM ? !(stdenv.isDarwin || stdenv.isAarch64 # broken for Ampere eMAG 8180 (c2.large.arm on Packet) #56245 || stdenv.isAarch32 # broken for the armv7l builder ) -, enablePolly ? false +, enablePolly ? false # TODO should be on by default }: let @@ -44,8 +45,7 @@ in stdenv.mkDerivation (rec { mv polly-* $sourceRoot/tools/polly ''; - outputs = [ "out" "python" ] - ++ optional enableSharedLibraries "lib"; + outputs = [ "out" "lib" "dev" "python" ]; nativeBuildInputs = [ cmake python3 ] ++ optionals enableManpages [ python3.pkgs.sphinx python3.pkgs.recommonmark ]; @@ -55,10 +55,14 @@ in stdenv.mkDerivation (rec { propagatedBuildInputs = [ ncurses zlib ]; + patches = [ + ./gnu-install-dirs.patch + ] ++ lib.optional enablePolly ./gnu-install-dirs-polly.patch; + postPatch = optionalString stdenv.isDarwin '' substituteInPlace cmake/modules/AddLLVM.cmake \ --replace 'set(_install_name_dir INSTALL_NAME_DIR "@rpath")' "set(_install_name_dir)" \ - --replace 'set(_install_rpath "@loader_path/../lib''${LLVM_LIBDIR_SUFFIX}" ''${extra_libdir})' "" + --replace 'set(_install_rpath "@loader_path/../''${CMAKE_INSTALL_LIBDIR}''${LLVM_LIBDIR_SUFFIX}" ''${extra_libdir})' "" '' # Patch llvm-config to return correct library path based on --link-{shared,static}. + optionalString (enableSharedLibraries) '' @@ -99,6 +103,7 @@ in stdenv.mkDerivation (rec { LDFLAGS = optionalString (enableSharedLibraries && !stdenv.isDarwin) "-Wl,--build-id=sha1"; cmakeFlags = with stdenv; [ + "-DLLVM_INSTALL_CMAKE_DIR=${placeholder "dev"}/lib/cmake/llvm/" "-DCMAKE_BUILD_TYPE=${if debugVersion then "Debug" else "Release"}" "-DLLVM_INSTALL_UTILS=ON" # Needed by rustc "-DLLVM_BUILD_TESTS=ON" @@ -122,7 +127,20 @@ in stdenv.mkDerivation (rec { "-DCAN_TARGET_i386=false" ] ++ optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ "-DCMAKE_CROSSCOMPILING=True" - "-DLLVM_TABLEGEN=${buildPackages.llvm_11}/bin/llvm-tblgen" + "-DLLVM_TABLEGEN=${buildLlvmTools.llvm}/bin/llvm-tblgen" + ( + let + nativeCC = pkgsBuildBuild.targetPackages.stdenv.cc; + nativeBintools = nativeCC.bintools.bintools; + nativeToolchainFlags = [ + "-DCMAKE_C_COMPILER=${nativeCC}/bin/${nativeCC.targetPrefix}cc" + "-DCMAKE_CXX_COMPILER=${nativeCC}/bin/${nativeCC.targetPrefix}c++" + "-DCMAKE_AR=${nativeBintools}/bin/${nativeBintools.targetPrefix}ar" + "-DCMAKE_STRIP=${nativeBintools}/bin/${nativeBintools.targetPrefix}strip" + "-DCMAKE_RANLIB=${nativeBintools}/bin/${nativeBintools.targetPrefix}ranlib" + ]; + in "-DCROSS_TOOLCHAIN_FLAGS_NATIVE:list=${lib.concatStringsSep ";" nativeToolchainFlags}" + ) ]; postBuild = '' @@ -136,20 +154,19 @@ in stdenv.mkDerivation (rec { postInstall = '' mkdir -p $python/share mv $out/share/opt-viewer $python/share/opt-viewer - '' - + optionalString enableSharedLibraries '' - moveToOutput "lib/libLLVM-*" "$lib" - moveToOutput "lib/libLLVM${stdenv.hostPlatform.extensions.sharedLibrary}" "$lib" - '' - + optionalString (enableSharedLibraries && (!stdenv.isDarwin)) '' - substituteInPlace "$out/lib/cmake/llvm/LLVMExports-${if debugVersion then "debug" else "release"}.cmake" \ - --replace "\''${_IMPORT_PREFIX}/lib/libLLVM-" "$lib/lib/libLLVM-" + moveToOutput "bin/llvm-config*" "$dev" + substituteInPlace "$dev/lib/cmake/llvm/LLVMExports-${if debugVersion then "debug" else "release"}.cmake" \ + --replace "\''${_IMPORT_PREFIX}/lib/lib" "$lib/lib/lib" \ + --replace "$out/bin/llvm-config" "$dev/bin/llvm-config" + substituteInPlace "$dev/lib/cmake/llvm/LLVMConfig.cmake" \ + --replace 'set(LLVM_BINARY_DIR "''${LLVM_INSTALL_PREFIX}")' 'set(LLVM_BINARY_DIR "''${LLVM_INSTALL_PREFIX}'"$lib"'")' '' + optionalString (stdenv.isDarwin && enableSharedLibraries) '' - substituteInPlace "$out/lib/cmake/llvm/LLVMExports-${if debugVersion then "debug" else "release"}.cmake" \ - --replace "\''${_IMPORT_PREFIX}/lib/libLLVM.dylib" "$lib/lib/libLLVM.dylib" ln -s $lib/lib/libLLVM.dylib $lib/lib/libLLVM-${shortVersion}.dylib ln -s $lib/lib/libLLVM.dylib $lib/lib/libLLVM-${release_version}.dylib + '' + + optionalString (stdenv.buildPlatform != stdenv.hostPlatform) '' + cp NATIVE/bin/llvm-config $dev/bin/llvm-config-native ''; doCheck = stdenv.isLinux && (!stdenv.isx86_32) && (!stdenv.hostPlatform.isMusl); diff --git a/pkgs/development/compilers/llvm/11/llvm/gnu-install-dirs-polly.patch b/pkgs/development/compilers/llvm/11/llvm/gnu-install-dirs-polly.patch new file mode 100644 index 00000000000..fff2d4953e9 --- /dev/null +++ b/pkgs/development/compilers/llvm/11/llvm/gnu-install-dirs-polly.patch @@ -0,0 +1,106 @@ +diff --git a/tools/polly/CMakeLists.txt b/tools/polly/CMakeLists.txt +index 9939097f743e..8cc538da912a 100644 +--- a/tools/polly/CMakeLists.txt ++++ b/tools/polly/CMakeLists.txt +@@ -2,7 +2,11 @@ + if (NOT DEFINED LLVM_MAIN_SRC_DIR) + project(Polly) + cmake_minimum_required(VERSION 3.4.3) ++endif() ++ ++include(GNUInstallDirs) + ++if (NOT DEFINED LLVM_MAIN_SRC_DIR) + # Where is LLVM installed? + find_package(LLVM CONFIG REQUIRED) + set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${LLVM_CMAKE_DIR}) +@@ -145,14 +149,14 @@ include_directories( + + if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY) + install(DIRECTORY include/ +- DESTINATION include ++ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} + FILES_MATCHING + PATTERN "*.h" + PATTERN ".svn" EXCLUDE + ) + + install(DIRECTORY ${POLLY_BINARY_DIR}/include/ +- DESTINATION include ++ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} + FILES_MATCHING + PATTERN "*.h" + PATTERN "CMakeFiles" EXCLUDE +diff --git a/tools/polly/cmake/CMakeLists.txt b/tools/polly/cmake/CMakeLists.txt +index 211f95512717..f9e04a4844b6 100644 +--- a/tools/polly/cmake/CMakeLists.txt ++++ b/tools/polly/cmake/CMakeLists.txt +@@ -79,18 +79,18 @@ file(GENERATE + + # Generate PollyConfig.cmake for the install tree. + unset(POLLY_EXPORTS) +-set(POLLY_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}") ++set(POLLY_INSTALL_PREFIX "") + set(POLLY_CONFIG_LLVM_CMAKE_DIR "${LLVM_BINARY_DIR}/${LLVM_INSTALL_PACKAGE_DIR}") +-set(POLLY_CONFIG_CMAKE_DIR "${POLLY_INSTALL_PREFIX}/${POLLY_INSTALL_PACKAGE_DIR}") +-set(POLLY_CONFIG_LIBRARY_DIRS "${POLLY_INSTALL_PREFIX}/lib${LLVM_LIBDIR_SUFFIX}") ++set(POLLY_CONFIG_CMAKE_DIR "${POLLY_INSTALL_PREFIX}${CMAKE_INSTALL_PREFIX}/${POLLY_INSTALL_PACKAGE_DIR}") ++set(POLLY_CONFIG_LIBRARY_DIRS "${POLLY_INSTALL_PREFIX}${CMAKE_INSTALL_FULL_LIBDIR}${LLVM_LIBDIR_SUFFIX}") + if (POLLY_BUNDLED_ISL) + set(POLLY_CONFIG_INCLUDE_DIRS +- "${POLLY_INSTALL_PREFIX}/include" +- "${POLLY_INSTALL_PREFIX}/include/polly" ++ "${POLLY_INSTALL_PREFIX}${CMAKE_INSTALL_FULL_LIBDIR}" ++ "${POLLY_INSTALL_PREFIX}${CMAKE_INSTALL_FULL_LIBDIR}/polly" + ) + else() + set(POLLY_CONFIG_INCLUDE_DIRS +- "${POLLY_INSTALL_PREFIX}/include" ++ "${POLLY_INSTALL_PREFIX}${CMAKE_INSTALL_FULL_INCLUDEDIR}" + ${ISL_INCLUDE_DIRS} + ) + endif() +@@ -100,12 +100,12 @@ endif() + foreach(tgt IN LISTS POLLY_CONFIG_EXPORTED_TARGETS) + get_target_property(tgt_type ${tgt} TYPE) + if (tgt_type STREQUAL "EXECUTABLE") +- set(tgt_prefix "bin/") ++ set(tgt_prefix "${CMAKE_INSTALL_BINDIR}/") + else() +- set(tgt_prefix "lib/") ++ set(tgt_prefix "${CMAKE_INSTALL_LIBDIR}/") + endif() + +- set(tgt_path "${CMAKE_INSTALL_PREFIX}/${tgt_prefix}$") ++ set(tgt_path "${tgt_prefix}$") + file(RELATIVE_PATH tgt_path ${POLLY_CONFIG_CMAKE_DIR} ${tgt_path}) + + if (NOT tgt_type STREQUAL "INTERFACE_LIBRARY") +diff --git a/tools/polly/cmake/polly_macros.cmake b/tools/polly/cmake/polly_macros.cmake +index 86de6f10686e..91f30891ccbe 100644 +--- a/tools/polly/cmake/polly_macros.cmake ++++ b/tools/polly/cmake/polly_macros.cmake +@@ -44,8 +44,8 @@ macro(add_polly_library name) + if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY OR ${name} STREQUAL "LLVMPolly") + install(TARGETS ${name} + EXPORT LLVMExports +- LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX} +- ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX}) ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}) + endif() + set_property(GLOBAL APPEND PROPERTY LLVM_EXPORTS ${name}) + endmacro(add_polly_library) +diff --git a/tools/polly/lib/External/CMakeLists.txt b/tools/polly/lib/External/CMakeLists.txt +index 1039079cb49c..28b499ae1e9e 100644 +--- a/tools/polly/lib/External/CMakeLists.txt ++++ b/tools/polly/lib/External/CMakeLists.txt +@@ -275,7 +275,7 @@ if (POLLY_BUNDLED_ISL) + install(DIRECTORY + ${ISL_SOURCE_DIR}/include/ + ${ISL_BINARY_DIR}/include/ +- DESTINATION include/polly ++ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/polly + FILES_MATCHING + PATTERN "*.h" + PATTERN "CMakeFiles" EXCLUDE diff --git a/pkgs/development/compilers/llvm/11/llvm/gnu-install-dirs.patch b/pkgs/development/compilers/llvm/11/llvm/gnu-install-dirs.patch new file mode 100644 index 00000000000..29df98a693f --- /dev/null +++ b/pkgs/development/compilers/llvm/11/llvm/gnu-install-dirs.patch @@ -0,0 +1,417 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 247ad36d3845..815e2c4ba955 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -269,15 +269,21 @@ if (CMAKE_BUILD_TYPE AND + message(FATAL_ERROR "Invalid value for CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}") + endif() + ++include(GNUInstallDirs) ++ + set(LLVM_LIBDIR_SUFFIX "" CACHE STRING "Define suffix of library directory name (32/64)" ) + +-set(LLVM_TOOLS_INSTALL_DIR "bin" CACHE STRING "Path for binary subdirectory (defaults to 'bin')") ++set(LLVM_TOOLS_INSTALL_DIR "${CMAKE_INSTALL_BINDIR}" CACHE STRING ++ "Path for binary subdirectory (defaults to 'bin')") + mark_as_advanced(LLVM_TOOLS_INSTALL_DIR) + + set(LLVM_UTILS_INSTALL_DIR "${LLVM_TOOLS_INSTALL_DIR}" CACHE STRING + "Path to install LLVM utilities (enabled by LLVM_INSTALL_UTILS=ON) (defaults to LLVM_TOOLS_INSTALL_DIR)") + mark_as_advanced(LLVM_UTILS_INSTALL_DIR) + ++set(LLVM_INSTALL_CMAKE_DIR "${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}/cmake/llvm" CACHE STRING ++ "Path for CMake subdirectory (defaults to lib/cmake/llvm)" ) ++ + # They are used as destination of target generators. + set(LLVM_RUNTIME_OUTPUT_INTDIR ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bin) + set(LLVM_LIBRARY_OUTPUT_INTDIR ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/lib${LLVM_LIBDIR_SUFFIX}) +@@ -559,9 +565,9 @@ option (LLVM_ENABLE_SPHINX "Use Sphinx to generate llvm documentation." OFF) + option (LLVM_ENABLE_OCAMLDOC "Build OCaml bindings documentation." ON) + option (LLVM_ENABLE_BINDINGS "Build bindings." ON) + +-set(LLVM_INSTALL_DOXYGEN_HTML_DIR "share/doc/llvm/doxygen-html" ++set(LLVM_INSTALL_DOXYGEN_HTML_DIR "${CMAKE_INSTALL_DOCDIR}/${project}/doxygen-html" + CACHE STRING "Doxygen-generated HTML documentation install directory") +-set(LLVM_INSTALL_OCAMLDOC_HTML_DIR "share/doc/llvm/ocaml-html" ++set(LLVM_INSTALL_OCAMLDOC_HTML_DIR "${CMAKE_INSTALL_DOCDIR}/${project}/ocaml-html" + CACHE STRING "OCamldoc-generated HTML documentation install directory") + + option (LLVM_BUILD_EXTERNAL_COMPILER_RT +@@ -1107,7 +1113,7 @@ endif() + + if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY) + install(DIRECTORY include/llvm include/llvm-c +- DESTINATION include ++ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} + COMPONENT llvm-headers + FILES_MATCHING + PATTERN "*.def" +@@ -1119,7 +1125,7 @@ if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY) + ) + + install(DIRECTORY ${LLVM_INCLUDE_DIR}/llvm ${LLVM_INCLUDE_DIR}/llvm-c +- DESTINATION include ++ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} + COMPONENT llvm-headers + FILES_MATCHING + PATTERN "*.def" +@@ -1134,13 +1140,13 @@ if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY) + + if (LLVM_INSTALL_MODULEMAPS) + install(DIRECTORY include/llvm include/llvm-c +- DESTINATION include ++ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} + COMPONENT llvm-headers + FILES_MATCHING + PATTERN "module.modulemap" + ) + install(FILES include/llvm/module.install.modulemap +- DESTINATION include/llvm ++ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/llvm + COMPONENT llvm-headers + RENAME "module.extern.modulemap" + ) +diff --git a/cmake/modules/AddLLVM.cmake b/cmake/modules/AddLLVM.cmake +index b74adc11ade9..a5aa258cde30 100644 +--- a/cmake/modules/AddLLVM.cmake ++++ b/cmake/modules/AddLLVM.cmake +@@ -766,9 +766,9 @@ macro(add_llvm_library name) + + install(TARGETS ${name} + ${export_to_llvmexports} +- LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX} COMPONENT ${name} +- ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX} COMPONENT ${name} +- RUNTIME DESTINATION bin COMPONENT ${name}) ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX} COMPONENT ${name} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX} COMPONENT ${name} ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT ${name}) + + if (NOT LLVM_ENABLE_IDE) + add_llvm_install_targets(install-${name} +@@ -981,7 +981,7 @@ function(process_llvm_pass_plugins) + "set(LLVM_STATIC_EXTENSIONS ${LLVM_STATIC_EXTENSIONS})") + install(FILES + ${llvm_cmake_builddir}/LLVMConfigExtensions.cmake +- DESTINATION ${LLVM_INSTALL_PACKAGE_DIR} ++ DESTINATION ${LLVM_INSTALL_CMAKE_DIR} + COMPONENT cmake-exports) + + set(ExtensionDef "${LLVM_BINARY_DIR}/include/llvm/Support/Extension.def") +@@ -1201,7 +1201,7 @@ macro(add_llvm_example name) + endif() + add_llvm_executable(${name} ${ARGN}) + if( LLVM_BUILD_EXAMPLES ) +- install(TARGETS ${name} RUNTIME DESTINATION examples) ++ install(TARGETS ${name} RUNTIME DESTINATION ${CMAKE_INSTALL_DOCDIR}/examples) + endif() + set_target_properties(${name} PROPERTIES FOLDER "Examples") + endmacro(add_llvm_example name) +@@ -1819,7 +1819,7 @@ function(llvm_install_library_symlink name dest type) + set(full_name ${CMAKE_${type}_LIBRARY_PREFIX}${name}${CMAKE_${type}_LIBRARY_SUFFIX}) + set(full_dest ${CMAKE_${type}_LIBRARY_PREFIX}${dest}${CMAKE_${type}_LIBRARY_SUFFIX}) + +- set(output_dir lib${LLVM_LIBDIR_SUFFIX}) ++ set(output_dir ${CMAKE_INSTALL_FULL_LIBDIR}${LLVM_LIBDIR_SUFFIX}) + if(WIN32 AND "${type}" STREQUAL "SHARED") + set(output_dir bin) + endif() +@@ -1836,7 +1836,7 @@ function(llvm_install_library_symlink name dest type) + endif() + endfunction() + +-function(llvm_install_symlink name dest) ++function(llvm_install_symlink name dest output_dir) + cmake_parse_arguments(ARG "ALWAYS_GENERATE" "COMPONENT" "" ${ARGN}) + foreach(path ${CMAKE_MODULE_PATH}) + if(EXISTS ${path}/LLVMInstallSymlink.cmake) +@@ -1859,7 +1859,7 @@ function(llvm_install_symlink name dest) + set(full_dest ${dest}${CMAKE_EXECUTABLE_SUFFIX}) + + install(SCRIPT ${INSTALL_SYMLINK} +- CODE "install_symlink(${full_name} ${full_dest} ${LLVM_TOOLS_INSTALL_DIR})" ++ CODE "install_symlink(${full_name} ${full_dest} ${output_dir})" + COMPONENT ${component}) + + if (NOT LLVM_ENABLE_IDE AND NOT ARG_ALWAYS_GENERATE) +@@ -1942,7 +1942,8 @@ function(add_llvm_tool_symlink link_name target) + endif() + + if ((TOOL_IS_TOOLCHAIN OR NOT LLVM_INSTALL_TOOLCHAIN_ONLY) AND LLVM_BUILD_TOOLS) +- llvm_install_symlink(${link_name} ${target}) ++ GNUInstallDirs_get_absolute_install_dir(output_dir LLVM_TOOLS_INSTALL_DIR) ++ llvm_install_symlink(${link_name} ${target} ${output_dir}) + endif() + endif() + endfunction() +@@ -2064,9 +2065,9 @@ function(llvm_setup_rpath name) + + if (APPLE) + set(_install_name_dir INSTALL_NAME_DIR "@rpath") +- set(_install_rpath "@loader_path/../lib${LLVM_LIBDIR_SUFFIX}" ${extra_libdir}) ++ set(_install_rpath "@loader_path/../${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}" ${extra_libdir}) + elseif(UNIX) +- set(_install_rpath "\$ORIGIN/../lib${LLVM_LIBDIR_SUFFIX}" ${extra_libdir}) ++ set(_install_rpath "\$ORIGIN/../${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}" ${extra_libdir}) + if(${CMAKE_SYSTEM_NAME} MATCHES "(FreeBSD|DragonFly)") + set_property(TARGET ${name} APPEND_STRING PROPERTY + LINK_FLAGS " -Wl,-z,origin ") +diff --git a/cmake/modules/AddOCaml.cmake b/cmake/modules/AddOCaml.cmake +index 554046b20edf..4d1ad980641e 100644 +--- a/cmake/modules/AddOCaml.cmake ++++ b/cmake/modules/AddOCaml.cmake +@@ -144,9 +144,9 @@ function(add_ocaml_library name) + endforeach() + + if( APPLE ) +- set(ocaml_rpath "@executable_path/../../../lib${LLVM_LIBDIR_SUFFIX}") ++ set(ocaml_rpath "@executable_path/../../../${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}") + elseif( UNIX ) +- set(ocaml_rpath "\\$ORIGIN/../../../lib${LLVM_LIBDIR_SUFFIX}") ++ set(ocaml_rpath "\\$ORIGIN/../../../${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}") + endif() + list(APPEND ocaml_flags "-ldopt" "-Wl,-rpath,${ocaml_rpath}") + +diff --git a/cmake/modules/AddSphinxTarget.cmake b/cmake/modules/AddSphinxTarget.cmake +index b5babb30abcf..190b1222a9f9 100644 +--- a/cmake/modules/AddSphinxTarget.cmake ++++ b/cmake/modules/AddSphinxTarget.cmake +@@ -84,7 +84,7 @@ function (add_sphinx_target builder project) + endif() + elseif (builder STREQUAL html) + string(TOUPPER "${project}" project_upper) +- set(${project_upper}_INSTALL_SPHINX_HTML_DIR "share/doc/${project}/html" ++ set(${project_upper}_INSTALL_SPHINX_HTML_DIR "${CMAKE_INSTALL_DOCDIR}/${project}/html" + CACHE STRING "HTML documentation install directory for ${project}") + + # '/.' indicates: copy the contents of the directory directly into +diff --git a/cmake/modules/CMakeLists.txt b/cmake/modules/CMakeLists.txt +index 4b8879f65fe4..f01920bcc60f 100644 +--- a/cmake/modules/CMakeLists.txt ++++ b/cmake/modules/CMakeLists.txt +@@ -1,4 +1,4 @@ +-set(LLVM_INSTALL_PACKAGE_DIR lib${LLVM_LIBDIR_SUFFIX}/cmake/llvm) ++set(LLVM_INSTALL_PACKAGE_DIR ${LLVM_INSTALL_CMAKE_DIR} CACHE STRING "Path for CMake subdirectory (defaults to 'cmake/llvm')") + set(llvm_cmake_builddir "${LLVM_BINARY_DIR}/${LLVM_INSTALL_PACKAGE_DIR}") + + # First for users who use an installed LLVM, create the LLVMExports.cmake file. +@@ -108,13 +108,13 @@ foreach(p ${_count}) + set(LLVM_CONFIG_CODE "${LLVM_CONFIG_CODE} + get_filename_component(LLVM_INSTALL_PREFIX \"\${LLVM_INSTALL_PREFIX}\" PATH)") + endforeach(p) +-set(LLVM_CONFIG_INCLUDE_DIRS "\${LLVM_INSTALL_PREFIX}/include") ++set(LLVM_CONFIG_INCLUDE_DIRS "\${LLVM_INSTALL_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR}") + set(LLVM_CONFIG_INCLUDE_DIR "${LLVM_CONFIG_INCLUDE_DIRS}") + set(LLVM_CONFIG_MAIN_INCLUDE_DIR "${LLVM_CONFIG_INCLUDE_DIRS}") +-set(LLVM_CONFIG_LIBRARY_DIRS "\${LLVM_INSTALL_PREFIX}/lib\${LLVM_LIBDIR_SUFFIX}") ++set(LLVM_CONFIG_LIBRARY_DIRS "\${LLVM_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}\${LLVM_LIBDIR_SUFFIX}") + set(LLVM_CONFIG_CMAKE_DIR "\${LLVM_INSTALL_PREFIX}/${LLVM_INSTALL_PACKAGE_DIR}") + set(LLVM_CONFIG_BINARY_DIR "\${LLVM_INSTALL_PREFIX}") +-set(LLVM_CONFIG_TOOLS_BINARY_DIR "\${LLVM_INSTALL_PREFIX}/bin") ++set(LLVM_CONFIG_TOOLS_BINARY_DIR "\${LLVM_INSTALL_PREFIX}/${CMAKE_INSTALL_BINDIR}") + + # Generate a default location for lit + if (LLVM_INSTALL_UTILS AND LLVM_BUILD_UTILS) +diff --git a/cmake/modules/LLVMInstallSymlink.cmake b/cmake/modules/LLVMInstallSymlink.cmake +index 09fed8085c23..aa79f192abf0 100644 +--- a/cmake/modules/LLVMInstallSymlink.cmake ++++ b/cmake/modules/LLVMInstallSymlink.cmake +@@ -10,7 +10,7 @@ function(install_symlink name target outdir) + set(LINK_OR_COPY copy) + endif() + +- set(bindir "${DESTDIR}${CMAKE_INSTALL_PREFIX}/${outdir}/") ++ set(bindir "${DESTDIR}${outdir}/") + + message(STATUS "Creating ${name}") + +diff --git a/docs/CMake.rst b/docs/CMake.rst +index 1f908d3e95b1..1315e0aa40e1 100644 +--- a/docs/CMake.rst ++++ b/docs/CMake.rst +@@ -196,7 +196,7 @@ CMake manual, or execute ``cmake --help-variable VARIABLE_NAME``. + **LLVM_LIBDIR_SUFFIX**:STRING + Extra suffix to append to the directory where libraries are to be + installed. On a 64-bit architecture, one could use ``-DLLVM_LIBDIR_SUFFIX=64`` +- to install libraries to ``/usr/lib64``. ++ to install libraries to ``/usr/lib64``. See also ``CMAKE_INSTALL_LIBDIR``. + + **CMAKE_C_FLAGS**:STRING + Extra flags to use when compiling C source files. +@@ -516,8 +516,8 @@ LLVM-specific variables + + **LLVM_INSTALL_DOXYGEN_HTML_DIR**:STRING + The path to install Doxygen-generated HTML documentation to. This path can +- either be absolute or relative to the CMAKE_INSTALL_PREFIX. Defaults to +- `share/doc/llvm/doxygen-html`. ++ either be absolute or relative to the ``CMAKE_INSTALL_PREFIX``. Defaults to ++ `${CMAKE_INSTALL_DOCDIR}/${project}/doxygen-html`. + + **LLVM_ENABLE_SPHINX**:BOOL + If specified, CMake will search for the ``sphinx-build`` executable and will make +@@ -548,13 +548,33 @@ LLVM-specific variables + + **LLVM_INSTALL_SPHINX_HTML_DIR**:STRING + The path to install Sphinx-generated HTML documentation to. This path can +- either be absolute or relative to the CMAKE_INSTALL_PREFIX. Defaults to +- `share/doc/llvm/html`. ++ either be absolute or relative to the ``CMAKE_INSTALL_PREFIX``. Defaults to ++ `${CMAKE_INSTALL_DOCDIR}/${project}/html`. + + **LLVM_INSTALL_OCAMLDOC_HTML_DIR**:STRING + The path to install OCamldoc-generated HTML documentation to. This path can +- either be absolute or relative to the CMAKE_INSTALL_PREFIX. Defaults to +- `share/doc/llvm/ocaml-html`. ++ either be absolute or relative to the ``CMAKE_INSTALL_PREFIX``. Defaults to ++ `${CMAKE_INSTALL_DOCDIR}/${project}/ocaml-html`. ++ ++**CMAKE_INSTALL_BINDIR**:STRING ++ The path to install binary tools, relative to the ``CMAKE_INSTALL_PREFIX``. ++ Defaults to `bin`. ++ ++**CMAKE_INSTALL_LIBDIR**:STRING ++ The path to install libraries, relative to the ``CMAKE_INSTALL_PREFIX``. ++ Defaults to `lib`. ++ ++**CMAKE_INSTALL_INCLUDEDIR**:STRING ++ The path to install header files, relative to the ``CMAKE_INSTALL_PREFIX``. ++ Defaults to `include`. ++ ++**CMAKE_INSTALL_DOCDIR**:STRING ++ The path to install documentation, relative to the ``CMAKE_INSTALL_PREFIX``. ++ Defaults to `share/doc`. ++ ++**CMAKE_INSTALL_MANDIR**:STRING ++ The path to install manpage files, relative to the ``CMAKE_INSTALL_PREFIX``. ++ Defaults to `share/man`. + + **LLVM_CREATE_XCODE_TOOLCHAIN**:BOOL + macOS Only: If enabled CMake will generate a target named +@@ -752,9 +772,11 @@ the ``cmake`` command or by setting it directly in ``ccmake`` or ``cmake-gui``). + + This file is available in two different locations. + +-* ``/lib/cmake/llvm/LLVMConfig.cmake`` where +- ```` is the install prefix of an installed version of LLVM. +- On Linux typically this is ``/usr/lib/cmake/llvm/LLVMConfig.cmake``. ++* ``LLVMConfig.cmake`` where ++ ```` is the location where LLVM CMake modules are ++ installed as part of an installed version of LLVM. This is typically ++ ``cmake/llvm/`` within the lib directory. On Linux, this is typically ++ ``/usr/lib/cmake/llvm/LLVMConfig.cmake``. + + * ``/lib/cmake/llvm/LLVMConfig.cmake`` where + ```` is the root of the LLVM build tree. **Note: this is only +diff --git a/examples/Bye/CMakeLists.txt b/examples/Bye/CMakeLists.txt +index bb96edb4b4bf..678c22fb43c8 100644 +--- a/examples/Bye/CMakeLists.txt ++++ b/examples/Bye/CMakeLists.txt +@@ -14,6 +14,6 @@ if (NOT WIN32) + BUILDTREE_ONLY + ) + +- install(TARGETS ${name} RUNTIME DESTINATION examples) ++ install(TARGETS ${name} RUNTIME DESTINATION ${CMAKE_INSTALL_DOCDIR}/examples) + set_target_properties(${name} PROPERTIES FOLDER "Examples") + endif() +diff --git a/include/llvm/CMakeLists.txt b/include/llvm/CMakeLists.txt +index b46319f24fc8..2feabd1954e4 100644 +--- a/include/llvm/CMakeLists.txt ++++ b/include/llvm/CMakeLists.txt +@@ -5,5 +5,5 @@ add_subdirectory(Frontend) + # If we're doing an out-of-tree build, copy a module map for generated + # header files into the build area. + if (NOT "${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}") +- configure_file(module.modulemap.build module.modulemap COPYONLY) ++ configure_file(module.modulemap.build ${LLVM_INCLUDE_DIR}/module.modulemap COPYONLY) + endif (NOT "${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}") +diff --git a/tools/llvm-config/BuildVariables.inc.in b/tools/llvm-config/BuildVariables.inc.in +index 63cef75368b7..6295478b1f3d 100644 +--- a/tools/llvm-config/BuildVariables.inc.in ++++ b/tools/llvm-config/BuildVariables.inc.in +@@ -23,6 +23,10 @@ + #define LLVM_CXXFLAGS "@LLVM_CXXFLAGS@" + #define LLVM_BUILDMODE "@LLVM_BUILDMODE@" + #define LLVM_LIBDIR_SUFFIX "@LLVM_LIBDIR_SUFFIX@" ++#define LLVM_INSTALL_BINDIR "@CMAKE_INSTALL_BINDIR@" ++#define LLVM_INSTALL_LIBDIR "@CMAKE_INSTALL_LIBDIR@" ++#define LLVM_INSTALL_INCLUDEDIR "@CMAKE_INSTALL_INCLUDEDIR@" ++#define LLVM_INSTALL_CMAKEDIR "@LLVM_INSTALL_CMAKE_DIR@" + #define LLVM_TARGETS_BUILT "@LLVM_TARGETS_BUILT@" + #define LLVM_SYSTEM_LIBS "@LLVM_SYSTEM_LIBS@" + #define LLVM_BUILD_SYSTEM "@LLVM_BUILD_SYSTEM@" +diff --git a/tools/llvm-config/llvm-config.cpp b/tools/llvm-config/llvm-config.cpp +index 7e74b7c90816..f185e9283f83 100644 +--- a/tools/llvm-config/llvm-config.cpp ++++ b/tools/llvm-config/llvm-config.cpp +@@ -358,12 +358,26 @@ int main(int argc, char **argv) { + ("-I" + ActiveIncludeDir + " " + "-I" + ActiveObjRoot + "/include"); + } else { + ActivePrefix = CurrentExecPrefix; +- ActiveIncludeDir = ActivePrefix + "/include"; +- SmallString<256> path(StringRef(LLVM_TOOLS_INSTALL_DIR)); +- sys::fs::make_absolute(ActivePrefix, path); +- ActiveBinDir = std::string(path.str()); +- ActiveLibDir = ActivePrefix + "/lib" + LLVM_LIBDIR_SUFFIX; +- ActiveCMakeDir = ActiveLibDir + "/cmake/llvm"; ++ { ++ SmallString<256> path(StringRef(LLVM_INSTALL_INCLUDEDIR)); ++ sys::fs::make_absolute(ActivePrefix, path); ++ ActiveIncludeDir = std::string(path.str()); ++ } ++ { ++ SmallString<256> path(StringRef(LLVM_INSTALL_BINDIR)); ++ sys::fs::make_absolute(ActivePrefix, path); ++ ActiveBinDir = std::string(path.str()); ++ } ++ { ++ SmallString<256> path(StringRef(LLVM_INSTALL_LIBDIR LLVM_LIBDIR_SUFFIX)); ++ sys::fs::make_absolute(ActivePrefix, path); ++ ActiveLibDir = std::string(path.str()); ++ } ++ { ++ SmallString<256> path(StringRef(LLVM_INSTALL_CMAKEDIR)); ++ sys::fs::make_absolute(ActivePrefix, path); ++ ActiveCMakeDir = std::string(path.str()); ++ } + ActiveIncludeOption = "-I" + ActiveIncludeDir; + } + +diff --git a/tools/lto/CMakeLists.txt b/tools/lto/CMakeLists.txt +index 2963f97cad88..69d66c9c9ca1 100644 +--- a/tools/lto/CMakeLists.txt ++++ b/tools/lto/CMakeLists.txt +@@ -25,7 +25,7 @@ add_llvm_library(LTO SHARED INSTALL_WITH_TOOLCHAIN ${SOURCES} DEPENDS + intrinsics_gen) + + install(FILES ${LLVM_MAIN_INCLUDE_DIR}/llvm-c/lto.h +- DESTINATION include/llvm-c ++ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/llvm-c + COMPONENT LTO) + + if (APPLE) +diff --git a/tools/opt-viewer/CMakeLists.txt b/tools/opt-viewer/CMakeLists.txt +index ead73ec13a8f..250362021f17 100644 +--- a/tools/opt-viewer/CMakeLists.txt ++++ b/tools/opt-viewer/CMakeLists.txt +@@ -8,7 +8,7 @@ set (files + + foreach (file ${files}) + install(PROGRAMS ${file} +- DESTINATION share/opt-viewer ++ DESTINATION ${CMAKE_INSTALL_DATADIR}/opt-viewer + COMPONENT opt-viewer) + endforeach (file) + +diff --git a/tools/remarks-shlib/CMakeLists.txt b/tools/remarks-shlib/CMakeLists.txt +index e948496c603a..1f4df8a98b10 100644 +--- a/tools/remarks-shlib/CMakeLists.txt ++++ b/tools/remarks-shlib/CMakeLists.txt +@@ -11,7 +11,7 @@ set(LLVM_EXPORTED_SYMBOL_FILE ${CMAKE_CURRENT_SOURCE_DIR}/Remarks.exports) + add_llvm_library(Remarks SHARED INSTALL_WITH_TOOLCHAIN ${SOURCES}) + + install(FILES ${LLVM_MAIN_INCLUDE_DIR}/llvm-c/Remarks.h +- DESTINATION include/llvm-c ++ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/llvm-c + COMPONENT Remarks) + + if (APPLE) diff --git a/pkgs/development/compilers/llvm/12/clang/default.nix b/pkgs/development/compilers/llvm/12/clang/default.nix index ab329e3d85d..3d1106dbc52 100644 --- a/pkgs/development/compilers/llvm/12/clang/default.nix +++ b/pkgs/development/compilers/llvm/12/clang/default.nix @@ -1,4 +1,5 @@ -{ lib, stdenv, llvm_meta, fetch, cmake, libxml2, llvm, version, clang-tools-extra_src, python3, lld +{ lib, stdenv, llvm_meta, fetch, cmake, libxml2, libllvm, version, clang-tools-extra_src, python3 +, buildLlvmTools , fixDarwinDylibNames , enableManpages ? false }: @@ -18,26 +19,31 @@ let unpackFile ${clang-tools-extra_src} ''; - nativeBuildInputs = [ cmake python3 lld ] + nativeBuildInputs = [ cmake python3 ] ++ lib.optional enableManpages python3.pkgs.sphinx ++ lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames; - buildInputs = [ libxml2 llvm ]; + buildInputs = [ libxml2 libllvm ]; cmakeFlags = [ "-DCMAKE_CXX_FLAGS=-std=c++14" "-DCLANGD_BUILD_XPC=OFF" + "-DLLVM_CONFIG_PATH=${libllvm.dev}/bin/llvm-config${lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) "-native"}" ] ++ lib.optionals enableManpages [ "-DCLANG_INCLUDE_DOCS=ON" "-DLLVM_ENABLE_SPHINX=ON" "-DSPHINX_OUTPUT_MAN=ON" "-DSPHINX_OUTPUT_HTML=OFF" "-DSPHINX_WARNINGS_AS_ERRORS=OFF" + ] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ + "-DLLVM_TABLEGEN_EXE=${buildLlvmTools.llvm}/bin/llvm-tblgen" + "-DCLANG_TABLEGEN=${buildLlvmTools.libclang.dev}/bin/clang-tblgen" ]; patches = [ ./purity.patch # https://reviews.llvm.org/D51899 + ./gnu-install-dirs.patch ]; postPatch = '' @@ -51,12 +57,12 @@ let sed -i -e 's/lgcc_s/lgcc_eh/' lib/Driver/ToolChains/*.cpp ''; - outputs = [ "out" "lib" "python" ]; + outputs = [ "out" "lib" "dev" "python" ]; # Clang expects to find LLVMgold in its own prefix postInstall = '' - if [ -e ${llvm}/lib/LLVMgold.so ]; then - ln -sv ${llvm}/lib/LLVMgold.so $out/lib + 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 @@ -75,11 +81,14 @@ let fi mv $out/share/clang/*.py $python/share/clang rm $out/bin/c-index-test + + mkdir -p $dev/bin + cp bin/clang-tblgen $dev/bin ''; passthru = { isClang = true; - inherit llvm; + inherit libllvm; }; meta = llvm_meta // { diff --git a/pkgs/development/compilers/llvm/12/clang/gnu-install-dirs.patch b/pkgs/development/compilers/llvm/12/clang/gnu-install-dirs.patch new file mode 100644 index 00000000000..b834d386b4e --- /dev/null +++ b/pkgs/development/compilers/llvm/12/clang/gnu-install-dirs.patch @@ -0,0 +1,235 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 9e74014134a0..976e6a1757fd 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -5,6 +5,8 @@ cmake_minimum_required(VERSION 3.13.4) + if( CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR ) + project(Clang) + ++ include(GNUInstallDirs) ++ + set(CMAKE_CXX_STANDARD 14 CACHE STRING "C++ standard to conform to") + set(CMAKE_CXX_STANDARD_REQUIRED YES) + set(CMAKE_CXX_EXTENSIONS NO) +@@ -416,7 +418,7 @@ include_directories(BEFORE + + if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY) + install(DIRECTORY include/clang include/clang-c +- DESTINATION include ++ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} + COMPONENT clang-headers + FILES_MATCHING + PATTERN "*.def" +@@ -425,7 +427,7 @@ if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY) + ) + + install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/include/clang +- DESTINATION include ++ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} + COMPONENT clang-headers + FILES_MATCHING + PATTERN "CMakeFiles" EXCLUDE +@@ -445,7 +447,7 @@ if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY) + + add_custom_target(bash-autocomplete DEPENDS utils/bash-autocomplete.sh) + install(PROGRAMS utils/bash-autocomplete.sh +- DESTINATION share/clang ++ DESTINATION ${CMAKE_INSTALL_DATADIR}/clang + COMPONENT bash-autocomplete) + if(NOT LLVM_ENABLE_IDE) + add_llvm_install_targets(install-bash-autocomplete +diff --git a/cmake/modules/AddClang.cmake b/cmake/modules/AddClang.cmake +index 704278a0e93b..d25c8d325c71 100644 +--- a/cmake/modules/AddClang.cmake ++++ b/cmake/modules/AddClang.cmake +@@ -123,9 +123,9 @@ macro(add_clang_library name) + install(TARGETS ${lib} + COMPONENT ${lib} + ${export_to_clangtargets} +- LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX} +- ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX} +- RUNTIME DESTINATION bin) ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX} ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) + + if (NOT LLVM_ENABLE_IDE) + add_llvm_install_targets(install-${lib} +@@ -170,7 +170,7 @@ macro(add_clang_tool name) + + install(TARGETS ${name} + ${export_to_clangtargets} +- RUNTIME DESTINATION bin ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + COMPONENT ${name}) + + if(NOT LLVM_ENABLE_IDE) +@@ -185,7 +185,7 @@ endmacro() + macro(add_clang_symlink name dest) + add_llvm_tool_symlink(${name} ${dest} ALWAYS_GENERATE) + # Always generate install targets +- llvm_install_symlink(${name} ${dest} ALWAYS_GENERATE) ++ llvm_install_symlink(${name} ${dest} ${CMAKE_INSTALL_FULL_BINDIR} ALWAYS_GENERATE) + endmacro() + + function(clang_target_link_libraries target type) +diff --git a/lib/Headers/CMakeLists.txt b/lib/Headers/CMakeLists.txt +index b2c0ce8dd4a0..19e5443d8c25 100644 +--- a/lib/Headers/CMakeLists.txt ++++ b/lib/Headers/CMakeLists.txt +@@ -215,7 +215,7 @@ set_target_properties(clang-resource-headers PROPERTIES + FOLDER "Misc" + RUNTIME_OUTPUT_DIRECTORY "${output_dir}") + +-set(header_install_dir lib${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION}/include) ++set(header_install_dir ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION}/include) + + install( + FILES ${files} ${generated_files} +diff --git a/tools/c-index-test/CMakeLists.txt b/tools/c-index-test/CMakeLists.txt +index ceef4b08637c..8efad5520ca4 100644 +--- a/tools/c-index-test/CMakeLists.txt ++++ b/tools/c-index-test/CMakeLists.txt +@@ -54,7 +54,7 @@ if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY) + set_property(TARGET c-index-test APPEND PROPERTY INSTALL_RPATH + "@executable_path/../../lib") + else() +- set(INSTALL_DESTINATION bin) ++ set(INSTALL_DESTINATION ${CMAKE_INSTALL_BINDIR}) + endif() + + install(TARGETS c-index-test +diff --git a/tools/clang-format/CMakeLists.txt b/tools/clang-format/CMakeLists.txt +index 35ecdb11253c..d77d75de0094 100644 +--- a/tools/clang-format/CMakeLists.txt ++++ b/tools/clang-format/CMakeLists.txt +@@ -21,20 +21,20 @@ if( LLVM_LIB_FUZZING_ENGINE OR LLVM_USE_SANITIZE_COVERAGE ) + endif() + + install(PROGRAMS clang-format-bbedit.applescript +- DESTINATION share/clang ++ DESTINATION ${CMAKE_INSTALL_DATADIR}/clang + COMPONENT clang-format) + install(PROGRAMS clang-format-diff.py +- DESTINATION share/clang ++ DESTINATION ${CMAKE_INSTALL_DATADIR}/clang + COMPONENT clang-format) + install(PROGRAMS clang-format-sublime.py +- DESTINATION share/clang ++ DESTINATION ${CMAKE_INSTALL_DATADIR}/clang + COMPONENT clang-format) + install(PROGRAMS clang-format.el +- DESTINATION share/clang ++ DESTINATION ${CMAKE_INSTALL_DATADIR}/clang + COMPONENT clang-format) + install(PROGRAMS clang-format.py +- DESTINATION share/clang ++ DESTINATION ${CMAKE_INSTALL_DATADIR}/clang + COMPONENT clang-format) + install(PROGRAMS git-clang-format +- DESTINATION bin ++ DESTINATION ${CMAKE_INSTALL_BINDIR} + COMPONENT clang-format) +diff --git a/tools/clang-rename/CMakeLists.txt b/tools/clang-rename/CMakeLists.txt +index cda8e29ec5b1..0134d8ccd70b 100644 +--- a/tools/clang-rename/CMakeLists.txt ++++ b/tools/clang-rename/CMakeLists.txt +@@ -19,8 +19,8 @@ clang_target_link_libraries(clang-rename + ) + + install(PROGRAMS clang-rename.py +- DESTINATION share/clang ++ DESTINATION ${CMAKE_INSTALL_DATADIR}/clang + COMPONENT clang-rename) + install(PROGRAMS clang-rename.el +- DESTINATION share/clang ++ DESTINATION ${CMAKE_INSTALL_DATADIR}/clang + COMPONENT clang-rename) +diff --git a/tools/libclang/CMakeLists.txt b/tools/libclang/CMakeLists.txt +index 51ff2e7e1565..1ed5f8a079a1 100644 +--- a/tools/libclang/CMakeLists.txt ++++ b/tools/libclang/CMakeLists.txt +@@ -166,7 +166,7 @@ endif() + if(INTERNAL_INSTALL_PREFIX) + set(LIBCLANG_HEADERS_INSTALL_DESTINATION "${INTERNAL_INSTALL_PREFIX}/include") + else() +- set(LIBCLANG_HEADERS_INSTALL_DESTINATION include) ++ set(LIBCLANG_HEADERS_INSTALL_DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) + endif() + + install(DIRECTORY ../../include/clang-c +@@ -196,7 +196,7 @@ foreach(PythonVersion ${CLANG_PYTHON_BINDINGS_VERSIONS}) + COMPONENT + libclang-python-bindings + DESTINATION +- "lib${LLVM_LIBDIR_SUFFIX}/python${PythonVersion}/site-packages") ++ "${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}/python${PythonVersion}/site-packages") + endforeach() + if(NOT LLVM_ENABLE_IDE) + add_custom_target(libclang-python-bindings) +diff --git a/tools/scan-build/CMakeLists.txt b/tools/scan-build/CMakeLists.txt +index ec0702d76f18..d25d982f51da 100644 +--- a/tools/scan-build/CMakeLists.txt ++++ b/tools/scan-build/CMakeLists.txt +@@ -47,7 +47,7 @@ if(CLANG_INSTALL_SCANBUILD) + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/bin/${BinFile}) + list(APPEND Depends ${CMAKE_BINARY_DIR}/bin/${BinFile}) + install(PROGRAMS bin/${BinFile} +- DESTINATION bin ++ DESTINATION ${CMAKE_INSTALL_BINDIR} + COMPONENT scan-build) + endforeach() + +@@ -61,7 +61,7 @@ if(CLANG_INSTALL_SCANBUILD) + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/libexec/${LibexecFile}) + list(APPEND Depends ${CMAKE_BINARY_DIR}/libexec/${LibexecFile}) + install(PROGRAMS libexec/${LibexecFile} +- DESTINATION libexec ++ DESTINATION ${CMAKE_INSTALL_LIBEXECDIR} + COMPONENT scan-build) + endforeach() + +@@ -89,7 +89,7 @@ if(CLANG_INSTALL_SCANBUILD) + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/share/scan-build/${ShareFile}) + list(APPEND Depends ${CMAKE_BINARY_DIR}/share/scan-build/${ShareFile}) + install(FILES share/scan-build/${ShareFile} +- DESTINATION share/scan-build ++ DESTINATION ${CMAKE_INSTALL_DATADIR}/scan-build + COMPONENT scan-build) + endforeach() + +diff --git a/tools/scan-view/CMakeLists.txt b/tools/scan-view/CMakeLists.txt +index dd3d33439299..fea19c12ce70 100644 +--- a/tools/scan-view/CMakeLists.txt ++++ b/tools/scan-view/CMakeLists.txt +@@ -19,7 +19,7 @@ if(CLANG_INSTALL_SCANVIEW) + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/bin/${BinFile}) + list(APPEND Depends ${CMAKE_BINARY_DIR}/bin/${BinFile}) + install(PROGRAMS bin/${BinFile} +- DESTINATION bin ++ DESTINATION ${CMAKE_INSTALL_BINDIR} + COMPONENT scan-view) + endforeach() + +@@ -33,7 +33,7 @@ if(CLANG_INSTALL_SCANVIEW) + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/share/${ShareFile}) + list(APPEND Depends ${CMAKE_BINARY_DIR}/share/scan-view/${ShareFile}) + install(FILES share/${ShareFile} +- DESTINATION share/scan-view ++ DESTINATION ${CMAKE_INSTALL_DATADIR}/scan-view + COMPONENT scan-view) + endforeach() + +diff --git a/utils/hmaptool/CMakeLists.txt b/utils/hmaptool/CMakeLists.txt +index 62f2de0cb15c..6aa66825b6ec 100644 +--- a/utils/hmaptool/CMakeLists.txt ++++ b/utils/hmaptool/CMakeLists.txt +@@ -10,7 +10,7 @@ add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bin/${CLANG_HM + + list(APPEND Depends ${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bin/${CLANG_HMAPTOOL}) + install(PROGRAMS ${CLANG_HMAPTOOL} +- DESTINATION bin ++ DESTINATION ${CMAKE_INSTALL_BINDIR} + COMPONENT hmaptool) + + add_custom_target(hmaptool ALL DEPENDS ${Depends}) diff --git a/pkgs/development/compilers/llvm/12/compiler-rt/compiler-rt-X86-support-extension.patch b/pkgs/development/compilers/llvm/12/compiler-rt/X86-support-extension.patch similarity index 100% rename from pkgs/development/compilers/llvm/12/compiler-rt/compiler-rt-X86-support-extension.patch rename to pkgs/development/compilers/llvm/12/compiler-rt/X86-support-extension.patch diff --git a/pkgs/development/compilers/llvm/12/compiler-rt/compiler-rt-armv7l.patch b/pkgs/development/compilers/llvm/12/compiler-rt/armv7l.patch similarity index 100% rename from pkgs/development/compilers/llvm/12/compiler-rt/compiler-rt-armv7l.patch rename to pkgs/development/compilers/llvm/12/compiler-rt/armv7l.patch diff --git a/pkgs/development/compilers/llvm/12/compiler-rt/compiler-rt-codesign.patch b/pkgs/development/compilers/llvm/12/compiler-rt/codesign.patch similarity index 100% rename from pkgs/development/compilers/llvm/12/compiler-rt/compiler-rt-codesign.patch rename to pkgs/development/compilers/llvm/12/compiler-rt/codesign.patch diff --git a/pkgs/development/compilers/llvm/12/compiler-rt/default.nix b/pkgs/development/compilers/llvm/12/compiler-rt/default.nix index bf7f4bc4312..7126deb8f0a 100644 --- a/pkgs/development/compilers/llvm/12/compiler-rt/default.nix +++ b/pkgs/development/compilers/llvm/12/compiler-rt/default.nix @@ -13,7 +13,7 @@ stdenv.mkDerivation rec { inherit version; src = fetch pname "0d444qihq9jhqnfv003cr704v363va72zl6qaw2algj1c85cva45"; - nativeBuildInputs = [ cmake python3 llvm ]; + nativeBuildInputs = [ cmake python3 llvm.dev ]; buildInputs = lib.optional stdenv.hostPlatform.isDarwin libcxxabi; NIX_CFLAGS_COMPILE = [ @@ -21,12 +21,10 @@ stdenv.mkDerivation rec { ]; cmakeFlags = [ + "-DCOMPILER_RT_OS_DIR=" "-DCOMPILER_RT_DEFAULT_TARGET_ONLY=ON" "-DCMAKE_C_COMPILER_TARGET=${stdenv.hostPlatform.config}" "-DCMAKE_ASM_COMPILER_TARGET=${stdenv.hostPlatform.config}" - ] ++ lib.optionals (stdenv.isDarwin) [ - "-DDARWIN_macosx_OVERRIDE_SDK_VERSION=ON" - "-DDARWIN_osx_ARCHS=${stdenv.hostPlatform.parsed.cpu.name}" ] ++ lib.optionals (useLLVM || bareMetal || isMusl) [ "-DCOMPILER_RT_BUILD_SANITIZERS=OFF" "-DCOMPILER_RT_BUILD_XRAY=OFF" @@ -44,15 +42,23 @@ stdenv.mkDerivation rec { "-DCMAKE_TRY_COMPILE_TARGET_TYPE=STATIC_LIBRARY" ] ++ lib.optionals (bareMetal) [ "-DCOMPILER_RT_OS_DIR=baremetal" + ] ++ lib.optionals (stdenv.hostPlatform.isDarwin) [ + "-DDARWIN_macosx_OVERRIDE_SDK_VERSION=ON" + "-DDARWIN_osx_ARCHS=${stdenv.hostPlatform.darwinArch}" + "-DDARWIN_osx_BUILTIN_ARCHS=${stdenv.hostPlatform.darwinArch}" ]; outputs = [ "out" "dev" ]; patches = [ - ./compiler-rt-codesign.patch # Revert compiler-rt commit that makes codesign mandatory - ./compiler-rt-X86-support-extension.patch # Add support for i486 i586 i686 by reusing i386 config + ./codesign.patch # Revert compiler-rt commit that makes codesign mandatory + ./X86-support-extension.patch # Add support for i486 i586 i686 by reusing i386 config + ./gnu-install-dirs.patch + # ld-wrapper dislikes `-rpath-link //nix/store`, so we normalize away the + # extra `/`. + ./normalize-var.patch ]# ++ lib.optional stdenv.hostPlatform.isMusl ./sanitizers-nongnu.patch - ++ lib.optional stdenv.hostPlatform.isAarch32 ./compiler-rt-armv7l.patch; + ++ lib.optional stdenv.hostPlatform.isAarch32 ./armv7l.patch; # TSAN requires XPC on Darwin, which we have no public/free source files for. We can depend on the Apple frameworks @@ -78,9 +84,7 @@ stdenv.mkDerivation rec { ''; # Hack around weird upsream RPATH bug - postInstall = lib.optionalString (stdenv.hostPlatform.isDarwin || stdenv.hostPlatform.isWasm) '' - ln -s "$out/lib"/*/* "$out/lib" - '' + lib.optionalString (useLLVM) '' + postInstall = lib.optionalString (useLLVM) '' ln -s $out/lib/*/clang_rt.crtbegin-*.o $out/lib/crtbegin.o ln -s $out/lib/*/clang_rt.crtend-*.o $out/lib/crtend.o ln -s $out/lib/*/clang_rt.crtbegin_shared-*.o $out/lib/crtbeginS.o diff --git a/pkgs/development/compilers/llvm/12/compiler-rt/gnu-install-dirs.patch b/pkgs/development/compilers/llvm/12/compiler-rt/gnu-install-dirs.patch new file mode 100644 index 00000000000..c18d7924890 --- /dev/null +++ b/pkgs/development/compilers/llvm/12/compiler-rt/gnu-install-dirs.patch @@ -0,0 +1,129 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index b44ad2c2118e..d42f5664d448 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -8,6 +8,7 @@ cmake_minimum_required(VERSION 3.13.4) + # Check if compiler-rt is built as a standalone project. + if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR OR COMPILER_RT_STANDALONE_BUILD) + project(CompilerRT C CXX ASM) ++ include(GNUInstallDirs) + set(COMPILER_RT_STANDALONE_BUILD TRUE) + set_property(GLOBAL PROPERTY USE_FOLDERS ON) + endif() +diff --git a/cmake/Modules/AddCompilerRT.cmake b/cmake/Modules/AddCompilerRT.cmake +index 361538a58e47..f0d8d9ab80f1 100644 +--- a/cmake/Modules/AddCompilerRT.cmake ++++ b/cmake/Modules/AddCompilerRT.cmake +@@ -495,7 +495,7 @@ macro(add_compiler_rt_resource_file target_name file_name component) + add_custom_target(${target_name} DEPENDS ${dst_file}) + # Install in Clang resource directory. + install(FILES ${file_name} +- DESTINATION ${COMPILER_RT_INSTALL_PATH}/share ++ DESTINATION ${COMPILER_RT_INSTALL_PATH}/${CMAKE_INSTALL_FULL_INCLUDEDIR} + COMPONENT ${component}) + add_dependencies(${component} ${target_name}) + +@@ -512,7 +512,7 @@ macro(add_compiler_rt_script name) + add_custom_target(${name} DEPENDS ${dst}) + install(FILES ${dst} + PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE +- DESTINATION ${COMPILER_RT_INSTALL_PATH}/bin) ++ DESTINATION ${COMPILER_RT_INSTALL_PATH}/${CMAKE_INSTALL_FULL_BINDIR}) + endmacro(add_compiler_rt_script src name) + + # Builds custom version of libc++ and installs it in . +diff --git a/cmake/Modules/CompilerRTDarwinUtils.cmake b/cmake/Modules/CompilerRTDarwinUtils.cmake +index 456a8dcda59f..7a09e74c7c79 100644 +--- a/cmake/Modules/CompilerRTDarwinUtils.cmake ++++ b/cmake/Modules/CompilerRTDarwinUtils.cmake +@@ -508,7 +508,7 @@ macro(darwin_add_embedded_builtin_libraries) + set(DARWIN_macho_embedded_LIBRARY_OUTPUT_DIR + ${COMPILER_RT_OUTPUT_DIR}/lib/macho_embedded) + set(DARWIN_macho_embedded_LIBRARY_INSTALL_DIR +- ${COMPILER_RT_INSTALL_PATH}/lib/macho_embedded) ++ ${COMPILER_RT_INSTALL_PATH}/${CMAKE_INSTALL_FULL_LIBDIR}/macho_embedded) + + set(CFLAGS_armv7 "-target thumbv7-apple-darwin-eabi") + set(CFLAGS_i386 "-march=pentium") +diff --git a/cmake/Modules/CompilerRTUtils.cmake b/cmake/Modules/CompilerRTUtils.cmake +index f61d487e93a0..f1f46fb9599c 100644 +--- a/cmake/Modules/CompilerRTUtils.cmake ++++ b/cmake/Modules/CompilerRTUtils.cmake +@@ -378,7 +378,7 @@ endfunction() + function(get_compiler_rt_install_dir arch install_dir) + if(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR AND NOT APPLE) + get_compiler_rt_target(${arch} target) +- set(${install_dir} ${COMPILER_RT_INSTALL_PATH}/lib/${target} PARENT_SCOPE) ++ set(${install_dir} ${COMPILER_RT_INSTALL_PATH}/${CMAKE_INSTALL_FULL_LIBDIR}/${target} PARENT_SCOPE) + else() + set(${install_dir} ${COMPILER_RT_LIBRARY_INSTALL_DIR} PARENT_SCOPE) + endif() +diff --git a/cmake/base-config-ix.cmake b/cmake/base-config-ix.cmake +index 1edab43e7c0d..1aac6b73ff82 100644 +--- a/cmake/base-config-ix.cmake ++++ b/cmake/base-config-ix.cmake +@@ -65,11 +65,11 @@ if (LLVM_TREE_AVAILABLE) + else() + # Take output dir and install path from the user. + set(COMPILER_RT_OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR} CACHE PATH +- "Path where built compiler-rt libraries should be stored.") ++ "Path where built compiler-rt build artifacts should be stored.") + set(COMPILER_RT_EXEC_OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR}/bin CACHE PATH + "Path where built compiler-rt executables should be stored.") +- set(COMPILER_RT_INSTALL_PATH ${CMAKE_INSTALL_PREFIX} CACHE PATH +- "Path where built compiler-rt libraries should be installed.") ++ set(COMPILER_RT_INSTALL_PATH "" CACHE PATH ++ "Prefix where built compiler-rt artifacts should be installed, comes before CMAKE_INSTALL_PREFIX.") + option(COMPILER_RT_INCLUDE_TESTS "Generate and build compiler-rt unit tests." OFF) + option(COMPILER_RT_ENABLE_WERROR "Fail and stop if warning is triggered" OFF) + # Use a host compiler to compile/link tests. +@@ -97,7 +97,7 @@ else(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR) + set(COMPILER_RT_LIBRARY_OUTPUT_DIR + ${COMPILER_RT_OUTPUT_DIR}/lib/${COMPILER_RT_OS_DIR}) + set(COMPILER_RT_LIBRARY_INSTALL_DIR +- ${COMPILER_RT_INSTALL_PATH}/lib/${COMPILER_RT_OS_DIR}) ++ ${COMPILER_RT_INSTALL_PATH}/${CMAKE_INSTALL_FULL_LIBDIR}/${COMPILER_RT_OS_DIR}) + endif() + + if(APPLE) +diff --git a/include/CMakeLists.txt b/include/CMakeLists.txt +index b00e8caa1ddd..0fe64e4862c9 100644 +--- a/include/CMakeLists.txt ++++ b/include/CMakeLists.txt +@@ -69,22 +69,22 @@ set_target_properties(compiler-rt-headers PROPERTIES FOLDER "Compiler-RT Misc") + install(FILES ${SANITIZER_HEADERS} + COMPONENT compiler-rt-headers + PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ +- DESTINATION ${COMPILER_RT_INSTALL_PATH}/include/sanitizer) ++ DESTINATION ${COMPILER_RT_INSTALL_PATH}/${CMAKE_INSTALL_FULL_INCLUDEDIR}/sanitizer) + # Install fuzzer headers. + install(FILES ${FUZZER_HEADERS} + COMPONENT compiler-rt-headers + PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ +- DESTINATION ${COMPILER_RT_INSTALL_PATH}/include/fuzzer) ++ DESTINATION ${COMPILER_RT_INSTALL_PATH}/${CMAKE_INSTALL_FULL_INCLUDEDIR}/fuzzer) + # Install xray headers. + install(FILES ${XRAY_HEADERS} + COMPONENT compiler-rt-headers + PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ +- DESTINATION ${COMPILER_RT_INSTALL_PATH}/include/xray) ++ DESTINATION ${COMPILER_RT_INSTALL_PATH}/${CMAKE_INSTALL_FULL_INCLUDEDIR}/xray) + # Install profile headers. + install(FILES ${PROFILE_HEADERS} + COMPONENT compiler-rt-headers + PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ +- DESTINATION ${COMPILER_RT_INSTALL_PATH}/include/profile) ++ DESTINATION ${COMPILER_RT_INSTALL_PATH}/${CMAKE_INSTALL_FULL_INCLUDEDIR}/profile) + + if (NOT CMAKE_CONFIGURATION_TYPES) # don't add this for IDEs. + add_custom_target(install-compiler-rt-headers +diff --git a/lib/dfsan/CMakeLists.txt b/lib/dfsan/CMakeLists.txt +index a29de8deff1b..d39ff01613d2 100644 +--- a/lib/dfsan/CMakeLists.txt ++++ b/lib/dfsan/CMakeLists.txt +@@ -57,4 +57,4 @@ add_custom_command(OUTPUT ${dfsan_abilist_filename} + DEPENDS done_abilist.txt libc_ubuntu1404_abilist.txt) + add_dependencies(dfsan dfsan_abilist) + install(FILES ${dfsan_abilist_filename} +- DESTINATION ${COMPILER_RT_INSTALL_PATH}/share) ++ DESTINATION ${COMPILER_RT_INSTALL_PATH}/${CMAKE_INSTALL_FULL_DATADIR}) diff --git a/pkgs/development/compilers/llvm/12/compiler-rt/normalize-var.patch b/pkgs/development/compilers/llvm/12/compiler-rt/normalize-var.patch new file mode 100644 index 00000000000..135cf625ef7 --- /dev/null +++ b/pkgs/development/compilers/llvm/12/compiler-rt/normalize-var.patch @@ -0,0 +1,16 @@ +diff --git a/compiler-rt/cmake/Modules/CompilerRTUtils.cmake b/compiler-rt/cmake/Modules/CompilerRTUtils.cmake +index f1f46fb9599c..6f19e69507ba 100644 +--- a/cmake/Modules/CompilerRTUtils.cmake ++++ b/cmake/Modules/CompilerRTUtils.cmake +@@ -302,8 +302,9 @@ macro(load_llvm_config) + # Get some LLVM variables from LLVMConfig. + include("${LLVM_CMAKE_PATH}/LLVMConfig.cmake") + +- set(LLVM_LIBRARY_OUTPUT_INTDIR +- ${LLVM_BINARY_DIR}/${CMAKE_CFG_INTDIR}/lib${LLVM_LIBDIR_SUFFIX}) ++ get_filename_component(LLVM_LIBRARY_OUTPUT_INTDIR ++ ${LLVM_BINARY_DIR}/${CMAKE_CFG_INTDIR}/lib${LLVM_LIBDIR_SUFFIX} ++ REALPATH) + endif() + endmacro() + diff --git a/pkgs/development/compilers/llvm/12/default.nix b/pkgs/development/compilers/llvm/12/default.nix index a6d68d2e2a4..bfdb65ee9ac 100644 --- a/pkgs/development/compilers/llvm/12/default.nix +++ b/pkgs/development/compilers/llvm/12/default.nix @@ -1,6 +1,5 @@ { lowPrio, newScope, pkgs, lib, stdenv, cmake, gccForLibs , libxml2, python3, isl, fetchurl, overrideCC, wrapCCWith, wrapBintoolsWith -, buildPackages , buildLlvmTools # tools, but from the previous stage, for cross , targetLlvmLibraries # libraries, but from the next stage, for cross , darwin @@ -27,11 +26,11 @@ let }; tools = lib.makeExtensible (tools: let - callPackage = newScope (tools // { inherit stdenv cmake libxml2 python3 isl release_version version fetch; }); + callPackage = newScope (tools // { inherit stdenv cmake libxml2 python3 isl release_version version fetch buildLlvmTools; }); mkExtraBuildCommands = cc: '' rsrc="$out/resource-root" mkdir "$rsrc" - ln -s "${cc}/lib/clang/${release_version}/include" "$rsrc" + ln -s "${cc.lib}/lib/clang/${release_version}/include" "$rsrc" ln -s "${targetLlvmLibraries.compiler-rt.out}/lib" "$rsrc/lib" ln -s "${targetLlvmLibraries.compiler-rt.out}/share" "$rsrc/share" echo "-resource-dir=$rsrc" >> $out/nix-support/cc-cflags @@ -39,22 +38,27 @@ let in { - llvm = callPackage ./llvm { + libllvm = callPackage ./llvm { inherit llvm_meta; }; - clang-unwrapped = callPackage ./clang { - inherit (tools) lld; + # `llvm` historically had the binaries. But this migration + # technique also impedes `lib.get*`. Perhaps we will revisit it. + llvm = tools.libllvm.out; + + libclang = callPackage ./clang { inherit clang-tools-extra_src llvm_meta; }; + clang-unwrapped = tools.libclang.out; + # disabled until recommonmark supports sphinx 3 - #Llvm-manpages = lowPrio (tools.llvm.override { + #Llvm-manpages = lowPrio (tools.libllvm.override { # enableManpages = true; # python3 = pkgs.python3; # don't use python-boot #}); - clang-manpages = lowPrio (tools.clang-unwrapped.override { + clang-manpages = lowPrio (tools.libclang.override { enableManpages = true; python3 = pkgs.python3; # don't use python-boot }); @@ -65,8 +69,6 @@ let # python3 = pkgs.python3; # don't use python-boot # }); - libclang = tools.clang-unwrapped.lib; - clang = if stdenv.cc.isGNU then tools.libstdcxxClang else tools.libcxxClang; libstdcxxClang = wrapCCWith rec { diff --git a/pkgs/development/compilers/llvm/12/libcxxabi/default.nix b/pkgs/development/compilers/llvm/12/libcxxabi/default.nix index dab6c583e88..7c974262438 100644 --- a/pkgs/development/compilers/llvm/12/libcxxabi/default.nix +++ b/pkgs/development/compilers/llvm/12/libcxxabi/default.nix @@ -31,7 +31,7 @@ stdenv.mkDerivation { '' + lib.optionalString stdenv.hostPlatform.isMusl '' patch -p1 -d libcxx -i ${../../libcxx-0001-musl-hacks.patch} '' + lib.optionalString stdenv.hostPlatform.isWasm '' - patch -p1 -d llvm -i ${./libcxxabi-wasm.patch} + patch -p1 -d llvm -i ${./wasm.patch} ''; installPhase = if stdenv.isDarwin diff --git a/pkgs/development/compilers/llvm/12/libcxxabi/libcxxabi-wasm.patch b/pkgs/development/compilers/llvm/12/libcxxabi/wasm.patch similarity index 100% rename from pkgs/development/compilers/llvm/12/libcxxabi/libcxxabi-wasm.patch rename to pkgs/development/compilers/llvm/12/libcxxabi/wasm.patch diff --git a/pkgs/development/compilers/llvm/12/libunwind/default.nix b/pkgs/development/compilers/llvm/12/libunwind/default.nix index 8b75146d7b2..abfe950614a 100644 --- a/pkgs/development/compilers/llvm/12/libunwind/default.nix +++ b/pkgs/development/compilers/llvm/12/libunwind/default.nix @@ -15,6 +15,12 @@ stdenv.mkDerivation rec { mv llvm-* llvm ''; + patches = [ + ./gnu-install-dirs.patch + ]; + + outputs = [ "out" "dev" ]; + nativeBuildInputs = [ cmake ]; cmakeFlags = lib.optional (!enableShared) "-DLIBUNWIND_ENABLE_SHARED=OFF"; diff --git a/pkgs/development/compilers/llvm/12/libunwind/gnu-install-dirs.patch b/pkgs/development/compilers/llvm/12/libunwind/gnu-install-dirs.patch new file mode 100644 index 00000000000..a791d6c4323 --- /dev/null +++ b/pkgs/development/compilers/llvm/12/libunwind/gnu-install-dirs.patch @@ -0,0 +1,34 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 48cb8e004e08..fec8144fb95a 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -23,6 +23,8 @@ set(LIBUNWIND_LIBCXX_PATH "${CMAKE_CURRENT_LIST_DIR}/../libcxx" CACHE PATH + if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR OR LIBUNWIND_STANDALONE_BUILD) + project(libunwind LANGUAGES C CXX ASM) + ++ include(GNUInstallDirs) ++ + set(PACKAGE_NAME libunwind) + set(PACKAGE_VERSION 12.0.0) + set(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}") +@@ -115,17 +117,17 @@ set(CMAKE_MODULE_PATH + + if(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR AND NOT APPLE) + set(LIBUNWIND_LIBRARY_DIR ${LLVM_LIBRARY_OUTPUT_INTDIR}/${LLVM_DEFAULT_TARGET_TRIPLE}/c++) +- set(LIBUNWIND_INSTALL_LIBRARY_DIR lib${LLVM_LIBDIR_SUFFIX}/${LLVM_DEFAULT_TARGET_TRIPLE}/c++) ++ set(LIBUNWIND_INSTALL_LIBRARY_DIR ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}/${LLVM_DEFAULT_TARGET_TRIPLE}/c++) + if(LIBCXX_LIBDIR_SUBDIR) + string(APPEND LIBUNWIND_LIBRARY_DIR /${LIBUNWIND_LIBDIR_SUBDIR}) + string(APPEND LIBUNWIND_INSTALL_LIBRARY_DIR /${LIBUNWIND_LIBDIR_SUBDIR}) + endif() + elseif(LLVM_LIBRARY_OUTPUT_INTDIR) + set(LIBUNWIND_LIBRARY_DIR ${LLVM_LIBRARY_OUTPUT_INTDIR}) +- set(LIBUNWIND_INSTALL_LIBRARY_DIR lib${LIBUNWIND_LIBDIR_SUFFIX}) ++ set(LIBUNWIND_INSTALL_LIBRARY_DIR ${CMAKE_INSTALL_LIBDIR}${LIBUNWIND_LIBDIR_SUFFIX}) + else() + set(LIBUNWIND_LIBRARY_DIR ${CMAKE_BINARY_DIR}/lib${LIBUNWIND_LIBDIR_SUFFIX}) +- set(LIBUNWIND_INSTALL_LIBRARY_DIR lib${LIBUNWIND_LIBDIR_SUFFIX}) ++ set(LIBUNWIND_INSTALL_LIBRARY_DIR ${CMAKE_INSTALL_LIBDIR}${LIBUNWIND_LIBDIR_SUFFIX}) + endif() + + set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${LIBUNWIND_LIBRARY_DIR}) diff --git a/pkgs/development/compilers/llvm/12/lld/default.nix b/pkgs/development/compilers/llvm/12/lld/default.nix index 18b72a90407..d46f25b68b3 100644 --- a/pkgs/development/compilers/llvm/12/lld/default.nix +++ b/pkgs/development/compilers/llvm/12/lld/default.nix @@ -1,9 +1,10 @@ { lib, stdenv, llvm_meta +, buildLlvmTools , fetch , libunwind , cmake , libxml2 -, llvm +, libllvm , version }: @@ -13,8 +14,20 @@ stdenv.mkDerivation rec { src = fetch pname "1zakyxk5bwnh7jarckcd4rbmzi58jgn2dbah5j5cwcyfyfbx9drc"; + patches = [ + ./gnu-install-dirs.patch + ]; + nativeBuildInputs = [ cmake ]; - buildInputs = [ llvm libxml2 ]; + buildInputs = [ libllvm libxml2 ]; + + cmakeFlags = [ + "-DLLVM_CONFIG_PATH=${libllvm.dev}/bin/llvm-config${lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) "-native"}" + ] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ + "-DLLVM_TABLEGEN_EXE=${buildLlvmTools.llvm}/bin/llvm-tblgen" + ]; + + outputs = [ "out" "lib" "dev" ]; postPatch = '' substituteInPlace MachO/CMakeLists.txt --replace \ @@ -23,13 +36,6 @@ stdenv.mkDerivation rec { tar -xf "${libunwind.src}" --wildcards -C libunwind/include --strip-components=2 "libunwind-*/include/" ''; - outputs = [ "out" "dev" ]; - - postInstall = '' - moveToOutput include "$dev" - moveToOutput lib "$dev" - ''; - meta = llvm_meta // { homepage = "https://lld.llvm.org/"; description = "The LLVM linker"; diff --git a/pkgs/development/compilers/llvm/12/lld/gnu-install-dirs.patch b/pkgs/development/compilers/llvm/12/lld/gnu-install-dirs.patch new file mode 100644 index 00000000000..61e2f0e4865 --- /dev/null +++ b/pkgs/development/compilers/llvm/12/lld/gnu-install-dirs.patch @@ -0,0 +1,68 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index d4e561b50d8f..cfa5bdd79c2a 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -6,6 +6,8 @@ if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR) + set(CMAKE_INCLUDE_CURRENT_DIR ON) + set(LLD_BUILT_STANDALONE TRUE) + ++ include(GNUInstallDirs) ++ + find_program(LLVM_CONFIG_PATH "llvm-config" DOC "Path to llvm-config binary") + if(NOT LLVM_CONFIG_PATH) + message(FATAL_ERROR "llvm-config not found: specify LLVM_CONFIG_PATH") +@@ -179,7 +181,7 @@ include_directories(BEFORE + + if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY) + install(DIRECTORY include/ +- DESTINATION include ++ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} + FILES_MATCHING + PATTERN "*.h" + ) +diff --git a/cmake/modules/AddLLD.cmake b/cmake/modules/AddLLD.cmake +index 23df41312403..d62372c88de7 100644 +--- a/cmake/modules/AddLLD.cmake ++++ b/cmake/modules/AddLLD.cmake +@@ -20,9 +20,9 @@ macro(add_lld_library name) + install(TARGETS ${name} + COMPONENT ${name} + ${export_to_lldtargets} +- LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX} +- ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX} +- RUNTIME DESTINATION bin) ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX} ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) + + if (${ARG_SHARED} AND NOT CMAKE_CONFIGURATION_TYPES) + add_llvm_install_targets(install-${name} +@@ -54,7 +54,7 @@ macro(add_lld_tool name) + + install(TARGETS ${name} + ${export_to_lldtargets} +- RUNTIME DESTINATION bin ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + COMPONENT ${name}) + + if(NOT CMAKE_CONFIGURATION_TYPES) +@@ -69,5 +69,5 @@ endmacro() + macro(add_lld_symlink name dest) + add_llvm_tool_symlink(${name} ${dest} ALWAYS_GENERATE) + # Always generate install targets +- llvm_install_symlink(${name} ${dest} ALWAYS_GENERATE) ++ llvm_install_symlink(${name} ${dest} ${CMAKE_INSTALL_FULL_BINDIR} ALWAYS_GENERATE) + endmacro() +diff --git a/tools/lld/CMakeLists.txt b/tools/lld/CMakeLists.txt +index 5cff736ff57f..64e775c771b9 100644 +--- a/tools/lld/CMakeLists.txt ++++ b/tools/lld/CMakeLists.txt +@@ -21,7 +21,7 @@ target_link_libraries(lld + ) + + install(TARGETS lld +- RUNTIME DESTINATION bin) ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) + + if(NOT LLD_SYMLINKS_TO_CREATE) + set(LLD_SYMLINKS_TO_CREATE diff --git a/pkgs/development/compilers/llvm/12/lldb/default.nix b/pkgs/development/compilers/llvm/12/lldb/default.nix index 1fce82d7990..07517308b46 100644 --- a/pkgs/development/compilers/llvm/12/lldb/default.nix +++ b/pkgs/development/compilers/llvm/12/lldb/default.nix @@ -1,4 +1,5 @@ { lib, stdenv, llvm_meta +, runCommand , fetch , cmake , zlib @@ -7,8 +8,8 @@ , which , libedit , libxml2 -, llvm -, clang-unwrapped +, libllvm +, libclang , python3 , version , libobjc @@ -27,17 +28,30 @@ stdenv.mkDerivation (rec { src = fetch pname "1v85qyq3snk81vjmwq5q7xikyyqsfpqy2c4qmr81mps4avsw1g0l"; - patches = [ ./lldb-procfs.patch ]; + patches = [ + ./procfs.patch + (runCommand "resource-dir.patch" { + clangLibDir = "${libclang.lib}/lib"; + } '' + substitute '${./resource-dir.patch}' "$out" --subst-var clangLibDir + '') + ./gnu-install-dirs.patch + ]; - nativeBuildInputs = [ cmake python3 which swig lit ] - ++ lib.optionals enableManpages [ python3.pkgs.sphinx python3.pkgs.recommonmark ]; + outputs = [ "out" "lib" "dev" ]; + + nativeBuildInputs = [ + cmake python3 which swig lit + ] ++ lib.optionals enableManpages [ + python3.pkgs.sphinx python3.pkgs.recommonmark + ]; buildInputs = [ ncurses zlib libedit libxml2 - llvm + libllvm ] ++ lib.optionals stdenv.isDarwin [ libobjc @@ -51,8 +65,9 @@ stdenv.mkDerivation (rec { hardeningDisable = [ "format" ]; cmakeFlags = [ + "-DLLDB_INCLUDE_TESTS=${if doCheck then "YES" else "NO"}" "-DLLVM_ENABLE_RTTI=OFF" - "-DClang_DIR=${clang-unwrapped}/lib/cmake" + "-DClang_DIR=${libclang.dev}/lib/cmake" "-DLLVM_EXTERNAL_LIT=${lit}/bin/lit" ] ++ lib.optionals stdenv.isDarwin [ "-DLLDB_USE_SYSTEM_DEBUGSERVER=ON" @@ -62,8 +77,13 @@ stdenv.mkDerivation (rec { "-DLLVM_ENABLE_SPHINX=ON" "-DSPHINX_OUTPUT_MAN=ON" "-DSPHINX_OUTPUT_HTML=OFF" + ] ++ lib.optionals doCheck [ + "-DLLDB_TEST_C_COMPILER=${stdenv.cc}/bin/${stdenv.cc.targetPrefix}cc" + "-DLLDB_TEST_CXX_COMPILER=${stdenv.cc}/bin/${stdenv.cc.targetPrefix}c++" ]; + doCheck = false; + postInstall = '' # Editor support # vscode: @@ -90,6 +110,7 @@ stdenv.mkDerivation (rec { ''; propagatedBuildInputs = []; + # manually install lldb man page installPhase = '' mkdir -p $out/share/man/man1 diff --git a/pkgs/development/compilers/llvm/12/lldb/gnu-install-dirs.patch b/pkgs/development/compilers/llvm/12/lldb/gnu-install-dirs.patch new file mode 100644 index 00000000000..98321f4479e --- /dev/null +++ b/pkgs/development/compilers/llvm/12/lldb/gnu-install-dirs.patch @@ -0,0 +1,65 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index b5633e21c56a..f2f1035e9238 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -10,6 +10,8 @@ set(CMAKE_MODULE_PATH + # If we are not building as part of LLVM, build LLDB as a standalone project, + # using LLVM as an external library. + if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR) ++ include(GNUInstallDirs) ++ + project(lldb) + include(LLDBStandalone) + +diff --git a/cmake/modules/AddLLDB.cmake b/cmake/modules/AddLLDB.cmake +index 4ed5c647c5d2..89f96e710d55 100644 +--- a/cmake/modules/AddLLDB.cmake ++++ b/cmake/modules/AddLLDB.cmake +@@ -107,13 +107,13 @@ function(add_lldb_library name) + endif() + + if(PARAM_SHARED) +- set(install_dest lib${LLVM_LIBDIR_SUFFIX}) ++ set(install_dest ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}) + if(PARAM_INSTALL_PREFIX) + set(install_dest ${PARAM_INSTALL_PREFIX}) + endif() + # RUNTIME is relevant for DLL platforms, FRAMEWORK for macOS + install(TARGETS ${name} COMPONENT ${name} +- RUNTIME DESTINATION bin ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${install_dest} + ARCHIVE DESTINATION ${install_dest} + FRAMEWORK DESTINATION ${install_dest}) +diff --git a/cmake/modules/LLDBConfig.cmake b/cmake/modules/LLDBConfig.cmake +index 2fdf1502d055..37364341ff8b 100644 +--- a/cmake/modules/LLDBConfig.cmake ++++ b/cmake/modules/LLDBConfig.cmake +@@ -225,7 +225,7 @@ include_directories(BEFORE + if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY) + install(DIRECTORY include/ + COMPONENT lldb-headers +- DESTINATION include ++ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} + FILES_MATCHING + PATTERN "*.h" + PATTERN ".cmake" EXCLUDE +@@ -233,7 +233,7 @@ if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY) + + install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/include/ + COMPONENT lldb-headers +- DESTINATION include ++ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} + FILES_MATCHING + PATTERN "*.h" + PATTERN ".cmake" EXCLUDE +diff --git a/tools/intel-features/CMakeLists.txt b/tools/intel-features/CMakeLists.txt +index 734167e51bc5..f95761b5df58 100644 +--- a/tools/intel-features/CMakeLists.txt ++++ b/tools/intel-features/CMakeLists.txt +@@ -65,4 +65,4 @@ if (LLDB_ENABLE_PYTHON AND LLDB_BUILD_INTEL_PT) + endif() + + install(TARGETS lldbIntelFeatures +- LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX}) ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}) diff --git a/pkgs/development/compilers/llvm/12/lldb/lldb-procfs.patch b/pkgs/development/compilers/llvm/12/lldb/procfs.patch similarity index 100% rename from pkgs/development/compilers/llvm/12/lldb/lldb-procfs.patch rename to pkgs/development/compilers/llvm/12/lldb/procfs.patch diff --git a/pkgs/development/compilers/llvm/12/lldb/resource-dir.patch b/pkgs/development/compilers/llvm/12/lldb/resource-dir.patch new file mode 100644 index 00000000000..e0db80afeb9 --- /dev/null +++ b/pkgs/development/compilers/llvm/12/lldb/resource-dir.patch @@ -0,0 +1,13 @@ +diff --git a/lldb/cmake/modules/LLDBConfig.cmake b/lldb/cmake/modules/LLDBConfig.cmake +index 37364341ff8b..7f74c1a3e257 100644 +--- a/cmake/modules/LLDBConfig.cmake ++++ b/cmake/modules/LLDBConfig.cmake +@@ -257,7 +257,7 @@ if (NOT TARGET clang-resource-headers) + # Iterate over the possible places where the external resource directory + # could be and pick the first that exists. + foreach(CANDIDATE "${Clang_DIR}/../.." "${LLVM_DIR}" "${LLVM_LIBRARY_DIRS}" +- "${LLVM_BUILD_LIBRARY_DIR}" ++ "${LLVM_BUILD_LIBRARY_DIR}" "@clangLibDir@" + "${LLVM_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}") + # Build the resource directory path by appending 'clang/'. + set(CANDIDATE_RESOURCE_DIR "${CANDIDATE}/clang/${LLDB_CLANG_RESOURCE_DIR_NAME}") diff --git a/pkgs/development/compilers/llvm/12/llvm/default.nix b/pkgs/development/compilers/llvm/12/llvm/default.nix index 33bb7b931f1..0bc704a8155 100644 --- a/pkgs/development/compilers/llvm/12/llvm/default.nix +++ b/pkgs/development/compilers/llvm/12/llvm/default.nix @@ -1,4 +1,5 @@ { lib, stdenv, llvm_meta +, pkgsBuildBuild , fetch , cmake , python3 @@ -10,10 +11,10 @@ , version , release_version , zlib -, buildPackages +, buildLlvmTools , debugVersion ? false , enableManpages ? false -, enableSharedLibraries ? true +, enableSharedLibraries ? !stdenv.hostPlatform.isStatic , enablePFM ? !(stdenv.isDarwin || stdenv.isAarch64 # broken for Ampere eMAG 8180 (c2.large.arm on Packet) #56245 || stdenv.isAarch32 # broken for the armv7l builder @@ -44,8 +45,7 @@ in stdenv.mkDerivation (rec { mv polly-* $sourceRoot/tools/polly ''; - outputs = [ "out" "python" ] - ++ optional enableSharedLibraries "lib"; + outputs = [ "out" "lib" "dev" "python" ]; nativeBuildInputs = [ cmake python3 ] ++ optionals enableManpages [ python3.pkgs.sphinx python3.pkgs.recommonmark ]; @@ -59,17 +59,18 @@ in stdenv.mkDerivation (rec { # Force a test to evaluate the saved benchmark for a CPU for which LLVM has # an execution model. See NixOS/nixpkgs#119673. ../../exegesis-force-bdver2.patch - ]; + ./gnu-install-dirs.patch + ] ++ lib.optional enablePolly ./gnu-install-dirs-polly.patch; postPatch = optionalString stdenv.isDarwin '' substituteInPlace cmake/modules/AddLLVM.cmake \ --replace 'set(_install_name_dir INSTALL_NAME_DIR "@rpath")' "set(_install_name_dir)" \ - --replace 'set(_install_rpath "@loader_path/../lib''${LLVM_LIBDIR_SUFFIX}" ''${extra_libdir})' "" + --replace 'set(_install_rpath "@loader_path/../''${CMAKE_INSTALL_LIBDIR}''${LLVM_LIBDIR_SUFFIX}" ''${extra_libdir})' "" '' # Patch llvm-config to return correct library path based on --link-{shared,static}. + optionalString (enableSharedLibraries) '' - substitute '${./llvm-outputs.patch}' ./llvm-outputs.patch --subst-var lib - patch -p1 < ./llvm-outputs.patch + substitute '${./outputs.patch}' ./outputs.patch --subst-var lib + patch -p1 < ./outputs.patch '' + '' # FileSystem permissions tests fail with various special bits substituteInPlace unittests/Support/CMakeLists.txt \ @@ -108,6 +109,7 @@ in stdenv.mkDerivation (rec { LDFLAGS = optionalString (enableSharedLibraries && !stdenv.isDarwin) "-Wl,--build-id=sha1"; cmakeFlags = with stdenv; [ + "-DLLVM_INSTALL_CMAKE_DIR=${placeholder "dev"}/lib/cmake/llvm/" "-DCMAKE_BUILD_TYPE=${if debugVersion then "Debug" else "Release"}" "-DLLVM_INSTALL_UTILS=ON" # Needed by rustc "-DLLVM_BUILD_TESTS=ON" @@ -131,11 +133,24 @@ in stdenv.mkDerivation (rec { "-DCAN_TARGET_i386=false" ] ++ optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ "-DCMAKE_CROSSCOMPILING=True" - "-DLLVM_TABLEGEN=${buildPackages.llvm_12}/bin/llvm-tblgen" + "-DLLVM_TABLEGEN=${buildLlvmTools.llvm}/bin/llvm-tblgen" + ( + let + nativeCC = pkgsBuildBuild.targetPackages.stdenv.cc; + nativeBintools = nativeCC.bintools.bintools; + nativeToolchainFlags = [ + "-DCMAKE_C_COMPILER=${nativeCC}/bin/${nativeCC.targetPrefix}cc" + "-DCMAKE_CXX_COMPILER=${nativeCC}/bin/${nativeCC.targetPrefix}c++" + "-DCMAKE_AR=${nativeBintools}/bin/${nativeBintools.targetPrefix}ar" + "-DCMAKE_STRIP=${nativeBintools}/bin/${nativeBintools.targetPrefix}strip" + "-DCMAKE_RANLIB=${nativeBintools}/bin/${nativeBintools.targetPrefix}ranlib" + ]; + in "-DCROSS_TOOLCHAIN_FLAGS_NATIVE:list=${lib.concatStringsSep ";" nativeToolchainFlags}" + ) ]; postBuild = '' - rm -R $out + rm -fR $out ''; preCheck = '' @@ -145,20 +160,19 @@ in stdenv.mkDerivation (rec { postInstall = '' mkdir -p $python/share mv $out/share/opt-viewer $python/share/opt-viewer - '' - + optionalString enableSharedLibraries '' - moveToOutput "lib/libLLVM-*" "$lib" - moveToOutput "lib/libLLVM${stdenv.hostPlatform.extensions.sharedLibrary}" "$lib" - '' - + optionalString (enableSharedLibraries && (!stdenv.isDarwin)) '' - substituteInPlace "$out/lib/cmake/llvm/LLVMExports-${if debugVersion then "debug" else "release"}.cmake" \ - --replace "\''${_IMPORT_PREFIX}/lib/libLLVM-" "$lib/lib/libLLVM-" + moveToOutput "bin/llvm-config*" "$dev" + substituteInPlace "$dev/lib/cmake/llvm/LLVMExports-${if debugVersion then "debug" else "release"}.cmake" \ + --replace "\''${_IMPORT_PREFIX}/lib/lib" "$lib/lib/lib" \ + --replace "$out/bin/llvm-config" "$dev/bin/llvm-config" + substituteInPlace "$dev/lib/cmake/llvm/LLVMConfig.cmake" \ + --replace 'set(LLVM_BINARY_DIR "''${LLVM_INSTALL_PREFIX}")' 'set(LLVM_BINARY_DIR "''${LLVM_INSTALL_PREFIX}'"$lib"'")' '' + optionalString (stdenv.isDarwin && enableSharedLibraries) '' - substituteInPlace "$out/lib/cmake/llvm/LLVMExports-${if debugVersion then "debug" else "release"}.cmake" \ - --replace "\''${_IMPORT_PREFIX}/lib/libLLVM.dylib" "$lib/lib/libLLVM.dylib" ln -s $lib/lib/libLLVM.dylib $lib/lib/libLLVM-${shortVersion}.dylib ln -s $lib/lib/libLLVM.dylib $lib/lib/libLLVM-${release_version}.dylib + '' + + optionalString (stdenv.buildPlatform != stdenv.hostPlatform) '' + cp NATIVE/bin/llvm-config $dev/bin/llvm-config-native ''; doCheck = stdenv.isLinux && (!stdenv.isx86_32) && (!stdenv.hostPlatform.isMusl); diff --git a/pkgs/development/compilers/llvm/12/llvm/gnu-install-dirs-polly.patch b/pkgs/development/compilers/llvm/12/llvm/gnu-install-dirs-polly.patch new file mode 100644 index 00000000000..68f3c45396f --- /dev/null +++ b/pkgs/development/compilers/llvm/12/llvm/gnu-install-dirs-polly.patch @@ -0,0 +1,105 @@ +diff --git a/tools/polly/CMakeLists.txt b/tools/polly/CMakeLists.txt +index ca7c04c565bb..6ed5db5dd4f8 100644 +--- a/tools/polly/CMakeLists.txt ++++ b/tools/polly/CMakeLists.txt +@@ -2,7 +2,11 @@ + if (NOT DEFINED LLVM_MAIN_SRC_DIR) + project(Polly) + cmake_minimum_required(VERSION 3.13.4) ++endif() ++ ++include(GNUInstallDirs) + ++if (NOT DEFINED LLVM_MAIN_SRC_DIR) + # Where is LLVM installed? + find_package(LLVM CONFIG REQUIRED) + set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${LLVM_CMAKE_DIR}) +@@ -122,13 +126,13 @@ include_directories( + + if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY) + install(DIRECTORY include/ +- DESTINATION include ++ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} + FILES_MATCHING + PATTERN "*.h" + ) + + install(DIRECTORY ${POLLY_BINARY_DIR}/include/ +- DESTINATION include ++ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} + FILES_MATCHING + PATTERN "*.h" + PATTERN "CMakeFiles" EXCLUDE +diff --git a/tools/polly/cmake/CMakeLists.txt b/tools/polly/cmake/CMakeLists.txt +index 7cc129ba2e90..137be25e4b80 100644 +--- a/tools/polly/cmake/CMakeLists.txt ++++ b/tools/polly/cmake/CMakeLists.txt +@@ -79,18 +79,18 @@ file(GENERATE + + # Generate PollyConfig.cmake for the install tree. + unset(POLLY_EXPORTS) +-set(POLLY_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}") ++set(POLLY_INSTALL_PREFIX "") + set(POLLY_CONFIG_LLVM_CMAKE_DIR "${LLVM_BINARY_DIR}/${LLVM_INSTALL_PACKAGE_DIR}") +-set(POLLY_CONFIG_CMAKE_DIR "${POLLY_INSTALL_PREFIX}/${POLLY_INSTALL_PACKAGE_DIR}") +-set(POLLY_CONFIG_LIBRARY_DIRS "${POLLY_INSTALL_PREFIX}/lib${LLVM_LIBDIR_SUFFIX}") ++set(POLLY_CONFIG_CMAKE_DIR "${POLLY_INSTALL_PREFIX}${CMAKE_INSTALL_PREFIX}/${POLLY_INSTALL_PACKAGE_DIR}") ++set(POLLY_CONFIG_LIBRARY_DIRS "${POLLY_INSTALL_PREFIX}${CMAKE_INSTALL_FULL_LIBDIR}${LLVM_LIBDIR_SUFFIX}") + if (POLLY_BUNDLED_ISL) + set(POLLY_CONFIG_INCLUDE_DIRS +- "${POLLY_INSTALL_PREFIX}/include" +- "${POLLY_INSTALL_PREFIX}/include/polly" ++ "${POLLY_INSTALL_PREFIX}${CMAKE_INSTALL_FULL_LIBDIR}" ++ "${POLLY_INSTALL_PREFIX}${CMAKE_INSTALL_FULL_LIBDIR}/polly" + ) + else() + set(POLLY_CONFIG_INCLUDE_DIRS +- "${POLLY_INSTALL_PREFIX}/include" ++ "${POLLY_INSTALL_PREFIX}${CMAKE_INSTALL_FULL_INCLUDEDIR}" + ${ISL_INCLUDE_DIRS} + ) + endif() +@@ -100,12 +100,12 @@ endif() + foreach(tgt IN LISTS POLLY_CONFIG_EXPORTED_TARGETS) + get_target_property(tgt_type ${tgt} TYPE) + if (tgt_type STREQUAL "EXECUTABLE") +- set(tgt_prefix "bin/") ++ set(tgt_prefix "${CMAKE_INSTALL_BINDIR}/") + else() +- set(tgt_prefix "lib/") ++ set(tgt_prefix "${CMAKE_INSTALL_LIBDIR}/") + endif() + +- set(tgt_path "${CMAKE_INSTALL_PREFIX}/${tgt_prefix}$") ++ set(tgt_path "${tgt_prefix}$") + file(RELATIVE_PATH tgt_path ${POLLY_CONFIG_CMAKE_DIR} ${tgt_path}) + + if (NOT tgt_type STREQUAL "INTERFACE_LIBRARY") +diff --git a/tools/polly/cmake/polly_macros.cmake b/tools/polly/cmake/polly_macros.cmake +index 518a09b45a42..bd9d6f5542ad 100644 +--- a/tools/polly/cmake/polly_macros.cmake ++++ b/tools/polly/cmake/polly_macros.cmake +@@ -44,8 +44,8 @@ macro(add_polly_library name) + if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY OR ${name} STREQUAL "LLVMPolly") + install(TARGETS ${name} + EXPORT LLVMExports +- LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX} +- ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX}) ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}) + endif() + set_property(GLOBAL APPEND PROPERTY LLVM_EXPORTS ${name}) + endmacro(add_polly_library) +diff --git a/tools/polly/lib/External/CMakeLists.txt b/tools/polly/lib/External/CMakeLists.txt +index 8991094d92c7..178d8ad606bb 100644 +--- a/tools/polly/lib/External/CMakeLists.txt ++++ b/tools/polly/lib/External/CMakeLists.txt +@@ -275,7 +275,7 @@ if (POLLY_BUNDLED_ISL) + install(DIRECTORY + ${ISL_SOURCE_DIR}/include/ + ${ISL_BINARY_DIR}/include/ +- DESTINATION include/polly ++ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/polly + FILES_MATCHING + PATTERN "*.h" + PATTERN "CMakeFiles" EXCLUDE diff --git a/pkgs/development/compilers/llvm/12/llvm/gnu-install-dirs.patch b/pkgs/development/compilers/llvm/12/llvm/gnu-install-dirs.patch new file mode 100644 index 00000000000..da8dc144517 --- /dev/null +++ b/pkgs/development/compilers/llvm/12/llvm/gnu-install-dirs.patch @@ -0,0 +1,417 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 277d0fe54d7b..af69c8be8745 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -256,15 +256,21 @@ if (CMAKE_BUILD_TYPE AND + message(FATAL_ERROR "Invalid value for CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}") + endif() + ++include(GNUInstallDirs) ++ + set(LLVM_LIBDIR_SUFFIX "" CACHE STRING "Define suffix of library directory name (32/64)" ) + +-set(LLVM_TOOLS_INSTALL_DIR "bin" CACHE STRING "Path for binary subdirectory (defaults to 'bin')") ++set(LLVM_TOOLS_INSTALL_DIR "${CMAKE_INSTALL_BINDIR}" CACHE STRING ++ "Path for binary subdirectory (defaults to 'bin')") + mark_as_advanced(LLVM_TOOLS_INSTALL_DIR) + + set(LLVM_UTILS_INSTALL_DIR "${LLVM_TOOLS_INSTALL_DIR}" CACHE STRING + "Path to install LLVM utilities (enabled by LLVM_INSTALL_UTILS=ON) (defaults to LLVM_TOOLS_INSTALL_DIR)") + mark_as_advanced(LLVM_UTILS_INSTALL_DIR) + ++set(LLVM_INSTALL_CMAKE_DIR "${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}/cmake/llvm" CACHE STRING ++ "Path for CMake subdirectory (defaults to lib/cmake/llvm)" ) ++ + # They are used as destination of target generators. + set(LLVM_RUNTIME_OUTPUT_INTDIR ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bin) + set(LLVM_LIBRARY_OUTPUT_INTDIR ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/lib${LLVM_LIBDIR_SUFFIX}) +@@ -567,9 +573,9 @@ option (LLVM_ENABLE_SPHINX "Use Sphinx to generate llvm documentation." OFF) + option (LLVM_ENABLE_OCAMLDOC "Build OCaml bindings documentation." ON) + option (LLVM_ENABLE_BINDINGS "Build bindings." ON) + +-set(LLVM_INSTALL_DOXYGEN_HTML_DIR "share/doc/llvm/doxygen-html" ++set(LLVM_INSTALL_DOXYGEN_HTML_DIR "${CMAKE_INSTALL_DOCDIR}/${project}/doxygen-html" + CACHE STRING "Doxygen-generated HTML documentation install directory") +-set(LLVM_INSTALL_OCAMLDOC_HTML_DIR "share/doc/llvm/ocaml-html" ++set(LLVM_INSTALL_OCAMLDOC_HTML_DIR "${CMAKE_INSTALL_DOCDIR}/${project}/ocaml-html" + CACHE STRING "OCamldoc-generated HTML documentation install directory") + + option (LLVM_BUILD_EXTERNAL_COMPILER_RT +@@ -1027,7 +1033,7 @@ endif() + + if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY) + install(DIRECTORY include/llvm include/llvm-c +- DESTINATION include ++ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} + COMPONENT llvm-headers + FILES_MATCHING + PATTERN "*.def" +@@ -1038,7 +1044,7 @@ if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY) + ) + + install(DIRECTORY ${LLVM_INCLUDE_DIR}/llvm ${LLVM_INCLUDE_DIR}/llvm-c +- DESTINATION include ++ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} + COMPONENT llvm-headers + FILES_MATCHING + PATTERN "*.def" +@@ -1052,13 +1058,13 @@ if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY) + + if (LLVM_INSTALL_MODULEMAPS) + install(DIRECTORY include/llvm include/llvm-c +- DESTINATION include ++ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} + COMPONENT llvm-headers + FILES_MATCHING + PATTERN "module.modulemap" + ) + install(FILES include/llvm/module.install.modulemap +- DESTINATION include/llvm ++ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/llvm + COMPONENT llvm-headers + RENAME "module.extern.modulemap" + ) +diff --git a/cmake/modules/AddLLVM.cmake b/cmake/modules/AddLLVM.cmake +index 97c9980c7de3..409e8b615f75 100644 +--- a/cmake/modules/AddLLVM.cmake ++++ b/cmake/modules/AddLLVM.cmake +@@ -804,9 +804,9 @@ macro(add_llvm_library name) + + install(TARGETS ${name} + ${export_to_llvmexports} +- LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX} COMPONENT ${name} +- ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX} COMPONENT ${name} +- RUNTIME DESTINATION bin COMPONENT ${name}) ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX} COMPONENT ${name} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX} COMPONENT ${name} ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT ${name}) + + if (NOT LLVM_ENABLE_IDE) + add_llvm_install_targets(install-${name} +@@ -1022,7 +1022,7 @@ function(process_llvm_pass_plugins) + "set(LLVM_STATIC_EXTENSIONS ${LLVM_STATIC_EXTENSIONS})") + install(FILES + ${llvm_cmake_builddir}/LLVMConfigExtensions.cmake +- DESTINATION ${LLVM_INSTALL_PACKAGE_DIR} ++ DESTINATION ${LLVM_INSTALL_CMAKE_DIR} + COMPONENT cmake-exports) + + set(ExtensionDef "${LLVM_BINARY_DIR}/include/llvm/Support/Extension.def") +@@ -1242,7 +1242,7 @@ macro(add_llvm_example name) + endif() + add_llvm_executable(${name} ${ARGN}) + if( LLVM_BUILD_EXAMPLES ) +- install(TARGETS ${name} RUNTIME DESTINATION examples) ++ install(TARGETS ${name} RUNTIME DESTINATION ${CMAKE_INSTALL_DOCDIR}/examples) + endif() + set_target_properties(${name} PROPERTIES FOLDER "Examples") + endmacro(add_llvm_example name) +@@ -1854,7 +1854,7 @@ function(llvm_install_library_symlink name dest type) + set(full_name ${CMAKE_${type}_LIBRARY_PREFIX}${name}${CMAKE_${type}_LIBRARY_SUFFIX}) + set(full_dest ${CMAKE_${type}_LIBRARY_PREFIX}${dest}${CMAKE_${type}_LIBRARY_SUFFIX}) + +- set(output_dir lib${LLVM_LIBDIR_SUFFIX}) ++ set(output_dir ${CMAKE_INSTALL_FULL_LIBDIR}${LLVM_LIBDIR_SUFFIX}) + if(WIN32 AND "${type}" STREQUAL "SHARED") + set(output_dir bin) + endif() +@@ -1871,7 +1871,7 @@ function(llvm_install_library_symlink name dest type) + endif() + endfunction() + +-function(llvm_install_symlink name dest) ++function(llvm_install_symlink name dest output_dir) + cmake_parse_arguments(ARG "ALWAYS_GENERATE" "COMPONENT" "" ${ARGN}) + foreach(path ${CMAKE_MODULE_PATH}) + if(EXISTS ${path}/LLVMInstallSymlink.cmake) +@@ -1894,7 +1894,7 @@ function(llvm_install_symlink name dest) + set(full_dest ${dest}${CMAKE_EXECUTABLE_SUFFIX}) + + install(SCRIPT ${INSTALL_SYMLINK} +- CODE "install_symlink(${full_name} ${full_dest} ${LLVM_TOOLS_INSTALL_DIR})" ++ CODE "install_symlink(${full_name} ${full_dest} ${output_dir})" + COMPONENT ${component}) + + if (NOT LLVM_ENABLE_IDE AND NOT ARG_ALWAYS_GENERATE) +@@ -1977,7 +1977,8 @@ function(add_llvm_tool_symlink link_name target) + endif() + + if ((TOOL_IS_TOOLCHAIN OR NOT LLVM_INSTALL_TOOLCHAIN_ONLY) AND LLVM_BUILD_TOOLS) +- llvm_install_symlink(${link_name} ${target}) ++ GNUInstallDirs_get_absolute_install_dir(output_dir LLVM_TOOLS_INSTALL_DIR) ++ llvm_install_symlink(${link_name} ${target} ${output_dir}) + endif() + endif() + endfunction() +@@ -2100,9 +2101,9 @@ function(llvm_setup_rpath name) + + if (APPLE) + set(_install_name_dir INSTALL_NAME_DIR "@rpath") +- set(_install_rpath "@loader_path/../lib${LLVM_LIBDIR_SUFFIX}" ${extra_libdir}) ++ set(_install_rpath "@loader_path/../${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}" ${extra_libdir}) + elseif(UNIX) +- set(_install_rpath "\$ORIGIN/../lib${LLVM_LIBDIR_SUFFIX}" ${extra_libdir}) ++ set(_install_rpath "\$ORIGIN/../${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}" ${extra_libdir}) + if(${CMAKE_SYSTEM_NAME} MATCHES "(FreeBSD|DragonFly)") + set_property(TARGET ${name} APPEND_STRING PROPERTY + LINK_FLAGS " -Wl,-z,origin ") +diff --git a/cmake/modules/AddOCaml.cmake b/cmake/modules/AddOCaml.cmake +index 554046b20edf..4d1ad980641e 100644 +--- a/cmake/modules/AddOCaml.cmake ++++ b/cmake/modules/AddOCaml.cmake +@@ -144,9 +144,9 @@ function(add_ocaml_library name) + endforeach() + + if( APPLE ) +- set(ocaml_rpath "@executable_path/../../../lib${LLVM_LIBDIR_SUFFIX}") ++ set(ocaml_rpath "@executable_path/../../../${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}") + elseif( UNIX ) +- set(ocaml_rpath "\\$ORIGIN/../../../lib${LLVM_LIBDIR_SUFFIX}") ++ set(ocaml_rpath "\\$ORIGIN/../../../${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}") + endif() + list(APPEND ocaml_flags "-ldopt" "-Wl,-rpath,${ocaml_rpath}") + +diff --git a/cmake/modules/AddSphinxTarget.cmake b/cmake/modules/AddSphinxTarget.cmake +index e80c3b5c1cac..482f6d715ef5 100644 +--- a/cmake/modules/AddSphinxTarget.cmake ++++ b/cmake/modules/AddSphinxTarget.cmake +@@ -90,7 +90,7 @@ function (add_sphinx_target builder project) + endif() + elseif (builder STREQUAL html) + string(TOUPPER "${project}" project_upper) +- set(${project_upper}_INSTALL_SPHINX_HTML_DIR "share/doc/${project}/html" ++ set(${project_upper}_INSTALL_SPHINX_HTML_DIR "${CMAKE_INSTALL_DOCDIR}/${project}/html" + CACHE STRING "HTML documentation install directory for ${project}") + + # '/.' indicates: copy the contents of the directory directly into +diff --git a/cmake/modules/CMakeLists.txt b/cmake/modules/CMakeLists.txt +index 505dc9a29d70..36e6c63af3f4 100644 +--- a/cmake/modules/CMakeLists.txt ++++ b/cmake/modules/CMakeLists.txt +@@ -1,4 +1,4 @@ +-set(LLVM_INSTALL_PACKAGE_DIR lib${LLVM_LIBDIR_SUFFIX}/cmake/llvm) ++set(LLVM_INSTALL_PACKAGE_DIR ${LLVM_INSTALL_CMAKE_DIR} CACHE STRING "Path for CMake subdirectory (defaults to 'cmake/llvm')") + set(llvm_cmake_builddir "${LLVM_BINARY_DIR}/${LLVM_INSTALL_PACKAGE_DIR}") + + # First for users who use an installed LLVM, create the LLVMExports.cmake file. +@@ -107,13 +107,13 @@ foreach(p ${_count}) + set(LLVM_CONFIG_CODE "${LLVM_CONFIG_CODE} + get_filename_component(LLVM_INSTALL_PREFIX \"\${LLVM_INSTALL_PREFIX}\" PATH)") + endforeach(p) +-set(LLVM_CONFIG_INCLUDE_DIRS "\${LLVM_INSTALL_PREFIX}/include") ++set(LLVM_CONFIG_INCLUDE_DIRS "\${LLVM_INSTALL_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR}") + set(LLVM_CONFIG_INCLUDE_DIR "${LLVM_CONFIG_INCLUDE_DIRS}") + set(LLVM_CONFIG_MAIN_INCLUDE_DIR "${LLVM_CONFIG_INCLUDE_DIRS}") +-set(LLVM_CONFIG_LIBRARY_DIRS "\${LLVM_INSTALL_PREFIX}/lib\${LLVM_LIBDIR_SUFFIX}") ++set(LLVM_CONFIG_LIBRARY_DIRS "\${LLVM_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}\${LLVM_LIBDIR_SUFFIX}") + set(LLVM_CONFIG_CMAKE_DIR "\${LLVM_INSTALL_PREFIX}/${LLVM_INSTALL_PACKAGE_DIR}") + set(LLVM_CONFIG_BINARY_DIR "\${LLVM_INSTALL_PREFIX}") +-set(LLVM_CONFIG_TOOLS_BINARY_DIR "\${LLVM_INSTALL_PREFIX}/bin") ++set(LLVM_CONFIG_TOOLS_BINARY_DIR "\${LLVM_INSTALL_PREFIX}/${CMAKE_INSTALL_BINDIR}") + + # Generate a default location for lit + if (LLVM_INSTALL_UTILS AND LLVM_BUILD_UTILS) +diff --git a/cmake/modules/LLVMInstallSymlink.cmake b/cmake/modules/LLVMInstallSymlink.cmake +index 09fed8085c23..aa79f192abf0 100644 +--- a/cmake/modules/LLVMInstallSymlink.cmake ++++ b/cmake/modules/LLVMInstallSymlink.cmake +@@ -10,7 +10,7 @@ function(install_symlink name target outdir) + set(LINK_OR_COPY copy) + endif() + +- set(bindir "${DESTDIR}${CMAKE_INSTALL_PREFIX}/${outdir}/") ++ set(bindir "${DESTDIR}${outdir}/") + + message(STATUS "Creating ${name}") + +diff --git a/docs/CMake.rst b/docs/CMake.rst +index bb821b417ad9..6a528f7c2ad3 100644 +--- a/docs/CMake.rst ++++ b/docs/CMake.rst +@@ -196,7 +196,7 @@ CMake manual, or execute ``cmake --help-variable VARIABLE_NAME``. + **LLVM_LIBDIR_SUFFIX**:STRING + Extra suffix to append to the directory where libraries are to be + installed. On a 64-bit architecture, one could use ``-DLLVM_LIBDIR_SUFFIX=64`` +- to install libraries to ``/usr/lib64``. ++ to install libraries to ``/usr/lib64``. See also ``CMAKE_INSTALL_LIBDIR``. + + **CMAKE_C_FLAGS**:STRING + Extra flags to use when compiling C source files. +@@ -550,8 +550,8 @@ LLVM-specific variables + + **LLVM_INSTALL_DOXYGEN_HTML_DIR**:STRING + The path to install Doxygen-generated HTML documentation to. This path can +- either be absolute or relative to the CMAKE_INSTALL_PREFIX. Defaults to +- `share/doc/llvm/doxygen-html`. ++ either be absolute or relative to the ``CMAKE_INSTALL_PREFIX``. Defaults to ++ `${CMAKE_INSTALL_DOCDIR}/${project}/doxygen-html`. + + **LLVM_ENABLE_SPHINX**:BOOL + If specified, CMake will search for the ``sphinx-build`` executable and will make +@@ -582,13 +582,33 @@ LLVM-specific variables + + **LLVM_INSTALL_SPHINX_HTML_DIR**:STRING + The path to install Sphinx-generated HTML documentation to. This path can +- either be absolute or relative to the CMAKE_INSTALL_PREFIX. Defaults to +- `share/doc/llvm/html`. ++ either be absolute or relative to the ``CMAKE_INSTALL_PREFIX``. Defaults to ++ `${CMAKE_INSTALL_DOCDIR}/${project}/html`. + + **LLVM_INSTALL_OCAMLDOC_HTML_DIR**:STRING + The path to install OCamldoc-generated HTML documentation to. This path can +- either be absolute or relative to the CMAKE_INSTALL_PREFIX. Defaults to +- `share/doc/llvm/ocaml-html`. ++ either be absolute or relative to the ``CMAKE_INSTALL_PREFIX``. Defaults to ++ `${CMAKE_INSTALL_DOCDIR}/${project}/ocaml-html`. ++ ++**CMAKE_INSTALL_BINDIR**:STRING ++ The path to install binary tools, relative to the ``CMAKE_INSTALL_PREFIX``. ++ Defaults to `bin`. ++ ++**CMAKE_INSTALL_LIBDIR**:STRING ++ The path to install libraries, relative to the ``CMAKE_INSTALL_PREFIX``. ++ Defaults to `lib`. ++ ++**CMAKE_INSTALL_INCLUDEDIR**:STRING ++ The path to install header files, relative to the ``CMAKE_INSTALL_PREFIX``. ++ Defaults to `include`. ++ ++**CMAKE_INSTALL_DOCDIR**:STRING ++ The path to install documentation, relative to the ``CMAKE_INSTALL_PREFIX``. ++ Defaults to `share/doc`. ++ ++**CMAKE_INSTALL_MANDIR**:STRING ++ The path to install manpage files, relative to the ``CMAKE_INSTALL_PREFIX``. ++ Defaults to `share/man`. + + **LLVM_CREATE_XCODE_TOOLCHAIN**:BOOL + macOS Only: If enabled CMake will generate a target named +@@ -786,9 +806,11 @@ the ``cmake`` command or by setting it directly in ``ccmake`` or ``cmake-gui``). + + This file is available in two different locations. + +-* ``/lib/cmake/llvm/LLVMConfig.cmake`` where +- ```` is the install prefix of an installed version of LLVM. +- On Linux typically this is ``/usr/lib/cmake/llvm/LLVMConfig.cmake``. ++* ``LLVMConfig.cmake`` where ++ ```` is the location where LLVM CMake modules are ++ installed as part of an installed version of LLVM. This is typically ++ ``cmake/llvm/`` within the lib directory. On Linux, this is typically ++ ``/usr/lib/cmake/llvm/LLVMConfig.cmake``. + + * ``/lib/cmake/llvm/LLVMConfig.cmake`` where + ```` is the root of the LLVM build tree. **Note: this is only +diff --git a/examples/Bye/CMakeLists.txt b/examples/Bye/CMakeLists.txt +index bb96edb4b4bf..678c22fb43c8 100644 +--- a/examples/Bye/CMakeLists.txt ++++ b/examples/Bye/CMakeLists.txt +@@ -14,6 +14,6 @@ if (NOT WIN32) + BUILDTREE_ONLY + ) + +- install(TARGETS ${name} RUNTIME DESTINATION examples) ++ install(TARGETS ${name} RUNTIME DESTINATION ${CMAKE_INSTALL_DOCDIR}/examples) + set_target_properties(${name} PROPERTIES FOLDER "Examples") + endif() +diff --git a/include/llvm/CMakeLists.txt b/include/llvm/CMakeLists.txt +index b46319f24fc8..2feabd1954e4 100644 +--- a/include/llvm/CMakeLists.txt ++++ b/include/llvm/CMakeLists.txt +@@ -5,5 +5,5 @@ add_subdirectory(Frontend) + # If we're doing an out-of-tree build, copy a module map for generated + # header files into the build area. + if (NOT "${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}") +- configure_file(module.modulemap.build module.modulemap COPYONLY) ++ configure_file(module.modulemap.build ${LLVM_INCLUDE_DIR}/module.modulemap COPYONLY) + endif (NOT "${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}") +diff --git a/tools/llvm-config/BuildVariables.inc.in b/tools/llvm-config/BuildVariables.inc.in +index ebe5b73a5c65..70c497be12f5 100644 +--- a/tools/llvm-config/BuildVariables.inc.in ++++ b/tools/llvm-config/BuildVariables.inc.in +@@ -23,6 +23,10 @@ + #define LLVM_CXXFLAGS "@LLVM_CXXFLAGS@" + #define LLVM_BUILDMODE "@LLVM_BUILDMODE@" + #define LLVM_LIBDIR_SUFFIX "@LLVM_LIBDIR_SUFFIX@" ++#define LLVM_INSTALL_BINDIR "@CMAKE_INSTALL_BINDIR@" ++#define LLVM_INSTALL_LIBDIR "@CMAKE_INSTALL_LIBDIR@" ++#define LLVM_INSTALL_INCLUDEDIR "@CMAKE_INSTALL_INCLUDEDIR@" ++#define LLVM_INSTALL_CMAKEDIR "@LLVM_INSTALL_CMAKE_DIR@" + #define LLVM_TARGETS_BUILT "@LLVM_TARGETS_BUILT@" + #define LLVM_SYSTEM_LIBS "@LLVM_SYSTEM_LIBS@" + #define LLVM_BUILD_SYSTEM "@LLVM_BUILD_SYSTEM@" +diff --git a/tools/llvm-config/llvm-config.cpp b/tools/llvm-config/llvm-config.cpp +index 1a2f04552d13..44fa7d3eec6b 100644 +--- a/tools/llvm-config/llvm-config.cpp ++++ b/tools/llvm-config/llvm-config.cpp +@@ -357,12 +357,26 @@ int main(int argc, char **argv) { + ("-I" + ActiveIncludeDir + " " + "-I" + ActiveObjRoot + "/include"); + } else { + ActivePrefix = CurrentExecPrefix; +- ActiveIncludeDir = ActivePrefix + "/include"; +- SmallString<256> path(StringRef(LLVM_TOOLS_INSTALL_DIR)); +- sys::fs::make_absolute(ActivePrefix, path); +- ActiveBinDir = std::string(path.str()); +- ActiveLibDir = ActivePrefix + "/lib" + LLVM_LIBDIR_SUFFIX; +- ActiveCMakeDir = ActiveLibDir + "/cmake/llvm"; ++ { ++ SmallString<256> path(StringRef(LLVM_INSTALL_INCLUDEDIR)); ++ sys::fs::make_absolute(ActivePrefix, path); ++ ActiveIncludeDir = std::string(path.str()); ++ } ++ { ++ SmallString<256> path(StringRef(LLVM_INSTALL_BINDIR)); ++ sys::fs::make_absolute(ActivePrefix, path); ++ ActiveBinDir = std::string(path.str()); ++ } ++ { ++ SmallString<256> path(StringRef(LLVM_INSTALL_LIBDIR LLVM_LIBDIR_SUFFIX)); ++ sys::fs::make_absolute(ActivePrefix, path); ++ ActiveLibDir = std::string(path.str()); ++ } ++ { ++ SmallString<256> path(StringRef(LLVM_INSTALL_CMAKEDIR)); ++ sys::fs::make_absolute(ActivePrefix, path); ++ ActiveCMakeDir = std::string(path.str()); ++ } + ActiveIncludeOption = "-I" + ActiveIncludeDir; + } + +diff --git a/tools/lto/CMakeLists.txt b/tools/lto/CMakeLists.txt +index 2963f97cad88..69d66c9c9ca1 100644 +--- a/tools/lto/CMakeLists.txt ++++ b/tools/lto/CMakeLists.txt +@@ -25,7 +25,7 @@ add_llvm_library(LTO SHARED INSTALL_WITH_TOOLCHAIN ${SOURCES} DEPENDS + intrinsics_gen) + + install(FILES ${LLVM_MAIN_INCLUDE_DIR}/llvm-c/lto.h +- DESTINATION include/llvm-c ++ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/llvm-c + COMPONENT LTO) + + if (APPLE) +diff --git a/tools/opt-viewer/CMakeLists.txt b/tools/opt-viewer/CMakeLists.txt +index ead73ec13a8f..250362021f17 100644 +--- a/tools/opt-viewer/CMakeLists.txt ++++ b/tools/opt-viewer/CMakeLists.txt +@@ -8,7 +8,7 @@ set (files + + foreach (file ${files}) + install(PROGRAMS ${file} +- DESTINATION share/opt-viewer ++ DESTINATION ${CMAKE_INSTALL_DATADIR}/opt-viewer + COMPONENT opt-viewer) + endforeach (file) + +diff --git a/tools/remarks-shlib/CMakeLists.txt b/tools/remarks-shlib/CMakeLists.txt +index 865436247270..ce1daa62f6ab 100644 +--- a/tools/remarks-shlib/CMakeLists.txt ++++ b/tools/remarks-shlib/CMakeLists.txt +@@ -19,7 +19,7 @@ if(LLVM_ENABLE_PIC) + endif() + + install(FILES ${LLVM_MAIN_INCLUDE_DIR}/llvm-c/Remarks.h +- DESTINATION include/llvm-c ++ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/llvm-c + COMPONENT Remarks) + + if (APPLE) diff --git a/pkgs/development/compilers/llvm/12/llvm/llvm-outputs.patch b/pkgs/development/compilers/llvm/12/llvm/outputs.patch similarity index 100% rename from pkgs/development/compilers/llvm/12/llvm/llvm-outputs.patch rename to pkgs/development/compilers/llvm/12/llvm/outputs.patch diff --git a/pkgs/development/compilers/llvm/5/clang/default.nix b/pkgs/development/compilers/llvm/5/clang/default.nix index 21961f4f041..bbeb9277683 100644 --- a/pkgs/development/compilers/llvm/5/clang/default.nix +++ b/pkgs/development/compilers/llvm/5/clang/default.nix @@ -1,4 +1,5 @@ -{ lib, stdenv, fetch, cmake, libxml2, llvm, version, clang-tools-extra_src, python3 +{ lib, stdenv, fetch, cmake, libxml2, libllvm, version, clang-tools-extra_src, python3 +, buildLlvmTools , fixDarwinDylibNames , enableManpages ? false }: @@ -22,20 +23,27 @@ let ++ lib.optional enableManpages python3.pkgs.sphinx ++ lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames; - buildInputs = [ libxml2 llvm ]; + buildInputs = [ libxml2 libllvm ]; cmakeFlags = [ "-DCMAKE_CXX_FLAGS=-std=c++11" "-DLLVM_ENABLE_RTTI=ON" + "-DLLVM_CONFIG_PATH=${libllvm.dev}/bin/llvm-config${lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) "-native"}" ] ++ lib.optionals enableManpages [ "-DCLANG_INCLUDE_DOCS=ON" "-DLLVM_ENABLE_SPHINX=ON" "-DSPHINX_OUTPUT_MAN=ON" "-DSPHINX_OUTPUT_HTML=OFF" "-DSPHINX_WARNINGS_AS_ERRORS=OFF" + ] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ + "-DLLVM_TABLEGEN_EXE=${buildLlvmTools.llvm}/bin/llvm-tblgen" + "-DCLANG_TABLEGEN=${buildLlvmTools.libclang.dev}/bin/clang-tblgen" ]; - patches = [ ./purity.patch ]; + patches = [ + ./purity.patch + ./gnu-install-dirs.patch + ]; postPatch = '' sed -i -e 's/DriverArgs.hasArg(options::OPT_nostdlibinc)/true/' \ @@ -48,12 +56,12 @@ let sed -i -e 's/lgcc_s/lgcc_eh/' lib/Driver/ToolChains/*.cpp ''; - outputs = [ "out" "lib" "python" ]; + outputs = [ "out" "lib" "dev" "python" ]; # Clang expects to find LLVMgold in its own prefix postInstall = '' - if [ -e ${llvm}/lib/LLVMgold.so ]; then - ln -sv ${llvm}/lib/LLVMgold.so $out/lib + 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 @@ -70,11 +78,14 @@ let fi mv $out/share/clang/*.py $python/share/clang rm $out/bin/c-index-test + + mkdir -p $dev/bin + cp bin/clang-tblgen $dev/bin ''; passthru = { isClang = true; - inherit llvm; + inherit libllvm; }; meta = { diff --git a/pkgs/development/compilers/llvm/5/clang/gnu-install-dirs.patch b/pkgs/development/compilers/llvm/5/clang/gnu-install-dirs.patch new file mode 100644 index 00000000000..7e6903222f4 --- /dev/null +++ b/pkgs/development/compilers/llvm/5/clang/gnu-install-dirs.patch @@ -0,0 +1,242 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 2667b1d6892e..87c5ad58738f 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -5,6 +5,8 @@ cmake_minimum_required(VERSION 3.4.3) + if( CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR ) + project(Clang) + ++ include(GNUInstallDirs) ++ + # Rely on llvm-config. + set(CONFIG_OUTPUT) + find_program(LLVM_CONFIG "llvm-config") +@@ -344,7 +346,7 @@ include_directories(BEFORE + + if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY) + install(DIRECTORY include/clang include/clang-c +- DESTINATION include ++ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} + FILES_MATCHING + PATTERN "*.def" + PATTERN "*.h" +@@ -353,7 +355,7 @@ if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY) + ) + + install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/include/clang +- DESTINATION include ++ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} + FILES_MATCHING + PATTERN "CMakeFiles" EXCLUDE + PATTERN "*.inc" +@@ -361,7 +363,7 @@ if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY) + ) + + install(PROGRAMS utils/bash-autocomplete.sh +- DESTINATION share/clang ++ DESTINATION ${CMAKE_INSTALL_DATADIR}/clang + ) + endif() + +diff --git a/cmake/modules/AddClang.cmake b/cmake/modules/AddClang.cmake +index e657059744a4..19da44638fe6 100644 +--- a/cmake/modules/AddClang.cmake ++++ b/cmake/modules/AddClang.cmake +@@ -99,9 +99,9 @@ macro(add_clang_library name) + install(TARGETS ${name} + COMPONENT ${name} + ${export_to_clangtargets} +- LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX} +- ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX} +- RUNTIME DESTINATION bin) ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX} ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) + + if (${ARG_SHARED} AND NOT CMAKE_CONFIGURATION_TYPES) + add_custom_target(install-${name} +@@ -143,7 +143,7 @@ macro(add_clang_tool name) + + install(TARGETS ${name} + ${export_to_clangtargets} +- RUNTIME DESTINATION bin ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + COMPONENT ${name}) + + if(NOT CMAKE_CONFIGURATION_TYPES) +@@ -160,5 +160,5 @@ endmacro() + macro(add_clang_symlink name dest) + add_llvm_tool_symlink(${name} ${dest} ALWAYS_GENERATE) + # Always generate install targets +- llvm_install_symlink(${name} ${dest} ALWAYS_GENERATE) ++ llvm_install_symlink(${name} ${dest} ${CMAKE_INSTALL_FULL_BINDIR} ALWAYS_GENERATE) + endmacro() +diff --git a/lib/Headers/CMakeLists.txt b/lib/Headers/CMakeLists.txt +index a621c02644e3..e140efc9c83c 100644 +--- a/lib/Headers/CMakeLists.txt ++++ b/lib/Headers/CMakeLists.txt +@@ -129,13 +129,13 @@ install( + FILES ${files} ${CMAKE_CURRENT_BINARY_DIR}/arm_neon.h + COMPONENT clang-headers + PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ +- DESTINATION lib${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION}/include) ++ DESTINATION ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION}/include) + + install( + FILES ${cuda_wrapper_files} + COMPONENT clang-headers + PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ +- DESTINATION lib${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION}/include/cuda_wrappers) ++ DESTINATION ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION}/include/cuda_wrappers) + + if (NOT CMAKE_CONFIGURATION_TYPES) # don't add this for IDE's. + add_custom_target(install-clang-headers +diff --git a/tools/c-index-test/CMakeLists.txt b/tools/c-index-test/CMakeLists.txt +index ad990e010eef..92e52d05afb9 100644 +--- a/tools/c-index-test/CMakeLists.txt ++++ b/tools/c-index-test/CMakeLists.txt +@@ -48,7 +48,7 @@ if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY) + set_property(TARGET c-index-test APPEND PROPERTY INSTALL_RPATH + "@executable_path/../../lib") + else() +- set(INSTALL_DESTINATION bin) ++ set(INSTALL_DESTINATION ${CMAKE_INSTALL_BINDIR}) + endif() + + install(TARGETS c-index-test +diff --git a/tools/clang-check/CMakeLists.txt b/tools/clang-check/CMakeLists.txt +index 04151a8e0331..13918d91c4ba 100644 +--- a/tools/clang-check/CMakeLists.txt ++++ b/tools/clang-check/CMakeLists.txt +@@ -19,4 +19,4 @@ target_link_libraries(clang-check + ) + + install(TARGETS clang-check +- RUNTIME DESTINATION bin) ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) +diff --git a/tools/clang-format/CMakeLists.txt b/tools/clang-format/CMakeLists.txt +index a13633eaefc4..9b0094783690 100644 +--- a/tools/clang-format/CMakeLists.txt ++++ b/tools/clang-format/CMakeLists.txt +@@ -20,20 +20,20 @@ if( LLVM_USE_SANITIZE_COVERAGE ) + endif() + + install(PROGRAMS clang-format-bbedit.applescript +- DESTINATION share/clang ++ DESTINATION ${CMAKE_INSTALL_DATADIR}/clang + COMPONENT clang-format) + install(PROGRAMS clang-format-diff.py +- DESTINATION share/clang ++ DESTINATION ${CMAKE_INSTALL_DATADIR}/clang + COMPONENT clang-format) + install(PROGRAMS clang-format-sublime.py +- DESTINATION share/clang ++ DESTINATION ${CMAKE_INSTALL_DATADIR}/clang + COMPONENT clang-format) + install(PROGRAMS clang-format.el +- DESTINATION share/clang ++ DESTINATION ${CMAKE_INSTALL_DATADIR}/clang + COMPONENT clang-format) + install(PROGRAMS clang-format.py +- DESTINATION share/clang ++ DESTINATION ${CMAKE_INSTALL_DATADIR}/clang + COMPONENT clang-format) + install(PROGRAMS git-clang-format +- DESTINATION bin ++ DESTINATION ${CMAKE_INSTALL_BINDIR} + COMPONENT clang-format) +diff --git a/tools/clang-offload-bundler/CMakeLists.txt b/tools/clang-offload-bundler/CMakeLists.txt +index 6161d08ae587..a003292d1676 100644 +--- a/tools/clang-offload-bundler/CMakeLists.txt ++++ b/tools/clang-offload-bundler/CMakeLists.txt +@@ -21,4 +21,4 @@ target_link_libraries(clang-offload-bundler + ${CLANG_OFFLOAD_BUNDLER_LIB_DEPS} + ) + +-install(TARGETS clang-offload-bundler RUNTIME DESTINATION bin) ++install(TARGETS clang-offload-bundler RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) +diff --git a/tools/clang-rename/CMakeLists.txt b/tools/clang-rename/CMakeLists.txt +index 771e3bdea6f0..d1396e62b28f 100644 +--- a/tools/clang-rename/CMakeLists.txt ++++ b/tools/clang-rename/CMakeLists.txt +@@ -14,11 +14,11 @@ target_link_libraries(clang-rename + clangToolingRefactor + ) + +-install(TARGETS clang-rename RUNTIME DESTINATION bin) ++install(TARGETS clang-rename RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) + + install(PROGRAMS clang-rename.py +- DESTINATION share/clang ++ DESTINATION ${CMAKE_INSTALL_DATADIR}/clang + COMPONENT clang-rename) + install(PROGRAMS clang-rename.el +- DESTINATION share/clang ++ DESTINATION ${CMAKE_INSTALL_DATADIR}/clang + COMPONENT clang-rename) +diff --git a/tools/libclang/CMakeLists.txt b/tools/libclang/CMakeLists.txt +index 2dd670307636..1fe576f77ddb 100644 +--- a/tools/libclang/CMakeLists.txt ++++ b/tools/libclang/CMakeLists.txt +@@ -121,7 +121,7 @@ endif() + if(INTERNAL_INSTALL_PREFIX) + set(LIBCLANG_HEADERS_INSTALL_DESTINATION "${INTERNAL_INSTALL_PREFIX}/include") + else() +- set(LIBCLANG_HEADERS_INSTALL_DESTINATION include) ++ set(LIBCLANG_HEADERS_INSTALL_DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) + endif() + + install(DIRECTORY ../../include/clang-c +diff --git a/tools/scan-build/CMakeLists.txt b/tools/scan-build/CMakeLists.txt +index 380379300b09..adfd58ed5f7d 100644 +--- a/tools/scan-build/CMakeLists.txt ++++ b/tools/scan-build/CMakeLists.txt +@@ -41,7 +41,7 @@ if(CLANG_INSTALL_SCANBUILD) + ${CMAKE_BINARY_DIR}/bin/ + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/bin/${BinFile}) + list(APPEND Depends ${CMAKE_BINARY_DIR}/bin/${BinFile}) +- install(PROGRAMS bin/${BinFile} DESTINATION bin) ++ install(PROGRAMS bin/${BinFile} DESTINATION ${CMAKE_INSTALL_BINDIR}) + endforeach() + + foreach(LibexecFile ${LibexecFiles}) +@@ -53,7 +53,7 @@ if(CLANG_INSTALL_SCANBUILD) + ${CMAKE_BINARY_DIR}/libexec/ + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/libexec/${LibexecFile}) + list(APPEND Depends ${CMAKE_BINARY_DIR}/libexec/${LibexecFile}) +- install(PROGRAMS libexec/${LibexecFile} DESTINATION libexec) ++ install(PROGRAMS libexec/${LibexecFile} DESTINATION ${CMAKE_INSTALL_LIBEXECDIR}) + endforeach() + + foreach(ManPage ${ManPages}) +@@ -77,7 +77,7 @@ if(CLANG_INSTALL_SCANBUILD) + ${CMAKE_BINARY_DIR}/share/scan-build/ + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/share/scan-build/${ShareFile}) + list(APPEND Depends ${CMAKE_BINARY_DIR}/share/scan-build/${ShareFile}) +- install(FILES share/scan-build/${ShareFile} DESTINATION share/scan-build) ++ install(FILES share/scan-build/${ShareFile} DESTINATION ${CMAKE_INSTALL_DATADIR}/scan-build) + endforeach() + + add_custom_target(scan-build ALL DEPENDS ${Depends}) +diff --git a/tools/scan-view/CMakeLists.txt b/tools/scan-view/CMakeLists.txt +index b305ca562a72..554bcb379061 100644 +--- a/tools/scan-view/CMakeLists.txt ++++ b/tools/scan-view/CMakeLists.txt +@@ -21,7 +21,7 @@ if(CLANG_INSTALL_SCANVIEW) + ${CMAKE_BINARY_DIR}/bin/ + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/bin/${BinFile}) + list(APPEND Depends ${CMAKE_BINARY_DIR}/bin/${BinFile}) +- install(PROGRAMS bin/${BinFile} DESTINATION bin) ++ install(PROGRAMS bin/${BinFile} DESTINATION ${CMAKE_INSTALL_BINDIR}) + endforeach() + + foreach(ShareFile ${ShareFiles}) +@@ -33,7 +33,7 @@ if(CLANG_INSTALL_SCANVIEW) + ${CMAKE_BINARY_DIR}/share/scan-view/ + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/share/${ShareFile}) + list(APPEND Depends ${CMAKE_BINARY_DIR}/share/scan-view/${ShareFile}) +- install(FILES share/${ShareFile} DESTINATION share/scan-view) ++ install(FILES share/${ShareFile} DESTINATION ${CMAKE_INSTALL_DATADIR}/scan-view) + endforeach() + + add_custom_target(scan-view ALL DEPENDS ${Depends}) diff --git a/pkgs/development/compilers/llvm/5/compiler-rt/default.nix b/pkgs/development/compilers/llvm/5/compiler-rt/default.nix index 705c5994bd1..237cea11a7c 100644 --- a/pkgs/development/compilers/llvm/5/compiler-rt/default.nix +++ b/pkgs/development/compilers/llvm/5/compiler-rt/default.nix @@ -13,7 +13,7 @@ stdenv.mkDerivation { inherit version; src = fetch "compiler-rt" "0ipd4jdxpczgr2w6lzrabymz6dhzj69ywmyybjjc1q397zgrvziy"; - nativeBuildInputs = [ cmake python3 llvm ]; + nativeBuildInputs = [ cmake python3 llvm.dev ]; buildInputs = lib.optional stdenv.hostPlatform.isDarwin libcxxabi; NIX_CFLAGS_COMPILE = [ @@ -21,6 +21,7 @@ stdenv.mkDerivation { ]; cmakeFlags = [ + "-DCOMPILER_RT_OS_DIR=" "-DCOMPILER_RT_DEFAULT_TARGET_ONLY=ON" "-DCMAKE_C_COMPILER_TARGET=${stdenv.hostPlatform.config}" "-DCMAKE_ASM_COMPILER_TARGET=${stdenv.hostPlatform.config}" @@ -54,6 +55,7 @@ stdenv.mkDerivation { ./codesign.patch # Revert compiler-rt commit that makes codesign mandatory # https://github.com/llvm/llvm-project/commit/947f9692440836dcb8d88b74b69dd379d85974ce ../../common/compiler-rt/glibc.patch + ./gnu-install-dirs.patch ] ++ lib.optional stdenv.hostPlatform.isMusl ./sanitizers-nongnu.patch ++ lib.optional (stdenv.hostPlatform.libc == "glibc") ./sys-ustat.patch ++ lib.optional stdenv.hostPlatform.isAarch32 ./armv7l.patch; @@ -76,9 +78,7 @@ stdenv.mkDerivation { ''; # Hack around weird upsream RPATH bug - postInstall = lib.optionalString (stdenv.hostPlatform.isDarwin || stdenv.hostPlatform.isWasm) '' - ln -s "$out/lib"/*/* "$out/lib" - '' + lib.optionalString (useLLVM) '' + postInstall = lib.optionalString (useLLVM) '' ln -s $out/lib/*/clang_rt.crtbegin-*.o $out/lib/linux/crtbegin.o ln -s $out/lib/*/clang_rt.crtend-*.o $out/lib/linux/crtend.o ln -s $out/lib/*/clang_rt.crtbegin_shared-*.o $out/lib/linux/crtbeginS.o diff --git a/pkgs/development/compilers/llvm/5/compiler-rt/gnu-install-dirs.patch b/pkgs/development/compilers/llvm/5/compiler-rt/gnu-install-dirs.patch new file mode 100644 index 00000000000..618e597e96d --- /dev/null +++ b/pkgs/development/compilers/llvm/5/compiler-rt/gnu-install-dirs.patch @@ -0,0 +1,103 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index f997c53410c1..ac079d89b57b 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -12,6 +12,7 @@ cmake_minimum_required(VERSION 3.4.3) + # Check if compiler-rt is built as a standalone project. + if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR OR COMPILER_RT_STANDALONE_BUILD) + project(CompilerRT C CXX ASM) ++ include(GNUInstallDirs) + set(COMPILER_RT_STANDALONE_BUILD TRUE) + endif() + +diff --git a/cmake/Modules/AddCompilerRT.cmake b/cmake/Modules/AddCompilerRT.cmake +index bc5fb9ff722b..91fb79d1980c 100644 +--- a/cmake/Modules/AddCompilerRT.cmake ++++ b/cmake/Modules/AddCompilerRT.cmake +@@ -344,7 +344,7 @@ macro(add_compiler_rt_resource_file target_name file_name component) + add_custom_target(${target_name} DEPENDS ${dst_file}) + # Install in Clang resource directory. + install(FILES ${file_name} +- DESTINATION ${COMPILER_RT_INSTALL_PATH} ++ DESTINATION ${COMPILER_RT_INSTALL_PATH}/${CMAKE_INSTALL_PREFIX} + COMPONENT ${component}) + add_dependencies(${component} ${target_name}) + +@@ -361,7 +361,7 @@ macro(add_compiler_rt_script name) + add_custom_target(${name} DEPENDS ${dst}) + install(FILES ${dst} + PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE +- DESTINATION ${COMPILER_RT_INSTALL_PATH}/bin) ++ DESTINATION ${COMPILER_RT_INSTALL_PATH}/${CMAKE_INSTALL_FULL_BINDIR}) + endmacro(add_compiler_rt_script src name) + + # Builds custom version of libc++ and installs it in . +diff --git a/cmake/Modules/CompilerRTDarwinUtils.cmake b/cmake/Modules/CompilerRTDarwinUtils.cmake +index f646975475bb..75885bf305b8 100644 +--- a/cmake/Modules/CompilerRTDarwinUtils.cmake ++++ b/cmake/Modules/CompilerRTDarwinUtils.cmake +@@ -391,7 +391,7 @@ macro(darwin_add_embedded_builtin_libraries) + set(DARWIN_macho_embedded_LIBRARY_OUTPUT_DIR + ${COMPILER_RT_OUTPUT_DIR}/lib/macho_embedded) + set(DARWIN_macho_embedded_LIBRARY_INSTALL_DIR +- ${COMPILER_RT_INSTALL_PATH}/lib/macho_embedded) ++ ${COMPILER_RT_INSTALL_PATH}/${CMAKE_INSTALL_FULL_LIBDIR}/macho_embedded) + + set(CFLAGS_armv7 "-target thumbv7-apple-darwin-eabi") + set(CFLAGS_i386 "-march=pentium") +diff --git a/cmake/base-config-ix.cmake b/cmake/base-config-ix.cmake +index b38c6ca96fac..a4580414cbc8 100644 +--- a/cmake/base-config-ix.cmake ++++ b/cmake/base-config-ix.cmake +@@ -43,11 +43,11 @@ if (LLVM_TREE_AVAILABLE) + else() + # Take output dir and install path from the user. + set(COMPILER_RT_OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR} CACHE PATH +- "Path where built compiler-rt libraries should be stored.") ++ "Path where built compiler-rt build artifacts should be stored.") + set(COMPILER_RT_EXEC_OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR}/bin CACHE PATH + "Path where built compiler-rt executables should be stored.") +- set(COMPILER_RT_INSTALL_PATH ${CMAKE_INSTALL_PREFIX} CACHE PATH +- "Path where built compiler-rt libraries should be installed.") ++ set(COMPILER_RT_INSTALL_PATH "" CACHE PATH ++ "Prefix where built compiler-rt artifacts should be installed, comes before CMAKE_INSTALL_PREFIX.") + option(COMPILER_RT_INCLUDE_TESTS "Generate and build compiler-rt unit tests." OFF) + option(COMPILER_RT_ENABLE_WERROR "Fail and stop if warning is triggered" OFF) + # Use a host compiler to compile/link tests. +@@ -67,9 +67,9 @@ if(NOT DEFINED COMPILER_RT_OS_DIR) + string(TOLOWER ${CMAKE_SYSTEM_NAME} COMPILER_RT_OS_DIR) + endif() + set(COMPILER_RT_LIBRARY_OUTPUT_DIR +- ${COMPILER_RT_OUTPUT_DIR}/lib/${COMPILER_RT_OS_DIR}) ++ ${COMPILER_RT_OUTPUT_DIR}/${CMAKE_INSTALL_FULL_LIBDIR}/${COMPILER_RT_OS_DIR}) + set(COMPILER_RT_LIBRARY_INSTALL_DIR +- ${COMPILER_RT_INSTALL_PATH}/lib/${COMPILER_RT_OS_DIR}) ++ ${COMPILER_RT_INSTALL_PATH}/${CMAKE_INSTALL_FULL_LIBDIR}/${COMPILER_RT_OS_DIR}) + + if(APPLE) + # On Darwin if /usr/include doesn't exist, the user probably has Xcode but not +diff --git a/include/CMakeLists.txt b/include/CMakeLists.txt +index ec3bf40b95e6..af119f10ee2b 100644 +--- a/include/CMakeLists.txt ++++ b/include/CMakeLists.txt +@@ -44,8 +44,8 @@ set_target_properties(compiler-rt-headers PROPERTIES FOLDER "Compiler-RT Misc") + # Install sanitizer headers. + install(FILES ${SANITIZER_HEADERS} + PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ +- DESTINATION ${COMPILER_RT_INSTALL_PATH}/include/sanitizer) ++ DESTINATION ${COMPILER_RT_INSTALL_PATH}/${CMAKE_INSTALL_FULL_INCLUDEDIR}/sanitizer) + # Install xray headers. + install(FILES ${XRAY_HEADERS} + PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ +- DESTINATION ${COMPILER_RT_INSTALL_PATH}/include/xray) ++ DESTINATION ${COMPILER_RT_INSTALL_PATH}/${CMAKE_INSTALL_FULL_INCLUDEDIR}/xray) +diff --git a/lib/dfsan/CMakeLists.txt b/lib/dfsan/CMakeLists.txt +index 2c486bff821b..0ee715da95f8 100644 +--- a/lib/dfsan/CMakeLists.txt ++++ b/lib/dfsan/CMakeLists.txt +@@ -44,4 +44,4 @@ add_custom_command(OUTPUT ${dfsan_abilist_filename} + DEPENDS done_abilist.txt libc_ubuntu1404_abilist.txt) + add_dependencies(dfsan dfsan_abilist) + install(FILES ${dfsan_abilist_filename} +- DESTINATION ${COMPILER_RT_INSTALL_PATH}) ++ DESTINATION ${COMPILER_RT_INSTALL_PATH}/${CMAKE_INSTALL_PREFIX}) diff --git a/pkgs/development/compilers/llvm/5/default.nix b/pkgs/development/compilers/llvm/5/default.nix index 86bba415c01..97a295d2d29 100644 --- a/pkgs/development/compilers/llvm/5/default.nix +++ b/pkgs/development/compilers/llvm/5/default.nix @@ -1,6 +1,5 @@ { lowPrio, newScope, pkgs, lib, stdenv, cmake, gccForLibs , libxml2, python3, isl, fetchurl, overrideCC, wrapCCWith -, buildPackages , buildLlvmTools # tools, but from the previous stage, for cross , targetLlvmLibraries # libraries, but from the next stage, for cross }: @@ -18,34 +17,43 @@ let clang-tools-extra_src = fetch "clang-tools-extra" "018b3fiwah8f8br5i26qmzh6sjvzchpn358sn8v079m49f2jldm3"; tools = lib.makeExtensible (tools: let - callPackage = newScope (tools // { inherit stdenv cmake libxml2 python3 isl release_version version fetch; }); + callPackage = newScope (tools // { inherit stdenv cmake libxml2 python3 isl release_version version fetch buildLlvmTools; }); mkExtraBuildCommands = cc: '' rsrc="$out/resource-root" mkdir "$rsrc" - ln -s "${cc}/lib/clang/${release_version}/include" "$rsrc" + ln -s "${cc.lib}/lib/clang/${release_version}/include" "$rsrc" ln -s "${targetLlvmLibraries.compiler-rt.out}/lib" "$rsrc/lib" echo "-resource-dir=$rsrc" >> $out/nix-support/cc-cflags ''; + in { - llvm = callPackage ./llvm { }; + libllvm = callPackage ./llvm { }; - clang-unwrapped = callPackage ./clang { + # `llvm` historically had the binaries. But this migration + # technique also impedes `lib.get*`. Perhaps we will revisit it. + llvm = tools.libllvm.out; + + libllvm-polly = callPackage ./llvm { enablePolly = true; }; + + llvm-polly = tools.libllvm-polly.lib; + + libclang = callPackage ./clang { inherit clang-tools-extra_src; }; - llvm-manpages = lowPrio (tools.llvm.override { + clang-unwrapped = tools.libclang.out; + + llvm-manpages = lowPrio (tools.libllvm.override { enableManpages = true; python3 = pkgs.python3; # don't use python-boot }); - clang-manpages = lowPrio (tools.clang-unwrapped.override { + clang-manpages = lowPrio (tools.libclang.override { enableManpages = true; python3 = pkgs.python3; # don't use python-boot }); - libclang = tools.clang-unwrapped.lib; - clang = if stdenv.cc.isGNU then tools.libstdcxxClang else tools.libcxxClang; libstdcxxClang = wrapCCWith rec { diff --git a/pkgs/development/compilers/llvm/5/libc++/default.nix b/pkgs/development/compilers/llvm/5/libc++/default.nix index 164836e1a4c..77421b4e6d8 100644 --- a/pkgs/development/compilers/llvm/5/libc++/default.nix +++ b/pkgs/development/compilers/llvm/5/libc++/default.nix @@ -11,7 +11,11 @@ stdenv.mkDerivation { export LIBCXXABI_INCLUDE_DIR="$PWD/$(ls -d libcxxabi-${version}*)/include" ''; - patches = lib.optionals stdenv.hostPlatform.isMusl [ + outputs = [ "out" "dev" ]; + + patches = [ + ./gnu-install-dirs.patch + ] ++ lib.optionals stdenv.hostPlatform.isMusl [ ../../libcxx-0001-musl-hacks.patch ]; diff --git a/pkgs/development/compilers/llvm/5/libc++/gnu-install-dirs.patch b/pkgs/development/compilers/llvm/5/libc++/gnu-install-dirs.patch new file mode 100644 index 00000000000..d9ea0dc7dfd --- /dev/null +++ b/pkgs/development/compilers/llvm/5/libc++/gnu-install-dirs.patch @@ -0,0 +1,72 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index ca5afba86d19..ed69e4043c3d 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -22,6 +22,8 @@ set(CMAKE_MODULE_PATH + if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR) + project(libcxx CXX C) + ++ include(GNUInstallDirs) ++ + set(PACKAGE_NAME libcxx) + set(PACKAGE_VERSION 5.0.0) + set(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}") +diff --git a/cmake/Modules/HandleLibCXXABI.cmake b/cmake/Modules/HandleLibCXXABI.cmake +index b1f6bee8f945..1b455fceed7f 100644 +--- a/cmake/Modules/HandleLibCXXABI.cmake ++++ b/cmake/Modules/HandleLibCXXABI.cmake +@@ -55,7 +55,7 @@ macro(setup_abi_lib abidefines abilib abifiles abidirs) + ) + if (LIBCXX_INSTALL_HEADERS) + install(FILES "${LIBCXX_BINARY_INCLUDE_DIR}/${fpath}" +- DESTINATION ${LIBCXX_INSTALL_PREFIX}include/c++/v1/${dstdir} ++ DESTINATION ${LIBCXX_INSTALL_PREFIX}${CMAKE_INSTALL_INCLUDEDIR}/c++/v1/${dstdir} + COMPONENT libcxx + PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ + ) +diff --git a/include/CMakeLists.txt b/include/CMakeLists.txt +index 5a1b2ccdc426..106d3d6c1d3c 100644 +--- a/include/CMakeLists.txt ++++ b/include/CMakeLists.txt +@@ -20,7 +20,7 @@ endif() + + if (LIBCXX_INSTALL_HEADERS) + install(DIRECTORY . +- DESTINATION ${LIBCXX_INSTALL_PREFIX}include/c++/v1 ++ DESTINATION ${LIBCXX_INSTALL_PREFIX}${CMAKE_INSTALL_INCLUDEDIR}/c++/v1 + COMPONENT cxx-headers + FILES_MATCHING + ${LIBCXX_HEADER_PATTERN} +@@ -44,7 +44,7 @@ if (LIBCXX_INSTALL_HEADERS) + set(generated_config_deps generate_config_header) + # Install the generated header as __config. + install(FILES ${LIBCXX_BINARY_DIR}/__generated_config +- DESTINATION ${LIBCXX_INSTALL_PREFIX}include/c++/v1 ++ DESTINATION ${LIBCXX_INSTALL_PREFIX}${CMAKE_INSTALL_INCLUDEDIR}/c++/v1 + PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ + RENAME __config + COMPONENT cxx-headers) +diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt +index 578651423f3b..277befd631ac 100644 +--- a/lib/CMakeLists.txt ++++ b/lib/CMakeLists.txt +@@ -355,8 +355,8 @@ if (LIBCXX_INSTALL_LIBRARY) + set(experimental_lib cxx_experimental) + endif() + install(TARGETS ${LIBCXX_TARGETS} ${experimental_lib} +- LIBRARY DESTINATION ${LIBCXX_INSTALL_PREFIX}lib${LIBCXX_LIBDIR_SUFFIX} COMPONENT cxx +- ARCHIVE DESTINATION ${LIBCXX_INSTALL_PREFIX}lib${LIBCXX_LIBDIR_SUFFIX} COMPONENT cxx ++ LIBRARY DESTINATION ${LIBCXX_INSTALL_PREFIX}${CMAKE_INSTALL_LIBDIR}${LIBCXX_LIBDIR_SUFFIX} COMPONENT cxx ++ ARCHIVE DESTINATION ${LIBCXX_INSTALL_PREFIX}${CMAKE_INSTALL_LIBDIR}${LIBCXX_LIBDIR_SUFFIX} COMPONENT cxx + ) + # NOTE: This install command must go after the cxx install command otherwise + # it will not be executed after the library symlinks are installed. +@@ -364,7 +364,7 @@ if (LIBCXX_INSTALL_LIBRARY) + # Replace the libc++ filename with $ + # after we required CMake 3.0. + install(FILES "${LIBCXX_LIBRARY_DIR}/libc++${CMAKE_SHARED_LIBRARY_SUFFIX}" +- DESTINATION ${LIBCXX_INSTALL_PREFIX}lib${LIBCXX_LIBDIR_SUFFIX} ++ DESTINATION ${LIBCXX_INSTALL_PREFIX}${CMAKE_INSTALL_LIBDIR}${LIBCXX_LIBDIR_SUFFIX} + COMPONENT libcxx) + endif() + endif() diff --git a/pkgs/development/compilers/llvm/5/libc++abi/default.nix b/pkgs/development/compilers/llvm/5/libc++abi/default.nix index dd148a8917f..8bc3b9e2977 100644 --- a/pkgs/development/compilers/llvm/5/libc++abi/default.nix +++ b/pkgs/development/compilers/llvm/5/libc++abi/default.nix @@ -6,8 +6,7 @@ stdenv.mkDerivation { src = fetch "libcxxabi" "12lp799rskr4fc2xr64qn4jfkjnfd8b1aymvsxyn4k9ar7r9pgqv"; - nativeBuildInputs = [ cmake ]; - buildInputs = lib.optional (!stdenv.isDarwin && !stdenv.isFreeBSD) libunwind; + outputs = [ "out" "dev" ]; postUnpack = '' unpackFile ${libcxx.src} @@ -19,6 +18,13 @@ stdenv.mkDerivation { patch -p1 -d $(ls -d libcxx-*) -i ${../../libcxx-0001-musl-hacks.patch} ''; + patches = [ + ./gnu-install-dirs.patch + ]; + + nativeBuildInputs = [ cmake ]; + buildInputs = lib.optional (!stdenv.isDarwin && !stdenv.isFreeBSD) libunwind; + installPhase = if stdenv.isDarwin then '' for file in lib/*.dylib; do diff --git a/pkgs/development/compilers/llvm/5/libc++abi/gnu-install-dirs.patch b/pkgs/development/compilers/llvm/5/libc++abi/gnu-install-dirs.patch new file mode 100644 index 00000000000..760d7194f7b --- /dev/null +++ b/pkgs/development/compilers/llvm/5/libc++abi/gnu-install-dirs.patch @@ -0,0 +1,28 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 4db3328deb9c..74b39acfe588 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -20,6 +20,8 @@ set(CMAKE_MODULE_PATH + if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR) + project(libcxxabi CXX C) + ++ include(GNUInstallDirs) ++ + set(PACKAGE_NAME libcxxabi) + set(PACKAGE_VERSION 5.0.0) + set(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}") +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index adcc412880c9..71758665af05 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -174,8 +174,8 @@ endif() + add_custom_target(cxxabi DEPENDS ${LIBCXXABI_TARGETS}) + + install(TARGETS ${LIBCXXABI_TARGETS} +- LIBRARY DESTINATION ${LIBCXXABI_INSTALL_PREFIX}lib${LIBCXXABI_LIBDIR_SUFFIX} COMPONENT cxxabi +- ARCHIVE DESTINATION ${LIBCXXABI_INSTALL_PREFIX}lib${LIBCXXABI_LIBDIR_SUFFIX} COMPONENT cxxabi ++ LIBRARY DESTINATION ${LIBCXXABI_INSTALL_PREFIX}${CMAKE_INSTALL_LIBDIR}${LIBCXXABI_LIBDIR_SUFFIX} COMPONENT cxxabi ++ ARCHIVE DESTINATION ${LIBCXXABI_INSTALL_PREFIX}${CMAKE_INSTALL_LIBDIR}${LIBCXXABI_LIBDIR_SUFFIX} COMPONENT cxxabi + ) + + if (NOT CMAKE_CONFIGURATION_TYPES) diff --git a/pkgs/development/compilers/llvm/5/lld/default.nix b/pkgs/development/compilers/llvm/5/lld/default.nix index 244960cf41b..73762e2d2e5 100644 --- a/pkgs/development/compilers/llvm/5/lld/default.nix +++ b/pkgs/development/compilers/llvm/5/lld/default.nix @@ -1,7 +1,8 @@ { lib, stdenv +, buildLlvmTools , fetch , cmake -, llvm +, libllvm , version }: @@ -11,15 +12,20 @@ stdenv.mkDerivation { src = fetch "lld" "1ah75rjly6747jk1zbwca3z0svr9b09ylgxd4x9ns721xir6sia6"; + patches = [ + ./gnu-install-dirs.patch + ]; + nativeBuildInputs = [ cmake ]; - buildInputs = [ llvm ]; + buildInputs = [ libllvm ]; - outputs = [ "out" "dev" ]; + cmakeFlags = [ + "-DLLVM_CONFIG_PATH=${libllvm.dev}/bin/llvm-config${lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) "-native"}" + ] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ + "-DLLVM_TABLEGEN_EXE=${buildLlvmTools.llvm}/bin/llvm-tblgen" + ]; - postInstall = '' - moveToOutput include "$dev" - moveToOutput lib "$dev" - ''; + outputs = [ "out" "lib" "dev" ]; meta = { description = "The LLVM Linker"; diff --git a/pkgs/development/compilers/llvm/5/lld/gnu-install-dirs.patch b/pkgs/development/compilers/llvm/5/lld/gnu-install-dirs.patch new file mode 100644 index 00000000000..ed673870dec --- /dev/null +++ b/pkgs/development/compilers/llvm/5/lld/gnu-install-dirs.patch @@ -0,0 +1,68 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index e2ab0e35f1ab..f68e23d2a70d 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -6,6 +6,8 @@ if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR) + set(CMAKE_INCLUDE_CURRENT_DIR ON) + set(LLD_BUILT_STANDALONE TRUE) + ++ include(GNUInstallDirs) ++ + find_program(LLVM_CONFIG_PATH "llvm-config" DOC "Path to llvm-config binary") + if(NOT LLVM_CONFIG_PATH) + message(FATAL_ERROR "llvm-config not found: specify LLVM_CONFIG_PATH") +@@ -203,7 +205,7 @@ include_directories(BEFORE + + if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY) + install(DIRECTORY include/ +- DESTINATION include ++ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} + FILES_MATCHING + PATTERN "*.h" + PATTERN ".svn" EXCLUDE +diff --git a/cmake/modules/AddLLD.cmake b/cmake/modules/AddLLD.cmake +index fd1d44199ca6..2ec1831ed8f6 100644 +--- a/cmake/modules/AddLLD.cmake ++++ b/cmake/modules/AddLLD.cmake +@@ -20,9 +20,9 @@ macro(add_lld_library name) + install(TARGETS ${name} + COMPONENT ${name} + ${export_to_lldtargets} +- LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX} +- ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX} +- RUNTIME DESTINATION bin) ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX} ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) + + if (${ARG_SHARED} AND NOT CMAKE_CONFIGURATION_TYPES) + add_custom_target(install-${name} +@@ -56,7 +56,7 @@ macro(add_lld_tool name) + + install(TARGETS ${name} + ${export_to_lldtargets} +- RUNTIME DESTINATION bin ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + COMPONENT ${name}) + + if(NOT CMAKE_CONFIGURATION_TYPES) +@@ -73,5 +73,5 @@ endmacro() + macro(add_lld_symlink name dest) + add_llvm_tool_symlink(${name} ${dest} ALWAYS_GENERATE) + # Always generate install targets +- llvm_install_symlink(${name} ${dest} ALWAYS_GENERATE) ++ llvm_install_symlink(${name} ${dest} ${CMAKE_INSTALL_FULL_BINDIR} ALWAYS_GENERATE) + endmacro() +diff --git a/tools/lld/CMakeLists.txt b/tools/lld/CMakeLists.txt +index 2df10697ff66..94aa8d092220 100644 +--- a/tools/lld/CMakeLists.txt ++++ b/tools/lld/CMakeLists.txt +@@ -13,7 +13,7 @@ target_link_libraries(lld + ) + + install(TARGETS lld +- RUNTIME DESTINATION bin) ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) + + if(NOT LLD_SYMLINKS_TO_CREATE) + set(LLD_SYMLINKS_TO_CREATE lld-link ld.lld) diff --git a/pkgs/development/compilers/llvm/5/lldb/default.nix b/pkgs/development/compilers/llvm/5/lldb/default.nix index 61a9e60391c..723792d1341 100644 --- a/pkgs/development/compilers/llvm/5/lldb/default.nix +++ b/pkgs/development/compilers/llvm/5/lldb/default.nix @@ -8,14 +8,14 @@ , which , libedit , libxml2 -, llvm -, clang-unwrapped +, libllvm +, libclang , python3 , version , darwin }: -stdenv.mkDerivation { +stdenv.mkDerivation rec { pname = "lldb"; inherit version; @@ -28,29 +28,46 @@ stdenv.mkDerivation { sha256 = "1zbx4m0m8kbg0wq6740jcw151vb2pb1p25p401wiq8diqqagkjps"; stripLen = 1; }) + ./gnu-install-dirs.patch ]; postPatch = '' # Fix up various paths that assume llvm and clang are installed in the same place - sed -i 's,".*ClangConfig.cmake","${clang-unwrapped}/lib/cmake/clang/ClangConfig.cmake",' \ + sed -i 's,".*ClangConfig.cmake","${libclang.dev}/lib/cmake/clang/ClangConfig.cmake",' \ cmake/modules/LLDBStandalone.cmake - sed -i 's,".*tools/clang/include","${clang-unwrapped}/include",' \ + sed -i 's,".*tools/clang/include","${libclang.dev}/include",' \ cmake/modules/LLDBStandalone.cmake - sed -i 's,"$.LLVM_LIBRARY_DIR.",${llvm}/lib ${clang-unwrapped}/lib,' \ + sed -i 's,"$.LLVM_LIBRARY_DIR.",${libllvm.lib}/lib ${libclang.lib}/lib,' \ cmake/modules/LLDBStandalone.cmake ''; - nativeBuildInputs = [ cmake python3 which swig ]; - buildInputs = [ ncurses zlib libedit libxml2 llvm ] - ++ lib.optionals stdenv.isDarwin [ darwin.libobjc darwin.apple_sdk.libs.xpc darwin.apple_sdk.frameworks.Foundation darwin.bootstrap_cmds darwin.apple_sdk.frameworks.Carbon darwin.apple_sdk.frameworks.Cocoa ]; + outputs = [ "out" "lib" "dev" ]; + + nativeBuildInputs = [ + cmake python3 which swig + ]; + + buildInputs = [ + ncurses zlib libedit libxml2 libllvm + ] ++ lib.optionals stdenv.isDarwin [ + darwin.libobjc + darwin.apple_sdk.libs.xpc + darwin.apple_sdk.frameworks.Foundation darwin.bootstrap_cmds darwin.apple_sdk.frameworks.Carbon darwin.apple_sdk.frameworks.Cocoa + ]; CXXFLAGS = "-fno-rtti"; hardeningDisable = [ "format" ]; cmakeFlags = [ + "-DLLDB_INCLUDE_TESTS=${if doCheck then "YES" else "NO"}" "-DLLDB_CODESIGN_IDENTITY=" # codesigning makes nondeterministic + ] ++ lib.optionals doCheck [ + "-DLLDB_TEST_C_COMPILER=${stdenv.cc}/bin/${stdenv.cc.targetPrefix}cc" + "-DLLDB_TEST_CXX_COMPILER=${stdenv.cc}/bin/${stdenv.cc.targetPrefix}c++" ]; + doCheck = false; + postInstall = '' mkdir -p $out/share/man/man1 cp ../docs/lldb.1 $out/share/man/man1/ diff --git a/pkgs/development/compilers/llvm/5/lldb/gnu-install-dirs.patch b/pkgs/development/compilers/llvm/5/lldb/gnu-install-dirs.patch new file mode 100644 index 00000000000..5c6193b028f --- /dev/null +++ b/pkgs/development/compilers/llvm/5/lldb/gnu-install-dirs.patch @@ -0,0 +1,76 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index ada293811b3e..6c2149309f65 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -7,6 +7,8 @@ set(CMAKE_MODULE_PATH + "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules" + ) + ++include(GNUInstallDirs) ++ + include(LLDBStandalone) + include(LLDBConfig) + include(AddLLDB) +diff --git a/cmake/modules/AddLLDB.cmake b/cmake/modules/AddLLDB.cmake +index 4c6f1efd673d..179a12b49cce 100644 +--- a/cmake/modules/AddLLDB.cmake ++++ b/cmake/modules/AddLLDB.cmake +@@ -54,14 +54,14 @@ function(add_lldb_library name) + endif() + install(TARGETS ${name} + COMPONENT ${name} +- RUNTIME DESTINATION bin ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${out_dir} + ARCHIVE DESTINATION ${out_dir}) + else() + install(TARGETS ${name} + COMPONENT ${name} +- LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX} +- ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX}) ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}) + endif() + if (NOT CMAKE_CONFIGURATION_TYPES) + add_custom_target(install-${name} +@@ -126,7 +126,7 @@ function(add_lldb_executable name) + if(ARG_GENERATE_INSTALL AND NOT (ARG_INCLUDE_IN_FRAMEWORK AND LLDB_BUILD_FRAMEWORK )) + install(TARGETS ${name} + COMPONENT ${name} +- RUNTIME DESTINATION bin) ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) + if (NOT CMAKE_CONFIGURATION_TYPES) + add_custom_target(install-${name} + DEPENDS ${name} +diff --git a/cmake/modules/LLDBConfig.cmake b/cmake/modules/LLDBConfig.cmake +index 726552675f47..f1f769f34446 100644 +--- a/cmake/modules/LLDBConfig.cmake ++++ b/cmake/modules/LLDBConfig.cmake +@@ -276,7 +276,7 @@ include_directories(BEFORE + if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY) + install(DIRECTORY include/ + COMPONENT lldb_headers +- DESTINATION include ++ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} + FILES_MATCHING + PATTERN "*.h" + PATTERN ".svn" EXCLUDE +@@ -286,7 +286,7 @@ if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY) + + install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/include/ + COMPONENT lldb_headers +- DESTINATION include ++ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} + FILES_MATCHING + PATTERN "*.h" + PATTERN ".svn" EXCLUDE +diff --git a/tools/intel-mpx/CMakeLists.txt b/tools/intel-mpx/CMakeLists.txt +index 29ba9a1cacec..30e2f9334b95 100644 +--- a/tools/intel-mpx/CMakeLists.txt ++++ b/tools/intel-mpx/CMakeLists.txt +@@ -12,4 +12,4 @@ target_link_libraries(lldb-intel-mpxtable + PUBLIC liblldb LLVMSupport) + + install(TARGETS lldb-intel-mpxtable +- LIBRARY DESTINATION bin) ++ LIBRARY DESTINATION ${CMAKE_INSTALL_BINDIR}) diff --git a/pkgs/development/compilers/llvm/5/llvm/default.nix b/pkgs/development/compilers/llvm/5/llvm/default.nix index 94d2a1e5863..0cbd30c783c 100644 --- a/pkgs/development/compilers/llvm/5/llvm/default.nix +++ b/pkgs/development/compilers/llvm/5/llvm/default.nix @@ -1,4 +1,5 @@ { lib, stdenv +, pkgsBuildBuild , fetch , fetchpatch , cmake @@ -10,9 +11,11 @@ , version , release_version , zlib +, buildLlvmTools , debugVersion ? false , enableManpages ? false , enableSharedLibraries ? !enableManpages +, enablePolly ? false }: let @@ -29,15 +32,18 @@ stdenv.mkDerivation ({ inherit version; src = fetch "llvm" "0g1bbj2n6xv4p1n6hh17vj3vpvg56wacipc81dgwga9mg2lys8nm"; + polly_src = fetch "polly" "1f4i1qsw7ywx25v262p8syz339zcbvfkx295xz26hmqrn944xa6x"; unpackPhase = '' unpackFile $src mv llvm-${version}* llvm sourceRoot=$PWD/llvm + '' + optionalString enablePolly '' + unpackFile $polly_src + mv polly-* $sourceRoot/tools/polly ''; - outputs = [ "out" "python" ] - ++ optional enableSharedLibraries "lib"; + outputs = [ "out" "lib" "dev" "python" ]; nativeBuildInputs = [ cmake python3 ] ++ optional enableManpages python3.pkgs.sphinx; @@ -59,11 +65,13 @@ stdenv.mkDerivation ({ # sha256 = "0injj1hqgrbcbihhwp2nbal88jfykad30r54f2cdcx7gws2fcy8i"; # stripLen = 1; #}) - ]; + ./gnu-install-dirs.patch + ] ++ lib.optional enablePolly ./gnu-install-dirs-polly.patch; + postPatch = optionalString stdenv.isDarwin '' substituteInPlace cmake/modules/AddLLVM.cmake \ --replace 'set(_install_name_dir INSTALL_NAME_DIR "@rpath")' "set(_install_name_dir)" \ - --replace 'set(_install_rpath "@loader_path/../lib" ''${extra_libdir})' "" + --replace 'set(_install_rpath "@loader_path/../''${CMAKE_INSTALL_LIBDIR}" ''${extra_libdir})' "" '' # Patch llvm-config to return correct library path based on --link-{shared,static}. + optionalString (enableSharedLibraries) '' @@ -90,6 +98,7 @@ stdenv.mkDerivation ({ ''; cmakeFlags = with stdenv; [ + "-DLLVM_INSTALL_CMAKE_DIR=${placeholder "dev"}/lib/cmake/llvm/" "-DCMAKE_BUILD_TYPE=${if debugVersion then "Debug" else "Release"}" "-DLLVM_INSTALL_UTILS=ON" # Needed by rustc "-DLLVM_BUILD_TESTS=ON" @@ -100,20 +109,36 @@ stdenv.mkDerivation ({ "-DLLVM_DEFAULT_TARGET_TRIPLE=${stdenv.hostPlatform.config}" "-DTARGET_TRIPLE=${stdenv.hostPlatform.config}" ] - ++ optional enableSharedLibraries + ++ lib.optional enableSharedLibraries "-DLLVM_LINK_LLVM_DYLIB=ON" - ++ optionals enableManpages [ + ++ lib.optionals enableManpages [ "-DLLVM_BUILD_DOCS=ON" "-DLLVM_ENABLE_SPHINX=ON" "-DSPHINX_OUTPUT_MAN=ON" "-DSPHINX_OUTPUT_HTML=OFF" "-DSPHINX_WARNINGS_AS_ERRORS=OFF" ] - ++ optional (!isDarwin) + ++ lib.optional (!isDarwin) "-DLLVM_BINUTILS_INCDIR=${libbfd.dev}/include" - ++ optionals (isDarwin) [ + ++ lib.optionals (isDarwin) [ "-DLLVM_ENABLE_LIBCXX=ON" "-DCAN_TARGET_i386=false" + ] ++ optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ + "-DCMAKE_CROSSCOMPILING=True" + "-DLLVM_TABLEGEN=${buildLlvmTools.llvm}/bin/llvm-tblgen" + ( + let + nativeCC = pkgsBuildBuild.targetPackages.stdenv.cc; + nativeBintools = nativeCC.bintools.bintools; + nativeToolchainFlags = [ + "-DCMAKE_C_COMPILER=${nativeCC}/bin/${nativeCC.targetPrefix}cc" + "-DCMAKE_CXX_COMPILER=${nativeCC}/bin/${nativeCC.targetPrefix}c++" + "-DCMAKE_AR=${nativeBintools}/bin/${nativeBintools.targetPrefix}ar" + "-DCMAKE_STRIP=${nativeBintools}/bin/${nativeBintools.targetPrefix}strip" + "-DCMAKE_RANLIB=${nativeBintools}/bin/${nativeBintools.targetPrefix}ranlib" + ]; + in "-DCROSS_TOOLCHAIN_FLAGS_NATIVE:list=${lib.concatStringsSep ";" nativeToolchainFlags}" + ) ]; postBuild = '' @@ -127,21 +152,20 @@ stdenv.mkDerivation ({ postInstall = '' mkdir -p $python/share mv $out/share/opt-viewer $python/share/opt-viewer - '' - + optionalString enableSharedLibraries '' - moveToOutput "lib/libLLVM-*" "$lib" - moveToOutput "lib/libLLVM${stdenv.hostPlatform.extensions.sharedLibrary}" "$lib" - moveToOutput "lib/libLTO${stdenv.hostPlatform.extensions.sharedLibrary}" "$lib" - substituteInPlace "$out/lib/cmake/llvm/LLVMExports-${if debugVersion then "debug" else "release"}.cmake" \ - --replace "\''${_IMPORT_PREFIX}/lib/libLLVM-" "$lib/lib/libLLVM-" + moveToOutput "bin/llvm-config*" "$dev" + substituteInPlace "$dev/lib/cmake/llvm/LLVMExports-${if debugVersion then "debug" else "release"}.cmake" \ + --replace "\''${_IMPORT_PREFIX}/lib/lib" "$lib/lib/lib" \ + --replace "$out/bin/llvm-config" "$dev/bin/llvm-config" + substituteInPlace "$dev/lib/cmake/llvm/LLVMConfig.cmake" \ + --replace 'set(LLVM_BINARY_DIR "''${LLVM_INSTALL_PREFIX}")' 'set(LLVM_BINARY_DIR "''${LLVM_INSTALL_PREFIX}'"$lib"'")' '' + optionalString (stdenv.isDarwin && enableSharedLibraries) '' - substituteInPlace "$out/lib/cmake/llvm/LLVMExports-${if debugVersion then "debug" else "release"}.cmake" \ - --replace "\''${_IMPORT_PREFIX}/lib/libLLVM.dylib" "$lib/lib/libLLVM.dylib" \ - --replace "\''${_IMPORT_PREFIX}/lib/libLTO.dylib" "$lib/lib/libLTO.dylib" ${lib.concatMapStringsSep "\n" (v: '' ln -s $lib/lib/libLLVM.dylib $lib/lib/libLLVM-${v}.dylib '') versionSuffixes} + '' + + optionalString (stdenv.buildPlatform != stdenv.hostPlatform) '' + cp NATIVE/bin/llvm-config $dev/bin/llvm-config-native ''; doCheck = stdenv.isLinux && (!stdenv.isi686); diff --git a/pkgs/development/compilers/llvm/5/llvm/gnu-install-dirs-polly.patch b/pkgs/development/compilers/llvm/5/llvm/gnu-install-dirs-polly.patch new file mode 100644 index 00000000000..40f6fa06036 --- /dev/null +++ b/pkgs/development/compilers/llvm/5/llvm/gnu-install-dirs-polly.patch @@ -0,0 +1,106 @@ +diff --git a/tools/polly/CMakeLists.txt b/tools/polly/CMakeLists.txt +index 9ddc0f7ff81d..7ca45f286d47 100644 +--- a/tools/polly/CMakeLists.txt ++++ b/tools/polly/CMakeLists.txt +@@ -2,7 +2,11 @@ + if (NOT DEFINED LLVM_MAIN_SRC_DIR) + project(Polly) + cmake_minimum_required(VERSION 3.4.3) ++endif() ++ ++include(GNUInstallDirs) + ++if (NOT DEFINED LLVM_MAIN_SRC_DIR) + # Where is LLVM installed? + find_package(LLVM CONFIG REQUIRED) + set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${LLVM_CMAKE_DIR}) +@@ -157,14 +161,14 @@ include_directories( + + if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY) + install(DIRECTORY include/ +- DESTINATION include ++ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} + FILES_MATCHING + PATTERN "*.h" + PATTERN ".svn" EXCLUDE + ) + + install(DIRECTORY ${POLLY_BINARY_DIR}/include/ +- DESTINATION include ++ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} + FILES_MATCHING + PATTERN "*.h" + PATTERN "CMakeFiles" EXCLUDE +diff --git a/tools/polly/cmake/CMakeLists.txt b/tools/polly/cmake/CMakeLists.txt +index 969292cd6b00..d7aea77bdd20 100644 +--- a/tools/polly/cmake/CMakeLists.txt ++++ b/tools/polly/cmake/CMakeLists.txt +@@ -79,18 +79,18 @@ file(GENERATE + + # Generate PollyConfig.cmake for the install tree. + unset(POLLY_EXPORTS) +-set(POLLY_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}") ++set(POLLY_INSTALL_PREFIX "") + set(POLLY_CONFIG_LLVM_CMAKE_DIR "${LLVM_BINARY_DIR}/${LLVM_INSTALL_PACKAGE_DIR}") +-set(POLLY_CONFIG_CMAKE_DIR "${POLLY_INSTALL_PREFIX}/${POLLY_INSTALL_PACKAGE_DIR}") +-set(POLLY_CONFIG_LIBRARY_DIRS "${POLLY_INSTALL_PREFIX}/lib${LLVM_LIBDIR_SUFFIX}") ++set(POLLY_CONFIG_CMAKE_DIR "${POLLY_INSTALL_PREFIX}${CMAKE_INSTALL_PREFIX}/${POLLY_INSTALL_PACKAGE_DIR}") ++set(POLLY_CONFIG_LIBRARY_DIRS "${POLLY_INSTALL_PREFIX}${CMAKE_INSTALL_FULL_LIBDIR}${LLVM_LIBDIR_SUFFIX}") + if (POLLY_BUNDLED_ISL) + set(POLLY_CONFIG_INCLUDE_DIRS +- "${POLLY_INSTALL_PREFIX}/include" +- "${POLLY_INSTALL_PREFIX}/include/polly" ++ "${POLLY_INSTALL_PREFIX}${CMAKE_INSTALL_FULL_LIBDIR}" ++ "${POLLY_INSTALL_PREFIX}${CMAKE_INSTALL_FULL_LIBDIR}/polly" + ) + else() + set(POLLY_CONFIG_INCLUDE_DIRS +- "${POLLY_INSTALL_PREFIX}/include" ++ "${POLLY_INSTALL_PREFIX}${CMAKE_INSTALL_FULL_INCLUDEDIR}" + ${ISL_INCLUDE_DIRS} + ) + endif() +@@ -100,12 +100,12 @@ endif() + foreach(tgt IN LISTS POLLY_CONFIG_EXPORTED_TARGETS) + get_target_property(tgt_type ${tgt} TYPE) + if (tgt_type STREQUAL "EXECUTABLE") +- set(tgt_prefix "bin/") ++ set(tgt_prefix "${CMAKE_INSTALL_BINDIR}/") + else() +- set(tgt_prefix "lib/") ++ set(tgt_prefix "${CMAKE_INSTALL_LIBDIR}/") + endif() + +- set(tgt_path "${CMAKE_INSTALL_PREFIX}/${tgt_prefix}$") ++ set(tgt_path "${tgt_prefix}$") + file(RELATIVE_PATH tgt_path ${POLLY_CONFIG_CMAKE_DIR} ${tgt_path}) + + if (NOT tgt_type STREQUAL "INTERFACE_LIBRARY") +diff --git a/tools/polly/cmake/polly_macros.cmake b/tools/polly/cmake/polly_macros.cmake +index 32bed50bb060..cca5bfff4970 100644 +--- a/tools/polly/cmake/polly_macros.cmake ++++ b/tools/polly/cmake/polly_macros.cmake +@@ -44,8 +44,8 @@ macro(add_polly_library name) + if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY OR ${name} STREQUAL "LLVMPolly") + install(TARGETS ${name} + EXPORT LLVMExports +- LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX} +- ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX}) ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}) + endif() + set_property(GLOBAL APPEND PROPERTY LLVM_EXPORTS ${name}) + endmacro(add_polly_library) +diff --git a/tools/polly/lib/External/CMakeLists.txt b/tools/polly/lib/External/CMakeLists.txt +index 286c04fba287..07905e68f595 100644 +--- a/tools/polly/lib/External/CMakeLists.txt ++++ b/tools/polly/lib/External/CMakeLists.txt +@@ -268,7 +268,7 @@ if (POLLY_BUNDLED_ISL) + install(DIRECTORY + ${ISL_SOURCE_DIR}/include/ + ${ISL_BINARY_DIR}/include/ +- DESTINATION include/polly ++ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/polly + FILES_MATCHING + PATTERN "*.h" + PATTERN "CMakeFiles" EXCLUDE diff --git a/pkgs/development/compilers/llvm/5/llvm/gnu-install-dirs.patch b/pkgs/development/compilers/llvm/5/llvm/gnu-install-dirs.patch new file mode 100644 index 00000000000..3f6d6acb83f --- /dev/null +++ b/pkgs/development/compilers/llvm/5/llvm/gnu-install-dirs.patch @@ -0,0 +1,386 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index c1e03aed4809..8b8bbb8c403e 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -279,15 +279,21 @@ if (CMAKE_BUILD_TYPE AND + message(FATAL_ERROR "Invalid value for CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}") + endif() + ++include(GNUInstallDirs) ++ + set(LLVM_LIBDIR_SUFFIX "" CACHE STRING "Define suffix of library directory name (32/64)" ) + +-set(LLVM_TOOLS_INSTALL_DIR "bin" CACHE STRING "Path for binary subdirectory (defaults to 'bin')") ++set(LLVM_TOOLS_INSTALL_DIR "${CMAKE_INSTALL_BINDIR}" CACHE STRING ++ "Path for binary subdirectory (defaults to 'bin')") + mark_as_advanced(LLVM_TOOLS_INSTALL_DIR) + + set(LLVM_UTILS_INSTALL_DIR "bin" CACHE STRING + "Path to install LLVM utilities (enabled by LLVM_INSTALL_UTILS=ON) (defaults to LLVM_TOOLS_INSTALL_DIR)") + mark_as_advanced(LLVM_TOOLS_INSTALL_DIR) + ++set(LLVM_INSTALL_CMAKE_DIR "${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}/cmake/llvm" CACHE STRING ++ "Path for CMake subdirectory (defaults to lib/cmake/llvm)" ) ++ + # They are used as destination of target generators. + set(LLVM_RUNTIME_OUTPUT_INTDIR ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bin) + set(LLVM_LIBRARY_OUTPUT_INTDIR ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/lib${LLVM_LIBDIR_SUFFIX}) +@@ -512,9 +518,9 @@ option (LLVM_ENABLE_DOXYGEN "Use doxygen to generate llvm API documentation." OF + option (LLVM_ENABLE_SPHINX "Use Sphinx to generate llvm documentation." OFF) + option (LLVM_ENABLE_OCAMLDOC "Build OCaml bindings documentation." ON) + +-set(LLVM_INSTALL_DOXYGEN_HTML_DIR "share/doc/llvm/doxygen-html" ++set(LLVM_INSTALL_DOXYGEN_HTML_DIR "${CMAKE_INSTALL_DOCDIR}/${project}/doxygen-html" + CACHE STRING "Doxygen-generated HTML documentation install directory") +-set(LLVM_INSTALL_OCAMLDOC_HTML_DIR "share/doc/llvm/ocaml-html" ++set(LLVM_INSTALL_OCAMLDOC_HTML_DIR "${CMAKE_INSTALL_DOCDIR}/${project}/ocaml-html" + CACHE STRING "OCamldoc-generated HTML documentation install directory") + + option (LLVM_BUILD_EXTERNAL_COMPILER_RT +@@ -945,7 +951,7 @@ add_subdirectory(cmake/modules) + + if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY) + install(DIRECTORY include/llvm include/llvm-c +- DESTINATION include ++ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} + COMPONENT llvm-headers + FILES_MATCHING + PATTERN "*.def" +@@ -957,7 +963,7 @@ if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY) + ) + + install(DIRECTORY ${LLVM_INCLUDE_DIR}/llvm +- DESTINATION include ++ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} + COMPONENT llvm-headers + FILES_MATCHING + PATTERN "*.def" +diff --git a/cmake/modules/AddLLVM.cmake b/cmake/modules/AddLLVM.cmake +index 1c922651b133..d555fd627a4f 100644 +--- a/cmake/modules/AddLLVM.cmake ++++ b/cmake/modules/AddLLVM.cmake +@@ -589,11 +589,11 @@ macro(add_llvm_library name) + else() + if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY OR ${name} STREQUAL "LTO" OR + (LLVM_LINK_LLVM_DYLIB AND ${name} STREQUAL "LLVM")) +- set(install_dir lib${LLVM_LIBDIR_SUFFIX}) ++ set(install_dir ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}) + if(ARG_SHARED OR BUILD_SHARED_LIBS) + if(WIN32 OR CYGWIN OR MINGW) + set(install_type RUNTIME) +- set(install_dir bin) ++ set(install_dir ${CMAKE_INSTALL_BINDIR}) + else() + set(install_type LIBRARY) + endif() +@@ -637,9 +637,9 @@ macro(add_llvm_loadable_module name) + if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY) + if(WIN32 OR CYGWIN) + # DLL platform +- set(dlldir "bin") ++ set(dlldir "${CMAKE_INSTALL_BINDIR}") + else() +- set(dlldir "lib${LLVM_LIBDIR_SUFFIX}") ++ set(dlldir "${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}") + endif() + + if(${name} IN_LIST LLVM_DISTRIBUTION_COMPONENTS OR +@@ -651,7 +651,7 @@ macro(add_llvm_loadable_module name) + install(TARGETS ${name} + ${export_to_llvmexports} + LIBRARY DESTINATION ${dlldir} +- ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX}) ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}) + endif() + set_property(GLOBAL APPEND PROPERTY LLVM_EXPORTS ${name}) + endif() +@@ -864,7 +864,7 @@ macro(add_llvm_example name) + endif() + add_llvm_executable(${name} ${ARGN}) + if( LLVM_BUILD_EXAMPLES ) +- install(TARGETS ${name} RUNTIME DESTINATION examples) ++ install(TARGETS ${name} RUNTIME DESTINATION ${CMAKE_INSTALL_DOCDIR}/examples) + endif() + set_target_properties(${name} PROPERTIES FOLDER "Examples") + endmacro(add_llvm_example name) +@@ -1275,7 +1275,7 @@ function(llvm_install_library_symlink name dest type) + set(full_name ${CMAKE_${type}_LIBRARY_PREFIX}${name}${CMAKE_${type}_LIBRARY_SUFFIX}) + set(full_dest ${CMAKE_${type}_LIBRARY_PREFIX}${dest}${CMAKE_${type}_LIBRARY_SUFFIX}) + +- set(output_dir lib${LLVM_LIBDIR_SUFFIX}) ++ set(output_dir ${CMAKE_INSTALL_FULL_LIBDIR}${LLVM_LIBDIR_SUFFIX}) + if(WIN32 AND "${type}" STREQUAL "SHARED") + set(output_dir bin) + endif() +@@ -1293,7 +1293,7 @@ function(llvm_install_library_symlink name dest type) + endif() + endfunction() + +-function(llvm_install_symlink name dest) ++function(llvm_install_symlink name dest output_dir) + cmake_parse_arguments(ARG "ALWAYS_GENERATE" "COMPONENT" "" ${ARGN}) + foreach(path ${CMAKE_MODULE_PATH}) + if(EXISTS ${path}/LLVMInstallSymlink.cmake) +@@ -1316,7 +1316,7 @@ function(llvm_install_symlink name dest) + set(full_dest ${dest}${CMAKE_EXECUTABLE_SUFFIX}) + + install(SCRIPT ${INSTALL_SYMLINK} +- CODE "install_symlink(${full_name} ${full_dest} ${LLVM_TOOLS_INSTALL_DIR})" ++ CODE "install_symlink(${full_name} ${full_dest} ${output_dir})" + COMPONENT ${component}) + + if (NOT CMAKE_CONFIGURATION_TYPES AND NOT ARG_ALWAYS_GENERATE) +@@ -1400,7 +1400,8 @@ function(add_llvm_tool_symlink link_name target) + endif() + + if ((TOOL_IS_TOOLCHAIN OR NOT LLVM_INSTALL_TOOLCHAIN_ONLY) AND LLVM_BUILD_TOOLS) +- llvm_install_symlink(${link_name} ${target}) ++ GNUInstallDirs_get_absolute_install_dir(output_dir LLVM_TOOLS_INSTALL_DIR) ++ llvm_install_symlink(${link_name} ${target} ${output_dir}) + endif() + endif() + endfunction() +@@ -1452,9 +1453,9 @@ function(llvm_setup_rpath name) + + if (APPLE) + set(_install_name_dir INSTALL_NAME_DIR "@rpath") +- set(_install_rpath "@loader_path/../lib" ${extra_libdir}) ++ set(_install_rpath "@loader_path/../${CMAKE_INSTALL_LIBDIR}" ${extra_libdir}) + elseif(UNIX) +- set(_install_rpath "\$ORIGIN/../lib${LLVM_LIBDIR_SUFFIX}" ${extra_libdir}) ++ set(_install_rpath "\$ORIGIN/../${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}" ${extra_libdir}) + if(${CMAKE_SYSTEM_NAME} MATCHES "(FreeBSD|DragonFly)") + set_property(TARGET ${name} APPEND_STRING PROPERTY + LINK_FLAGS " -Wl,-z,origin ") +diff --git a/cmake/modules/AddOCaml.cmake b/cmake/modules/AddOCaml.cmake +index 1d8094cc505f..afdbe6e6d19c 100644 +--- a/cmake/modules/AddOCaml.cmake ++++ b/cmake/modules/AddOCaml.cmake +@@ -140,9 +140,9 @@ function(add_ocaml_library name) + endforeach() + + if( APPLE ) +- set(ocaml_rpath "@executable_path/../../../lib${LLVM_LIBDIR_SUFFIX}") ++ set(ocaml_rpath "@executable_path/../../../${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}") + elseif( UNIX ) +- set(ocaml_rpath "\\$ORIGIN/../../../lib${LLVM_LIBDIR_SUFFIX}") ++ set(ocaml_rpath "\\$ORIGIN/../../../${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}") + endif() + list(APPEND ocaml_flags "-ldopt" "-Wl,-rpath,${ocaml_rpath}") + +diff --git a/cmake/modules/AddSphinxTarget.cmake b/cmake/modules/AddSphinxTarget.cmake +index 4540c5c36c8e..4cefb17fbd55 100644 +--- a/cmake/modules/AddSphinxTarget.cmake ++++ b/cmake/modules/AddSphinxTarget.cmake +@@ -73,7 +73,7 @@ function (add_sphinx_target builder project) + + elseif (builder STREQUAL html) + string(TOUPPER "${project}" project_upper) +- set(${project_upper}_INSTALL_SPHINX_HTML_DIR "share/doc/${project}/html" ++ set(${project_upper}_INSTALL_SPHINX_HTML_DIR "${CMAKE_INSTALL_DOCDIR}/${project}/html" + CACHE STRING "HTML documentation install directory for ${project}") + + # '/.' indicates: copy the contents of the directory directly into +diff --git a/cmake/modules/CMakeLists.txt b/cmake/modules/CMakeLists.txt +index ac4b0b7c0304..21a6a3da8667 100644 +--- a/cmake/modules/CMakeLists.txt ++++ b/cmake/modules/CMakeLists.txt +@@ -1,4 +1,4 @@ +-set(LLVM_INSTALL_PACKAGE_DIR lib${LLVM_LIBDIR_SUFFIX}/cmake/llvm) ++set(LLVM_INSTALL_PACKAGE_DIR ${LLVM_INSTALL_CMAKE_DIR} CACHE STRING "Path for CMake subdirectory (defaults to 'cmake/llvm')") + set(llvm_cmake_builddir "${LLVM_BINARY_DIR}/${LLVM_INSTALL_PACKAGE_DIR}") + + # First for users who use an installed LLVM, create the LLVMExports.cmake file. +@@ -84,11 +84,11 @@ foreach(p ${_count}) + set(LLVM_CONFIG_CODE "${LLVM_CONFIG_CODE} + get_filename_component(LLVM_INSTALL_PREFIX \"\${LLVM_INSTALL_PREFIX}\" PATH)") + endforeach(p) +-set(LLVM_CONFIG_INCLUDE_DIRS "\${LLVM_INSTALL_PREFIX}/include") +-set(LLVM_CONFIG_LIBRARY_DIRS "\${LLVM_INSTALL_PREFIX}/lib\${LLVM_LIBDIR_SUFFIX}") ++set(LLVM_CONFIG_INCLUDE_DIRS "\${LLVM_INSTALL_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR}") ++set(LLVM_CONFIG_LIBRARY_DIRS "\${LLVM_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}\${LLVM_LIBDIR_SUFFIX}") + set(LLVM_CONFIG_CMAKE_DIR "\${LLVM_INSTALL_PREFIX}/${LLVM_INSTALL_PACKAGE_DIR}") + set(LLVM_CONFIG_BINARY_DIR "\${LLVM_INSTALL_PREFIX}") +-set(LLVM_CONFIG_TOOLS_BINARY_DIR "\${LLVM_INSTALL_PREFIX}/bin") ++set(LLVM_CONFIG_TOOLS_BINARY_DIR "\${LLVM_INSTALL_PREFIX}/${CMAKE_INSTALL_BINDIR}") + set(LLVM_CONFIG_EXPORTS_FILE "\${LLVM_CMAKE_DIR}/LLVMExports.cmake") + set(LLVM_CONFIG_EXPORTS "${LLVM_EXPORTS}") + configure_file( +diff --git a/cmake/modules/LLVMInstallSymlink.cmake b/cmake/modules/LLVMInstallSymlink.cmake +index 482697b06baf..af2ac1e6c979 100644 +--- a/cmake/modules/LLVMInstallSymlink.cmake ++++ b/cmake/modules/LLVMInstallSymlink.cmake +@@ -10,7 +10,7 @@ function(install_symlink name target outdir) + set(LINK_OR_COPY copy) + endif() + +- set(bindir "${DESTDIR}${CMAKE_INSTALL_PREFIX}/${outdir}/") ++ set(bindir "${DESTDIR}${outdir}/") + + message("Creating ${name}") + +diff --git a/docs/CMake.rst b/docs/CMake.rst +index b6ebf37adc92..34c73d2869e0 100644 +--- a/docs/CMake.rst ++++ b/docs/CMake.rst +@@ -196,7 +196,7 @@ CMake manual, or execute ``cmake --help-variable VARIABLE_NAME``. + **LLVM_LIBDIR_SUFFIX**:STRING + Extra suffix to append to the directory where libraries are to be + installed. On a 64-bit architecture, one could use ``-DLLVM_LIBDIR_SUFFIX=64`` +- to install libraries to ``/usr/lib64``. ++ to install libraries to ``/usr/lib64``. See also ``CMAKE_INSTALL_LIBDIR``. + + **CMAKE_C_FLAGS**:STRING + Extra flags to use when compiling C source files. +@@ -461,8 +461,8 @@ LLVM-specific variables + + **LLVM_INSTALL_DOXYGEN_HTML_DIR**:STRING + The path to install Doxygen-generated HTML documentation to. This path can +- either be absolute or relative to the CMAKE_INSTALL_PREFIX. Defaults to +- `share/doc/llvm/doxygen-html`. ++ either be absolute or relative to the ``CMAKE_INSTALL_PREFIX``. Defaults to ++ `${CMAKE_INSTALL_DOCDIR}/${project}/doxygen-html`. + + **LLVM_ENABLE_SPHINX**:BOOL + If specified, CMake will search for the ``sphinx-build`` executable and will make +@@ -493,13 +493,33 @@ LLVM-specific variables + + **LLVM_INSTALL_SPHINX_HTML_DIR**:STRING + The path to install Sphinx-generated HTML documentation to. This path can +- either be absolute or relative to the CMAKE_INSTALL_PREFIX. Defaults to +- `share/doc/llvm/html`. ++ either be absolute or relative to the ``CMAKE_INSTALL_PREFIX``. Defaults to ++ `${CMAKE_INSTALL_DOCDIR}/${project}/html`. + + **LLVM_INSTALL_OCAMLDOC_HTML_DIR**:STRING + The path to install OCamldoc-generated HTML documentation to. This path can +- either be absolute or relative to the CMAKE_INSTALL_PREFIX. Defaults to +- `share/doc/llvm/ocaml-html`. ++ either be absolute or relative to the ``CMAKE_INSTALL_PREFIX``. Defaults to ++ `${CMAKE_INSTALL_DOCDIR}/${project}/ocaml-html`. ++ ++**CMAKE_INSTALL_BINDIR**:STRING ++ The path to install binary tools, relative to the ``CMAKE_INSTALL_PREFIX``. ++ Defaults to `bin`. ++ ++**CMAKE_INSTALL_LIBDIR**:STRING ++ The path to install libraries, relative to the ``CMAKE_INSTALL_PREFIX``. ++ Defaults to `lib`. ++ ++**CMAKE_INSTALL_INCLUDEDIR**:STRING ++ The path to install header files, relative to the ``CMAKE_INSTALL_PREFIX``. ++ Defaults to `include`. ++ ++**CMAKE_INSTALL_DOCDIR**:STRING ++ The path to install documentation, relative to the ``CMAKE_INSTALL_PREFIX``. ++ Defaults to `share/doc`. ++ ++**CMAKE_INSTALL_MANDIR**:STRING ++ The path to install manpage files, relative to the ``CMAKE_INSTALL_PREFIX``. ++ Defaults to `share/man`. + + **LLVM_CREATE_XCODE_TOOLCHAIN**:BOOL + OS X Only: If enabled CMake will generate a target named +@@ -651,9 +671,11 @@ the ``cmake`` command or by setting it directly in ``ccmake`` or ``cmake-gui``). + + This file is available in two different locations. + +-* ``/lib/cmake/llvm/LLVMConfig.cmake`` where +- ```` is the install prefix of an installed version of LLVM. +- On Linux typically this is ``/usr/lib/cmake/llvm/LLVMConfig.cmake``. ++* ``LLVMConfig.cmake`` where ++ ```` is the location where LLVM CMake modules are ++ installed as part of an installed version of LLVM. This is typically ++ ``cmake/llvm/`` within the lib directory. On Linux, this is typically ++ ``/usr/lib/cmake/llvm/LLVMConfig.cmake``. + + * ``/lib/cmake/llvm/LLVMConfig.cmake`` where + ```` is the root of the LLVM build tree. **Note: this is only +diff --git a/include/llvm/CMakeLists.txt b/include/llvm/CMakeLists.txt +index 1d5ca3ba92b0..026f5453c1da 100644 +--- a/include/llvm/CMakeLists.txt ++++ b/include/llvm/CMakeLists.txt +@@ -4,5 +4,5 @@ add_subdirectory(Support) + # If we're doing an out-of-tree build, copy a module map for generated + # header files into the build area. + if (NOT "${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}") +- configure_file(module.modulemap.build module.modulemap COPYONLY) ++ configure_file(module.modulemap.build ${LLVM_INCLUDE_DIR}/module.modulemap COPYONLY) + endif (NOT "${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}") +diff --git a/tools/llvm-config/BuildVariables.inc.in b/tools/llvm-config/BuildVariables.inc.in +index f201e1f7bff0..4582ed556a02 100644 +--- a/tools/llvm-config/BuildVariables.inc.in ++++ b/tools/llvm-config/BuildVariables.inc.in +@@ -24,6 +24,10 @@ + #define LLVM_CXXFLAGS "@LLVM_CXXFLAGS@" + #define LLVM_BUILDMODE "@LLVM_BUILDMODE@" + #define LLVM_LIBDIR_SUFFIX "@LLVM_LIBDIR_SUFFIX@" ++#define LLVM_INSTALL_BINDIR "@CMAKE_INSTALL_BINDIR@" ++#define LLVM_INSTALL_LIBDIR "@CMAKE_INSTALL_LIBDIR@" ++#define LLVM_INSTALL_INCLUDEDIR "@CMAKE_INSTALL_INCLUDEDIR@" ++#define LLVM_INSTALL_CMAKEDIR "@LLVM_INSTALL_CMAKE_DIR@" + #define LLVM_TARGETS_BUILT "@LLVM_TARGETS_BUILT@" + #define LLVM_SYSTEM_LIBS "@LLVM_SYSTEM_LIBS@" + #define LLVM_BUILD_SYSTEM "@LLVM_BUILD_SYSTEM@" +diff --git a/tools/llvm-config/llvm-config.cpp b/tools/llvm-config/llvm-config.cpp +index 08b096afb052..2deae0dcfacc 100644 +--- a/tools/llvm-config/llvm-config.cpp ++++ b/tools/llvm-config/llvm-config.cpp +@@ -332,12 +332,26 @@ int main(int argc, char **argv) { + ("-I" + ActiveIncludeDir + " " + "-I" + ActiveObjRoot + "/include"); + } else { + ActivePrefix = CurrentExecPrefix; +- ActiveIncludeDir = ActivePrefix + "/include"; +- SmallString<256> path(StringRef(LLVM_TOOLS_INSTALL_DIR)); +- sys::fs::make_absolute(ActivePrefix, path); +- ActiveBinDir = path.str(); +- ActiveLibDir = ActivePrefix + "/lib" + LLVM_LIBDIR_SUFFIX; +- ActiveCMakeDir = ActiveLibDir + "/cmake/llvm"; ++ { ++ SmallString<256> path(StringRef(LLVM_INSTALL_INCLUDEDIR)); ++ sys::fs::make_absolute(ActivePrefix, path); ++ ActiveIncludeDir = std::string(path.str()); ++ } ++ { ++ SmallString<256> path(StringRef(LLVM_INSTALL_BINDIR)); ++ sys::fs::make_absolute(ActivePrefix, path); ++ ActiveBinDir = std::string(path.str()); ++ } ++ { ++ SmallString<256> path(StringRef(LLVM_INSTALL_LIBDIR LLVM_LIBDIR_SUFFIX)); ++ sys::fs::make_absolute(ActivePrefix, path); ++ ActiveLibDir = std::string(path.str()); ++ } ++ { ++ SmallString<256> path(StringRef(LLVM_INSTALL_CMAKEDIR)); ++ sys::fs::make_absolute(ActivePrefix, path); ++ ActiveCMakeDir = std::string(path.str()); ++ } + ActiveIncludeOption = "-I" + ActiveIncludeDir; + } + +diff --git a/tools/lto/CMakeLists.txt b/tools/lto/CMakeLists.txt +index 6e913519a809..85641eef721f 100644 +--- a/tools/lto/CMakeLists.txt ++++ b/tools/lto/CMakeLists.txt +@@ -19,7 +19,7 @@ set(LLVM_EXPORTED_SYMBOL_FILE ${CMAKE_CURRENT_SOURCE_DIR}/lto.exports) + add_llvm_library(LTO SHARED ${SOURCES} DEPENDS intrinsics_gen) + + install(FILES ${LLVM_MAIN_INCLUDE_DIR}/llvm-c/lto.h +- DESTINATION include/llvm-c ++ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/llvm-c + COMPONENT LTO) + + if (APPLE) +diff --git a/tools/opt-viewer/CMakeLists.txt b/tools/opt-viewer/CMakeLists.txt +index 19b606933082..27b9f71b3d79 100644 +--- a/tools/opt-viewer/CMakeLists.txt ++++ b/tools/opt-viewer/CMakeLists.txt +@@ -8,6 +8,6 @@ set (files + + foreach (file ${files}) + install(PROGRAMS ${file} +- DESTINATION share/opt-viewer ++ DESTINATION ${CMAKE_INSTALL_DATADIR}/opt-viewer + COMPONENT opt-viewer) + endforeach (file) diff --git a/pkgs/development/compilers/llvm/6/clang/default.nix b/pkgs/development/compilers/llvm/6/clang/default.nix index 41202dd3f5d..5c4894af9da 100644 --- a/pkgs/development/compilers/llvm/6/clang/default.nix +++ b/pkgs/development/compilers/llvm/6/clang/default.nix @@ -1,4 +1,5 @@ -{ lib, stdenv, fetch, cmake, libxml2, llvm, version, clang-tools-extra_src, python3 +{ lib, stdenv, fetch, cmake, libxml2, libllvm, version, clang-tools-extra_src, python3 +, buildLlvmTools , fixDarwinDylibNames , enableManpages ? false }: @@ -22,20 +23,27 @@ let ++ lib.optional enableManpages python3.pkgs.sphinx ++ lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames; - buildInputs = [ libxml2 llvm ]; + buildInputs = [ libxml2 libllvm ]; cmakeFlags = [ "-DCMAKE_CXX_FLAGS=-std=c++11" "-DLLVM_ENABLE_RTTI=ON" + "-DLLVM_CONFIG_PATH=${libllvm.dev}/bin/llvm-config${lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) "-native"}" ] ++ lib.optionals enableManpages [ "-DCLANG_INCLUDE_DOCS=ON" "-DLLVM_ENABLE_SPHINX=ON" "-DSPHINX_OUTPUT_MAN=ON" "-DSPHINX_OUTPUT_HTML=OFF" "-DSPHINX_WARNINGS_AS_ERRORS=OFF" + ] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ + "-DLLVM_TABLEGEN_EXE=${buildLlvmTools.llvm}/bin/llvm-tblgen" + "-DCLANG_TABLEGEN=${buildLlvmTools.libclang.dev}/bin/clang-tblgen" ]; - patches = [ ./purity.patch ]; + patches = [ + ./purity.patch + ./gnu-install-dirs.patch + ]; postPatch = '' sed -i -e 's/DriverArgs.hasArg(options::OPT_nostdlibinc)/true/' \ @@ -48,12 +56,12 @@ let sed -i -e 's/lgcc_s/lgcc_eh/' lib/Driver/ToolChains/*.cpp ''; - outputs = [ "out" "lib" "python" ]; + outputs = [ "out" "lib" "dev" "python" ]; # Clang expects to find LLVMgold in its own prefix postInstall = '' - if [ -e ${llvm}/lib/LLVMgold.so ]; then - ln -sv ${llvm}/lib/LLVMgold.so $out/lib + 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 @@ -70,11 +78,14 @@ let fi mv $out/share/clang/*.py $python/share/clang rm $out/bin/c-index-test + + mkdir -p $dev/bin + cp bin/clang-tblgen $dev/bin ''; passthru = { isClang = true; - inherit llvm; + inherit libllvm; }; meta = { diff --git a/pkgs/development/compilers/llvm/6/clang/gnu-install-dirs.patch b/pkgs/development/compilers/llvm/6/clang/gnu-install-dirs.patch new file mode 100644 index 00000000000..bdbbae95516 --- /dev/null +++ b/pkgs/development/compilers/llvm/6/clang/gnu-install-dirs.patch @@ -0,0 +1,258 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 2eee8e6148f7..63efc7d2fdd0 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -5,6 +5,8 @@ cmake_minimum_required(VERSION 3.4.3) + if( CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR ) + project(Clang) + ++ include(GNUInstallDirs) ++ + # Rely on llvm-config. + set(CONFIG_OUTPUT) + find_program(LLVM_CONFIG "llvm-config") +@@ -365,7 +367,7 @@ include_directories(BEFORE + + if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY) + install(DIRECTORY include/clang include/clang-c +- DESTINATION include ++ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} + FILES_MATCHING + PATTERN "*.def" + PATTERN "*.h" +@@ -374,7 +376,7 @@ if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY) + ) + + install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/include/clang +- DESTINATION include ++ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} + FILES_MATCHING + PATTERN "CMakeFiles" EXCLUDE + PATTERN "*.inc" +@@ -382,7 +384,7 @@ if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY) + ) + + install(PROGRAMS utils/bash-autocomplete.sh +- DESTINATION share/clang ++ DESTINATION ${CMAKE_INSTALL_DATADIR}/clang + ) + endif() + +diff --git a/cmake/modules/AddClang.cmake b/cmake/modules/AddClang.cmake +index c09a8423f9f6..39f37e0097eb 100644 +--- a/cmake/modules/AddClang.cmake ++++ b/cmake/modules/AddClang.cmake +@@ -99,9 +99,9 @@ macro(add_clang_library name) + install(TARGETS ${name} + COMPONENT ${name} + ${export_to_clangtargets} +- LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX} +- ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX} +- RUNTIME DESTINATION bin) ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX} ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) + + if (${ARG_SHARED} AND NOT CMAKE_CONFIGURATION_TYPES) + add_llvm_install_targets(install-${name} +@@ -141,7 +141,7 @@ macro(add_clang_tool name) + + install(TARGETS ${name} + ${export_to_clangtargets} +- RUNTIME DESTINATION bin ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + COMPONENT ${name}) + + if(NOT CMAKE_CONFIGURATION_TYPES) +@@ -156,5 +156,5 @@ endmacro() + macro(add_clang_symlink name dest) + add_llvm_tool_symlink(${name} ${dest} ALWAYS_GENERATE) + # Always generate install targets +- llvm_install_symlink(${name} ${dest} ALWAYS_GENERATE) ++ llvm_install_symlink(${name} ${dest} ${CMAKE_INSTALL_FULL_BINDIR} ALWAYS_GENERATE) + endmacro() +diff --git a/lib/Headers/CMakeLists.txt b/lib/Headers/CMakeLists.txt +index 97ba3edea1c5..9d2bc5714af5 100644 +--- a/lib/Headers/CMakeLists.txt ++++ b/lib/Headers/CMakeLists.txt +@@ -142,13 +142,13 @@ install( + FILES ${files} ${CMAKE_CURRENT_BINARY_DIR}/arm_neon.h + COMPONENT clang-headers + PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ +- DESTINATION lib${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION}/include) ++ DESTINATION ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION}/include) + + install( + FILES ${cuda_wrapper_files} + COMPONENT clang-headers + PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ +- DESTINATION lib${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION}/include/cuda_wrappers) ++ DESTINATION ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION}/include/cuda_wrappers) + + if (NOT CMAKE_CONFIGURATION_TYPES) # don't add this for IDE's. + add_llvm_install_targets(install-clang-headers +diff --git a/tools/c-index-test/CMakeLists.txt b/tools/c-index-test/CMakeLists.txt +index d38c7bb28709..c9b5499cb756 100644 +--- a/tools/c-index-test/CMakeLists.txt ++++ b/tools/c-index-test/CMakeLists.txt +@@ -50,7 +50,7 @@ if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY) + set_property(TARGET c-index-test APPEND PROPERTY INSTALL_RPATH + "@executable_path/../../lib") + else() +- set(INSTALL_DESTINATION bin) ++ set(INSTALL_DESTINATION ${CMAKE_INSTALL_BINDIR}) + endif() + + install(TARGETS c-index-test +diff --git a/tools/clang-check/CMakeLists.txt b/tools/clang-check/CMakeLists.txt +index c5ace26c2914..97bdfca7d896 100644 +--- a/tools/clang-check/CMakeLists.txt ++++ b/tools/clang-check/CMakeLists.txt +@@ -20,4 +20,4 @@ target_link_libraries(clang-check + ) + + install(TARGETS clang-check +- RUNTIME DESTINATION bin) ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) +diff --git a/tools/clang-format/CMakeLists.txt b/tools/clang-format/CMakeLists.txt +index a295e8cd0b2a..1973ff82c7f6 100644 +--- a/tools/clang-format/CMakeLists.txt ++++ b/tools/clang-format/CMakeLists.txt +@@ -21,20 +21,20 @@ if( LLVM_LIB_FUZZING_ENGINE OR LLVM_USE_SANITIZE_COVERAGE ) + endif() + + install(PROGRAMS clang-format-bbedit.applescript +- DESTINATION share/clang ++ DESTINATION ${CMAKE_INSTALL_DATADIR}/clang + COMPONENT clang-format) + install(PROGRAMS clang-format-diff.py +- DESTINATION share/clang ++ DESTINATION ${CMAKE_INSTALL_DATADIR}/clang + COMPONENT clang-format) + install(PROGRAMS clang-format-sublime.py +- DESTINATION share/clang ++ DESTINATION ${CMAKE_INSTALL_DATADIR}/clang + COMPONENT clang-format) + install(PROGRAMS clang-format.el +- DESTINATION share/clang ++ DESTINATION ${CMAKE_INSTALL_DATADIR}/clang + COMPONENT clang-format) + install(PROGRAMS clang-format.py +- DESTINATION share/clang ++ DESTINATION ${CMAKE_INSTALL_DATADIR}/clang + COMPONENT clang-format) + install(PROGRAMS git-clang-format +- DESTINATION bin ++ DESTINATION ${CMAKE_INSTALL_BINDIR} + COMPONENT clang-format) +diff --git a/tools/clang-func-mapping/CMakeLists.txt b/tools/clang-func-mapping/CMakeLists.txt +index ae28e28d532d..8ecb2e37a8f7 100644 +--- a/tools/clang-func-mapping/CMakeLists.txt ++++ b/tools/clang-func-mapping/CMakeLists.txt +@@ -20,4 +20,4 @@ target_link_libraries(clang-func-mapping + ) + + install(TARGETS clang-func-mapping +- RUNTIME DESTINATION bin) ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) +diff --git a/tools/clang-offload-bundler/CMakeLists.txt b/tools/clang-offload-bundler/CMakeLists.txt +index 8718015be76a..7a038f39622e 100644 +--- a/tools/clang-offload-bundler/CMakeLists.txt ++++ b/tools/clang-offload-bundler/CMakeLists.txt +@@ -22,4 +22,4 @@ target_link_libraries(clang-offload-bundler + ${CLANG_OFFLOAD_BUNDLER_LIB_DEPS} + ) + +-install(TARGETS clang-offload-bundler RUNTIME DESTINATION bin) ++install(TARGETS clang-offload-bundler RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) +diff --git a/tools/clang-refactor/CMakeLists.txt b/tools/clang-refactor/CMakeLists.txt +index d2029066b9b7..9bc152a675af 100644 +--- a/tools/clang-refactor/CMakeLists.txt ++++ b/tools/clang-refactor/CMakeLists.txt +@@ -21,4 +21,4 @@ target_link_libraries(clang-refactor + clangToolingRefactor + ) + +-install(TARGETS clang-refactor RUNTIME DESTINATION bin) ++install(TARGETS clang-refactor RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) +diff --git a/tools/clang-rename/CMakeLists.txt b/tools/clang-rename/CMakeLists.txt +index 9689e1c6804d..6087716510a9 100644 +--- a/tools/clang-rename/CMakeLists.txt ++++ b/tools/clang-rename/CMakeLists.txt +@@ -16,8 +16,8 @@ target_link_libraries(clang-rename + ) + + install(PROGRAMS clang-rename.py +- DESTINATION share/clang ++ DESTINATION ${CMAKE_INSTALL_DATADIR}/clang + COMPONENT clang-rename) + install(PROGRAMS clang-rename.el +- DESTINATION share/clang ++ DESTINATION ${CMAKE_INSTALL_DATADIR}/clang + COMPONENT clang-rename) +diff --git a/tools/libclang/CMakeLists.txt b/tools/libclang/CMakeLists.txt +index 44406378207b..3b64b18ad4a5 100644 +--- a/tools/libclang/CMakeLists.txt ++++ b/tools/libclang/CMakeLists.txt +@@ -130,7 +130,7 @@ endif() + if(INTERNAL_INSTALL_PREFIX) + set(LIBCLANG_HEADERS_INSTALL_DESTINATION "${INTERNAL_INSTALL_PREFIX}/include") + else() +- set(LIBCLANG_HEADERS_INSTALL_DESTINATION include) ++ set(LIBCLANG_HEADERS_INSTALL_DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) + endif() + + install(DIRECTORY ../../include/clang-c +diff --git a/tools/scan-build/CMakeLists.txt b/tools/scan-build/CMakeLists.txt +index 380379300b09..adfd58ed5f7d 100644 +--- a/tools/scan-build/CMakeLists.txt ++++ b/tools/scan-build/CMakeLists.txt +@@ -41,7 +41,7 @@ if(CLANG_INSTALL_SCANBUILD) + ${CMAKE_BINARY_DIR}/bin/ + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/bin/${BinFile}) + list(APPEND Depends ${CMAKE_BINARY_DIR}/bin/${BinFile}) +- install(PROGRAMS bin/${BinFile} DESTINATION bin) ++ install(PROGRAMS bin/${BinFile} DESTINATION ${CMAKE_INSTALL_BINDIR}) + endforeach() + + foreach(LibexecFile ${LibexecFiles}) +@@ -53,7 +53,7 @@ if(CLANG_INSTALL_SCANBUILD) + ${CMAKE_BINARY_DIR}/libexec/ + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/libexec/${LibexecFile}) + list(APPEND Depends ${CMAKE_BINARY_DIR}/libexec/${LibexecFile}) +- install(PROGRAMS libexec/${LibexecFile} DESTINATION libexec) ++ install(PROGRAMS libexec/${LibexecFile} DESTINATION ${CMAKE_INSTALL_LIBEXECDIR}) + endforeach() + + foreach(ManPage ${ManPages}) +@@ -77,7 +77,7 @@ if(CLANG_INSTALL_SCANBUILD) + ${CMAKE_BINARY_DIR}/share/scan-build/ + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/share/scan-build/${ShareFile}) + list(APPEND Depends ${CMAKE_BINARY_DIR}/share/scan-build/${ShareFile}) +- install(FILES share/scan-build/${ShareFile} DESTINATION share/scan-build) ++ install(FILES share/scan-build/${ShareFile} DESTINATION ${CMAKE_INSTALL_DATADIR}/scan-build) + endforeach() + + add_custom_target(scan-build ALL DEPENDS ${Depends}) +diff --git a/tools/scan-view/CMakeLists.txt b/tools/scan-view/CMakeLists.txt +index b305ca562a72..554bcb379061 100644 +--- a/tools/scan-view/CMakeLists.txt ++++ b/tools/scan-view/CMakeLists.txt +@@ -21,7 +21,7 @@ if(CLANG_INSTALL_SCANVIEW) + ${CMAKE_BINARY_DIR}/bin/ + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/bin/${BinFile}) + list(APPEND Depends ${CMAKE_BINARY_DIR}/bin/${BinFile}) +- install(PROGRAMS bin/${BinFile} DESTINATION bin) ++ install(PROGRAMS bin/${BinFile} DESTINATION ${CMAKE_INSTALL_BINDIR}) + endforeach() + + foreach(ShareFile ${ShareFiles}) +@@ -33,7 +33,7 @@ if(CLANG_INSTALL_SCANVIEW) + ${CMAKE_BINARY_DIR}/share/scan-view/ + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/share/${ShareFile}) + list(APPEND Depends ${CMAKE_BINARY_DIR}/share/scan-view/${ShareFile}) +- install(FILES share/${ShareFile} DESTINATION share/scan-view) ++ install(FILES share/${ShareFile} DESTINATION ${CMAKE_INSTALL_DATADIR}/scan-view) + endforeach() + + add_custom_target(scan-view ALL DEPENDS ${Depends}) diff --git a/pkgs/development/compilers/llvm/6/compiler-rt/default.nix b/pkgs/development/compilers/llvm/6/compiler-rt/default.nix index f0a1c7ecc34..c74693629d3 100644 --- a/pkgs/development/compilers/llvm/6/compiler-rt/default.nix +++ b/pkgs/development/compilers/llvm/6/compiler-rt/default.nix @@ -13,7 +13,7 @@ stdenv.mkDerivation { inherit version; src = fetch "compiler-rt" "1fcr3jn24yr8lh36nc0c4ikli4744i2q9m1ik67p1jymwwaixkgl"; - nativeBuildInputs = [ cmake python3 llvm ]; + nativeBuildInputs = [ cmake python3 llvm.dev ]; buildInputs = lib.optional stdenv.hostPlatform.isDarwin libcxxabi; NIX_CFLAGS_COMPILE = [ @@ -21,6 +21,7 @@ stdenv.mkDerivation { ]; cmakeFlags = [ + "-DCOMPILER_RT_OS_DIR=" "-DCOMPILER_RT_DEFAULT_TARGET_ONLY=ON" "-DCMAKE_C_COMPILER_TARGET=${stdenv.hostPlatform.config}" "-DCMAKE_ASM_COMPILER_TARGET=${stdenv.hostPlatform.config}" @@ -54,6 +55,7 @@ stdenv.mkDerivation { ./codesign.patch # Revert compiler-rt commit that makes codesign mandatory # https://github.com/llvm/llvm-project/commit/947f9692440836dcb8d88b74b69dd379d85974ce ../../common/compiler-rt/glibc.patch + ./gnu-install-dirs.patch ] ++ lib.optional stdenv.hostPlatform.isMusl ./sanitizers-nongnu.patch ++ lib.optional stdenv.hostPlatform.isAarch32 ./armv7l.patch; @@ -78,9 +80,7 @@ stdenv.mkDerivation { ''; # Hack around weird upsream RPATH bug - postInstall = lib.optionalString (stdenv.hostPlatform.isDarwin || stdenv.hostPlatform.isWasm) '' - ln -s "$out/lib"/*/* "$out/lib" - '' + lib.optionalString (useLLVM) '' + postInstall = lib.optionalString (useLLVM) '' ln -s $out/lib/*/clang_rt.crtbegin-*.o $out/lib/linux/crtbegin.o ln -s $out/lib/*/clang_rt.crtend-*.o $out/lib/linux/crtend.o ln -s $out/lib/*/clang_rt.crtbegin_shared-*.o $out/lib/linux/crtbeginS.o diff --git a/pkgs/development/compilers/llvm/6/compiler-rt/gnu-install-dirs.patch b/pkgs/development/compilers/llvm/6/compiler-rt/gnu-install-dirs.patch new file mode 100644 index 00000000000..8daf03994b5 --- /dev/null +++ b/pkgs/development/compilers/llvm/6/compiler-rt/gnu-install-dirs.patch @@ -0,0 +1,107 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 4b953b212829..a10b69aa67dc 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -8,6 +8,7 @@ cmake_minimum_required(VERSION 3.4.3) + # Check if compiler-rt is built as a standalone project. + if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR OR COMPILER_RT_STANDALONE_BUILD) + project(CompilerRT C CXX ASM) ++ include(GNUInstallDirs) + set(COMPILER_RT_STANDALONE_BUILD TRUE) + endif() + +diff --git a/cmake/Modules/AddCompilerRT.cmake b/cmake/Modules/AddCompilerRT.cmake +index 139b6140011c..502354a37d67 100644 +--- a/cmake/Modules/AddCompilerRT.cmake ++++ b/cmake/Modules/AddCompilerRT.cmake +@@ -439,7 +439,7 @@ macro(add_compiler_rt_resource_file target_name file_name component) + add_custom_target(${target_name} DEPENDS ${dst_file}) + # Install in Clang resource directory. + install(FILES ${file_name} +- DESTINATION ${COMPILER_RT_INSTALL_PATH} ++ DESTINATION ${COMPILER_RT_INSTALL_PATH}/${CMAKE_INSTALL_PREFIX} + COMPONENT ${component}) + add_dependencies(${component} ${target_name}) + +@@ -456,7 +456,7 @@ macro(add_compiler_rt_script name) + add_custom_target(${name} DEPENDS ${dst}) + install(FILES ${dst} + PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE +- DESTINATION ${COMPILER_RT_INSTALL_PATH}/bin) ++ DESTINATION ${COMPILER_RT_INSTALL_PATH}/${CMAKE_INSTALL_FULL_BINDIR}) + endmacro(add_compiler_rt_script src name) + + # Builds custom version of libc++ and installs it in . +diff --git a/cmake/Modules/CompilerRTDarwinUtils.cmake b/cmake/Modules/CompilerRTDarwinUtils.cmake +index a25540bf46d1..77ea739fea74 100644 +--- a/cmake/Modules/CompilerRTDarwinUtils.cmake ++++ b/cmake/Modules/CompilerRTDarwinUtils.cmake +@@ -375,7 +375,7 @@ macro(darwin_add_embedded_builtin_libraries) + set(DARWIN_macho_embedded_LIBRARY_OUTPUT_DIR + ${COMPILER_RT_OUTPUT_DIR}/lib/macho_embedded) + set(DARWIN_macho_embedded_LIBRARY_INSTALL_DIR +- ${COMPILER_RT_INSTALL_PATH}/lib/macho_embedded) ++ ${COMPILER_RT_INSTALL_PATH}/${CMAKE_INSTALL_FULL_LIBDIR}/macho_embedded) + + set(CFLAGS_armv7 "-target thumbv7-apple-darwin-eabi") + set(CFLAGS_i386 "-march=pentium") +diff --git a/cmake/base-config-ix.cmake b/cmake/base-config-ix.cmake +index b208f0852408..cacf4e8fb69d 100644 +--- a/cmake/base-config-ix.cmake ++++ b/cmake/base-config-ix.cmake +@@ -46,11 +46,11 @@ if (LLVM_TREE_AVAILABLE) + else() + # Take output dir and install path from the user. + set(COMPILER_RT_OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR} CACHE PATH +- "Path where built compiler-rt libraries should be stored.") ++ "Path where built compiler-rt build artifacts should be stored.") + set(COMPILER_RT_EXEC_OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR}/bin CACHE PATH + "Path where built compiler-rt executables should be stored.") +- set(COMPILER_RT_INSTALL_PATH ${CMAKE_INSTALL_PREFIX} CACHE PATH +- "Path where built compiler-rt libraries should be installed.") ++ set(COMPILER_RT_INSTALL_PATH "" CACHE PATH ++ "Prefix where built compiler-rt artifacts should be installed, comes before CMAKE_INSTALL_PREFIX.") + option(COMPILER_RT_INCLUDE_TESTS "Generate and build compiler-rt unit tests." OFF) + option(COMPILER_RT_ENABLE_WERROR "Fail and stop if warning is triggered" OFF) + # Use a host compiler to compile/link tests. +@@ -70,9 +70,9 @@ if(NOT DEFINED COMPILER_RT_OS_DIR) + string(TOLOWER ${CMAKE_SYSTEM_NAME} COMPILER_RT_OS_DIR) + endif() + set(COMPILER_RT_LIBRARY_OUTPUT_DIR +- ${COMPILER_RT_OUTPUT_DIR}/lib/${COMPILER_RT_OS_DIR}) ++ ${COMPILER_RT_OUTPUT_DIR}/${CMAKE_INSTALL_FULL_LIBDIR}/${COMPILER_RT_OS_DIR}) + set(COMPILER_RT_LIBRARY_INSTALL_DIR +- ${COMPILER_RT_INSTALL_PATH}/lib/${COMPILER_RT_OS_DIR}) ++ ${COMPILER_RT_INSTALL_PATH}/${CMAKE_INSTALL_FULL_LIBDIR}/${COMPILER_RT_OS_DIR}) + + if(APPLE) + # On Darwin if /usr/include doesn't exist, the user probably has Xcode but not +diff --git a/include/CMakeLists.txt b/include/CMakeLists.txt +index f7efb102ab63..ab8a94d9ff40 100644 +--- a/include/CMakeLists.txt ++++ b/include/CMakeLists.txt +@@ -47,12 +47,12 @@ set_target_properties(compiler-rt-headers PROPERTIES FOLDER "Compiler-RT Misc") + install(FILES ${SANITIZER_HEADERS} + COMPONENT compiler-rt-headers + PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ +- DESTINATION ${COMPILER_RT_INSTALL_PATH}/include/sanitizer) ++ DESTINATION ${COMPILER_RT_INSTALL_PATH}/${CMAKE_INSTALL_FULL_INCLUDEDIR}/sanitizer) + # Install xray headers. + install(FILES ${XRAY_HEADERS} + COMPONENT compiler-rt-headers + PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ +- DESTINATION ${COMPILER_RT_INSTALL_PATH}/include/xray) ++ DESTINATION ${COMPILER_RT_INSTALL_PATH}/${CMAKE_INSTALL_FULL_INCLUDEDIR}/xray) + + if (NOT CMAKE_CONFIGURATION_TYPES) # don't add this for IDEs. + add_custom_target(install-compiler-rt-headers +diff --git a/lib/dfsan/CMakeLists.txt b/lib/dfsan/CMakeLists.txt +index 2c486bff821b..0ee715da95f8 100644 +--- a/lib/dfsan/CMakeLists.txt ++++ b/lib/dfsan/CMakeLists.txt +@@ -44,4 +44,4 @@ add_custom_command(OUTPUT ${dfsan_abilist_filename} + DEPENDS done_abilist.txt libc_ubuntu1404_abilist.txt) + add_dependencies(dfsan dfsan_abilist) + install(FILES ${dfsan_abilist_filename} +- DESTINATION ${COMPILER_RT_INSTALL_PATH}) ++ DESTINATION ${COMPILER_RT_INSTALL_PATH}/${CMAKE_INSTALL_PREFIX}) diff --git a/pkgs/development/compilers/llvm/6/default.nix b/pkgs/development/compilers/llvm/6/default.nix index 2c4c11c89bd..0fc49844b5d 100644 --- a/pkgs/development/compilers/llvm/6/default.nix +++ b/pkgs/development/compilers/llvm/6/default.nix @@ -1,6 +1,5 @@ { lowPrio, newScope, pkgs, lib, stdenv, cmake, gccForLibs , libxml2, python3, isl, fetchurl, overrideCC, wrapCCWith -, buildPackages , buildLlvmTools # tools, but from the previous stage, for cross , targetLlvmLibraries # libraries, but from the next stage, for cross }: @@ -18,35 +17,44 @@ let clang-tools-extra_src = fetch "clang-tools-extra" "1w8ml7fyn4vyxmy59n2qm4r1k1kgwgwkaldp6m45fdv4g0kkfbhd"; tools = lib.makeExtensible (tools: let - callPackage = newScope (tools // { inherit stdenv cmake libxml2 python3 isl release_version version fetch; }); + callPackage = newScope (tools // { inherit stdenv cmake libxml2 python3 isl release_version version fetch buildLlvmTools; }); mkExtraBuildCommands = cc: '' rsrc="$out/resource-root" mkdir "$rsrc" - ln -s "${cc}/lib/clang/${release_version}/include" "$rsrc" + ln -s "${cc.lib}/lib/clang/${release_version}/include" "$rsrc" ln -s "${targetLlvmLibraries.compiler-rt.out}/lib" "$rsrc/lib" echo "-resource-dir=$rsrc" >> $out/nix-support/cc-cflags ''; + in { - llvm = callPackage ./llvm { }; + libllvm = callPackage ./llvm { }; - clang-unwrapped = callPackage ./clang { + # `llvm` historically had the binaries. But this migration + # technique also impedes `lib.get*`. Perhaps we will revisit it. + llvm = tools.libllvm.out; + + libllvm-polly = callPackage ./llvm { enablePolly = true; }; + + llvm-polly = tools.libllvm-polly.lib; + + libclang = callPackage ./clang { inherit clang-tools-extra_src; }; - llvm-manpages = lowPrio (tools.llvm.override { + clang-unwrapped = tools.libclang.out; + + llvm-manpages = lowPrio (tools.libllvm.override { enableManpages = true; enableSharedLibraries = false; python3 = pkgs.python3; # don't use python-boot }); - clang-manpages = lowPrio (tools.clang-unwrapped.override { + clang-manpages = lowPrio (tools.libclang.override { enableManpages = true; python3 = pkgs.python3; # don't use python-boot }); - libclang = tools.clang-unwrapped.lib; - clang = if stdenv.cc.isGNU then tools.libstdcxxClang else tools.libcxxClang; libstdcxxClang = wrapCCWith rec { diff --git a/pkgs/development/compilers/llvm/6/libc++/default.nix b/pkgs/development/compilers/llvm/6/libc++/default.nix index ac489db54fc..69314fbe2ba 100644 --- a/pkgs/development/compilers/llvm/6/libc++/default.nix +++ b/pkgs/development/compilers/llvm/6/libc++/default.nix @@ -11,7 +11,11 @@ stdenv.mkDerivation { export LIBCXXABI_INCLUDE_DIR="$PWD/$(ls -d libcxxabi-${version}*)/include" ''; - patches = lib.optionals stdenv.hostPlatform.isMusl [ + outputs = [ "out" "dev" ]; + + patches = [ + ./gnu-install-dirs.patch + ] ++ lib.optionals stdenv.hostPlatform.isMusl [ ../../libcxx-0001-musl-hacks.patch ]; diff --git a/pkgs/development/compilers/llvm/6/libc++/gnu-install-dirs.patch b/pkgs/development/compilers/llvm/6/libc++/gnu-install-dirs.patch new file mode 100644 index 00000000000..33ff9ef123a --- /dev/null +++ b/pkgs/development/compilers/llvm/6/libc++/gnu-install-dirs.patch @@ -0,0 +1,72 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 9e8e9d5e3d9b..e1d6d2392b92 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -22,6 +22,8 @@ set(CMAKE_MODULE_PATH + if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR) + project(libcxx CXX C) + ++ include(GNUInstallDirs) ++ + set(PACKAGE_NAME libcxx) + set(PACKAGE_VERSION 6.0.0) + set(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}") +diff --git a/cmake/Modules/HandleLibCXXABI.cmake b/cmake/Modules/HandleLibCXXABI.cmake +index 558e11ba2cc1..c6a99cec0191 100644 +--- a/cmake/Modules/HandleLibCXXABI.cmake ++++ b/cmake/Modules/HandleLibCXXABI.cmake +@@ -55,7 +55,7 @@ macro(setup_abi_lib abidefines abilib abifiles abidirs) + ) + if (LIBCXX_INSTALL_HEADERS) + install(FILES "${LIBCXX_BINARY_INCLUDE_DIR}/${fpath}" +- DESTINATION ${LIBCXX_INSTALL_PREFIX}include/c++/v1/${dstdir} ++ DESTINATION ${LIBCXX_INSTALL_PREFIX}${CMAKE_INSTALL_INCLUDEDIR}/c++/v1/${dstdir} + COMPONENT cxx-headers + PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ + ) +diff --git a/include/CMakeLists.txt b/include/CMakeLists.txt +index b98e09260ca1..c920f48697bc 100644 +--- a/include/CMakeLists.txt ++++ b/include/CMakeLists.txt +@@ -20,7 +20,7 @@ endif() + + if (LIBCXX_INSTALL_HEADERS) + install(DIRECTORY . +- DESTINATION ${LIBCXX_INSTALL_PREFIX}include/c++/v1 ++ DESTINATION ${LIBCXX_INSTALL_PREFIX}${CMAKE_INSTALL_INCLUDEDIR}/c++/v1 + COMPONENT cxx-headers + FILES_MATCHING + ${LIBCXX_HEADER_PATTERN} +@@ -44,7 +44,7 @@ if (LIBCXX_INSTALL_HEADERS) + set(generated_config_deps generate_config_header) + # Install the generated header as __config. + install(FILES ${LIBCXX_BINARY_DIR}/__generated_config +- DESTINATION ${LIBCXX_INSTALL_PREFIX}include/c++/v1 ++ DESTINATION ${LIBCXX_INSTALL_PREFIX}${CMAKE_INSTALL_INCLUDEDIR}/c++/v1 + PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ + RENAME __config + COMPONENT cxx-headers) +diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt +index aa5ebf1568ec..36d85b94c3ba 100644 +--- a/lib/CMakeLists.txt ++++ b/lib/CMakeLists.txt +@@ -357,8 +357,8 @@ if (LIBCXX_INSTALL_LIBRARY) + set(experimental_lib cxx_experimental) + endif() + install(TARGETS ${LIBCXX_TARGETS} ${experimental_lib} +- LIBRARY DESTINATION ${LIBCXX_INSTALL_PREFIX}lib${LIBCXX_LIBDIR_SUFFIX} COMPONENT cxx +- ARCHIVE DESTINATION ${LIBCXX_INSTALL_PREFIX}lib${LIBCXX_LIBDIR_SUFFIX} COMPONENT cxx ++ LIBRARY DESTINATION ${LIBCXX_INSTALL_PREFIX}${CMAKE_INSTALL_LIBDIR}${LIBCXX_LIBDIR_SUFFIX} COMPONENT cxx ++ ARCHIVE DESTINATION ${LIBCXX_INSTALL_PREFIX}${CMAKE_INSTALL_LIBDIR}${LIBCXX_LIBDIR_SUFFIX} COMPONENT cxx + ) + # NOTE: This install command must go after the cxx install command otherwise + # it will not be executed after the library symlinks are installed. +@@ -366,7 +366,7 @@ if (LIBCXX_INSTALL_LIBRARY) + # Replace the libc++ filename with $ + # after we required CMake 3.0. + install(FILES "${LIBCXX_LIBRARY_DIR}/libc++${CMAKE_SHARED_LIBRARY_SUFFIX}" +- DESTINATION ${LIBCXX_INSTALL_PREFIX}lib${LIBCXX_LIBDIR_SUFFIX} ++ DESTINATION ${LIBCXX_INSTALL_PREFIX}${CMAKE_INSTALL_LIBDIR}${LIBCXX_LIBDIR_SUFFIX} + COMPONENT libcxx) + endif() + endif() diff --git a/pkgs/development/compilers/llvm/6/libc++abi/default.nix b/pkgs/development/compilers/llvm/6/libc++abi/default.nix index c0d90f6c8e4..04054f0ba0e 100644 --- a/pkgs/development/compilers/llvm/6/libc++abi/default.nix +++ b/pkgs/development/compilers/llvm/6/libc++abi/default.nix @@ -6,8 +6,7 @@ stdenv.mkDerivation { src = fetch "libcxxabi" "0prqvdj317qrc8nddaq1hh2ag9algkd9wbkj3y4mr5588k12x7r0"; - nativeBuildInputs = [ cmake ]; - buildInputs = lib.optional (!stdenv.isDarwin && !stdenv.isFreeBSD) libunwind; + outputs = [ "out" "dev" ]; postUnpack = '' unpackFile ${libcxx.src} @@ -19,6 +18,13 @@ stdenv.mkDerivation { patch -p1 -d $(ls -d libcxx-*) -i ${../../libcxx-0001-musl-hacks.patch} ''; + patches = [ + ./gnu-install-dirs.patch + ]; + + nativeBuildInputs = [ cmake ]; + buildInputs = lib.optional (!stdenv.isDarwin && !stdenv.isFreeBSD) libunwind; + installPhase = if stdenv.isDarwin then '' for file in lib/*.dylib; do diff --git a/pkgs/development/compilers/llvm/6/libc++abi/gnu-install-dirs.patch b/pkgs/development/compilers/llvm/6/libc++abi/gnu-install-dirs.patch new file mode 100644 index 00000000000..649d28d6c45 --- /dev/null +++ b/pkgs/development/compilers/llvm/6/libc++abi/gnu-install-dirs.patch @@ -0,0 +1,28 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 1adbdb338322..2978631e1c58 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -20,6 +20,8 @@ set(CMAKE_MODULE_PATH + if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR) + project(libcxxabi CXX C) + ++ include(GNUInstallDirs) ++ + set(PACKAGE_NAME libcxxabi) + set(PACKAGE_VERSION 6.0.0) + set(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}") +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index 240f6d0d103b..7ad5c31ec7b4 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -181,8 +181,8 @@ add_custom_target(cxxabi DEPENDS ${LIBCXXABI_TARGETS}) + + if (LIBCXXABI_INSTALL_LIBRARY) + install(TARGETS ${LIBCXXABI_TARGETS} +- LIBRARY DESTINATION ${LIBCXXABI_INSTALL_PREFIX}lib${LIBCXXABI_LIBDIR_SUFFIX} COMPONENT cxxabi +- ARCHIVE DESTINATION ${LIBCXXABI_INSTALL_PREFIX}lib${LIBCXXABI_LIBDIR_SUFFIX} COMPONENT cxxabi ++ LIBRARY DESTINATION ${LIBCXXABI_INSTALL_PREFIX}${CMAKE_INSTALL_LIBDIR}${LIBCXXABI_LIBDIR_SUFFIX} COMPONENT cxxabi ++ ARCHIVE DESTINATION ${LIBCXXABI_INSTALL_PREFIX}${CMAKE_INSTALL_LIBDIR}${LIBCXXABI_LIBDIR_SUFFIX} COMPONENT cxxabi + ) + endif() + diff --git a/pkgs/development/compilers/llvm/6/lld/default.nix b/pkgs/development/compilers/llvm/6/lld/default.nix index b8038524805..5bfd5f60e92 100644 --- a/pkgs/development/compilers/llvm/6/lld/default.nix +++ b/pkgs/development/compilers/llvm/6/lld/default.nix @@ -1,8 +1,9 @@ { lib, stdenv +, buildLlvmTools , fetch , cmake , libxml2 -, llvm +, libllvm , version }: @@ -12,15 +13,20 @@ stdenv.mkDerivation { src = fetch "lld" "04afcfq2h7ysyqxxhyhb7ig4p0vdw7mi63kh8mffl74j0rc781p7"; + patches = [ + ./gnu-install-dirs.patch + ]; + nativeBuildInputs = [ cmake ]; - buildInputs = [ llvm libxml2 ]; + buildInputs = [ libllvm libxml2 ]; - outputs = [ "out" "dev" ]; + cmakeFlags = [ + "-DLLVM_CONFIG_PATH=${libllvm.dev}/bin/llvm-config${lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) "-native"}" + ] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ + "-DLLVM_TABLEGEN_EXE=${buildLlvmTools.llvm}/bin/llvm-tblgen" + ]; - postInstall = '' - moveToOutput include "$dev" - moveToOutput lib "$dev" - ''; + outputs = [ "out" "lib" "dev" ]; meta = { description = "The LLVM Linker"; diff --git a/pkgs/development/compilers/llvm/6/lld/gnu-install-dirs.patch b/pkgs/development/compilers/llvm/6/lld/gnu-install-dirs.patch new file mode 100644 index 00000000000..8c6886c6890 --- /dev/null +++ b/pkgs/development/compilers/llvm/6/lld/gnu-install-dirs.patch @@ -0,0 +1,68 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index e2fbdbfbbb47..d601b231ebb8 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -6,6 +6,8 @@ if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR) + set(CMAKE_INCLUDE_CURRENT_DIR ON) + set(LLD_BUILT_STANDALONE TRUE) + ++ include(GNUInstallDirs) ++ + find_program(LLVM_CONFIG_PATH "llvm-config" DOC "Path to llvm-config binary") + if(NOT LLVM_CONFIG_PATH) + message(FATAL_ERROR "llvm-config not found: specify LLVM_CONFIG_PATH") +@@ -203,7 +205,7 @@ include_directories(BEFORE + + if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY) + install(DIRECTORY include/ +- DESTINATION include ++ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} + FILES_MATCHING + PATTERN "*.h" + PATTERN ".svn" EXCLUDE +diff --git a/cmake/modules/AddLLD.cmake b/cmake/modules/AddLLD.cmake +index 0d951799cdfe..7d8546ba87f8 100644 +--- a/cmake/modules/AddLLD.cmake ++++ b/cmake/modules/AddLLD.cmake +@@ -20,9 +20,9 @@ macro(add_lld_library name) + install(TARGETS ${name} + COMPONENT ${name} + ${export_to_lldtargets} +- LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX} +- ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX} +- RUNTIME DESTINATION bin) ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX} ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) + + if (${ARG_SHARED} AND NOT CMAKE_CONFIGURATION_TYPES) + add_llvm_install_targets(install-${name} +@@ -54,7 +54,7 @@ macro(add_lld_tool name) + + install(TARGETS ${name} + ${export_to_lldtargets} +- RUNTIME DESTINATION bin ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + COMPONENT ${name}) + + if(NOT CMAKE_CONFIGURATION_TYPES) +@@ -69,5 +69,5 @@ endmacro() + macro(add_lld_symlink name dest) + add_llvm_tool_symlink(${name} ${dest} ALWAYS_GENERATE) + # Always generate install targets +- llvm_install_symlink(${name} ${dest} ALWAYS_GENERATE) ++ llvm_install_symlink(${name} ${dest} ${CMAKE_INSTALL_FULL_BINDIR} ALWAYS_GENERATE) + endmacro() +diff --git a/tools/lld/CMakeLists.txt b/tools/lld/CMakeLists.txt +index d8829493fc22..df748a0e749b 100644 +--- a/tools/lld/CMakeLists.txt ++++ b/tools/lld/CMakeLists.txt +@@ -16,7 +16,7 @@ target_link_libraries(lld + ) + + install(TARGETS lld +- RUNTIME DESTINATION bin) ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) + + if(NOT LLD_SYMLINKS_TO_CREATE) + set(LLD_SYMLINKS_TO_CREATE lld-link ld.lld ld64.lld wasm-ld) diff --git a/pkgs/development/compilers/llvm/6/lldb/default.nix b/pkgs/development/compilers/llvm/6/lldb/default.nix index 7c6f8b1bd97..31cc0ca68d7 100644 --- a/pkgs/development/compilers/llvm/6/lldb/default.nix +++ b/pkgs/development/compilers/llvm/6/lldb/default.nix @@ -8,14 +8,14 @@ , which , libedit , libxml2 -, llvm -, clang-unwrapped +, libllvm +, libclang , python3 , version , darwin }: -stdenv.mkDerivation { +stdenv.mkDerivation rec { pname = "lldb"; inherit version; @@ -28,29 +28,46 @@ stdenv.mkDerivation { sha256 = "1zbx4m0m8kbg0wq6740jcw151vb2pb1p25p401wiq8diqqagkjps"; stripLen = 1; }) + ./gnu-install-dirs.patch ]; postPatch = '' # Fix up various paths that assume llvm and clang are installed in the same place - sed -i 's,".*ClangConfig.cmake","${clang-unwrapped}/lib/cmake/clang/ClangConfig.cmake",' \ + sed -i 's,".*ClangConfig.cmake","${libclang.dev}/lib/cmake/clang/ClangConfig.cmake",' \ cmake/modules/LLDBStandalone.cmake - sed -i 's,".*tools/clang/include","${clang-unwrapped}/include",' \ + sed -i 's,".*tools/clang/include","${libclang.dev}/include",' \ cmake/modules/LLDBStandalone.cmake - sed -i 's,"$.LLVM_LIBRARY_DIR.",${llvm}/lib ${clang-unwrapped}/lib,' \ + sed -i 's,"$.LLVM_LIBRARY_DIR.",${libllvm.lib}/lib ${libclang.lib}/lib,' \ cmake/modules/LLDBStandalone.cmake ''; - nativeBuildInputs = [ cmake python3 which swig ]; - buildInputs = [ ncurses zlib libedit libxml2 llvm ] - ++ lib.optionals stdenv.isDarwin [ darwin.libobjc darwin.apple_sdk.libs.xpc darwin.apple_sdk.frameworks.Foundation darwin.bootstrap_cmds darwin.apple_sdk.frameworks.Carbon darwin.apple_sdk.frameworks.Cocoa ]; + outputs = [ "out" "lib" "dev" ]; + + nativeBuildInputs = [ + cmake python3 which swig + ]; + + buildInputs = [ + ncurses zlib libedit libxml2 libllvm + ] ++ lib.optionals stdenv.isDarwin [ + darwin.libobjc + darwin.apple_sdk.libs.xpc + darwin.apple_sdk.frameworks.Foundation darwin.bootstrap_cmds darwin.apple_sdk.frameworks.Carbon darwin.apple_sdk.frameworks.Cocoa + ]; CXXFLAGS = "-fno-rtti"; hardeningDisable = [ "format" ]; cmakeFlags = [ + "-DLLDB_INCLUDE_TESTS=${if doCheck then "YES" else "NO"}" "-DLLDB_CODESIGN_IDENTITY=" # codesigning makes nondeterministic + ] ++ lib.optionals doCheck [ + "-DLLDB_TEST_C_COMPILER=${stdenv.cc}/bin/${stdenv.cc.targetPrefix}cc" + "-DLLDB_TEST_CXX_COMPILER=${stdenv.cc}/bin/${stdenv.cc.targetPrefix}c++" ]; + doCheck = false; + postInstall = '' mkdir -p $out/share/man/man1 cp ../docs/lldb.1 $out/share/man/man1/ diff --git a/pkgs/development/compilers/llvm/6/lldb/gnu-install-dirs.patch b/pkgs/development/compilers/llvm/6/lldb/gnu-install-dirs.patch new file mode 100644 index 00000000000..a240ecaab17 --- /dev/null +++ b/pkgs/development/compilers/llvm/6/lldb/gnu-install-dirs.patch @@ -0,0 +1,76 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index c6b082e104e5..568a99837e1f 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -7,6 +7,8 @@ set(CMAKE_MODULE_PATH + "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules" + ) + ++include(GNUInstallDirs) ++ + include(LLDBStandalone) + include(LLDBConfig) + include(AddLLDB) +diff --git a/cmake/modules/AddLLDB.cmake b/cmake/modules/AddLLDB.cmake +index 2fd8b384d9e3..4db5e786c493 100644 +--- a/cmake/modules/AddLLDB.cmake ++++ b/cmake/modules/AddLLDB.cmake +@@ -56,14 +56,14 @@ function(add_lldb_library name) + endif() + install(TARGETS ${name} + COMPONENT ${name} +- RUNTIME DESTINATION bin ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${out_dir} + ARCHIVE DESTINATION ${out_dir}) + else() + install(TARGETS ${name} + COMPONENT ${name} +- LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX} +- ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX}) ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}) + endif() + if (NOT CMAKE_CONFIGURATION_TYPES) + add_llvm_install_targets(install-${name} +@@ -132,7 +132,7 @@ function(add_lldb_executable name) + if(ARG_GENERATE_INSTALL AND NOT (ARG_INCLUDE_IN_FRAMEWORK AND LLDB_BUILD_FRAMEWORK )) + install(TARGETS ${name} + COMPONENT ${name} +- RUNTIME DESTINATION bin) ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) + if (NOT CMAKE_CONFIGURATION_TYPES) + add_llvm_install_targets(install-${name} + DEPENDS ${name} +diff --git a/cmake/modules/LLDBConfig.cmake b/cmake/modules/LLDBConfig.cmake +index 24878b5913f3..b9d27788bb87 100644 +--- a/cmake/modules/LLDBConfig.cmake ++++ b/cmake/modules/LLDBConfig.cmake +@@ -278,7 +278,7 @@ include_directories(BEFORE + if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY) + install(DIRECTORY include/ + COMPONENT lldb-headers +- DESTINATION include ++ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} + FILES_MATCHING + PATTERN "*.h" + PATTERN ".svn" EXCLUDE +@@ -288,7 +288,7 @@ if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY) + + install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/include/ + COMPONENT lldb-headers +- DESTINATION include ++ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} + FILES_MATCHING + PATTERN "*.h" + PATTERN ".svn" EXCLUDE +diff --git a/tools/intel-features/CMakeLists.txt b/tools/intel-features/CMakeLists.txt +index b5316540fdf3..3c3c882d503f 100644 +--- a/tools/intel-features/CMakeLists.txt ++++ b/tools/intel-features/CMakeLists.txt +@@ -64,4 +64,4 @@ if (NOT LLDB_DISABLE_PYTHON AND LLDB_BUILD_INTEL_PT) + endif() + + install(TARGETS lldbIntelFeatures +- LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX}) ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}) diff --git a/pkgs/development/compilers/llvm/6/llvm/default.nix b/pkgs/development/compilers/llvm/6/llvm/default.nix index de99691094b..1c04a62c4d5 100644 --- a/pkgs/development/compilers/llvm/6/llvm/default.nix +++ b/pkgs/development/compilers/llvm/6/llvm/default.nix @@ -1,4 +1,5 @@ { lib, stdenv +, pkgsBuildBuild , fetch , cmake , python3 @@ -9,11 +10,12 @@ , version , release_version , zlib -, buildPackages +, buildLlvmTools , fetchpatch , debugVersion ? false , enableManpages ? false -, enableSharedLibraries ? true +, enableSharedLibraries ? !stdenv.hostPlatform.isStatic +, enablePolly ? false }: let @@ -30,15 +32,18 @@ stdenv.mkDerivation ({ inherit version; src = fetch "llvm" "1qpls3vk85lydi5b4axl0809fv932qgsqgdgrk098567z4jc7mmn"; + polly_src = fetch "polly" "1k2frwg5mkqh0raia8xf69h3jhdw7a5nxd6vjscjn44cdkgmyxp7"; unpackPhase = '' unpackFile $src mv llvm-${version}* llvm sourceRoot=$PWD/llvm + '' + optionalString enablePolly '' + unpackFile $polly_src + mv polly-* $sourceRoot/tools/polly ''; - outputs = [ "out" "python" ] - ++ optional enableSharedLibraries "lib"; + outputs = [ "out" "lib" "dev" "python" ]; nativeBuildInputs = [ cmake python3 ] ++ optional enableManpages python3.pkgs.sphinx; @@ -58,12 +63,13 @@ stdenv.mkDerivation ({ includes = [ "test/tools/gold/X86/common.ll" ]; sha256 = "0fxgrxmfnjx17w3lcq19rk68b2xksh1bynz3ina784kma7hp4wdb"; }) - ]; + ./gnu-install-dirs.patch + ] ++ lib.optional enablePolly ./gnu-install-dirs-polly.patch; postPatch = optionalString stdenv.isDarwin '' substituteInPlace cmake/modules/AddLLVM.cmake \ --replace 'set(_install_name_dir INSTALL_NAME_DIR "@rpath")' "set(_install_name_dir)" \ - --replace 'set(_install_rpath "@loader_path/../lib" ''${extra_libdir})' "" + --replace 'set(_install_rpath "@loader_path/../''${CMAKE_INSTALL_LIBDIR}" ''${extra_libdir})' "" '' # Patch llvm-config to return correct library path based on --link-{shared,static}. + optionalString (enableSharedLibraries) '' @@ -88,6 +94,7 @@ stdenv.mkDerivation ({ ''; cmakeFlags = with stdenv; [ + "-DLLVM_INSTALL_CMAKE_DIR=${placeholder "dev"}/lib/cmake/llvm/" "-DCMAKE_BUILD_TYPE=${if debugVersion then "Debug" else "Release"}" "-DLLVM_INSTALL_UTILS=ON" # Needed by rustc "-DLLVM_BUILD_TESTS=ON" @@ -112,7 +119,20 @@ stdenv.mkDerivation ({ "-DCAN_TARGET_i386=false" ] ++ optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ "-DCMAKE_CROSSCOMPILING=True" - "-DLLVM_TABLEGEN=${buildPackages.llvm_6}/bin/llvm-tblgen" + "-DLLVM_TABLEGEN=${buildLlvmTools.llvm}/bin/llvm-tblgen" + ( + let + nativeCC = pkgsBuildBuild.targetPackages.stdenv.cc; + nativeBintools = nativeCC.bintools.bintools; + nativeToolchainFlags = [ + "-DCMAKE_C_COMPILER=${nativeCC}/bin/${nativeCC.targetPrefix}cc" + "-DCMAKE_CXX_COMPILER=${nativeCC}/bin/${nativeCC.targetPrefix}c++" + "-DCMAKE_AR=${nativeBintools}/bin/${nativeBintools.targetPrefix}ar" + "-DCMAKE_STRIP=${nativeBintools}/bin/${nativeBintools.targetPrefix}strip" + "-DCMAKE_RANLIB=${nativeBintools}/bin/${nativeBintools.targetPrefix}ranlib" + ]; + in "-DCROSS_TOOLCHAIN_FLAGS_NATIVE:list=${lib.concatStringsSep ";" nativeToolchainFlags}" + ) ]; postBuild = '' @@ -126,19 +146,20 @@ stdenv.mkDerivation ({ postInstall = '' mkdir -p $python/share mv $out/share/opt-viewer $python/share/opt-viewer - '' - + optionalString enableSharedLibraries '' - moveToOutput "lib/libLLVM-*" "$lib" - moveToOutput "lib/libLLVM${stdenv.hostPlatform.extensions.sharedLibrary}" "$lib" - substituteInPlace "$out/lib/cmake/llvm/LLVMExports-${if debugVersion then "debug" else "release"}.cmake" \ - --replace "\''${_IMPORT_PREFIX}/lib/libLLVM-" "$lib/lib/libLLVM-" + moveToOutput "bin/llvm-config*" "$dev" + substituteInPlace "$dev/lib/cmake/llvm/LLVMExports-${if debugVersion then "debug" else "release"}.cmake" \ + --replace "\''${_IMPORT_PREFIX}/lib/lib" "$lib/lib/lib" \ + --replace "$out/bin/llvm-config" "$dev/bin/llvm-config" + substituteInPlace "$dev/lib/cmake/llvm/LLVMConfig.cmake" \ + --replace 'set(LLVM_BINARY_DIR "''${LLVM_INSTALL_PREFIX}")' 'set(LLVM_BINARY_DIR "''${LLVM_INSTALL_PREFIX}'"$lib"'")' '' + optionalString (stdenv.isDarwin && enableSharedLibraries) '' - substituteInPlace "$out/lib/cmake/llvm/LLVMExports-${if debugVersion then "debug" else "release"}.cmake" \ - --replace "\''${_IMPORT_PREFIX}/lib/libLLVM.dylib" "$lib/lib/libLLVM.dylib" ${lib.concatMapStringsSep "\n" (v: '' ln -s $lib/lib/libLLVM.dylib $lib/lib/libLLVM-${v}.dylib '') versionSuffixes} + '' + + optionalString (stdenv.buildPlatform != stdenv.hostPlatform) '' + cp NATIVE/bin/llvm-config $dev/bin/llvm-config-native ''; doCheck = stdenv.isLinux && (!stdenv.isi686); diff --git a/pkgs/development/compilers/llvm/6/llvm/gnu-install-dirs-polly.patch b/pkgs/development/compilers/llvm/6/llvm/gnu-install-dirs-polly.patch new file mode 100644 index 00000000000..b4fda24a55f --- /dev/null +++ b/pkgs/development/compilers/llvm/6/llvm/gnu-install-dirs-polly.patch @@ -0,0 +1,106 @@ +diff --git a/tools/polly/CMakeLists.txt b/tools/polly/CMakeLists.txt +index 9ddc0f7ff81d..7ca45f286d47 100644 +--- a/tools/polly/CMakeLists.txt ++++ b/tools/polly/CMakeLists.txt +@@ -2,7 +2,11 @@ + if (NOT DEFINED LLVM_MAIN_SRC_DIR) + project(Polly) + cmake_minimum_required(VERSION 3.4.3) ++endif() ++ ++include(GNUInstallDirs) + ++if (NOT DEFINED LLVM_MAIN_SRC_DIR) + # Where is LLVM installed? + find_package(LLVM CONFIG REQUIRED) + set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${LLVM_CMAKE_DIR}) +@@ -157,14 +161,14 @@ include_directories( + + if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY) + install(DIRECTORY include/ +- DESTINATION include ++ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} + FILES_MATCHING + PATTERN "*.h" + PATTERN ".svn" EXCLUDE + ) + + install(DIRECTORY ${POLLY_BINARY_DIR}/include/ +- DESTINATION include ++ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} + FILES_MATCHING + PATTERN "*.h" + PATTERN "CMakeFiles" EXCLUDE +diff --git a/tools/polly/cmake/CMakeLists.txt b/tools/polly/cmake/CMakeLists.txt +index 969292cd6b00..d7aea77bdd20 100644 +--- a/tools/polly/cmake/CMakeLists.txt ++++ b/tools/polly/cmake/CMakeLists.txt +@@ -79,18 +79,18 @@ file(GENERATE + + # Generate PollyConfig.cmake for the install tree. + unset(POLLY_EXPORTS) +-set(POLLY_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}") ++set(POLLY_INSTALL_PREFIX "") + set(POLLY_CONFIG_LLVM_CMAKE_DIR "${LLVM_BINARY_DIR}/${LLVM_INSTALL_PACKAGE_DIR}") +-set(POLLY_CONFIG_CMAKE_DIR "${POLLY_INSTALL_PREFIX}/${POLLY_INSTALL_PACKAGE_DIR}") +-set(POLLY_CONFIG_LIBRARY_DIRS "${POLLY_INSTALL_PREFIX}/lib${LLVM_LIBDIR_SUFFIX}") ++set(POLLY_CONFIG_CMAKE_DIR "${POLLY_INSTALL_PREFIX}${CMAKE_INSTALL_PREFIX}/${POLLY_INSTALL_PACKAGE_DIR}") ++set(POLLY_CONFIG_LIBRARY_DIRS "${POLLY_INSTALL_PREFIX}${CMAKE_INSTALL_FULL_LIBDIR}${LLVM_LIBDIR_SUFFIX}") + if (POLLY_BUNDLED_ISL) + set(POLLY_CONFIG_INCLUDE_DIRS +- "${POLLY_INSTALL_PREFIX}/include" +- "${POLLY_INSTALL_PREFIX}/include/polly" ++ "${POLLY_INSTALL_PREFIX}${CMAKE_INSTALL_FULL_LIBDIR}" ++ "${POLLY_INSTALL_PREFIX}${CMAKE_INSTALL_FULL_LIBDIR}/polly" + ) + else() + set(POLLY_CONFIG_INCLUDE_DIRS +- "${POLLY_INSTALL_PREFIX}/include" ++ "${POLLY_INSTALL_PREFIX}${CMAKE_INSTALL_FULL_INCLUDEDIR}" + ${ISL_INCLUDE_DIRS} + ) + endif() +@@ -100,12 +100,12 @@ endif() + foreach(tgt IN LISTS POLLY_CONFIG_EXPORTED_TARGETS) + get_target_property(tgt_type ${tgt} TYPE) + if (tgt_type STREQUAL "EXECUTABLE") +- set(tgt_prefix "bin/") ++ set(tgt_prefix "${CMAKE_INSTALL_BINDIR}/") + else() +- set(tgt_prefix "lib/") ++ set(tgt_prefix "${CMAKE_INSTALL_LIBDIR}/") + endif() + +- set(tgt_path "${CMAKE_INSTALL_PREFIX}/${tgt_prefix}$") ++ set(tgt_path "${tgt_prefix}$") + file(RELATIVE_PATH tgt_path ${POLLY_CONFIG_CMAKE_DIR} ${tgt_path}) + + if (NOT tgt_type STREQUAL "INTERFACE_LIBRARY") +diff --git a/tools/polly/cmake/polly_macros.cmake b/tools/polly/cmake/polly_macros.cmake +index 32bed50bb060..cca5bfff4970 100644 +--- a/tools/polly/cmake/polly_macros.cmake ++++ b/tools/polly/cmake/polly_macros.cmake +@@ -44,8 +44,8 @@ macro(add_polly_library name) + if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY OR ${name} STREQUAL "LLVMPolly") + install(TARGETS ${name} + EXPORT LLVMExports +- LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX} +- ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX}) ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}) + endif() + set_property(GLOBAL APPEND PROPERTY LLVM_EXPORTS ${name}) + endmacro(add_polly_library) +diff --git a/tools/polly/lib/External/CMakeLists.txt b/tools/polly/lib/External/CMakeLists.txt +index b3c6e73a7a00..c67acf8576c7 100644 +--- a/tools/polly/lib/External/CMakeLists.txt ++++ b/tools/polly/lib/External/CMakeLists.txt +@@ -268,7 +268,7 @@ if (POLLY_BUNDLED_ISL) + install(DIRECTORY + ${ISL_SOURCE_DIR}/include/ + ${ISL_BINARY_DIR}/include/ +- DESTINATION include/polly ++ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/polly + FILES_MATCHING + PATTERN "*.h" + PATTERN "CMakeFiles" EXCLUDE diff --git a/pkgs/development/compilers/llvm/6/llvm/gnu-install-dirs.patch b/pkgs/development/compilers/llvm/6/llvm/gnu-install-dirs.patch new file mode 100644 index 00000000000..987f97210fb --- /dev/null +++ b/pkgs/development/compilers/llvm/6/llvm/gnu-install-dirs.patch @@ -0,0 +1,386 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index f8da6cf92119..881e4cda4971 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -271,15 +271,21 @@ if (CMAKE_BUILD_TYPE AND + message(FATAL_ERROR "Invalid value for CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}") + endif() + ++include(GNUInstallDirs) ++ + set(LLVM_LIBDIR_SUFFIX "" CACHE STRING "Define suffix of library directory name (32/64)" ) + +-set(LLVM_TOOLS_INSTALL_DIR "bin" CACHE STRING "Path for binary subdirectory (defaults to 'bin')") ++set(LLVM_TOOLS_INSTALL_DIR "${CMAKE_INSTALL_BINDIR}" CACHE STRING ++ "Path for binary subdirectory (defaults to 'bin')") + mark_as_advanced(LLVM_TOOLS_INSTALL_DIR) + + set(LLVM_UTILS_INSTALL_DIR "bin" CACHE STRING + "Path to install LLVM utilities (enabled by LLVM_INSTALL_UTILS=ON) (defaults to LLVM_TOOLS_INSTALL_DIR)") + mark_as_advanced(LLVM_TOOLS_INSTALL_DIR) + ++set(LLVM_INSTALL_CMAKE_DIR "${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}/cmake/llvm" CACHE STRING ++ "Path for CMake subdirectory (defaults to lib/cmake/llvm)" ) ++ + # They are used as destination of target generators. + set(LLVM_RUNTIME_OUTPUT_INTDIR ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bin) + set(LLVM_LIBRARY_OUTPUT_INTDIR ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/lib${LLVM_LIBDIR_SUFFIX}) +@@ -510,9 +516,9 @@ option (LLVM_ENABLE_DOXYGEN "Use doxygen to generate llvm API documentation." OF + option (LLVM_ENABLE_SPHINX "Use Sphinx to generate llvm documentation." OFF) + option (LLVM_ENABLE_OCAMLDOC "Build OCaml bindings documentation." ON) + +-set(LLVM_INSTALL_DOXYGEN_HTML_DIR "share/doc/llvm/doxygen-html" ++set(LLVM_INSTALL_DOXYGEN_HTML_DIR "${CMAKE_INSTALL_DOCDIR}/${project}/doxygen-html" + CACHE STRING "Doxygen-generated HTML documentation install directory") +-set(LLVM_INSTALL_OCAMLDOC_HTML_DIR "share/doc/llvm/ocaml-html" ++set(LLVM_INSTALL_OCAMLDOC_HTML_DIR "${CMAKE_INSTALL_DOCDIR}/${project}/ocaml-html" + CACHE STRING "OCamldoc-generated HTML documentation install directory") + + option (LLVM_BUILD_EXTERNAL_COMPILER_RT +@@ -944,7 +950,7 @@ endif() + + if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY) + install(DIRECTORY include/llvm include/llvm-c +- DESTINATION include ++ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} + COMPONENT llvm-headers + FILES_MATCHING + PATTERN "*.def" +@@ -956,7 +962,7 @@ if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY) + ) + + install(DIRECTORY ${LLVM_INCLUDE_DIR}/llvm +- DESTINATION include ++ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} + COMPONENT llvm-headers + FILES_MATCHING + PATTERN "*.def" +diff --git a/cmake/modules/AddLLVM.cmake b/cmake/modules/AddLLVM.cmake +index fd5627eecbb2..29e09c6f3f8a 100644 +--- a/cmake/modules/AddLLVM.cmake ++++ b/cmake/modules/AddLLVM.cmake +@@ -621,11 +621,11 @@ macro(add_llvm_library name) + else() + if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY OR ${name} STREQUAL "LTO" OR + (LLVM_LINK_LLVM_DYLIB AND ${name} STREQUAL "LLVM")) +- set(install_dir lib${LLVM_LIBDIR_SUFFIX}) ++ set(install_dir ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}) + if(ARG_SHARED OR BUILD_SHARED_LIBS) + if(WIN32 OR CYGWIN OR MINGW) + set(install_type RUNTIME) +- set(install_dir bin) ++ set(install_dir ${CMAKE_INSTALL_BINDIR}) + else() + set(install_type LIBRARY) + endif() +@@ -667,9 +667,9 @@ macro(add_llvm_loadable_module name) + if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY) + if(WIN32 OR CYGWIN) + # DLL platform +- set(dlldir "bin") ++ set(dlldir "${CMAKE_INSTALL_BINDIR}") + else() +- set(dlldir "lib${LLVM_LIBDIR_SUFFIX}") ++ set(dlldir "${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}") + endif() + + if(${name} IN_LIST LLVM_DISTRIBUTION_COMPONENTS OR +@@ -681,7 +681,7 @@ macro(add_llvm_loadable_module name) + install(TARGETS ${name} + ${export_to_llvmexports} + LIBRARY DESTINATION ${dlldir} +- ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX}) ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}) + endif() + set_property(GLOBAL APPEND PROPERTY LLVM_EXPORTS ${name}) + endif() +@@ -892,7 +892,7 @@ macro(add_llvm_example name) + endif() + add_llvm_executable(${name} ${ARGN}) + if( LLVM_BUILD_EXAMPLES ) +- install(TARGETS ${name} RUNTIME DESTINATION examples) ++ install(TARGETS ${name} RUNTIME DESTINATION ${CMAKE_INSTALL_DOCDIR}/examples) + endif() + set_target_properties(${name} PROPERTIES FOLDER "Examples") + endmacro(add_llvm_example name) +@@ -1410,7 +1410,7 @@ function(llvm_install_library_symlink name dest type) + set(full_name ${CMAKE_${type}_LIBRARY_PREFIX}${name}${CMAKE_${type}_LIBRARY_SUFFIX}) + set(full_dest ${CMAKE_${type}_LIBRARY_PREFIX}${dest}${CMAKE_${type}_LIBRARY_SUFFIX}) + +- set(output_dir lib${LLVM_LIBDIR_SUFFIX}) ++ set(output_dir ${CMAKE_INSTALL_FULL_LIBDIR}${LLVM_LIBDIR_SUFFIX}) + if(WIN32 AND "${type}" STREQUAL "SHARED") + set(output_dir bin) + endif() +@@ -1426,7 +1426,7 @@ function(llvm_install_library_symlink name dest type) + endif() + endfunction() + +-function(llvm_install_symlink name dest) ++function(llvm_install_symlink name dest output_dir) + cmake_parse_arguments(ARG "ALWAYS_GENERATE" "COMPONENT" "" ${ARGN}) + foreach(path ${CMAKE_MODULE_PATH}) + if(EXISTS ${path}/LLVMInstallSymlink.cmake) +@@ -1449,7 +1449,7 @@ function(llvm_install_symlink name dest) + set(full_dest ${dest}${CMAKE_EXECUTABLE_SUFFIX}) + + install(SCRIPT ${INSTALL_SYMLINK} +- CODE "install_symlink(${full_name} ${full_dest} ${LLVM_TOOLS_INSTALL_DIR})" ++ CODE "install_symlink(${full_name} ${full_dest} ${output_dir})" + COMPONENT ${component}) + + if (NOT CMAKE_CONFIGURATION_TYPES AND NOT ARG_ALWAYS_GENERATE) +@@ -1531,7 +1531,8 @@ function(add_llvm_tool_symlink link_name target) + endif() + + if ((TOOL_IS_TOOLCHAIN OR NOT LLVM_INSTALL_TOOLCHAIN_ONLY) AND LLVM_BUILD_TOOLS) +- llvm_install_symlink(${link_name} ${target}) ++ GNUInstallDirs_get_absolute_install_dir(output_dir LLVM_TOOLS_INSTALL_DIR) ++ llvm_install_symlink(${link_name} ${target} ${output_dir}) + endif() + endif() + endfunction() +@@ -1583,9 +1584,9 @@ function(llvm_setup_rpath name) + + if (APPLE) + set(_install_name_dir INSTALL_NAME_DIR "@rpath") +- set(_install_rpath "@loader_path/../lib" ${extra_libdir}) ++ set(_install_rpath "@loader_path/../${CMAKE_INSTALL_LIBDIR}" ${extra_libdir}) + elseif(UNIX) +- set(_install_rpath "\$ORIGIN/../lib${LLVM_LIBDIR_SUFFIX}" ${extra_libdir}) ++ set(_install_rpath "\$ORIGIN/../${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}" ${extra_libdir}) + if(${CMAKE_SYSTEM_NAME} MATCHES "(FreeBSD|DragonFly)") + set_property(TARGET ${name} APPEND_STRING PROPERTY + LINK_FLAGS " -Wl,-z,origin ") +diff --git a/cmake/modules/AddOCaml.cmake b/cmake/modules/AddOCaml.cmake +index 02bab6846376..eff26adb2efc 100644 +--- a/cmake/modules/AddOCaml.cmake ++++ b/cmake/modules/AddOCaml.cmake +@@ -140,9 +140,9 @@ function(add_ocaml_library name) + endforeach() + + if( APPLE ) +- set(ocaml_rpath "@executable_path/../../../lib${LLVM_LIBDIR_SUFFIX}") ++ set(ocaml_rpath "@executable_path/../../../${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}") + elseif( UNIX ) +- set(ocaml_rpath "\\$ORIGIN/../../../lib${LLVM_LIBDIR_SUFFIX}") ++ set(ocaml_rpath "\\$ORIGIN/../../../${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}") + endif() + list(APPEND ocaml_flags "-ldopt" "-Wl,-rpath,${ocaml_rpath}") + +diff --git a/cmake/modules/AddSphinxTarget.cmake b/cmake/modules/AddSphinxTarget.cmake +index 22e3dcb776aa..ba77b9c195e2 100644 +--- a/cmake/modules/AddSphinxTarget.cmake ++++ b/cmake/modules/AddSphinxTarget.cmake +@@ -73,7 +73,7 @@ function (add_sphinx_target builder project) + + elseif (builder STREQUAL html) + string(TOUPPER "${project}" project_upper) +- set(${project_upper}_INSTALL_SPHINX_HTML_DIR "share/doc/${project}/html" ++ set(${project_upper}_INSTALL_SPHINX_HTML_DIR "${CMAKE_INSTALL_DOCDIR}/${project}/html" + CACHE STRING "HTML documentation install directory for ${project}") + + # '/.' indicates: copy the contents of the directory directly into +diff --git a/cmake/modules/CMakeLists.txt b/cmake/modules/CMakeLists.txt +index 6074e8358594..9d0be6c2ced5 100644 +--- a/cmake/modules/CMakeLists.txt ++++ b/cmake/modules/CMakeLists.txt +@@ -1,4 +1,4 @@ +-set(LLVM_INSTALL_PACKAGE_DIR lib${LLVM_LIBDIR_SUFFIX}/cmake/llvm) ++set(LLVM_INSTALL_PACKAGE_DIR ${LLVM_INSTALL_CMAKE_DIR} CACHE STRING "Path for CMake subdirectory (defaults to 'cmake/llvm')") + set(llvm_cmake_builddir "${LLVM_BINARY_DIR}/${LLVM_INSTALL_PACKAGE_DIR}") + + # First for users who use an installed LLVM, create the LLVMExports.cmake file. +@@ -84,11 +84,11 @@ foreach(p ${_count}) + set(LLVM_CONFIG_CODE "${LLVM_CONFIG_CODE} + get_filename_component(LLVM_INSTALL_PREFIX \"\${LLVM_INSTALL_PREFIX}\" PATH)") + endforeach(p) +-set(LLVM_CONFIG_INCLUDE_DIRS "\${LLVM_INSTALL_PREFIX}/include") +-set(LLVM_CONFIG_LIBRARY_DIRS "\${LLVM_INSTALL_PREFIX}/lib\${LLVM_LIBDIR_SUFFIX}") ++set(LLVM_CONFIG_INCLUDE_DIRS "\${LLVM_INSTALL_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR}") ++set(LLVM_CONFIG_LIBRARY_DIRS "\${LLVM_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}\${LLVM_LIBDIR_SUFFIX}") + set(LLVM_CONFIG_CMAKE_DIR "\${LLVM_INSTALL_PREFIX}/${LLVM_INSTALL_PACKAGE_DIR}") + set(LLVM_CONFIG_BINARY_DIR "\${LLVM_INSTALL_PREFIX}") +-set(LLVM_CONFIG_TOOLS_BINARY_DIR "\${LLVM_INSTALL_PREFIX}/bin") ++set(LLVM_CONFIG_TOOLS_BINARY_DIR "\${LLVM_INSTALL_PREFIX}/${CMAKE_INSTALL_BINDIR}") + set(LLVM_CONFIG_EXPORTS_FILE "\${LLVM_CMAKE_DIR}/LLVMExports.cmake") + set(LLVM_CONFIG_EXPORTS "${LLVM_EXPORTS}") + configure_file( +diff --git a/cmake/modules/LLVMInstallSymlink.cmake b/cmake/modules/LLVMInstallSymlink.cmake +index 482697b06baf..af2ac1e6c979 100644 +--- a/cmake/modules/LLVMInstallSymlink.cmake ++++ b/cmake/modules/LLVMInstallSymlink.cmake +@@ -10,7 +10,7 @@ function(install_symlink name target outdir) + set(LINK_OR_COPY copy) + endif() + +- set(bindir "${DESTDIR}${CMAKE_INSTALL_PREFIX}/${outdir}/") ++ set(bindir "${DESTDIR}${outdir}/") + + message("Creating ${name}") + +diff --git a/docs/CMake.rst b/docs/CMake.rst +index 05edec64da33..6db014f04656 100644 +--- a/docs/CMake.rst ++++ b/docs/CMake.rst +@@ -196,7 +196,7 @@ CMake manual, or execute ``cmake --help-variable VARIABLE_NAME``. + **LLVM_LIBDIR_SUFFIX**:STRING + Extra suffix to append to the directory where libraries are to be + installed. On a 64-bit architecture, one could use ``-DLLVM_LIBDIR_SUFFIX=64`` +- to install libraries to ``/usr/lib64``. ++ to install libraries to ``/usr/lib64``. See also ``CMAKE_INSTALL_LIBDIR``. + + **CMAKE_C_FLAGS**:STRING + Extra flags to use when compiling C source files. +@@ -465,8 +465,8 @@ LLVM-specific variables + + **LLVM_INSTALL_DOXYGEN_HTML_DIR**:STRING + The path to install Doxygen-generated HTML documentation to. This path can +- either be absolute or relative to the CMAKE_INSTALL_PREFIX. Defaults to +- `share/doc/llvm/doxygen-html`. ++ either be absolute or relative to the ``CMAKE_INSTALL_PREFIX``. Defaults to ++ `${CMAKE_INSTALL_DOCDIR}/${project}/doxygen-html`. + + **LLVM_ENABLE_SPHINX**:BOOL + If specified, CMake will search for the ``sphinx-build`` executable and will make +@@ -497,13 +497,33 @@ LLVM-specific variables + + **LLVM_INSTALL_SPHINX_HTML_DIR**:STRING + The path to install Sphinx-generated HTML documentation to. This path can +- either be absolute or relative to the CMAKE_INSTALL_PREFIX. Defaults to +- `share/doc/llvm/html`. ++ either be absolute or relative to the ``CMAKE_INSTALL_PREFIX``. Defaults to ++ `${CMAKE_INSTALL_DOCDIR}/${project}/html`. + + **LLVM_INSTALL_OCAMLDOC_HTML_DIR**:STRING + The path to install OCamldoc-generated HTML documentation to. This path can +- either be absolute or relative to the CMAKE_INSTALL_PREFIX. Defaults to +- `share/doc/llvm/ocaml-html`. ++ either be absolute or relative to the ``CMAKE_INSTALL_PREFIX``. Defaults to ++ `${CMAKE_INSTALL_DOCDIR}/${project}/ocaml-html`. ++ ++**CMAKE_INSTALL_BINDIR**:STRING ++ The path to install binary tools, relative to the ``CMAKE_INSTALL_PREFIX``. ++ Defaults to `bin`. ++ ++**CMAKE_INSTALL_LIBDIR**:STRING ++ The path to install libraries, relative to the ``CMAKE_INSTALL_PREFIX``. ++ Defaults to `lib`. ++ ++**CMAKE_INSTALL_INCLUDEDIR**:STRING ++ The path to install header files, relative to the ``CMAKE_INSTALL_PREFIX``. ++ Defaults to `include`. ++ ++**CMAKE_INSTALL_DOCDIR**:STRING ++ The path to install documentation, relative to the ``CMAKE_INSTALL_PREFIX``. ++ Defaults to `share/doc`. ++ ++**CMAKE_INSTALL_MANDIR**:STRING ++ The path to install manpage files, relative to the ``CMAKE_INSTALL_PREFIX``. ++ Defaults to `share/man`. + + **LLVM_CREATE_XCODE_TOOLCHAIN**:BOOL + OS X Only: If enabled CMake will generate a target named +@@ -660,9 +680,11 @@ the ``cmake`` command or by setting it directly in ``ccmake`` or ``cmake-gui``). + + This file is available in two different locations. + +-* ``/lib/cmake/llvm/LLVMConfig.cmake`` where +- ```` is the install prefix of an installed version of LLVM. +- On Linux typically this is ``/usr/lib/cmake/llvm/LLVMConfig.cmake``. ++* ``LLVMConfig.cmake`` where ++ ```` is the location where LLVM CMake modules are ++ installed as part of an installed version of LLVM. This is typically ++ ``cmake/llvm/`` within the lib directory. On Linux, this is typically ++ ``/usr/lib/cmake/llvm/LLVMConfig.cmake``. + + * ``/lib/cmake/llvm/LLVMConfig.cmake`` where + ```` is the root of the LLVM build tree. **Note: this is only +diff --git a/include/llvm/CMakeLists.txt b/include/llvm/CMakeLists.txt +index 1d5ca3ba92b0..026f5453c1da 100644 +--- a/include/llvm/CMakeLists.txt ++++ b/include/llvm/CMakeLists.txt +@@ -4,5 +4,5 @@ add_subdirectory(Support) + # If we're doing an out-of-tree build, copy a module map for generated + # header files into the build area. + if (NOT "${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}") +- configure_file(module.modulemap.build module.modulemap COPYONLY) ++ configure_file(module.modulemap.build ${LLVM_INCLUDE_DIR}/module.modulemap COPYONLY) + endif (NOT "${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}") +diff --git a/tools/llvm-config/BuildVariables.inc.in b/tools/llvm-config/BuildVariables.inc.in +index f201e1f7bff0..4582ed556a02 100644 +--- a/tools/llvm-config/BuildVariables.inc.in ++++ b/tools/llvm-config/BuildVariables.inc.in +@@ -24,6 +24,10 @@ + #define LLVM_CXXFLAGS "@LLVM_CXXFLAGS@" + #define LLVM_BUILDMODE "@LLVM_BUILDMODE@" + #define LLVM_LIBDIR_SUFFIX "@LLVM_LIBDIR_SUFFIX@" ++#define LLVM_INSTALL_BINDIR "@CMAKE_INSTALL_BINDIR@" ++#define LLVM_INSTALL_LIBDIR "@CMAKE_INSTALL_LIBDIR@" ++#define LLVM_INSTALL_INCLUDEDIR "@CMAKE_INSTALL_INCLUDEDIR@" ++#define LLVM_INSTALL_CMAKEDIR "@LLVM_INSTALL_CMAKE_DIR@" + #define LLVM_TARGETS_BUILT "@LLVM_TARGETS_BUILT@" + #define LLVM_SYSTEM_LIBS "@LLVM_SYSTEM_LIBS@" + #define LLVM_BUILD_SYSTEM "@LLVM_BUILD_SYSTEM@" +diff --git a/tools/llvm-config/llvm-config.cpp b/tools/llvm-config/llvm-config.cpp +index 08b096afb052..2deae0dcfacc 100644 +--- a/tools/llvm-config/llvm-config.cpp ++++ b/tools/llvm-config/llvm-config.cpp +@@ -332,12 +332,26 @@ int main(int argc, char **argv) { + ("-I" + ActiveIncludeDir + " " + "-I" + ActiveObjRoot + "/include"); + } else { + ActivePrefix = CurrentExecPrefix; +- ActiveIncludeDir = ActivePrefix + "/include"; +- SmallString<256> path(StringRef(LLVM_TOOLS_INSTALL_DIR)); +- sys::fs::make_absolute(ActivePrefix, path); +- ActiveBinDir = path.str(); +- ActiveLibDir = ActivePrefix + "/lib" + LLVM_LIBDIR_SUFFIX; +- ActiveCMakeDir = ActiveLibDir + "/cmake/llvm"; ++ { ++ SmallString<256> path(StringRef(LLVM_INSTALL_INCLUDEDIR)); ++ sys::fs::make_absolute(ActivePrefix, path); ++ ActiveIncludeDir = std::string(path.str()); ++ } ++ { ++ SmallString<256> path(StringRef(LLVM_INSTALL_BINDIR)); ++ sys::fs::make_absolute(ActivePrefix, path); ++ ActiveBinDir = std::string(path.str()); ++ } ++ { ++ SmallString<256> path(StringRef(LLVM_INSTALL_LIBDIR LLVM_LIBDIR_SUFFIX)); ++ sys::fs::make_absolute(ActivePrefix, path); ++ ActiveLibDir = std::string(path.str()); ++ } ++ { ++ SmallString<256> path(StringRef(LLVM_INSTALL_CMAKEDIR)); ++ sys::fs::make_absolute(ActivePrefix, path); ++ ActiveCMakeDir = std::string(path.str()); ++ } + ActiveIncludeOption = "-I" + ActiveIncludeDir; + } + +diff --git a/tools/lto/CMakeLists.txt b/tools/lto/CMakeLists.txt +index 6e913519a809..85641eef721f 100644 +--- a/tools/lto/CMakeLists.txt ++++ b/tools/lto/CMakeLists.txt +@@ -19,7 +19,7 @@ set(LLVM_EXPORTED_SYMBOL_FILE ${CMAKE_CURRENT_SOURCE_DIR}/lto.exports) + add_llvm_library(LTO SHARED ${SOURCES} DEPENDS intrinsics_gen) + + install(FILES ${LLVM_MAIN_INCLUDE_DIR}/llvm-c/lto.h +- DESTINATION include/llvm-c ++ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/llvm-c + COMPONENT LTO) + + if (APPLE) +diff --git a/tools/opt-viewer/CMakeLists.txt b/tools/opt-viewer/CMakeLists.txt +index 19b606933082..27b9f71b3d79 100644 +--- a/tools/opt-viewer/CMakeLists.txt ++++ b/tools/opt-viewer/CMakeLists.txt +@@ -8,6 +8,6 @@ set (files + + foreach (file ${files}) + install(PROGRAMS ${file} +- DESTINATION share/opt-viewer ++ DESTINATION ${CMAKE_INSTALL_DATADIR}/opt-viewer + COMPONENT opt-viewer) + endforeach (file) diff --git a/pkgs/development/compilers/llvm/7/clang/default.nix b/pkgs/development/compilers/llvm/7/clang/default.nix index a4d43d9d7f4..187602ef361 100644 --- a/pkgs/development/compilers/llvm/7/clang/default.nix +++ b/pkgs/development/compilers/llvm/7/clang/default.nix @@ -1,4 +1,5 @@ -{ lib, stdenv, fetch, cmake, libxml2, llvm, version, clang-tools-extra_src, python3, lld +{ lib, stdenv, fetch, cmake, libxml2, libllvm, version, clang-tools-extra_src, python3 +, buildLlvmTools , fixDarwinDylibNames , enableManpages ? false , enablePolly ? false # TODO: get this info from llvm (passthru?) @@ -23,17 +24,21 @@ let ++ lib.optional enableManpages python3.pkgs.sphinx ++ lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames; - buildInputs = [ libxml2 llvm lld ]; + buildInputs = [ libxml2 libllvm ]; cmakeFlags = [ "-DCMAKE_CXX_FLAGS=-std=c++11" "-DLLVM_ENABLE_RTTI=ON" + "-DLLVM_CONFIG_PATH=${libllvm.dev}/bin/llvm-config${lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) "-native"}" ] ++ lib.optionals enableManpages [ "-DCLANG_INCLUDE_DOCS=ON" "-DLLVM_ENABLE_SPHINX=ON" "-DSPHINX_OUTPUT_MAN=ON" "-DSPHINX_OUTPUT_HTML=OFF" "-DSPHINX_WARNINGS_AS_ERRORS=OFF" + ] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ + "-DLLVM_TABLEGEN_EXE=${buildLlvmTools.llvm}/bin/llvm-tblgen" + "-DCLANG_TABLEGEN=${buildLlvmTools.libclang.dev}/bin/clang-tblgen" ] ++ lib.optionals enablePolly [ "-DWITH_POLLY=ON" "-DLINK_POLLY_INTO_TOOLS=ON" @@ -46,6 +51,7 @@ let # Backport for the `--unwindlib=[libgcc|compiler-rt]` flag, which is # needed for our bootstrapping to not interfere with C. ./unwindlib.patch + ./gnu-install-dirs.patch ]; postPatch = '' @@ -62,12 +68,12 @@ let --replace "NOT HAVE_CXX_ATOMICS64_WITHOUT_LIB" FALSE ''; - outputs = [ "out" "lib" "python" ]; + outputs = [ "out" "lib" "dev" "python" ]; # Clang expects to find LLVMgold in its own prefix postInstall = '' - if [ -e ${llvm}/lib/LLVMgold.so ]; then - ln -sv ${llvm}/lib/LLVMgold.so $out/lib + 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 @@ -84,11 +90,14 @@ let fi mv $out/share/clang/*.py $python/share/clang rm $out/bin/c-index-test + + mkdir -p $dev/bin + cp bin/clang-tblgen $dev/bin ''; passthru = { isClang = true; - inherit llvm; + inherit libllvm; }; meta = { diff --git a/pkgs/development/compilers/llvm/7/clang/gnu-install-dirs.patch b/pkgs/development/compilers/llvm/7/clang/gnu-install-dirs.patch new file mode 100644 index 00000000000..540c043a2db --- /dev/null +++ b/pkgs/development/compilers/llvm/7/clang/gnu-install-dirs.patch @@ -0,0 +1,281 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 52b881939499..85662a2113e7 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -5,6 +5,8 @@ cmake_minimum_required(VERSION 3.4.3) + if( CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR ) + project(Clang) + ++ include(GNUInstallDirs) ++ + # Rely on llvm-config. + set(CONFIG_OUTPUT) + find_program(LLVM_CONFIG "llvm-config") +@@ -374,7 +376,7 @@ include_directories(BEFORE + + if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY) + install(DIRECTORY include/clang include/clang-c +- DESTINATION include ++ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} + FILES_MATCHING + PATTERN "*.def" + PATTERN "*.h" +@@ -383,7 +385,7 @@ if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY) + ) + + install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/include/clang +- DESTINATION include ++ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} + FILES_MATCHING + PATTERN "CMakeFiles" EXCLUDE + PATTERN "*.inc" +@@ -391,7 +393,7 @@ if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY) + ) + + install(PROGRAMS utils/bash-autocomplete.sh +- DESTINATION share/clang ++ DESTINATION ${CMAKE_INSTALL_DATADIR}/clang + ) + endif() + +diff --git a/cmake/modules/AddClang.cmake b/cmake/modules/AddClang.cmake +index c09a8423f9f6..39f37e0097eb 100644 +--- a/cmake/modules/AddClang.cmake ++++ b/cmake/modules/AddClang.cmake +@@ -99,9 +99,9 @@ macro(add_clang_library name) + install(TARGETS ${name} + COMPONENT ${name} + ${export_to_clangtargets} +- LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX} +- ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX} +- RUNTIME DESTINATION bin) ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX} ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) + + if (${ARG_SHARED} AND NOT CMAKE_CONFIGURATION_TYPES) + add_llvm_install_targets(install-${name} +@@ -141,7 +141,7 @@ macro(add_clang_tool name) + + install(TARGETS ${name} + ${export_to_clangtargets} +- RUNTIME DESTINATION bin ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + COMPONENT ${name}) + + if(NOT CMAKE_CONFIGURATION_TYPES) +@@ -156,5 +156,5 @@ endmacro() + macro(add_clang_symlink name dest) + add_llvm_tool_symlink(${name} ${dest} ALWAYS_GENERATE) + # Always generate install targets +- llvm_install_symlink(${name} ${dest} ALWAYS_GENERATE) ++ llvm_install_symlink(${name} ${dest} ${CMAKE_INSTALL_FULL_BINDIR} ALWAYS_GENERATE) + endmacro() +diff --git a/lib/Headers/CMakeLists.txt b/lib/Headers/CMakeLists.txt +index 1930d8e225c7..bb9158093079 100644 +--- a/lib/Headers/CMakeLists.txt ++++ b/lib/Headers/CMakeLists.txt +@@ -162,19 +162,19 @@ install( + FILES ${files} ${CMAKE_CURRENT_BINARY_DIR}/arm_neon.h + COMPONENT clang-headers + PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ +- DESTINATION lib${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION}/include) ++ DESTINATION ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION}/include) + + install( + FILES ${files} ${CMAKE_CURRENT_BINARY_DIR}/arm_fp16.h + COMPONENT clang-headers + PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ +- DESTINATION lib${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION}/include) ++ DESTINATION ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION}/include) + + install( + FILES ${cuda_wrapper_files} + COMPONENT clang-headers + PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ +- DESTINATION lib${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION}/include/cuda_wrappers) ++ DESTINATION ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION}/include/cuda_wrappers) + + if (NOT CMAKE_CONFIGURATION_TYPES) # don't add this for IDE's. + add_llvm_install_targets(install-clang-headers +diff --git a/tools/c-index-test/CMakeLists.txt b/tools/c-index-test/CMakeLists.txt +index 53e3421f1b35..79ae5bb4c399 100644 +--- a/tools/c-index-test/CMakeLists.txt ++++ b/tools/c-index-test/CMakeLists.txt +@@ -54,7 +54,7 @@ if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY) + set_property(TARGET c-index-test APPEND PROPERTY INSTALL_RPATH + "@executable_path/../../lib") + else() +- set(INSTALL_DESTINATION bin) ++ set(INSTALL_DESTINATION ${CMAKE_INSTALL_BINDIR}) + endif() + + install(TARGETS c-index-test +diff --git a/tools/clang-check/CMakeLists.txt b/tools/clang-check/CMakeLists.txt +index c5ace26c2914..97bdfca7d896 100644 +--- a/tools/clang-check/CMakeLists.txt ++++ b/tools/clang-check/CMakeLists.txt +@@ -20,4 +20,4 @@ target_link_libraries(clang-check + ) + + install(TARGETS clang-check +- RUNTIME DESTINATION bin) ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) +diff --git a/tools/clang-format/CMakeLists.txt b/tools/clang-format/CMakeLists.txt +index a295e8cd0b2a..1973ff82c7f6 100644 +--- a/tools/clang-format/CMakeLists.txt ++++ b/tools/clang-format/CMakeLists.txt +@@ -21,20 +21,20 @@ if( LLVM_LIB_FUZZING_ENGINE OR LLVM_USE_SANITIZE_COVERAGE ) + endif() + + install(PROGRAMS clang-format-bbedit.applescript +- DESTINATION share/clang ++ DESTINATION ${CMAKE_INSTALL_DATADIR}/clang + COMPONENT clang-format) + install(PROGRAMS clang-format-diff.py +- DESTINATION share/clang ++ DESTINATION ${CMAKE_INSTALL_DATADIR}/clang + COMPONENT clang-format) + install(PROGRAMS clang-format-sublime.py +- DESTINATION share/clang ++ DESTINATION ${CMAKE_INSTALL_DATADIR}/clang + COMPONENT clang-format) + install(PROGRAMS clang-format.el +- DESTINATION share/clang ++ DESTINATION ${CMAKE_INSTALL_DATADIR}/clang + COMPONENT clang-format) + install(PROGRAMS clang-format.py +- DESTINATION share/clang ++ DESTINATION ${CMAKE_INSTALL_DATADIR}/clang + COMPONENT clang-format) + install(PROGRAMS git-clang-format +- DESTINATION bin ++ DESTINATION ${CMAKE_INSTALL_BINDIR} + COMPONENT clang-format) +diff --git a/tools/clang-func-mapping/CMakeLists.txt b/tools/clang-func-mapping/CMakeLists.txt +index ae28e28d532d..8ecb2e37a8f7 100644 +--- a/tools/clang-func-mapping/CMakeLists.txt ++++ b/tools/clang-func-mapping/CMakeLists.txt +@@ -20,4 +20,4 @@ target_link_libraries(clang-func-mapping + ) + + install(TARGETS clang-func-mapping +- RUNTIME DESTINATION bin) ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) +diff --git a/tools/clang-offload-bundler/CMakeLists.txt b/tools/clang-offload-bundler/CMakeLists.txt +index 8718015be76a..7a038f39622e 100644 +--- a/tools/clang-offload-bundler/CMakeLists.txt ++++ b/tools/clang-offload-bundler/CMakeLists.txt +@@ -22,4 +22,4 @@ target_link_libraries(clang-offload-bundler + ${CLANG_OFFLOAD_BUNDLER_LIB_DEPS} + ) + +-install(TARGETS clang-offload-bundler RUNTIME DESTINATION bin) ++install(TARGETS clang-offload-bundler RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) +diff --git a/tools/clang-rename/CMakeLists.txt b/tools/clang-rename/CMakeLists.txt +index 3b3ab1540a80..9aca9ba4a2cf 100644 +--- a/tools/clang-rename/CMakeLists.txt ++++ b/tools/clang-rename/CMakeLists.txt +@@ -18,8 +18,8 @@ target_link_libraries(clang-rename + ) + + install(PROGRAMS clang-rename.py +- DESTINATION share/clang ++ DESTINATION ${CMAKE_INSTALL_DATADIR}/clang + COMPONENT clang-rename) + install(PROGRAMS clang-rename.el +- DESTINATION share/clang ++ DESTINATION ${CMAKE_INSTALL_DATADIR}/clang + COMPONENT clang-rename) +diff --git a/tools/diagtool/CMakeLists.txt b/tools/diagtool/CMakeLists.txt +index 96d1c390249c..41c762b37b76 100644 +--- a/tools/diagtool/CMakeLists.txt ++++ b/tools/diagtool/CMakeLists.txt +@@ -21,7 +21,7 @@ target_link_libraries(diagtool + if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY) + install(TARGETS diagtool + COMPONENT diagtool +- RUNTIME DESTINATION bin) ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) + + if (NOT CMAKE_CONFIGURATION_TYPES) + add_llvm_install_targets(install-diagtool +diff --git a/tools/libclang/CMakeLists.txt b/tools/libclang/CMakeLists.txt +index e539c8308e75..4e1fbccea35d 100644 +--- a/tools/libclang/CMakeLists.txt ++++ b/tools/libclang/CMakeLists.txt +@@ -130,7 +130,7 @@ endif() + if(INTERNAL_INSTALL_PREFIX) + set(LIBCLANG_HEADERS_INSTALL_DESTINATION "${INTERNAL_INSTALL_PREFIX}/include") + else() +- set(LIBCLANG_HEADERS_INSTALL_DESTINATION include) ++ set(LIBCLANG_HEADERS_INSTALL_DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) + endif() + + install(DIRECTORY ../../include/clang-c +diff --git a/tools/scan-build/CMakeLists.txt b/tools/scan-build/CMakeLists.txt +index 380379300b09..adfd58ed5f7d 100644 +--- a/tools/scan-build/CMakeLists.txt ++++ b/tools/scan-build/CMakeLists.txt +@@ -41,7 +41,7 @@ if(CLANG_INSTALL_SCANBUILD) + ${CMAKE_BINARY_DIR}/bin/ + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/bin/${BinFile}) + list(APPEND Depends ${CMAKE_BINARY_DIR}/bin/${BinFile}) +- install(PROGRAMS bin/${BinFile} DESTINATION bin) ++ install(PROGRAMS bin/${BinFile} DESTINATION ${CMAKE_INSTALL_BINDIR}) + endforeach() + + foreach(LibexecFile ${LibexecFiles}) +@@ -53,7 +53,7 @@ if(CLANG_INSTALL_SCANBUILD) + ${CMAKE_BINARY_DIR}/libexec/ + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/libexec/${LibexecFile}) + list(APPEND Depends ${CMAKE_BINARY_DIR}/libexec/${LibexecFile}) +- install(PROGRAMS libexec/${LibexecFile} DESTINATION libexec) ++ install(PROGRAMS libexec/${LibexecFile} DESTINATION ${CMAKE_INSTALL_LIBEXECDIR}) + endforeach() + + foreach(ManPage ${ManPages}) +@@ -77,7 +77,7 @@ if(CLANG_INSTALL_SCANBUILD) + ${CMAKE_BINARY_DIR}/share/scan-build/ + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/share/scan-build/${ShareFile}) + list(APPEND Depends ${CMAKE_BINARY_DIR}/share/scan-build/${ShareFile}) +- install(FILES share/scan-build/${ShareFile} DESTINATION share/scan-build) ++ install(FILES share/scan-build/${ShareFile} DESTINATION ${CMAKE_INSTALL_DATADIR}/scan-build) + endforeach() + + add_custom_target(scan-build ALL DEPENDS ${Depends}) +diff --git a/tools/scan-view/CMakeLists.txt b/tools/scan-view/CMakeLists.txt +index b305ca562a72..554bcb379061 100644 +--- a/tools/scan-view/CMakeLists.txt ++++ b/tools/scan-view/CMakeLists.txt +@@ -21,7 +21,7 @@ if(CLANG_INSTALL_SCANVIEW) + ${CMAKE_BINARY_DIR}/bin/ + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/bin/${BinFile}) + list(APPEND Depends ${CMAKE_BINARY_DIR}/bin/${BinFile}) +- install(PROGRAMS bin/${BinFile} DESTINATION bin) ++ install(PROGRAMS bin/${BinFile} DESTINATION ${CMAKE_INSTALL_BINDIR}) + endforeach() + + foreach(ShareFile ${ShareFiles}) +@@ -33,7 +33,7 @@ if(CLANG_INSTALL_SCANVIEW) + ${CMAKE_BINARY_DIR}/share/scan-view/ + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/share/${ShareFile}) + list(APPEND Depends ${CMAKE_BINARY_DIR}/share/scan-view/${ShareFile}) +- install(FILES share/${ShareFile} DESTINATION share/scan-view) ++ install(FILES share/${ShareFile} DESTINATION ${CMAKE_INSTALL_DATADIR}/scan-view) + endforeach() + + add_custom_target(scan-view ALL DEPENDS ${Depends}) +diff --git a/utils/hmaptool/CMakeLists.txt b/utils/hmaptool/CMakeLists.txt +index 5573009d343a..24b3a90f233f 100644 +--- a/utils/hmaptool/CMakeLists.txt ++++ b/utils/hmaptool/CMakeLists.txt +@@ -9,7 +9,7 @@ add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bin/${CLANG_HM + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${CLANG_HMAPTOOL}) + + list(APPEND Depends ${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bin/${CLANG_HMAPTOOL}) +-install(PROGRAMS ${CLANG_HMAPTOOL} DESTINATION bin) ++install(PROGRAMS ${CLANG_HMAPTOOL} DESTINATION ${CMAKE_INSTALL_BINDIR}) + + add_custom_target(hmaptool ALL DEPENDS ${Depends}) + set_target_properties(hmaptool PROPERTIES FOLDER "Utils") diff --git a/pkgs/development/compilers/llvm/7/compiler-rt/default.nix b/pkgs/development/compilers/llvm/7/compiler-rt/default.nix index 21842131599..d083347dde5 100644 --- a/pkgs/development/compilers/llvm/7/compiler-rt/default.nix +++ b/pkgs/development/compilers/llvm/7/compiler-rt/default.nix @@ -13,7 +13,7 @@ stdenv.mkDerivation { inherit version; src = fetch "compiler-rt" "1n48p8gjarihkws0i2bay5w9bdwyxyxxbpwyng7ba58jb30dlyq5"; - nativeBuildInputs = [ cmake python3 llvm ]; + nativeBuildInputs = [ cmake python3 llvm.dev ]; buildInputs = lib.optional stdenv.hostPlatform.isDarwin libcxxabi; NIX_CFLAGS_COMPILE = [ @@ -21,6 +21,7 @@ stdenv.mkDerivation { ]; cmakeFlags = [ + "-DCOMPILER_RT_OS_DIR=" "-DCOMPILER_RT_DEFAULT_TARGET_ONLY=ON" "-DCMAKE_C_COMPILER_TARGET=${stdenv.hostPlatform.config}" "-DCMAKE_ASM_COMPILER_TARGET=${stdenv.hostPlatform.config}" @@ -54,6 +55,7 @@ stdenv.mkDerivation { # https://github.com/llvm/llvm-project/commit/947f9692440836dcb8d88b74b69dd379d85974ce ../../common/compiler-rt/glibc.patch ./codesign.patch # Revert compiler-rt commit that makes codesign mandatory + ./gnu-install-dirs.patch ] ++ lib.optional (useLLVM) ./crtbegin-and-end.patch ++ lib.optional stdenv.hostPlatform.isMusl ./sanitizers-nongnu.patch ++ lib.optional stdenv.hostPlatform.isAarch32 ./armv7l.patch; @@ -79,9 +81,7 @@ stdenv.mkDerivation { ''; # Hack around weird upsream RPATH bug - postInstall = lib.optionalString (stdenv.hostPlatform.isDarwin || stdenv.hostPlatform.isWasm) '' - ln -s "$out/lib"/*/* "$out/lib" - '' + lib.optionalString (useLLVM) '' + postInstall = lib.optionalString (useLLVM) '' ln -s $out/lib/*/clang_rt.crtbegin-*.o $out/lib/linux/crtbegin.o ln -s $out/lib/*/clang_rt.crtend-*.o $out/lib/linux/crtend.o ln -s $out/lib/*/clang_rt.crtbegin_shared-*.o $out/lib/linux/crtbeginS.o diff --git a/pkgs/development/compilers/llvm/7/compiler-rt/gnu-install-dirs.patch b/pkgs/development/compilers/llvm/7/compiler-rt/gnu-install-dirs.patch new file mode 100644 index 00000000000..fd7c6a690fa --- /dev/null +++ b/pkgs/development/compilers/llvm/7/compiler-rt/gnu-install-dirs.patch @@ -0,0 +1,117 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 86ca2b3ef74b..555103bd97fe 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -8,6 +8,7 @@ cmake_minimum_required(VERSION 3.4.3) + # Check if compiler-rt is built as a standalone project. + if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR OR COMPILER_RT_STANDALONE_BUILD) + project(CompilerRT C CXX ASM) ++ include(GNUInstallDirs) + set(COMPILER_RT_STANDALONE_BUILD TRUE) + set_property(GLOBAL PROPERTY USE_FOLDERS ON) + endif() +diff --git a/cmake/Modules/AddCompilerRT.cmake b/cmake/Modules/AddCompilerRT.cmake +index cd4c704fc824..5abcd1260381 100644 +--- a/cmake/Modules/AddCompilerRT.cmake ++++ b/cmake/Modules/AddCompilerRT.cmake +@@ -478,7 +478,7 @@ macro(add_compiler_rt_resource_file target_name file_name component) + add_custom_target(${target_name} DEPENDS ${dst_file}) + # Install in Clang resource directory. + install(FILES ${file_name} +- DESTINATION ${COMPILER_RT_INSTALL_PATH}/share ++ DESTINATION ${COMPILER_RT_INSTALL_PATH}/${CMAKE_INSTALL_FULL_INCLUDEDIR} + COMPONENT ${component}) + add_dependencies(${component} ${target_name}) + +@@ -495,7 +495,7 @@ macro(add_compiler_rt_script name) + add_custom_target(${name} DEPENDS ${dst}) + install(FILES ${dst} + PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE +- DESTINATION ${COMPILER_RT_INSTALL_PATH}/bin) ++ DESTINATION ${COMPILER_RT_INSTALL_PATH}/${CMAKE_INSTALL_FULL_BINDIR}) + endmacro(add_compiler_rt_script src name) + + # Builds custom version of libc++ and installs it in . +diff --git a/cmake/Modules/CompilerRTDarwinUtils.cmake b/cmake/Modules/CompilerRTDarwinUtils.cmake +index 04cc955980fa..a99f6dfb2f82 100644 +--- a/cmake/Modules/CompilerRTDarwinUtils.cmake ++++ b/cmake/Modules/CompilerRTDarwinUtils.cmake +@@ -377,7 +377,7 @@ macro(darwin_add_embedded_builtin_libraries) + set(DARWIN_macho_embedded_LIBRARY_OUTPUT_DIR + ${COMPILER_RT_OUTPUT_DIR}/lib/macho_embedded) + set(DARWIN_macho_embedded_LIBRARY_INSTALL_DIR +- ${COMPILER_RT_INSTALL_PATH}/lib/macho_embedded) ++ ${COMPILER_RT_INSTALL_PATH}/${CMAKE_INSTALL_FULL_LIBDIR}/macho_embedded) + + set(CFLAGS_armv7 "-target thumbv7-apple-darwin-eabi") + set(CFLAGS_i386 "-march=pentium") +diff --git a/cmake/Modules/CompilerRTUtils.cmake b/cmake/Modules/CompilerRTUtils.cmake +index e5651718fa34..d95cfc984a85 100644 +--- a/cmake/Modules/CompilerRTUtils.cmake ++++ b/cmake/Modules/CompilerRTUtils.cmake +@@ -330,7 +330,7 @@ endfunction() + function(get_compiler_rt_install_dir arch install_dir) + if(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR AND NOT APPLE) + get_compiler_rt_target(${arch} target) +- set(${install_dir} ${COMPILER_RT_INSTALL_PATH}/${target}/lib PARENT_SCOPE) ++ set(${install_dir} ${COMPILER_RT_INSTALL_PATH}/${target}/${CMAKE_INSTALL_FULL_LIBDIR} PARENT_SCOPE) + else() + set(${install_dir} ${COMPILER_RT_LIBRARY_INSTALL_DIR} PARENT_SCOPE) + endif() +diff --git a/cmake/base-config-ix.cmake b/cmake/base-config-ix.cmake +index 91fe2494b476..b59a0ffc69f4 100644 +--- a/cmake/base-config-ix.cmake ++++ b/cmake/base-config-ix.cmake +@@ -53,11 +53,11 @@ if (LLVM_TREE_AVAILABLE) + else() + # Take output dir and install path from the user. + set(COMPILER_RT_OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR} CACHE PATH +- "Path where built compiler-rt libraries should be stored.") ++ "Path where built compiler-rt build artifacts should be stored.") + set(COMPILER_RT_EXEC_OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR}/bin CACHE PATH + "Path where built compiler-rt executables should be stored.") +- set(COMPILER_RT_INSTALL_PATH ${CMAKE_INSTALL_PREFIX} CACHE PATH +- "Path where built compiler-rt libraries should be installed.") ++ set(COMPILER_RT_INSTALL_PATH "" CACHE PATH ++ "Prefix where built compiler-rt artifacts should be installed, comes before CMAKE_INSTALL_PREFIX.") + option(COMPILER_RT_INCLUDE_TESTS "Generate and build compiler-rt unit tests." OFF) + option(COMPILER_RT_ENABLE_WERROR "Fail and stop if warning is triggered" OFF) + # Use a host compiler to compile/link tests. +@@ -85,7 +85,7 @@ else(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR) + set(COMPILER_RT_LIBRARY_OUTPUT_DIR + ${COMPILER_RT_OUTPUT_DIR}/lib/${COMPILER_RT_OS_DIR}) + set(COMPILER_RT_LIBRARY_INSTALL_DIR +- ${COMPILER_RT_INSTALL_PATH}/lib/${COMPILER_RT_OS_DIR}) ++ ${COMPILER_RT_INSTALL_PATH}/${CMAKE_INSTALL_FULL_LIBDIR}/${COMPILER_RT_OS_DIR}) + endif() + + if(APPLE) +diff --git a/include/CMakeLists.txt b/include/CMakeLists.txt +index c4b93b89a30c..3913dc3a1ee6 100644 +--- a/include/CMakeLists.txt ++++ b/include/CMakeLists.txt +@@ -48,12 +48,12 @@ set_target_properties(compiler-rt-headers PROPERTIES FOLDER "Compiler-RT Misc") + install(FILES ${SANITIZER_HEADERS} + COMPONENT compiler-rt-headers + PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ +- DESTINATION ${COMPILER_RT_INSTALL_PATH}/include/sanitizer) ++ DESTINATION ${COMPILER_RT_INSTALL_PATH}/${CMAKE_INSTALL_FULL_INCLUDEDIR}/sanitizer) + # Install xray headers. + install(FILES ${XRAY_HEADERS} + COMPONENT compiler-rt-headers + PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ +- DESTINATION ${COMPILER_RT_INSTALL_PATH}/include/xray) ++ DESTINATION ${COMPILER_RT_INSTALL_PATH}/${CMAKE_INSTALL_FULL_INCLUDEDIR}/xray) + + if (NOT CMAKE_CONFIGURATION_TYPES) # don't add this for IDEs. + add_custom_target(install-compiler-rt-headers +diff --git a/lib/dfsan/CMakeLists.txt b/lib/dfsan/CMakeLists.txt +index b3ae713cf02c..52b364b900f5 100644 +--- a/lib/dfsan/CMakeLists.txt ++++ b/lib/dfsan/CMakeLists.txt +@@ -54,4 +54,4 @@ add_custom_command(OUTPUT ${dfsan_abilist_filename} + DEPENDS done_abilist.txt libc_ubuntu1404_abilist.txt) + add_dependencies(dfsan dfsan_abilist) + install(FILES ${dfsan_abilist_filename} +- DESTINATION ${COMPILER_RT_INSTALL_PATH}/share) ++ DESTINATION ${COMPILER_RT_INSTALL_PATH}/${CMAKE_INSTALL_FULL_DATADIR}) diff --git a/pkgs/development/compilers/llvm/7/default.nix b/pkgs/development/compilers/llvm/7/default.nix index 5ae5f9ecb20..8a80c55d45a 100644 --- a/pkgs/development/compilers/llvm/7/default.nix +++ b/pkgs/development/compilers/llvm/7/default.nix @@ -1,6 +1,5 @@ { lowPrio, newScope, pkgs, lib, stdenv, cmake, gccForLibs , libxml2, python3, isl, fetchurl, overrideCC, wrapCCWith, wrapBintoolsWith -, buildPackages , buildLlvmTools # tools, but from the previous stage, for cross , targetLlvmLibraries # libraries, but from the next stage, for cross }: @@ -18,42 +17,49 @@ let clang-tools-extra_src = fetch "clang-tools-extra" "0lb4kdh7j2fhfz8kd6iv5df7m3pikiryk1vvwsf87spc90n09q0w"; tools = lib.makeExtensible (tools: let - callPackage = newScope (tools // { inherit stdenv cmake libxml2 python3 isl release_version version fetch; }); + callPackage = newScope (tools // { inherit stdenv cmake libxml2 python3 isl release_version version fetch buildLlvmTools; }); mkExtraBuildCommands = cc: '' rsrc="$out/resource-root" mkdir "$rsrc" - ln -s "${cc}/lib/clang/${release_version}/include" "$rsrc" + ln -s "${cc.lib}/lib/clang/${release_version}/include" "$rsrc" ln -s "${targetLlvmLibraries.compiler-rt.out}/lib" "$rsrc/lib" echo "-resource-dir=$rsrc" >> $out/nix-support/cc-cflags ''; + in { - llvm = callPackage ./llvm { }; + libllvm = callPackage ./llvm { }; - llvm-polly = callPackage ./llvm { enablePolly = true; }; + # `llvm` historically had the binaries. But this migration + # technique also impedes `lib.get*`. Perhaps we will revisit it. + llvm = tools.libllvm.out; - clang-unwrapped = callPackage ./clang { - inherit (tools) lld; + libllvm-polly = callPackage ./llvm { enablePolly = true; }; + + llvm-polly = tools.libllvm-polly.lib; + + libclang = callPackage ./clang { inherit clang-tools-extra_src; }; + + clang-unwrapped = tools.libclang.out; + clang-polly-unwrapped = callPackage ./clang { inherit clang-tools-extra_src; - llvm = tools.llvm-polly; + libllvm = tools.libllvm-polly; enablePolly = true; }; - llvm-manpages = lowPrio (tools.llvm.override { + llvm-manpages = lowPrio (tools.libllvm.override { enableManpages = true; python3 = pkgs.python3; # don't use python-boot }); - clang-manpages = lowPrio (tools.clang-unwrapped.override { + clang-manpages = lowPrio (tools.libclang.override { enableManpages = true; python3 = pkgs.python3; # don't use python-boot }); - libclang = tools.clang-unwrapped.lib; - clang = if stdenv.cc.isGNU then tools.libstdcxxClang else tools.libcxxClang; libstdcxxClang = wrapCCWith rec { diff --git a/pkgs/development/compilers/llvm/7/libc++/default.nix b/pkgs/development/compilers/llvm/7/libc++/default.nix index 37f90fae5e4..afc59d91179 100644 --- a/pkgs/development/compilers/llvm/7/libc++/default.nix +++ b/pkgs/development/compilers/llvm/7/libc++/default.nix @@ -13,7 +13,11 @@ stdenv.mkDerivation { export LIBCXXABI_INCLUDE_DIR="$PWD/$(ls -d libcxxabi-${version}*)/include" ''; - patches = lib.optional stdenv.hostPlatform.isMusl ../../libcxx-0001-musl-hacks.patch; + outputs = [ "out" "dev" ]; + + patches = [ + ./gnu-install-dirs.patch + ] ++ lib.optional stdenv.hostPlatform.isMusl ../../libcxx-0001-musl-hacks.patch; prePatch = '' substituteInPlace lib/CMakeLists.txt --replace "/usr/lib/libc++" "\''${LIBCXX_LIBCXXABI_LIB_PATH}/libc++" diff --git a/pkgs/development/compilers/llvm/7/libc++/gnu-install-dirs.patch b/pkgs/development/compilers/llvm/7/libc++/gnu-install-dirs.patch new file mode 100644 index 00000000000..910e5287a86 --- /dev/null +++ b/pkgs/development/compilers/llvm/7/libc++/gnu-install-dirs.patch @@ -0,0 +1,72 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index acb49565ce97..6a863926cbca 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -26,6 +26,8 @@ set(CMAKE_MODULE_PATH + if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR) + project(libcxx CXX C) + ++ include(GNUInstallDirs) ++ + set(PACKAGE_NAME libcxx) + set(PACKAGE_VERSION 7.0.0) + set(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}") +diff --git a/cmake/Modules/HandleLibCXXABI.cmake b/cmake/Modules/HandleLibCXXABI.cmake +index 1c19d7e01af7..9c8aee8e8bb7 100644 +--- a/cmake/Modules/HandleLibCXXABI.cmake ++++ b/cmake/Modules/HandleLibCXXABI.cmake +@@ -59,7 +59,7 @@ macro(setup_abi_lib abidefines abilib abifiles abidirs) + + if (LIBCXX_INSTALL_HEADERS) + install(FILES "${LIBCXX_BINARY_INCLUDE_DIR}/${fpath}" +- DESTINATION ${LIBCXX_INSTALL_HEADER_PREFIX}include/c++/v1/${dstdir} ++ DESTINATION ${LIBCXX_INSTALL_HEADER_PREFIX}${CMAKE_INSTALL_INCLUDEDIR}/c++/v1/${dstdir} + COMPONENT cxx-headers + PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ + ) +diff --git a/include/CMakeLists.txt b/include/CMakeLists.txt +index d9def18d725c..16494dacaf6f 100644 +--- a/include/CMakeLists.txt ++++ b/include/CMakeLists.txt +@@ -243,7 +243,7 @@ if (LIBCXX_INSTALL_HEADERS) + foreach(file ${files}) + get_filename_component(dir ${file} DIRECTORY) + install(FILES ${file} +- DESTINATION ${LIBCXX_INSTALL_HEADER_PREFIX}include/c++/v1/${dir} ++ DESTINATION ${LIBCXX_INSTALL_HEADER_PREFIX}${CMAKE_INSTALL_INCLUDEDIR}/c++/v1/${dir} + COMPONENT cxx-headers + PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ + ) +@@ -252,7 +252,7 @@ if (LIBCXX_INSTALL_HEADERS) + if (LIBCXX_NEEDS_SITE_CONFIG) + # Install the generated header as __config. + install(FILES ${LIBCXX_BINARY_DIR}/__generated_config +- DESTINATION ${LIBCXX_INSTALL_HEADER_PREFIX}include/c++/v1 ++ DESTINATION ${LIBCXX_INSTALL_HEADER_PREFIX}${CMAKE_INSTALL_INCLUDEDIR}/c++/v1 + PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ + RENAME __config + COMPONENT cxx-headers) +diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt +index e068edc8a7af..b63ad92d1d78 100644 +--- a/lib/CMakeLists.txt ++++ b/lib/CMakeLists.txt +@@ -399,8 +399,8 @@ if (LIBCXX_INSTALL_LIBRARY) + set(experimental_lib cxx_experimental) + endif() + install(TARGETS ${LIBCXX_INSTALL_TARGETS} ${filesystem_lib} ${experimental_lib} +- LIBRARY DESTINATION ${LIBCXX_INSTALL_PREFIX}lib${LIBCXX_LIBDIR_SUFFIX} COMPONENT cxx +- ARCHIVE DESTINATION ${LIBCXX_INSTALL_PREFIX}lib${LIBCXX_LIBDIR_SUFFIX} COMPONENT cxx ++ LIBRARY DESTINATION ${LIBCXX_INSTALL_PREFIX}${CMAKE_INSTALL_LIBDIR}${LIBCXX_LIBDIR_SUFFIX} COMPONENT cxx ++ ARCHIVE DESTINATION ${LIBCXX_INSTALL_PREFIX}${CMAKE_INSTALL_LIBDIR}${LIBCXX_LIBDIR_SUFFIX} COMPONENT cxx + ) + # NOTE: This install command must go after the cxx install command otherwise + # it will not be executed after the library symlinks are installed. +@@ -408,7 +408,7 @@ if (LIBCXX_INSTALL_LIBRARY) + # Replace the libc++ filename with $ + # after we required CMake 3.0. + install(FILES "${LIBCXX_LIBRARY_DIR}/libc++${CMAKE_SHARED_LIBRARY_SUFFIX}" +- DESTINATION ${LIBCXX_INSTALL_PREFIX}lib${LIBCXX_LIBDIR_SUFFIX} ++ DESTINATION ${LIBCXX_INSTALL_PREFIX}${CMAKE_INSTALL_LIBDIR}${LIBCXX_LIBDIR_SUFFIX} + COMPONENT libcxx) + endif() + endif() diff --git a/pkgs/development/compilers/llvm/7/libc++abi/default.nix b/pkgs/development/compilers/llvm/7/libc++abi/default.nix index 4f29ca0d6e2..31ead6eb421 100644 --- a/pkgs/development/compilers/llvm/7/libc++abi/default.nix +++ b/pkgs/development/compilers/llvm/7/libc++abi/default.nix @@ -11,14 +11,7 @@ stdenv.mkDerivation { src = fetch "libcxxabi" "1zcqxsdjhawgz1cvpk07y3jl6fg9p3ay4nl69zsirqb2ghgyhhb2"; - nativeBuildInputs = [ cmake ]; - buildInputs = lib.optional withLibunwind libunwind; - - cmakeFlags = lib.optionals standalone [ - "-DLLVM_ENABLE_LIBCXX=ON" - ] ++ lib.optionals (standalone && withLibunwind) [ - "-DLIBCXXABI_USE_LLVM_UNWINDER=ON" - ] ++ lib.optional (!enableShared) "-DLIBCXXABI_ENABLE_SHARED=OFF"; + outputs = [ "out" "dev" ]; postUnpack = '' unpackFile ${libcxx.src} @@ -30,6 +23,19 @@ stdenv.mkDerivation { patch -p1 -d $(ls -d libcxx-*) -i ${../../libcxx-0001-musl-hacks.patch} ''; + patches = [ + ./gnu-install-dirs.patch + ]; + + nativeBuildInputs = [ cmake ]; + buildInputs = lib.optional withLibunwind libunwind; + + cmakeFlags = lib.optionals standalone [ + "-DLLVM_ENABLE_LIBCXX=ON" + ] ++ lib.optionals (standalone && withLibunwind) [ + "-DLIBCXXABI_USE_LLVM_UNWINDER=ON" + ] ++ lib.optional (!enableShared) "-DLIBCXXABI_ENABLE_SHARED=OFF"; + installPhase = if stdenv.isDarwin then '' for file in lib/*.dylib; do diff --git a/pkgs/development/compilers/llvm/7/libc++abi/gnu-install-dirs.patch b/pkgs/development/compilers/llvm/7/libc++abi/gnu-install-dirs.patch new file mode 100644 index 00000000000..92d9e94fdee --- /dev/null +++ b/pkgs/development/compilers/llvm/7/libc++abi/gnu-install-dirs.patch @@ -0,0 +1,28 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index d6648ede1f59..55a8f17ca5e6 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -20,6 +20,8 @@ set(CMAKE_MODULE_PATH + if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR) + project(libcxxabi CXX C) + ++ include(GNUInstallDirs) ++ + set(PACKAGE_NAME libcxxabi) + set(PACKAGE_VERSION 7.0.0svn) + set(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}") +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index 776c51294330..314b45feac69 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -195,8 +195,8 @@ add_custom_target(cxxabi DEPENDS ${LIBCXXABI_BUILD_TARGETS}) + + if (LIBCXXABI_INSTALL_LIBRARY) + install(TARGETS ${LIBCXXABI_INSTALL_TARGETS} +- LIBRARY DESTINATION ${LIBCXXABI_INSTALL_PREFIX}lib${LIBCXXABI_LIBDIR_SUFFIX} COMPONENT cxxabi +- ARCHIVE DESTINATION ${LIBCXXABI_INSTALL_PREFIX}lib${LIBCXXABI_LIBDIR_SUFFIX} COMPONENT cxxabi ++ LIBRARY DESTINATION ${LIBCXXABI_INSTALL_PREFIX}${CMAKE_INSTALL_LIBDIR}${LIBCXXABI_LIBDIR_SUFFIX} COMPONENT cxxabi ++ ARCHIVE DESTINATION ${LIBCXXABI_INSTALL_PREFIX}${CMAKE_INSTALL_LIBDIR}${LIBCXXABI_LIBDIR_SUFFIX} COMPONENT cxxabi + ) + endif() + diff --git a/pkgs/development/compilers/llvm/7/libunwind/default.nix b/pkgs/development/compilers/llvm/7/libunwind/default.nix index 8fb6e2c7b6d..14c0abc5153 100644 --- a/pkgs/development/compilers/llvm/7/libunwind/default.nix +++ b/pkgs/development/compilers/llvm/7/libunwind/default.nix @@ -8,7 +8,9 @@ stdenv.mkDerivation { src = fetch "libunwind" "035dsxs10nyiqd00q07yycvmkjl01yz4jdlrjvmch8klxg4pyjhp"; - patches = lib.optional (stdenv.hostPlatform.useLLVM or false) [ + patches = [ + ./gnu-install-dirs.patch + ] ++ lib.optionals (stdenv.hostPlatform.useLLVM or false) [ # removes use of `new` that require libc++ (fetchpatch { url = "https://github.com/llvm-mirror/libunwind/commit/34a45c630d4c79af403661d267db42fbe7de1178.patch"; @@ -22,7 +24,7 @@ stdenv.mkDerivation { }) ]; - nativeBuildInputs = [ cmake llvm ]; + nativeBuildInputs = [ cmake llvm.dev ]; cmakeFlags = lib.optionals (!enableShared) [ "-DLIBUNWIND_ENABLE_SHARED=OFF" diff --git a/pkgs/development/compilers/llvm/7/libunwind/gnu-install-dirs.patch b/pkgs/development/compilers/llvm/7/libunwind/gnu-install-dirs.patch new file mode 100644 index 00000000000..21d4fa80ea1 --- /dev/null +++ b/pkgs/development/compilers/llvm/7/libunwind/gnu-install-dirs.patch @@ -0,0 +1,28 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 0e48d713837a..05483c367bd1 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -18,6 +18,8 @@ set(CMAKE_MODULE_PATH + if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR) + project(libunwind) + ++ include(GNUInstallDirs) ++ + # Rely on llvm-config. + set(CONFIG_OUTPUT) + if(NOT LLVM_CONFIG_PATH) +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index 937159e2cb86..07f8b936e7e5 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -141,8 +141,8 @@ add_custom_target(unwind DEPENDS ${LIBUNWIND_BUILD_TARGETS}) + + if (LIBUNWIND_INSTALL_LIBRARY) + install(TARGETS ${LIBUNWIND_INSTALL_TARGETS} +- LIBRARY DESTINATION ${LIBUNWIND_INSTALL_PREFIX}lib${LIBUNWIND_LIBDIR_SUFFIX} COMPONENT unwind +- ARCHIVE DESTINATION ${LIBUNWIND_INSTALL_PREFIX}lib${LIBUNWIND_LIBDIR_SUFFIX} COMPONENT unwind) ++ LIBRARY DESTINATION ${LIBUNWIND_INSTALL_PREFIX}${CMAKE_INSTALL_LIBDIR}${LIBUNWIND_LIBDIR_SUFFIX} COMPONENT unwind ++ ARCHIVE DESTINATION ${LIBUNWIND_INSTALL_PREFIX}${CMAKE_INSTALL_LIBDIR}${LIBUNWIND_LIBDIR_SUFFIX} COMPONENT unwind) + endif() + + if (NOT CMAKE_CONFIGURATION_TYPES AND LIBUNWIND_INSTALL_LIBRARY) diff --git a/pkgs/development/compilers/llvm/7/lld/default.nix b/pkgs/development/compilers/llvm/7/lld/default.nix index f4c58abef8a..da863d5ad4a 100644 --- a/pkgs/development/compilers/llvm/7/lld/default.nix +++ b/pkgs/development/compilers/llvm/7/lld/default.nix @@ -1,8 +1,9 @@ { lib, stdenv +, buildLlvmTools , fetch , cmake , libxml2 -, llvm +, libllvm , version }: @@ -12,15 +13,20 @@ stdenv.mkDerivation { src = fetch "lld" "0rsqb7zcnij5r5ipfhr129j7skr5n9pyr388kjpqwh091952f3x1"; + patches = [ + ./gnu-install-dirs.patch + ]; + nativeBuildInputs = [ cmake ]; - buildInputs = [ llvm libxml2 ]; + buildInputs = [ libllvm libxml2 ]; - outputs = [ "out" "dev" ]; + cmakeFlags = [ + "-DLLVM_CONFIG_PATH=${libllvm.dev}/bin/llvm-config${lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) "-native"}" + ] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ + "-DLLVM_TABLEGEN_EXE=${buildLlvmTools.llvm}/bin/llvm-tblgen" + ]; - postInstall = '' - moveToOutput include "$dev" - moveToOutput lib "$dev" - ''; + outputs = [ "out" "lib" "dev" ]; meta = { description = "The LLVM Linker"; diff --git a/pkgs/development/compilers/llvm/7/lld/gnu-install-dirs.patch b/pkgs/development/compilers/llvm/7/lld/gnu-install-dirs.patch new file mode 100644 index 00000000000..acc2d3d4776 --- /dev/null +++ b/pkgs/development/compilers/llvm/7/lld/gnu-install-dirs.patch @@ -0,0 +1,68 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index e2fbdbfbbb47..d601b231ebb8 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -6,6 +6,8 @@ if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR) + set(CMAKE_INCLUDE_CURRENT_DIR ON) + set(LLD_BUILT_STANDALONE TRUE) + ++ include(GNUInstallDirs) ++ + find_program(LLVM_CONFIG_PATH "llvm-config" DOC "Path to llvm-config binary") + if(NOT LLVM_CONFIG_PATH) + message(FATAL_ERROR "llvm-config not found: specify LLVM_CONFIG_PATH") +@@ -203,7 +205,7 @@ include_directories(BEFORE + + if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY) + install(DIRECTORY include/ +- DESTINATION include ++ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} + FILES_MATCHING + PATTERN "*.h" + PATTERN ".svn" EXCLUDE +diff --git a/cmake/modules/AddLLD.cmake b/cmake/modules/AddLLD.cmake +index fa48b428d26b..e7967aad3ceb 100644 +--- a/cmake/modules/AddLLD.cmake ++++ b/cmake/modules/AddLLD.cmake +@@ -20,9 +20,9 @@ macro(add_lld_library name) + install(TARGETS ${name} + COMPONENT ${name} + ${export_to_lldtargets} +- LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX} +- ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX} +- RUNTIME DESTINATION bin) ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX} ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) + + if (${ARG_SHARED} AND NOT CMAKE_CONFIGURATION_TYPES) + add_llvm_install_targets(install-${name} +@@ -54,7 +54,7 @@ macro(add_lld_tool name) + + install(TARGETS ${name} + ${export_to_lldtargets} +- RUNTIME DESTINATION bin ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + COMPONENT ${name}) + + if(NOT CMAKE_CONFIGURATION_TYPES) +@@ -69,5 +69,5 @@ endmacro() + macro(add_lld_symlink name dest) + add_llvm_tool_symlink(${name} ${dest} ALWAYS_GENERATE) + # Always generate install targets +- llvm_install_symlink(${name} ${dest} ALWAYS_GENERATE) ++ llvm_install_symlink(${name} ${dest} ${CMAKE_INSTALL_FULL_BINDIR} ALWAYS_GENERATE) + endmacro() +diff --git a/tools/lld/CMakeLists.txt b/tools/lld/CMakeLists.txt +index d8829493fc22..df748a0e749b 100644 +--- a/tools/lld/CMakeLists.txt ++++ b/tools/lld/CMakeLists.txt +@@ -16,7 +16,7 @@ target_link_libraries(lld + ) + + install(TARGETS lld +- RUNTIME DESTINATION bin) ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) + + if(NOT LLD_SYMLINKS_TO_CREATE) + set(LLD_SYMLINKS_TO_CREATE lld-link ld.lld ld64.lld wasm-ld) diff --git a/pkgs/development/compilers/llvm/7/lldb/default.nix b/pkgs/development/compilers/llvm/7/lldb/default.nix index 3fa5b411f63..97888492879 100644 --- a/pkgs/development/compilers/llvm/7/lldb/default.nix +++ b/pkgs/development/compilers/llvm/7/lldb/default.nix @@ -7,32 +7,31 @@ , which , libedit , libxml2 -, llvm -, clang-unwrapped +, libllvm +, libclang , perl , python3 , version , darwin }: -stdenv.mkDerivation { +stdenv.mkDerivation rec { pname = "lldb"; inherit version; src = fetch "lldb" "0klsscg1sczc4nw2l53xggi969k361cng2sjjrfp3bv4g5x14s4v"; - nativeBuildInputs = [ cmake perl python3 which swig ]; - buildInputs = [ ncurses zlib libedit libxml2 llvm ] - ++ lib.optionals stdenv.isDarwin [ darwin.libobjc darwin.apple_sdk.libs.xpc darwin.apple_sdk.frameworks.Foundation darwin.bootstrap_cmds darwin.apple_sdk.frameworks.Carbon darwin.apple_sdk.frameworks.Cocoa ]; - + patches = [ + ./gnu-install-dirs.patch + ]; postPatch = '' # Fix up various paths that assume llvm and clang are installed in the same place - sed -i 's,".*ClangConfig.cmake","${clang-unwrapped}/lib/cmake/clang/ClangConfig.cmake",' \ + sed -i 's,".*ClangConfig.cmake","${libclang.dev}/lib/cmake/clang/ClangConfig.cmake",' \ cmake/modules/LLDBStandalone.cmake - sed -i 's,".*tools/clang/include","${clang-unwrapped}/include",' \ + sed -i 's,".*tools/clang/include","${libclang.dev}/include",' \ cmake/modules/LLDBStandalone.cmake - sed -i 's,"$.LLVM_LIBRARY_DIR.",${llvm}/lib ${clang-unwrapped}/lib,' \ + sed -i 's,"$.LLVM_LIBRARY_DIR.",${libllvm.lib}/lib ${libclang.lib}/lib,' \ cmake/modules/LLDBStandalone.cmake sed -i -e 's,message(SEND_ERROR "Cannot find debugserver on system."),,' \ -e 's,string(STRIP ''${XCODE_DEV_DIR} XCODE_DEV_DIR),,' \ @@ -42,9 +41,18 @@ stdenv.mkDerivation { patchShebangs scripts ''; - cmakeFlags = [ - "-DLLDB_CODESIGN_IDENTITY=" # codesigning makes nondeterministic - "-DSKIP_DEBUGSERVER=ON" + outputs = [ "out" "lib" "dev" ]; + + nativeBuildInputs = [ + cmake perl python3 which swig + ]; + + buildInputs = [ + ncurses zlib libedit libxml2 libllvm + ] ++ lib.optionals stdenv.isDarwin [ + darwin.libobjc + darwin.apple_sdk.libs.xpc + darwin.apple_sdk.frameworks.Foundation darwin.bootstrap_cmds darwin.apple_sdk.frameworks.Carbon darwin.apple_sdk.frameworks.Cocoa ]; CXXFLAGS = "-fno-rtti"; @@ -52,6 +60,17 @@ stdenv.mkDerivation { NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isClang "-I${libxml2.dev}/include/libxml2"; + cmakeFlags = [ + "-DLLDB_INCLUDE_TESTS=${if doCheck then "YES" else "NO"}" + "-DLLDB_CODESIGN_IDENTITY=" # codesigning makes nondeterministic + "-DSKIP_DEBUGSERVER=ON" + ] ++ lib.optionals doCheck [ + "-DLLDB_TEST_C_COMPILER=${stdenv.cc}/bin/${stdenv.cc.targetPrefix}cc" + "-DLLDB_TEST_CXX_COMPILER=${stdenv.cc}/bin/${stdenv.cc.targetPrefix}c++" + ]; + + doCheck = false; + postInstall = '' mkdir -p $out/share/man/man1 cp ../docs/lldb.1 $out/share/man/man1/ diff --git a/pkgs/development/compilers/llvm/7/lldb/gnu-install-dirs.patch b/pkgs/development/compilers/llvm/7/lldb/gnu-install-dirs.patch new file mode 100644 index 00000000000..40645743ecc --- /dev/null +++ b/pkgs/development/compilers/llvm/7/lldb/gnu-install-dirs.patch @@ -0,0 +1,76 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 00ddcdc1488f..af2aa238939a 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -7,6 +7,8 @@ set(CMAKE_MODULE_PATH + "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules" + ) + ++include(GNUInstallDirs) ++ + include(LLDBStandalone) + include(LLDBConfig) + include(AddLLDB) +diff --git a/cmake/modules/AddLLDB.cmake b/cmake/modules/AddLLDB.cmake +index 129a5ef7500d..fb3fb3ce655c 100644 +--- a/cmake/modules/AddLLDB.cmake ++++ b/cmake/modules/AddLLDB.cmake +@@ -56,14 +56,14 @@ function(add_lldb_library name) + endif() + install(TARGETS ${name} + COMPONENT ${name} +- RUNTIME DESTINATION bin ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${out_dir} + ARCHIVE DESTINATION ${out_dir}) + else() + install(TARGETS ${name} + COMPONENT ${name} +- LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX} +- ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX}) ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}) + endif() + if (NOT CMAKE_CONFIGURATION_TYPES) + add_llvm_install_targets(install-${name} +@@ -121,7 +121,7 @@ function(add_lldb_executable name) + endif() + + if(ARG_GENERATE_INSTALL) +- set(out_dir "bin") ++ set(out_dir "${CMAKE_INSTALL_BINDIR}") + if (LLDB_BUILD_FRAMEWORK AND ARG_INCLUDE_IN_SUITE) + set(out_dir ${LLDB_FRAMEWORK_INSTALL_DIR}/${LLDB_FRAMEWORK_RESOURCE_DIR}) + endif() +diff --git a/cmake/modules/LLDBConfig.cmake b/cmake/modules/LLDBConfig.cmake +index dae6e365da38..ef272d5de5c0 100644 +--- a/cmake/modules/LLDBConfig.cmake ++++ b/cmake/modules/LLDBConfig.cmake +@@ -278,7 +278,7 @@ include_directories(BEFORE + if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY) + install(DIRECTORY include/ + COMPONENT lldb-headers +- DESTINATION include ++ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} + FILES_MATCHING + PATTERN "*.h" + PATTERN ".svn" EXCLUDE +@@ -288,7 +288,7 @@ if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY) + + install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/include/ + COMPONENT lldb-headers +- DESTINATION include ++ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} + FILES_MATCHING + PATTERN "*.h" + PATTERN ".svn" EXCLUDE +diff --git a/tools/intel-features/CMakeLists.txt b/tools/intel-features/CMakeLists.txt +index b5316540fdf3..3c3c882d503f 100644 +--- a/tools/intel-features/CMakeLists.txt ++++ b/tools/intel-features/CMakeLists.txt +@@ -64,4 +64,4 @@ if (NOT LLDB_DISABLE_PYTHON AND LLDB_BUILD_INTEL_PT) + endif() + + install(TARGETS lldbIntelFeatures +- LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX}) ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}) diff --git a/pkgs/development/compilers/llvm/7/llvm/default.nix b/pkgs/development/compilers/llvm/7/llvm/default.nix index 53a7301b19b..6f189779f84 100644 --- a/pkgs/development/compilers/llvm/7/llvm/default.nix +++ b/pkgs/development/compilers/llvm/7/llvm/default.nix @@ -1,4 +1,5 @@ { lib, stdenv +, pkgsBuildBuild , fetch , fetchpatch , cmake @@ -11,10 +12,10 @@ , version , release_version , zlib -, buildPackages +, buildLlvmTools , debugVersion ? false , enableManpages ? false -, enableSharedLibraries ? true +, enableSharedLibraries ? !stdenv.hostPlatform.isStatic , enablePFM ? !(stdenv.isDarwin || stdenv.isAarch64 # broken for Ampere eMAG 8180 (c2.large.arm on Packet) #56245 || stdenv.isAarch32 # broken for the armv7l builder @@ -46,8 +47,7 @@ in stdenv.mkDerivation ({ mv polly-* $sourceRoot/tools/polly ''; - outputs = [ "out" "python" ] - ++ optional enableSharedLibraries "lib"; + outputs = [ "out" "lib" "dev" "python" ]; nativeBuildInputs = [ cmake python3 ] ++ optional enableManpages python3.pkgs.sphinx; @@ -67,12 +67,13 @@ in stdenv.mkDerivation ({ url = "https://github.com/llvm-mirror/llvm/commit/cc1f2a595ead516812a6c50398f0f3480ebe031f.patch"; sha256 = "0k6k1p5yisgwx417a67s7sr9930rqh1n0zv5jvply8vjjy4b3kf8"; }) - ]; + ./gnu-install-dirs.patch + ] ++ lib.optional enablePolly ./gnu-install-dirs-polly.patch; postPatch = optionalString stdenv.isDarwin '' substituteInPlace cmake/modules/AddLLVM.cmake \ --replace 'set(_install_name_dir INSTALL_NAME_DIR "@rpath")' "set(_install_name_dir)" \ - --replace 'set(_install_rpath "@loader_path/../lib" ''${extra_libdir})' "" + --replace 'set(_install_rpath "@loader_path/../''${CMAKE_INSTALL_LIBDIR}" ''${extra_libdir})' "" '' # Patch llvm-config to return correct library path based on --link-{shared,static}. + optionalString (enableSharedLibraries) '' @@ -110,6 +111,7 @@ in stdenv.mkDerivation ({ ''; cmakeFlags = with stdenv; [ + "-DLLVM_INSTALL_CMAKE_DIR=${placeholder "dev"}/lib/cmake/llvm/" "-DCMAKE_BUILD_TYPE=${if debugVersion then "Debug" else "Release"}" "-DLLVM_INSTALL_UTILS=ON" # Needed by rustc "-DLLVM_BUILD_TESTS=ON" @@ -134,7 +136,20 @@ in stdenv.mkDerivation ({ "-DCAN_TARGET_i386=false" ] ++ optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ "-DCMAKE_CROSSCOMPILING=True" - "-DLLVM_TABLEGEN=${buildPackages.llvm_7}/bin/llvm-tblgen" + "-DLLVM_TABLEGEN=${buildLlvmTools.llvm}/bin/llvm-tblgen" + ( + let + nativeCC = pkgsBuildBuild.targetPackages.stdenv.cc; + nativeBintools = nativeCC.bintools.bintools; + nativeToolchainFlags = [ + "-DCMAKE_C_COMPILER=${nativeCC}/bin/${nativeCC.targetPrefix}cc" + "-DCMAKE_CXX_COMPILER=${nativeCC}/bin/${nativeCC.targetPrefix}c++" + "-DCMAKE_AR=${nativeBintools}/bin/${nativeBintools.targetPrefix}ar" + "-DCMAKE_STRIP=${nativeBintools}/bin/${nativeBintools.targetPrefix}strip" + "-DCMAKE_RANLIB=${nativeBintools}/bin/${nativeBintools.targetPrefix}ranlib" + ]; + in "-DCROSS_TOOLCHAIN_FLAGS_NATIVE:list=${lib.concatStringsSep ";" nativeToolchainFlags}" + ) ]; postBuild = '' @@ -148,19 +163,20 @@ in stdenv.mkDerivation ({ postInstall = '' mkdir -p $python/share mv $out/share/opt-viewer $python/share/opt-viewer - '' - + optionalString enableSharedLibraries '' - moveToOutput "lib/libLLVM-*" "$lib" - moveToOutput "lib/libLLVM${stdenv.hostPlatform.extensions.sharedLibrary}" "$lib" - substituteInPlace "$out/lib/cmake/llvm/LLVMExports-${if debugVersion then "debug" else "release"}.cmake" \ - --replace "\''${_IMPORT_PREFIX}/lib/libLLVM-" "$lib/lib/libLLVM-" + moveToOutput "bin/llvm-config*" "$dev" + substituteInPlace "$dev/lib/cmake/llvm/LLVMExports-${if debugVersion then "debug" else "release"}.cmake" \ + --replace "\''${_IMPORT_PREFIX}/lib/lib" "$lib/lib/lib" \ + --replace "$out/bin/llvm-config" "$dev/bin/llvm-config" + substituteInPlace "$dev/lib/cmake/llvm/LLVMConfig.cmake" \ + --replace 'set(LLVM_BINARY_DIR "''${LLVM_INSTALL_PREFIX}")' 'set(LLVM_BINARY_DIR "''${LLVM_INSTALL_PREFIX}'"$lib"'")' '' + optionalString (stdenv.isDarwin && enableSharedLibraries) '' - substituteInPlace "$out/lib/cmake/llvm/LLVMExports-${if debugVersion then "debug" else "release"}.cmake" \ - --replace "\''${_IMPORT_PREFIX}/lib/libLLVM.dylib" "$lib/lib/libLLVM.dylib" ${lib.concatMapStringsSep "\n" (v: '' ln -s $lib/lib/libLLVM.dylib $lib/lib/libLLVM-${v}.dylib '') versionSuffixes} + '' + + optionalString (stdenv.buildPlatform != stdenv.hostPlatform) '' + cp NATIVE/bin/llvm-config $dev/bin/llvm-config-native ''; doCheck = stdenv.isLinux && (!stdenv.isx86_32); diff --git a/pkgs/development/compilers/llvm/7/llvm/gnu-install-dirs-polly.patch b/pkgs/development/compilers/llvm/7/llvm/gnu-install-dirs-polly.patch new file mode 100644 index 00000000000..0b2d3b79e41 --- /dev/null +++ b/pkgs/development/compilers/llvm/7/llvm/gnu-install-dirs-polly.patch @@ -0,0 +1,106 @@ +diff --git a/tools/polly/CMakeLists.txt b/tools/polly/CMakeLists.txt +index 9939097f743e..8cc538da912a 100644 +--- a/tools/polly/CMakeLists.txt ++++ b/tools/polly/CMakeLists.txt +@@ -2,7 +2,11 @@ + if (NOT DEFINED LLVM_MAIN_SRC_DIR) + project(Polly) + cmake_minimum_required(VERSION 3.4.3) ++endif() ++ ++include(GNUInstallDirs) + ++if (NOT DEFINED LLVM_MAIN_SRC_DIR) + # Where is LLVM installed? + find_package(LLVM CONFIG REQUIRED) + set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${LLVM_CMAKE_DIR}) +@@ -145,14 +149,14 @@ include_directories( + + if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY) + install(DIRECTORY include/ +- DESTINATION include ++ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} + FILES_MATCHING + PATTERN "*.h" + PATTERN ".svn" EXCLUDE + ) + + install(DIRECTORY ${POLLY_BINARY_DIR}/include/ +- DESTINATION include ++ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} + FILES_MATCHING + PATTERN "*.h" + PATTERN "CMakeFiles" EXCLUDE +diff --git a/tools/polly/cmake/CMakeLists.txt b/tools/polly/cmake/CMakeLists.txt +index 969292cd6b00..d7aea77bdd20 100644 +--- a/tools/polly/cmake/CMakeLists.txt ++++ b/tools/polly/cmake/CMakeLists.txt +@@ -79,18 +79,18 @@ file(GENERATE + + # Generate PollyConfig.cmake for the install tree. + unset(POLLY_EXPORTS) +-set(POLLY_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}") ++set(POLLY_INSTALL_PREFIX "") + set(POLLY_CONFIG_LLVM_CMAKE_DIR "${LLVM_BINARY_DIR}/${LLVM_INSTALL_PACKAGE_DIR}") +-set(POLLY_CONFIG_CMAKE_DIR "${POLLY_INSTALL_PREFIX}/${POLLY_INSTALL_PACKAGE_DIR}") +-set(POLLY_CONFIG_LIBRARY_DIRS "${POLLY_INSTALL_PREFIX}/lib${LLVM_LIBDIR_SUFFIX}") ++set(POLLY_CONFIG_CMAKE_DIR "${POLLY_INSTALL_PREFIX}${CMAKE_INSTALL_PREFIX}/${POLLY_INSTALL_PACKAGE_DIR}") ++set(POLLY_CONFIG_LIBRARY_DIRS "${POLLY_INSTALL_PREFIX}${CMAKE_INSTALL_FULL_LIBDIR}${LLVM_LIBDIR_SUFFIX}") + if (POLLY_BUNDLED_ISL) + set(POLLY_CONFIG_INCLUDE_DIRS +- "${POLLY_INSTALL_PREFIX}/include" +- "${POLLY_INSTALL_PREFIX}/include/polly" ++ "${POLLY_INSTALL_PREFIX}${CMAKE_INSTALL_FULL_LIBDIR}" ++ "${POLLY_INSTALL_PREFIX}${CMAKE_INSTALL_FULL_LIBDIR}/polly" + ) + else() + set(POLLY_CONFIG_INCLUDE_DIRS +- "${POLLY_INSTALL_PREFIX}/include" ++ "${POLLY_INSTALL_PREFIX}${CMAKE_INSTALL_FULL_INCLUDEDIR}" + ${ISL_INCLUDE_DIRS} + ) + endif() +@@ -100,12 +100,12 @@ endif() + foreach(tgt IN LISTS POLLY_CONFIG_EXPORTED_TARGETS) + get_target_property(tgt_type ${tgt} TYPE) + if (tgt_type STREQUAL "EXECUTABLE") +- set(tgt_prefix "bin/") ++ set(tgt_prefix "${CMAKE_INSTALL_BINDIR}/") + else() +- set(tgt_prefix "lib/") ++ set(tgt_prefix "${CMAKE_INSTALL_LIBDIR}/") + endif() + +- set(tgt_path "${CMAKE_INSTALL_PREFIX}/${tgt_prefix}$") ++ set(tgt_path "${tgt_prefix}$") + file(RELATIVE_PATH tgt_path ${POLLY_CONFIG_CMAKE_DIR} ${tgt_path}) + + if (NOT tgt_type STREQUAL "INTERFACE_LIBRARY") +diff --git a/tools/polly/cmake/polly_macros.cmake b/tools/polly/cmake/polly_macros.cmake +index e48203871884..5bc8a2a52541 100644 +--- a/tools/polly/cmake/polly_macros.cmake ++++ b/tools/polly/cmake/polly_macros.cmake +@@ -44,8 +44,8 @@ macro(add_polly_library name) + if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY OR ${name} STREQUAL "LLVMPolly") + install(TARGETS ${name} + EXPORT LLVMExports +- LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX} +- ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX}) ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}) + endif() + set_property(GLOBAL APPEND PROPERTY LLVM_EXPORTS ${name}) + endmacro(add_polly_library) +diff --git a/tools/polly/lib/External/CMakeLists.txt b/tools/polly/lib/External/CMakeLists.txt +index 8ffd984e542b..261cc19f3238 100644 +--- a/tools/polly/lib/External/CMakeLists.txt ++++ b/tools/polly/lib/External/CMakeLists.txt +@@ -274,7 +274,7 @@ if (POLLY_BUNDLED_ISL) + install(DIRECTORY + ${ISL_SOURCE_DIR}/include/ + ${ISL_BINARY_DIR}/include/ +- DESTINATION include/polly ++ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/polly + FILES_MATCHING + PATTERN "*.h" + PATTERN "CMakeFiles" EXCLUDE diff --git a/pkgs/development/compilers/llvm/7/llvm/gnu-install-dirs.patch b/pkgs/development/compilers/llvm/7/llvm/gnu-install-dirs.patch new file mode 100644 index 00000000000..7e7921e49ab --- /dev/null +++ b/pkgs/development/compilers/llvm/7/llvm/gnu-install-dirs.patch @@ -0,0 +1,386 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index a3d3013cedcd..b298d6ef04af 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -275,15 +275,21 @@ if (CMAKE_BUILD_TYPE AND + message(FATAL_ERROR "Invalid value for CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}") + endif() + ++include(GNUInstallDirs) ++ + set(LLVM_LIBDIR_SUFFIX "" CACHE STRING "Define suffix of library directory name (32/64)" ) + +-set(LLVM_TOOLS_INSTALL_DIR "bin" CACHE STRING "Path for binary subdirectory (defaults to 'bin')") ++set(LLVM_TOOLS_INSTALL_DIR "${CMAKE_INSTALL_BINDIR}" CACHE STRING ++ "Path for binary subdirectory (defaults to 'bin')") + mark_as_advanced(LLVM_TOOLS_INSTALL_DIR) + + set(LLVM_UTILS_INSTALL_DIR "${LLVM_TOOLS_INSTALL_DIR}" CACHE STRING + "Path to install LLVM utilities (enabled by LLVM_INSTALL_UTILS=ON) (defaults to LLVM_TOOLS_INSTALL_DIR)") + mark_as_advanced(LLVM_UTILS_INSTALL_DIR) + ++set(LLVM_INSTALL_CMAKE_DIR "${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}/cmake/llvm" CACHE STRING ++ "Path for CMake subdirectory (defaults to lib/cmake/llvm)" ) ++ + # They are used as destination of target generators. + set(LLVM_RUNTIME_OUTPUT_INTDIR ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bin) + set(LLVM_LIBRARY_OUTPUT_INTDIR ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/lib${LLVM_LIBDIR_SUFFIX}) +@@ -531,9 +537,9 @@ option (LLVM_ENABLE_SPHINX "Use Sphinx to generate llvm documentation." OFF) + option (LLVM_ENABLE_OCAMLDOC "Build OCaml bindings documentation." ON) + option (LLVM_ENABLE_BINDINGS "Build bindings." ON) + +-set(LLVM_INSTALL_DOXYGEN_HTML_DIR "share/doc/llvm/doxygen-html" ++set(LLVM_INSTALL_DOXYGEN_HTML_DIR "${CMAKE_INSTALL_DOCDIR}/${project}/doxygen-html" + CACHE STRING "Doxygen-generated HTML documentation install directory") +-set(LLVM_INSTALL_OCAMLDOC_HTML_DIR "share/doc/llvm/ocaml-html" ++set(LLVM_INSTALL_OCAMLDOC_HTML_DIR "${CMAKE_INSTALL_DOCDIR}/${project}/ocaml-html" + CACHE STRING "OCamldoc-generated HTML documentation install directory") + + option (LLVM_BUILD_EXTERNAL_COMPILER_RT +@@ -966,7 +972,7 @@ endif() + + if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY) + install(DIRECTORY include/llvm include/llvm-c +- DESTINATION include ++ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} + COMPONENT llvm-headers + FILES_MATCHING + PATTERN "*.def" +@@ -978,7 +984,7 @@ if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY) + ) + + install(DIRECTORY ${LLVM_INCLUDE_DIR}/llvm ${LLVM_INCLUDE_DIR}/llvm-c +- DESTINATION include ++ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} + COMPONENT llvm-headers + FILES_MATCHING + PATTERN "*.def" +diff --git a/cmake/modules/AddLLVM.cmake b/cmake/modules/AddLLVM.cmake +index c0f90ba7068d..d656156ff9c8 100644 +--- a/cmake/modules/AddLLVM.cmake ++++ b/cmake/modules/AddLLVM.cmake +@@ -638,11 +638,11 @@ macro(add_llvm_library name) + else() + if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY OR ${name} STREQUAL "LTO" OR + (LLVM_LINK_LLVM_DYLIB AND ${name} STREQUAL "LLVM")) +- set(install_dir lib${LLVM_LIBDIR_SUFFIX}) ++ set(install_dir ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}) + if(ARG_SHARED OR BUILD_SHARED_LIBS) + if(WIN32 OR CYGWIN OR MINGW) + set(install_type RUNTIME) +- set(install_dir bin) ++ set(install_dir ${CMAKE_INSTALL_BINDIR}) + else() + set(install_type LIBRARY) + endif() +@@ -684,9 +684,9 @@ macro(add_llvm_loadable_module name) + if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY) + if(WIN32 OR CYGWIN) + # DLL platform +- set(dlldir "bin") ++ set(dlldir "${CMAKE_INSTALL_BINDIR}") + else() +- set(dlldir "lib${LLVM_LIBDIR_SUFFIX}") ++ set(dlldir "${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}") + endif() + + if(${name} IN_LIST LLVM_DISTRIBUTION_COMPONENTS OR +@@ -698,7 +698,7 @@ macro(add_llvm_loadable_module name) + install(TARGETS ${name} + ${export_to_llvmexports} + LIBRARY DESTINATION ${dlldir} +- ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX}) ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}) + endif() + set_property(GLOBAL APPEND PROPERTY LLVM_EXPORTS ${name}) + endif() +@@ -912,7 +912,7 @@ macro(add_llvm_example name) + endif() + add_llvm_executable(${name} ${ARGN}) + if( LLVM_BUILD_EXAMPLES ) +- install(TARGETS ${name} RUNTIME DESTINATION examples) ++ install(TARGETS ${name} RUNTIME DESTINATION ${CMAKE_INSTALL_DOCDIR}/examples) + endif() + set_target_properties(${name} PROPERTIES FOLDER "Examples") + endmacro(add_llvm_example name) +@@ -1430,7 +1430,7 @@ function(llvm_install_library_symlink name dest type) + set(full_name ${CMAKE_${type}_LIBRARY_PREFIX}${name}${CMAKE_${type}_LIBRARY_SUFFIX}) + set(full_dest ${CMAKE_${type}_LIBRARY_PREFIX}${dest}${CMAKE_${type}_LIBRARY_SUFFIX}) + +- set(output_dir lib${LLVM_LIBDIR_SUFFIX}) ++ set(output_dir ${CMAKE_INSTALL_FULL_LIBDIR}${LLVM_LIBDIR_SUFFIX}) + if(WIN32 AND "${type}" STREQUAL "SHARED") + set(output_dir bin) + endif() +@@ -1446,7 +1446,7 @@ function(llvm_install_library_symlink name dest type) + endif() + endfunction() + +-function(llvm_install_symlink name dest) ++function(llvm_install_symlink name dest output_dir) + cmake_parse_arguments(ARG "ALWAYS_GENERATE" "COMPONENT" "" ${ARGN}) + foreach(path ${CMAKE_MODULE_PATH}) + if(EXISTS ${path}/LLVMInstallSymlink.cmake) +@@ -1469,7 +1469,7 @@ function(llvm_install_symlink name dest) + set(full_dest ${dest}${CMAKE_EXECUTABLE_SUFFIX}) + + install(SCRIPT ${INSTALL_SYMLINK} +- CODE "install_symlink(${full_name} ${full_dest} ${LLVM_TOOLS_INSTALL_DIR})" ++ CODE "install_symlink(${full_name} ${full_dest} ${output_dir})" + COMPONENT ${component}) + + if (NOT CMAKE_CONFIGURATION_TYPES AND NOT ARG_ALWAYS_GENERATE) +@@ -1551,7 +1551,8 @@ function(add_llvm_tool_symlink link_name target) + endif() + + if ((TOOL_IS_TOOLCHAIN OR NOT LLVM_INSTALL_TOOLCHAIN_ONLY) AND LLVM_BUILD_TOOLS) +- llvm_install_symlink(${link_name} ${target}) ++ GNUInstallDirs_get_absolute_install_dir(output_dir LLVM_TOOLS_INSTALL_DIR) ++ llvm_install_symlink(${link_name} ${target} ${output_dir}) + endif() + endif() + endfunction() +@@ -1635,9 +1636,9 @@ function(llvm_setup_rpath name) + + if (APPLE) + set(_install_name_dir INSTALL_NAME_DIR "@rpath") +- set(_install_rpath "@loader_path/../lib" ${extra_libdir}) ++ set(_install_rpath "@loader_path/../${CMAKE_INSTALL_LIBDIR}" ${extra_libdir}) + elseif(UNIX) +- set(_install_rpath "\$ORIGIN/../lib${LLVM_LIBDIR_SUFFIX}" ${extra_libdir}) ++ set(_install_rpath "\$ORIGIN/../${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}" ${extra_libdir}) + if(${CMAKE_SYSTEM_NAME} MATCHES "(FreeBSD|DragonFly)") + set_property(TARGET ${name} APPEND_STRING PROPERTY + LINK_FLAGS " -Wl,-z,origin ") +diff --git a/cmake/modules/AddOCaml.cmake b/cmake/modules/AddOCaml.cmake +index 02bab6846376..eff26adb2efc 100644 +--- a/cmake/modules/AddOCaml.cmake ++++ b/cmake/modules/AddOCaml.cmake +@@ -140,9 +140,9 @@ function(add_ocaml_library name) + endforeach() + + if( APPLE ) +- set(ocaml_rpath "@executable_path/../../../lib${LLVM_LIBDIR_SUFFIX}") ++ set(ocaml_rpath "@executable_path/../../../${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}") + elseif( UNIX ) +- set(ocaml_rpath "\\$ORIGIN/../../../lib${LLVM_LIBDIR_SUFFIX}") ++ set(ocaml_rpath "\\$ORIGIN/../../../${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}") + endif() + list(APPEND ocaml_flags "-ldopt" "-Wl,-rpath,${ocaml_rpath}") + +diff --git a/cmake/modules/AddSphinxTarget.cmake b/cmake/modules/AddSphinxTarget.cmake +index 22e3dcb776aa..ba77b9c195e2 100644 +--- a/cmake/modules/AddSphinxTarget.cmake ++++ b/cmake/modules/AddSphinxTarget.cmake +@@ -73,7 +73,7 @@ function (add_sphinx_target builder project) + + elseif (builder STREQUAL html) + string(TOUPPER "${project}" project_upper) +- set(${project_upper}_INSTALL_SPHINX_HTML_DIR "share/doc/${project}/html" ++ set(${project_upper}_INSTALL_SPHINX_HTML_DIR "${CMAKE_INSTALL_DOCDIR}/${project}/html" + CACHE STRING "HTML documentation install directory for ${project}") + + # '/.' indicates: copy the contents of the directory directly into +diff --git a/cmake/modules/CMakeLists.txt b/cmake/modules/CMakeLists.txt +index 6c316a2f04fb..129c0995059c 100644 +--- a/cmake/modules/CMakeLists.txt ++++ b/cmake/modules/CMakeLists.txt +@@ -1,4 +1,4 @@ +-set(LLVM_INSTALL_PACKAGE_DIR lib${LLVM_LIBDIR_SUFFIX}/cmake/llvm) ++set(LLVM_INSTALL_PACKAGE_DIR ${LLVM_INSTALL_CMAKE_DIR} CACHE STRING "Path for CMake subdirectory (defaults to 'cmake/llvm')") + set(llvm_cmake_builddir "${LLVM_BINARY_DIR}/${LLVM_INSTALL_PACKAGE_DIR}") + + # First for users who use an installed LLVM, create the LLVMExports.cmake file. +@@ -90,11 +90,11 @@ foreach(p ${_count}) + set(LLVM_CONFIG_CODE "${LLVM_CONFIG_CODE} + get_filename_component(LLVM_INSTALL_PREFIX \"\${LLVM_INSTALL_PREFIX}\" PATH)") + endforeach(p) +-set(LLVM_CONFIG_INCLUDE_DIRS "\${LLVM_INSTALL_PREFIX}/include") +-set(LLVM_CONFIG_LIBRARY_DIRS "\${LLVM_INSTALL_PREFIX}/lib\${LLVM_LIBDIR_SUFFIX}") ++set(LLVM_CONFIG_INCLUDE_DIRS "\${LLVM_INSTALL_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR}") ++set(LLVM_CONFIG_LIBRARY_DIRS "\${LLVM_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}\${LLVM_LIBDIR_SUFFIX}") + set(LLVM_CONFIG_CMAKE_DIR "\${LLVM_INSTALL_PREFIX}/${LLVM_INSTALL_PACKAGE_DIR}") + set(LLVM_CONFIG_BINARY_DIR "\${LLVM_INSTALL_PREFIX}") +-set(LLVM_CONFIG_TOOLS_BINARY_DIR "\${LLVM_INSTALL_PREFIX}/bin") ++set(LLVM_CONFIG_TOOLS_BINARY_DIR "\${LLVM_INSTALL_PREFIX}/${CMAKE_INSTALL_BINDIR}") + set(LLVM_CONFIG_EXPORTS_FILE "\${LLVM_CMAKE_DIR}/LLVMExports.cmake") + set(LLVM_CONFIG_EXPORTS "${LLVM_EXPORTS}") + configure_file( +diff --git a/cmake/modules/LLVMInstallSymlink.cmake b/cmake/modules/LLVMInstallSymlink.cmake +index 1a04de931ff7..1c5ea4200635 100644 +--- a/cmake/modules/LLVMInstallSymlink.cmake ++++ b/cmake/modules/LLVMInstallSymlink.cmake +@@ -10,7 +10,7 @@ function(install_symlink name target outdir) + set(LINK_OR_COPY copy) + endif() + +- set(bindir "${DESTDIR}${CMAKE_INSTALL_PREFIX}/${outdir}/") ++ set(bindir "${DESTDIR}${outdir}/") + + message("Creating ${name}") + +diff --git a/docs/CMake.rst b/docs/CMake.rst +index cbcadc212498..a3da96546f43 100644 +--- a/docs/CMake.rst ++++ b/docs/CMake.rst +@@ -196,7 +196,7 @@ CMake manual, or execute ``cmake --help-variable VARIABLE_NAME``. + **LLVM_LIBDIR_SUFFIX**:STRING + Extra suffix to append to the directory where libraries are to be + installed. On a 64-bit architecture, one could use ``-DLLVM_LIBDIR_SUFFIX=64`` +- to install libraries to ``/usr/lib64``. ++ to install libraries to ``/usr/lib64``. See also ``CMAKE_INSTALL_LIBDIR``. + + **CMAKE_C_FLAGS**:STRING + Extra flags to use when compiling C source files. +@@ -473,8 +473,8 @@ LLVM-specific variables + + **LLVM_INSTALL_DOXYGEN_HTML_DIR**:STRING + The path to install Doxygen-generated HTML documentation to. This path can +- either be absolute or relative to the CMAKE_INSTALL_PREFIX. Defaults to +- `share/doc/llvm/doxygen-html`. ++ either be absolute or relative to the ``CMAKE_INSTALL_PREFIX``. Defaults to ++ `${CMAKE_INSTALL_DOCDIR}/${project}/doxygen-html`. + + **LLVM_ENABLE_SPHINX**:BOOL + If specified, CMake will search for the ``sphinx-build`` executable and will make +@@ -505,13 +505,33 @@ LLVM-specific variables + + **LLVM_INSTALL_SPHINX_HTML_DIR**:STRING + The path to install Sphinx-generated HTML documentation to. This path can +- either be absolute or relative to the CMAKE_INSTALL_PREFIX. Defaults to +- `share/doc/llvm/html`. ++ either be absolute or relative to the ``CMAKE_INSTALL_PREFIX``. Defaults to ++ `${CMAKE_INSTALL_DOCDIR}/${project}/html`. + + **LLVM_INSTALL_OCAMLDOC_HTML_DIR**:STRING + The path to install OCamldoc-generated HTML documentation to. This path can +- either be absolute or relative to the CMAKE_INSTALL_PREFIX. Defaults to +- `share/doc/llvm/ocaml-html`. ++ either be absolute or relative to the ``CMAKE_INSTALL_PREFIX``. Defaults to ++ `${CMAKE_INSTALL_DOCDIR}/${project}/ocaml-html`. ++ ++**CMAKE_INSTALL_BINDIR**:STRING ++ The path to install binary tools, relative to the ``CMAKE_INSTALL_PREFIX``. ++ Defaults to `bin`. ++ ++**CMAKE_INSTALL_LIBDIR**:STRING ++ The path to install libraries, relative to the ``CMAKE_INSTALL_PREFIX``. ++ Defaults to `lib`. ++ ++**CMAKE_INSTALL_INCLUDEDIR**:STRING ++ The path to install header files, relative to the ``CMAKE_INSTALL_PREFIX``. ++ Defaults to `include`. ++ ++**CMAKE_INSTALL_DOCDIR**:STRING ++ The path to install documentation, relative to the ``CMAKE_INSTALL_PREFIX``. ++ Defaults to `share/doc`. ++ ++**CMAKE_INSTALL_MANDIR**:STRING ++ The path to install manpage files, relative to the ``CMAKE_INSTALL_PREFIX``. ++ Defaults to `share/man`. + + **LLVM_CREATE_XCODE_TOOLCHAIN**:BOOL + OS X Only: If enabled CMake will generate a target named +@@ -676,9 +696,11 @@ the ``cmake`` command or by setting it directly in ``ccmake`` or ``cmake-gui``). + + This file is available in two different locations. + +-* ``/lib/cmake/llvm/LLVMConfig.cmake`` where +- ```` is the install prefix of an installed version of LLVM. +- On Linux typically this is ``/usr/lib/cmake/llvm/LLVMConfig.cmake``. ++* ``LLVMConfig.cmake`` where ++ ```` is the location where LLVM CMake modules are ++ installed as part of an installed version of LLVM. This is typically ++ ``cmake/llvm/`` within the lib directory. On Linux, this is typically ++ ``/usr/lib/cmake/llvm/LLVMConfig.cmake``. + + * ``/lib/cmake/llvm/LLVMConfig.cmake`` where + ```` is the root of the LLVM build tree. **Note: this is only +diff --git a/include/llvm/CMakeLists.txt b/include/llvm/CMakeLists.txt +index 1d5ca3ba92b0..026f5453c1da 100644 +--- a/include/llvm/CMakeLists.txt ++++ b/include/llvm/CMakeLists.txt +@@ -4,5 +4,5 @@ add_subdirectory(Support) + # If we're doing an out-of-tree build, copy a module map for generated + # header files into the build area. + if (NOT "${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}") +- configure_file(module.modulemap.build module.modulemap COPYONLY) ++ configure_file(module.modulemap.build ${LLVM_INCLUDE_DIR}/module.modulemap COPYONLY) + endif (NOT "${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}") +diff --git a/tools/llvm-config/BuildVariables.inc.in b/tools/llvm-config/BuildVariables.inc.in +index f201e1f7bff0..4582ed556a02 100644 +--- a/tools/llvm-config/BuildVariables.inc.in ++++ b/tools/llvm-config/BuildVariables.inc.in +@@ -24,6 +24,10 @@ + #define LLVM_CXXFLAGS "@LLVM_CXXFLAGS@" + #define LLVM_BUILDMODE "@LLVM_BUILDMODE@" + #define LLVM_LIBDIR_SUFFIX "@LLVM_LIBDIR_SUFFIX@" ++#define LLVM_INSTALL_BINDIR "@CMAKE_INSTALL_BINDIR@" ++#define LLVM_INSTALL_LIBDIR "@CMAKE_INSTALL_LIBDIR@" ++#define LLVM_INSTALL_INCLUDEDIR "@CMAKE_INSTALL_INCLUDEDIR@" ++#define LLVM_INSTALL_CMAKEDIR "@LLVM_INSTALL_CMAKE_DIR@" + #define LLVM_TARGETS_BUILT "@LLVM_TARGETS_BUILT@" + #define LLVM_SYSTEM_LIBS "@LLVM_SYSTEM_LIBS@" + #define LLVM_BUILD_SYSTEM "@LLVM_BUILD_SYSTEM@" +diff --git a/tools/llvm-config/llvm-config.cpp b/tools/llvm-config/llvm-config.cpp +index 892adc3b9dd8..cabe7fcc630f 100644 +--- a/tools/llvm-config/llvm-config.cpp ++++ b/tools/llvm-config/llvm-config.cpp +@@ -333,12 +333,26 @@ int main(int argc, char **argv) { + ("-I" + ActiveIncludeDir + " " + "-I" + ActiveObjRoot + "/include"); + } else { + ActivePrefix = CurrentExecPrefix; +- ActiveIncludeDir = ActivePrefix + "/include"; +- SmallString<256> path(StringRef(LLVM_TOOLS_INSTALL_DIR)); +- sys::fs::make_absolute(ActivePrefix, path); +- ActiveBinDir = path.str(); +- ActiveLibDir = ActivePrefix + "/lib" + LLVM_LIBDIR_SUFFIX; +- ActiveCMakeDir = ActiveLibDir + "/cmake/llvm"; ++ { ++ SmallString<256> path(StringRef(LLVM_INSTALL_INCLUDEDIR)); ++ sys::fs::make_absolute(ActivePrefix, path); ++ ActiveIncludeDir = std::string(path.str()); ++ } ++ { ++ SmallString<256> path(StringRef(LLVM_INSTALL_BINDIR)); ++ sys::fs::make_absolute(ActivePrefix, path); ++ ActiveBinDir = std::string(path.str()); ++ } ++ { ++ SmallString<256> path(StringRef(LLVM_INSTALL_LIBDIR LLVM_LIBDIR_SUFFIX)); ++ sys::fs::make_absolute(ActivePrefix, path); ++ ActiveLibDir = std::string(path.str()); ++ } ++ { ++ SmallString<256> path(StringRef(LLVM_INSTALL_CMAKEDIR)); ++ sys::fs::make_absolute(ActivePrefix, path); ++ ActiveCMakeDir = std::string(path.str()); ++ } + ActiveIncludeOption = "-I" + ActiveIncludeDir; + } + +diff --git a/tools/lto/CMakeLists.txt b/tools/lto/CMakeLists.txt +index 6e913519a809..85641eef721f 100644 +--- a/tools/lto/CMakeLists.txt ++++ b/tools/lto/CMakeLists.txt +@@ -19,7 +19,7 @@ set(LLVM_EXPORTED_SYMBOL_FILE ${CMAKE_CURRENT_SOURCE_DIR}/lto.exports) + add_llvm_library(LTO SHARED ${SOURCES} DEPENDS intrinsics_gen) + + install(FILES ${LLVM_MAIN_INCLUDE_DIR}/llvm-c/lto.h +- DESTINATION include/llvm-c ++ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/llvm-c + COMPONENT LTO) + + if (APPLE) +diff --git a/tools/opt-viewer/CMakeLists.txt b/tools/opt-viewer/CMakeLists.txt +index 19b606933082..27b9f71b3d79 100644 +--- a/tools/opt-viewer/CMakeLists.txt ++++ b/tools/opt-viewer/CMakeLists.txt +@@ -8,6 +8,6 @@ set (files + + foreach (file ${files}) + install(PROGRAMS ${file} +- DESTINATION share/opt-viewer ++ DESTINATION ${CMAKE_INSTALL_DATADIR}/opt-viewer + COMPONENT opt-viewer) + endforeach (file) diff --git a/pkgs/development/compilers/llvm/8/clang/default.nix b/pkgs/development/compilers/llvm/8/clang/default.nix index 8f44ffc0615..c82b3e873e8 100644 --- a/pkgs/development/compilers/llvm/8/clang/default.nix +++ b/pkgs/development/compilers/llvm/8/clang/default.nix @@ -1,4 +1,5 @@ -{ lib, stdenv, fetch, cmake, libxml2, llvm, version, clang-tools-extra_src, python3, lld +{ lib, stdenv, fetch, cmake, libxml2, libllvm, version, clang-tools-extra_src, python3 +, buildLlvmTools , fixDarwinDylibNames , enableManpages ? false , enablePolly ? false # TODO: get this info from llvm (passthru?) @@ -23,18 +24,22 @@ let ++ lib.optional enableManpages python3.pkgs.sphinx ++ lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames; - buildInputs = [ libxml2 llvm lld ]; + buildInputs = [ libxml2 libllvm ]; cmakeFlags = [ "-DCMAKE_CXX_FLAGS=-std=c++11" "-DCLANGD_BUILD_XPC=OFF" "-DLLVM_ENABLE_RTTI=ON" + "-DLLVM_CONFIG_PATH=${libllvm.dev}/bin/llvm-config${lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) "-native"}" ] ++ lib.optionals enableManpages [ "-DCLANG_INCLUDE_DOCS=ON" "-DLLVM_ENABLE_SPHINX=ON" "-DSPHINX_OUTPUT_MAN=ON" "-DSPHINX_OUTPUT_HTML=OFF" "-DSPHINX_WARNINGS_AS_ERRORS=OFF" + ] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ + "-DLLVM_TABLEGEN_EXE=${buildLlvmTools.llvm}/bin/llvm-tblgen" + "-DCLANG_TABLEGEN=${buildLlvmTools.libclang.dev}/bin/clang-tblgen" ] ++ lib.optionals enablePolly [ "-DWITH_POLLY=ON" "-DLINK_POLLY_INTO_TOOLS=ON" @@ -42,7 +47,7 @@ let patches = [ ./purity.patch - ./clang-xpc.patch + ./xpc.patch # Backport for -static-pie, which the latter touches, and which is nice in # its own right. ./static-pie.patch @@ -53,6 +58,7 @@ let ./compiler-rt-baremetal.patch # make clang -xhip use $PATH to find executables ./HIP-use-PATH-8.patch + ./gnu-install-dirs.patch ]; postPatch = '' @@ -69,12 +75,12 @@ let --replace "NOT HAVE_CXX_ATOMICS64_WITHOUT_LIB" FALSE ''; - outputs = [ "out" "lib" "python" ]; + outputs = [ "out" "lib" "dev" "python" ]; # Clang expects to find LLVMgold in its own prefix postInstall = '' - if [ -e ${llvm}/lib/LLVMgold.so ]; then - ln -sv ${llvm}/lib/LLVMgold.so $out/lib + 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 @@ -91,11 +97,14 @@ let fi mv $out/share/clang/*.py $python/share/clang rm $out/bin/c-index-test + + mkdir -p $dev/bin + cp bin/clang-tblgen $dev/bin ''; passthru = { isClang = true; - inherit llvm; + inherit libllvm; }; meta = { diff --git a/pkgs/development/compilers/llvm/8/clang/gnu-install-dirs.patch b/pkgs/development/compilers/llvm/8/clang/gnu-install-dirs.patch new file mode 100644 index 00000000000..e4b9c3f8ddd --- /dev/null +++ b/pkgs/development/compilers/llvm/8/clang/gnu-install-dirs.patch @@ -0,0 +1,290 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index c2016a45ca6b..9224797da0b5 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -9,6 +9,8 @@ endif() + if( CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR ) + project(Clang) + ++ include(GNUInstallDirs) ++ + # Rely on llvm-config. + set(CONFIG_OUTPUT) + if(LLVM_CONFIG) +@@ -382,7 +384,7 @@ include_directories(BEFORE + + if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY) + install(DIRECTORY include/clang include/clang-c +- DESTINATION include ++ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} + FILES_MATCHING + PATTERN "*.def" + PATTERN "*.h" +@@ -391,7 +393,7 @@ if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY) + ) + + install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/include/clang +- DESTINATION include ++ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} + FILES_MATCHING + PATTERN "CMakeFiles" EXCLUDE + PATTERN "*.inc" +@@ -399,7 +401,7 @@ if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY) + ) + + install(PROGRAMS utils/bash-autocomplete.sh +- DESTINATION share/clang ++ DESTINATION ${CMAKE_INSTALL_DATADIR}/clang + ) + endif() + +diff --git a/cmake/modules/AddClang.cmake b/cmake/modules/AddClang.cmake +index 7e22f16f365b..3c0c1d245969 100644 +--- a/cmake/modules/AddClang.cmake ++++ b/cmake/modules/AddClang.cmake +@@ -99,9 +99,9 @@ macro(add_clang_library name) + install(TARGETS ${name} + COMPONENT ${name} + ${export_to_clangtargets} +- LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX} +- ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX} +- RUNTIME DESTINATION bin) ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX} ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) + + if (${ARG_SHARED} AND NOT CMAKE_CONFIGURATION_TYPES) + add_llvm_install_targets(install-${name} +@@ -142,7 +142,7 @@ macro(add_clang_tool name) + + install(TARGETS ${name} + ${export_to_clangtargets} +- RUNTIME DESTINATION bin ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + COMPONENT ${name}) + + if(NOT CMAKE_CONFIGURATION_TYPES) +@@ -157,5 +157,5 @@ endmacro() + macro(add_clang_symlink name dest) + add_llvm_tool_symlink(${name} ${dest} ALWAYS_GENERATE) + # Always generate install targets +- llvm_install_symlink(${name} ${dest} ALWAYS_GENERATE) ++ llvm_install_symlink(${name} ${dest} ${CMAKE_INSTALL_FULL_BINDIR} ALWAYS_GENERATE) + endmacro() +diff --git a/lib/Headers/CMakeLists.txt b/lib/Headers/CMakeLists.txt +index e444c9c8706f..f8e4d06366a4 100644 +--- a/lib/Headers/CMakeLists.txt ++++ b/lib/Headers/CMakeLists.txt +@@ -164,19 +164,19 @@ install( + FILES ${files} ${CMAKE_CURRENT_BINARY_DIR}/arm_neon.h + COMPONENT clang-headers + PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ +- DESTINATION lib${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION}/include) ++ DESTINATION ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION}/include) + + install( + FILES ${files} ${CMAKE_CURRENT_BINARY_DIR}/arm_fp16.h + COMPONENT clang-headers + PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ +- DESTINATION lib${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION}/include) ++ DESTINATION ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION}/include) + + install( + FILES ${cuda_wrapper_files} + COMPONENT clang-headers + PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ +- DESTINATION lib${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION}/include/cuda_wrappers) ++ DESTINATION ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION}/include/cuda_wrappers) + + if (NOT CMAKE_CONFIGURATION_TYPES) # don't add this for IDE's. + add_llvm_install_targets(install-clang-headers +diff --git a/tools/c-index-test/CMakeLists.txt b/tools/c-index-test/CMakeLists.txt +index 53e3421f1b35..79ae5bb4c399 100644 +--- a/tools/c-index-test/CMakeLists.txt ++++ b/tools/c-index-test/CMakeLists.txt +@@ -54,7 +54,7 @@ if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY) + set_property(TARGET c-index-test APPEND PROPERTY INSTALL_RPATH + "@executable_path/../../lib") + else() +- set(INSTALL_DESTINATION bin) ++ set(INSTALL_DESTINATION ${CMAKE_INSTALL_BINDIR}) + endif() + + install(TARGETS c-index-test +diff --git a/tools/clang-check/CMakeLists.txt b/tools/clang-check/CMakeLists.txt +index b837b0a0a5d9..9e30bd5780a5 100644 +--- a/tools/clang-check/CMakeLists.txt ++++ b/tools/clang-check/CMakeLists.txt +@@ -21,4 +21,4 @@ target_link_libraries(clang-check + ) + + install(TARGETS clang-check +- RUNTIME DESTINATION bin) ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) +diff --git a/tools/clang-extdef-mapping/CMakeLists.txt b/tools/clang-extdef-mapping/CMakeLists.txt +index 6c81689a831a..dacc14737719 100644 +--- a/tools/clang-extdef-mapping/CMakeLists.txt ++++ b/tools/clang-extdef-mapping/CMakeLists.txt +@@ -18,4 +18,4 @@ target_link_libraries(clang-extdef-mapping + ) + + install(TARGETS clang-extdef-mapping +- RUNTIME DESTINATION bin) ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) +diff --git a/tools/clang-format/CMakeLists.txt b/tools/clang-format/CMakeLists.txt +index a295e8cd0b2a..1973ff82c7f6 100644 +--- a/tools/clang-format/CMakeLists.txt ++++ b/tools/clang-format/CMakeLists.txt +@@ -21,20 +21,20 @@ if( LLVM_LIB_FUZZING_ENGINE OR LLVM_USE_SANITIZE_COVERAGE ) + endif() + + install(PROGRAMS clang-format-bbedit.applescript +- DESTINATION share/clang ++ DESTINATION ${CMAKE_INSTALL_DATADIR}/clang + COMPONENT clang-format) + install(PROGRAMS clang-format-diff.py +- DESTINATION share/clang ++ DESTINATION ${CMAKE_INSTALL_DATADIR}/clang + COMPONENT clang-format) + install(PROGRAMS clang-format-sublime.py +- DESTINATION share/clang ++ DESTINATION ${CMAKE_INSTALL_DATADIR}/clang + COMPONENT clang-format) + install(PROGRAMS clang-format.el +- DESTINATION share/clang ++ DESTINATION ${CMAKE_INSTALL_DATADIR}/clang + COMPONENT clang-format) + install(PROGRAMS clang-format.py +- DESTINATION share/clang ++ DESTINATION ${CMAKE_INSTALL_DATADIR}/clang + COMPONENT clang-format) + install(PROGRAMS git-clang-format +- DESTINATION bin ++ DESTINATION ${CMAKE_INSTALL_BINDIR} + COMPONENT clang-format) +diff --git a/tools/clang-offload-bundler/CMakeLists.txt b/tools/clang-offload-bundler/CMakeLists.txt +index 8718015be76a..7a038f39622e 100644 +--- a/tools/clang-offload-bundler/CMakeLists.txt ++++ b/tools/clang-offload-bundler/CMakeLists.txt +@@ -22,4 +22,4 @@ target_link_libraries(clang-offload-bundler + ${CLANG_OFFLOAD_BUNDLER_LIB_DEPS} + ) + +-install(TARGETS clang-offload-bundler RUNTIME DESTINATION bin) ++install(TARGETS clang-offload-bundler RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) +diff --git a/tools/clang-rename/CMakeLists.txt b/tools/clang-rename/CMakeLists.txt +index 45cbd763425c..f534e022024a 100644 +--- a/tools/clang-rename/CMakeLists.txt ++++ b/tools/clang-rename/CMakeLists.txt +@@ -19,8 +19,8 @@ target_link_libraries(clang-rename + ) + + install(PROGRAMS clang-rename.py +- DESTINATION share/clang ++ DESTINATION ${CMAKE_INSTALL_DATADIR}/clang + COMPONENT clang-rename) + install(PROGRAMS clang-rename.el +- DESTINATION share/clang ++ DESTINATION ${CMAKE_INSTALL_DATADIR}/clang + COMPONENT clang-rename) +diff --git a/tools/diagtool/CMakeLists.txt b/tools/diagtool/CMakeLists.txt +index 96d1c390249c..41c762b37b76 100644 +--- a/tools/diagtool/CMakeLists.txt ++++ b/tools/diagtool/CMakeLists.txt +@@ -21,7 +21,7 @@ target_link_libraries(diagtool + if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY) + install(TARGETS diagtool + COMPONENT diagtool +- RUNTIME DESTINATION bin) ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) + + if (NOT CMAKE_CONFIGURATION_TYPES) + add_llvm_install_targets(install-diagtool +diff --git a/tools/libclang/CMakeLists.txt b/tools/libclang/CMakeLists.txt +index 32333b011ad1..258dfb2d520c 100644 +--- a/tools/libclang/CMakeLists.txt ++++ b/tools/libclang/CMakeLists.txt +@@ -131,7 +131,7 @@ endif() + if(INTERNAL_INSTALL_PREFIX) + set(LIBCLANG_HEADERS_INSTALL_DESTINATION "${INTERNAL_INSTALL_PREFIX}/include") + else() +- set(LIBCLANG_HEADERS_INSTALL_DESTINATION include) ++ set(LIBCLANG_HEADERS_INSTALL_DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) + endif() + + install(DIRECTORY ../../include/clang-c +@@ -162,7 +162,7 @@ foreach(PythonVersion ${CLANG_PYTHON_BINDINGS_VERSIONS}) + COMPONENT + libclang-python-bindings + DESTINATION +- "lib${LLVM_LIBDIR_SUFFIX}/python${PythonVersion}/site-packages") ++ "${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}/python${PythonVersion}/site-packages") + endforeach() + if(NOT CMAKE_CONFIGURATION_TYPES) + add_custom_target(libclang-python-bindings) +diff --git a/tools/scan-build/CMakeLists.txt b/tools/scan-build/CMakeLists.txt +index 380379300b09..adfd58ed5f7d 100644 +--- a/tools/scan-build/CMakeLists.txt ++++ b/tools/scan-build/CMakeLists.txt +@@ -41,7 +41,7 @@ if(CLANG_INSTALL_SCANBUILD) + ${CMAKE_BINARY_DIR}/bin/ + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/bin/${BinFile}) + list(APPEND Depends ${CMAKE_BINARY_DIR}/bin/${BinFile}) +- install(PROGRAMS bin/${BinFile} DESTINATION bin) ++ install(PROGRAMS bin/${BinFile} DESTINATION ${CMAKE_INSTALL_BINDIR}) + endforeach() + + foreach(LibexecFile ${LibexecFiles}) +@@ -53,7 +53,7 @@ if(CLANG_INSTALL_SCANBUILD) + ${CMAKE_BINARY_DIR}/libexec/ + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/libexec/${LibexecFile}) + list(APPEND Depends ${CMAKE_BINARY_DIR}/libexec/${LibexecFile}) +- install(PROGRAMS libexec/${LibexecFile} DESTINATION libexec) ++ install(PROGRAMS libexec/${LibexecFile} DESTINATION ${CMAKE_INSTALL_LIBEXECDIR}) + endforeach() + + foreach(ManPage ${ManPages}) +@@ -77,7 +77,7 @@ if(CLANG_INSTALL_SCANBUILD) + ${CMAKE_BINARY_DIR}/share/scan-build/ + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/share/scan-build/${ShareFile}) + list(APPEND Depends ${CMAKE_BINARY_DIR}/share/scan-build/${ShareFile}) +- install(FILES share/scan-build/${ShareFile} DESTINATION share/scan-build) ++ install(FILES share/scan-build/${ShareFile} DESTINATION ${CMAKE_INSTALL_DATADIR}/scan-build) + endforeach() + + add_custom_target(scan-build ALL DEPENDS ${Depends}) +diff --git a/tools/scan-view/CMakeLists.txt b/tools/scan-view/CMakeLists.txt +index b305ca562a72..554bcb379061 100644 +--- a/tools/scan-view/CMakeLists.txt ++++ b/tools/scan-view/CMakeLists.txt +@@ -21,7 +21,7 @@ if(CLANG_INSTALL_SCANVIEW) + ${CMAKE_BINARY_DIR}/bin/ + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/bin/${BinFile}) + list(APPEND Depends ${CMAKE_BINARY_DIR}/bin/${BinFile}) +- install(PROGRAMS bin/${BinFile} DESTINATION bin) ++ install(PROGRAMS bin/${BinFile} DESTINATION ${CMAKE_INSTALL_BINDIR}) + endforeach() + + foreach(ShareFile ${ShareFiles}) +@@ -33,7 +33,7 @@ if(CLANG_INSTALL_SCANVIEW) + ${CMAKE_BINARY_DIR}/share/scan-view/ + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/share/${ShareFile}) + list(APPEND Depends ${CMAKE_BINARY_DIR}/share/scan-view/${ShareFile}) +- install(FILES share/${ShareFile} DESTINATION share/scan-view) ++ install(FILES share/${ShareFile} DESTINATION ${CMAKE_INSTALL_DATADIR}/scan-view) + endforeach() + + add_custom_target(scan-view ALL DEPENDS ${Depends}) +diff --git a/utils/hmaptool/CMakeLists.txt b/utils/hmaptool/CMakeLists.txt +index 5573009d343a..24b3a90f233f 100644 +--- a/utils/hmaptool/CMakeLists.txt ++++ b/utils/hmaptool/CMakeLists.txt +@@ -9,7 +9,7 @@ add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bin/${CLANG_HM + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${CLANG_HMAPTOOL}) + + list(APPEND Depends ${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bin/${CLANG_HMAPTOOL}) +-install(PROGRAMS ${CLANG_HMAPTOOL} DESTINATION bin) ++install(PROGRAMS ${CLANG_HMAPTOOL} DESTINATION ${CMAKE_INSTALL_BINDIR}) + + add_custom_target(hmaptool ALL DEPENDS ${Depends}) + set_target_properties(hmaptool PROPERTIES FOLDER "Utils") diff --git a/pkgs/development/compilers/llvm/8/clang/clang-xpc.patch b/pkgs/development/compilers/llvm/8/clang/xpc.patch similarity index 100% rename from pkgs/development/compilers/llvm/8/clang/clang-xpc.patch rename to pkgs/development/compilers/llvm/8/clang/xpc.patch diff --git a/pkgs/development/compilers/llvm/8/compiler-rt/default.nix b/pkgs/development/compilers/llvm/8/compiler-rt/default.nix index 3da3d59d111..0f07e78dded 100644 --- a/pkgs/development/compilers/llvm/8/compiler-rt/default.nix +++ b/pkgs/development/compilers/llvm/8/compiler-rt/default.nix @@ -13,7 +13,7 @@ stdenv.mkDerivation { inherit version; src = fetch "compiler-rt" "0dqqf8f930l8gag4d9qjgn1n0pj0nbv2anviqqhdi1rkhas8z0hi"; - nativeBuildInputs = [ cmake python3 llvm ]; + nativeBuildInputs = [ cmake python3 llvm.dev ]; buildInputs = lib.optional stdenv.hostPlatform.isDarwin libcxxabi; NIX_CFLAGS_COMPILE = [ @@ -21,6 +21,7 @@ stdenv.mkDerivation { ]; cmakeFlags = [ + "-DCOMPILER_RT_OS_DIR=" "-DCOMPILER_RT_DEFAULT_TARGET_ONLY=ON" "-DCMAKE_C_COMPILER_TARGET=${stdenv.hostPlatform.config}" "-DCMAKE_ASM_COMPILER_TARGET=${stdenv.hostPlatform.config}" @@ -54,6 +55,7 @@ stdenv.mkDerivation { # https://github.com/llvm/llvm-project/commit/947f9692440836dcb8d88b74b69dd379d85974ce ../../common/compiler-rt/glibc.patch ./codesign.patch # Revert compiler-rt commit that makes codesign mandatory + ./gnu-install-dirs.patch ]# ++ lib.optional stdenv.hostPlatform.isMusl ./sanitizers-nongnu.patch ++ lib.optional (useLLVM) ./crtbegin-and-end.patch ++ lib.optional stdenv.hostPlatform.isAarch32 ./armv7l.patch; @@ -79,9 +81,7 @@ stdenv.mkDerivation { ''; # Hack around weird upsream RPATH bug - postInstall = lib.optionalString (stdenv.hostPlatform.isDarwin || stdenv.hostPlatform.isWasm) '' - ln -s "$out/lib"/*/* "$out/lib" - '' + lib.optionalString (useLLVM) '' + postInstall = lib.optionalString (useLLVM) '' ln -s $out/lib/*/clang_rt.crtbegin-*.o $out/lib/crtbegin.o ln -s $out/lib/*/clang_rt.crtend-*.o $out/lib/crtend.o ln -s $out/lib/*/clang_rt.crtbegin_shared-*.o $out/lib/crtbeginS.o diff --git a/pkgs/development/compilers/llvm/8/compiler-rt/gnu-install-dirs.patch b/pkgs/development/compilers/llvm/8/compiler-rt/gnu-install-dirs.patch new file mode 100644 index 00000000000..1c2e7f0b311 --- /dev/null +++ b/pkgs/development/compilers/llvm/8/compiler-rt/gnu-install-dirs.patch @@ -0,0 +1,117 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index aa360a3ef36e..a39676148181 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -8,6 +8,7 @@ cmake_minimum_required(VERSION 3.4.3) + # Check if compiler-rt is built as a standalone project. + if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR OR COMPILER_RT_STANDALONE_BUILD) + project(CompilerRT C CXX ASM) ++ include(GNUInstallDirs) + set(COMPILER_RT_STANDALONE_BUILD TRUE) + set_property(GLOBAL PROPERTY USE_FOLDERS ON) + endif() +diff --git a/cmake/Modules/AddCompilerRT.cmake b/cmake/Modules/AddCompilerRT.cmake +index 81b110203c27..df7598a11caf 100644 +--- a/cmake/Modules/AddCompilerRT.cmake ++++ b/cmake/Modules/AddCompilerRT.cmake +@@ -479,7 +479,7 @@ macro(add_compiler_rt_resource_file target_name file_name component) + add_custom_target(${target_name} DEPENDS ${dst_file}) + # Install in Clang resource directory. + install(FILES ${file_name} +- DESTINATION ${COMPILER_RT_INSTALL_PATH}/share ++ DESTINATION ${COMPILER_RT_INSTALL_PATH}/${CMAKE_INSTALL_FULL_INCLUDEDIR} + COMPONENT ${component}) + add_dependencies(${component} ${target_name}) + +@@ -496,7 +496,7 @@ macro(add_compiler_rt_script name) + add_custom_target(${name} DEPENDS ${dst}) + install(FILES ${dst} + PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE +- DESTINATION ${COMPILER_RT_INSTALL_PATH}/bin) ++ DESTINATION ${COMPILER_RT_INSTALL_PATH}/${CMAKE_INSTALL_FULL_BINDIR}) + endmacro(add_compiler_rt_script src name) + + # Builds custom version of libc++ and installs it in . +diff --git a/cmake/Modules/CompilerRTDarwinUtils.cmake b/cmake/Modules/CompilerRTDarwinUtils.cmake +index 04cc955980fa..a99f6dfb2f82 100644 +--- a/cmake/Modules/CompilerRTDarwinUtils.cmake ++++ b/cmake/Modules/CompilerRTDarwinUtils.cmake +@@ -377,7 +377,7 @@ macro(darwin_add_embedded_builtin_libraries) + set(DARWIN_macho_embedded_LIBRARY_OUTPUT_DIR + ${COMPILER_RT_OUTPUT_DIR}/lib/macho_embedded) + set(DARWIN_macho_embedded_LIBRARY_INSTALL_DIR +- ${COMPILER_RT_INSTALL_PATH}/lib/macho_embedded) ++ ${COMPILER_RT_INSTALL_PATH}/${CMAKE_INSTALL_FULL_LIBDIR}/macho_embedded) + + set(CFLAGS_armv7 "-target thumbv7-apple-darwin-eabi") + set(CFLAGS_i386 "-march=pentium") +diff --git a/cmake/Modules/CompilerRTUtils.cmake b/cmake/Modules/CompilerRTUtils.cmake +index 5348f2064b67..d7b8fe190789 100644 +--- a/cmake/Modules/CompilerRTUtils.cmake ++++ b/cmake/Modules/CompilerRTUtils.cmake +@@ -363,7 +363,7 @@ endfunction() + function(get_compiler_rt_install_dir arch install_dir) + if(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR AND NOT APPLE) + get_compiler_rt_target(${arch} target) +- set(${install_dir} ${COMPILER_RT_INSTALL_PATH}/${target}/lib PARENT_SCOPE) ++ set(${install_dir} ${COMPILER_RT_INSTALL_PATH}/${target}/${CMAKE_INSTALL_FULL_LIBDIR} PARENT_SCOPE) + else() + set(${install_dir} ${COMPILER_RT_LIBRARY_INSTALL_DIR} PARENT_SCOPE) + endif() +diff --git a/cmake/base-config-ix.cmake b/cmake/base-config-ix.cmake +index aeabf17653f5..0a927fbfc750 100644 +--- a/cmake/base-config-ix.cmake ++++ b/cmake/base-config-ix.cmake +@@ -59,11 +59,11 @@ if (LLVM_TREE_AVAILABLE) + else() + # Take output dir and install path from the user. + set(COMPILER_RT_OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR} CACHE PATH +- "Path where built compiler-rt libraries should be stored.") ++ "Path where built compiler-rt build artifacts should be stored.") + set(COMPILER_RT_EXEC_OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR}/bin CACHE PATH + "Path where built compiler-rt executables should be stored.") +- set(COMPILER_RT_INSTALL_PATH ${CMAKE_INSTALL_PREFIX} CACHE PATH +- "Path where built compiler-rt libraries should be installed.") ++ set(COMPILER_RT_INSTALL_PATH "" CACHE PATH ++ "Prefix where built compiler-rt artifacts should be installed, comes before CMAKE_INSTALL_PREFIX.") + option(COMPILER_RT_INCLUDE_TESTS "Generate and build compiler-rt unit tests." OFF) + option(COMPILER_RT_ENABLE_WERROR "Fail and stop if warning is triggered" OFF) + # Use a host compiler to compile/link tests. +@@ -91,7 +91,7 @@ else(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR) + set(COMPILER_RT_LIBRARY_OUTPUT_DIR + ${COMPILER_RT_OUTPUT_DIR}/lib/${COMPILER_RT_OS_DIR}) + set(COMPILER_RT_LIBRARY_INSTALL_DIR +- ${COMPILER_RT_INSTALL_PATH}/lib/${COMPILER_RT_OS_DIR}) ++ ${COMPILER_RT_INSTALL_PATH}/${CMAKE_INSTALL_FULL_LIBDIR}/${COMPILER_RT_OS_DIR}) + endif() + + if(APPLE) +diff --git a/include/CMakeLists.txt b/include/CMakeLists.txt +index c4b93b89a30c..3913dc3a1ee6 100644 +--- a/include/CMakeLists.txt ++++ b/include/CMakeLists.txt +@@ -48,12 +48,12 @@ set_target_properties(compiler-rt-headers PROPERTIES FOLDER "Compiler-RT Misc") + install(FILES ${SANITIZER_HEADERS} + COMPONENT compiler-rt-headers + PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ +- DESTINATION ${COMPILER_RT_INSTALL_PATH}/include/sanitizer) ++ DESTINATION ${COMPILER_RT_INSTALL_PATH}/${CMAKE_INSTALL_FULL_INCLUDEDIR}/sanitizer) + # Install xray headers. + install(FILES ${XRAY_HEADERS} + COMPONENT compiler-rt-headers + PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ +- DESTINATION ${COMPILER_RT_INSTALL_PATH}/include/xray) ++ DESTINATION ${COMPILER_RT_INSTALL_PATH}/${CMAKE_INSTALL_FULL_INCLUDEDIR}/xray) + + if (NOT CMAKE_CONFIGURATION_TYPES) # don't add this for IDEs. + add_custom_target(install-compiler-rt-headers +diff --git a/lib/dfsan/CMakeLists.txt b/lib/dfsan/CMakeLists.txt +index b3ae713cf02c..52b364b900f5 100644 +--- a/lib/dfsan/CMakeLists.txt ++++ b/lib/dfsan/CMakeLists.txt +@@ -54,4 +54,4 @@ add_custom_command(OUTPUT ${dfsan_abilist_filename} + DEPENDS done_abilist.txt libc_ubuntu1404_abilist.txt) + add_dependencies(dfsan dfsan_abilist) + install(FILES ${dfsan_abilist_filename} +- DESTINATION ${COMPILER_RT_INSTALL_PATH}/share) ++ DESTINATION ${COMPILER_RT_INSTALL_PATH}/${CMAKE_INSTALL_FULL_DATADIR}) diff --git a/pkgs/development/compilers/llvm/8/default.nix b/pkgs/development/compilers/llvm/8/default.nix index 6d6d8b4f783..3e7ef892e3d 100644 --- a/pkgs/development/compilers/llvm/8/default.nix +++ b/pkgs/development/compilers/llvm/8/default.nix @@ -1,6 +1,5 @@ { lowPrio, newScope, pkgs, lib, stdenv, cmake, gccForLibs , libxml2, python3, isl, fetchurl, overrideCC, wrapCCWith, wrapBintoolsWith -, buildPackages , buildLlvmTools # tools, but from the previous stage, for cross , targetLlvmLibraries # libraries, but from the next stage, for cross }: @@ -18,43 +17,50 @@ let clang-tools-extra_src = fetch "clang-tools-extra" "1qf3097bc5ia8p6cpmbx985rjr3yaah5s8fc0nv7pw742yv7jw8q"; tools = lib.makeExtensible (tools: let - callPackage = newScope (tools // { inherit stdenv cmake libxml2 python3 isl release_version version fetch; }); + callPackage = newScope (tools // { inherit stdenv cmake libxml2 python3 isl release_version version fetch buildLlvmTools; }); mkExtraBuildCommands = cc: '' rsrc="$out/resource-root" mkdir "$rsrc" - ln -s "${cc}/lib/clang/${release_version}/include" "$rsrc" + ln -s "${cc.lib}/lib/clang/${release_version}/include" "$rsrc" ln -s "${targetLlvmLibraries.compiler-rt.out}/lib" "$rsrc/lib" echo "-resource-dir=$rsrc" >> $out/nix-support/cc-cflags ''; + in { - llvm = callPackage ./llvm { }; + libllvm = callPackage ./llvm { }; - llvm-polly = callPackage ./llvm { enablePolly = true; }; + # `llvm` historically had the binaries. But this migration + # technique also impedes `lib.get*`. Perhaps we will revisit it. + llvm = tools.libllvm.out; - clang-unwrapped = callPackage ./clang { - inherit (tools) lld; + libllvm-polly = callPackage ./llvm { enablePolly = true; }; + + llvm-polly = tools.libllvm-polly.lib; + + libclang = callPackage ./clang { inherit clang-tools-extra_src; }; + + clang-unwrapped = tools.libclang.out; + clang-polly-unwrapped = callPackage ./clang { inherit clang-tools-extra_src; - llvm = tools.llvm-polly; + libllvm = tools.libllvm-polly; enablePolly = true; }; # disabled until recommonmark supports sphinx 3 - #llvm-manpages = lowPrio (tools.llvm.override { + #llvm-manpages = lowPrio (tools.libllvm.override { # enableManpages = true; # python3 = pkgs.python3; # don't use python-boot #}); - clang-manpages = lowPrio (tools.clang-unwrapped.override { + clang-manpages = lowPrio (tools.libclang.override { enableManpages = true; python3 = pkgs.python3; # don't use python-boot }); - libclang = tools.clang-unwrapped.lib; - clang = if stdenv.cc.isGNU then tools.libstdcxxClang else tools.libcxxClang; libstdcxxClang = wrapCCWith rec { diff --git a/pkgs/development/compilers/llvm/8/libc++/default.nix b/pkgs/development/compilers/llvm/8/libc++/default.nix index 70e4d9e1a65..d73600b441d 100644 --- a/pkgs/development/compilers/llvm/8/libc++/default.nix +++ b/pkgs/development/compilers/llvm/8/libc++/default.nix @@ -13,7 +13,11 @@ stdenv.mkDerivation { export LIBCXXABI_INCLUDE_DIR="$PWD/$(ls -d libcxxabi-${version}*)/include" ''; - patches = lib.optional stdenv.hostPlatform.isMusl ../../libcxx-0001-musl-hacks.patch; + outputs = [ "out" "dev" ]; + + patches = [ + ./gnu-install-dirs.patch + ] ++ lib.optional stdenv.hostPlatform.isMusl ../../libcxx-0001-musl-hacks.patch; prePatch = '' substituteInPlace lib/CMakeLists.txt --replace "/usr/lib/libc++" "\''${LIBCXX_LIBCXXABI_LIB_PATH}/libc++" diff --git a/pkgs/development/compilers/llvm/8/libc++/gnu-install-dirs.patch b/pkgs/development/compilers/llvm/8/libc++/gnu-install-dirs.patch new file mode 100644 index 00000000000..6af403ac86b --- /dev/null +++ b/pkgs/development/compilers/llvm/8/libc++/gnu-install-dirs.patch @@ -0,0 +1,72 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 6b83bce1ae72..63cda3e4e80c 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -26,6 +26,8 @@ set(CMAKE_MODULE_PATH + if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR) + project(libcxx CXX C) + ++ include(GNUInstallDirs) ++ + set(PACKAGE_NAME libcxx) + set(PACKAGE_VERSION 8.0.1) + set(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}") +diff --git a/cmake/Modules/HandleLibCXXABI.cmake b/cmake/Modules/HandleLibCXXABI.cmake +index 1c19d7e01af7..9c8aee8e8bb7 100644 +--- a/cmake/Modules/HandleLibCXXABI.cmake ++++ b/cmake/Modules/HandleLibCXXABI.cmake +@@ -59,7 +59,7 @@ macro(setup_abi_lib abidefines abilib abifiles abidirs) + + if (LIBCXX_INSTALL_HEADERS) + install(FILES "${LIBCXX_BINARY_INCLUDE_DIR}/${fpath}" +- DESTINATION ${LIBCXX_INSTALL_HEADER_PREFIX}include/c++/v1/${dstdir} ++ DESTINATION ${LIBCXX_INSTALL_HEADER_PREFIX}${CMAKE_INSTALL_INCLUDEDIR}/c++/v1/${dstdir} + COMPONENT cxx-headers + PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ + ) +diff --git a/include/CMakeLists.txt b/include/CMakeLists.txt +index 73f7cfc4d8e3..92cf0864ac7e 100644 +--- a/include/CMakeLists.txt ++++ b/include/CMakeLists.txt +@@ -243,7 +243,7 @@ if (LIBCXX_INSTALL_HEADERS) + foreach(file ${files}) + get_filename_component(dir ${file} DIRECTORY) + install(FILES ${file} +- DESTINATION ${LIBCXX_INSTALL_HEADER_PREFIX}include/c++/v1/${dir} ++ DESTINATION ${LIBCXX_INSTALL_HEADER_PREFIX}${CMAKE_INSTALL_INCLUDEDIR}/c++/v1/${dir} + COMPONENT cxx-headers + PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ + ) +@@ -252,7 +252,7 @@ if (LIBCXX_INSTALL_HEADERS) + if (LIBCXX_NEEDS_SITE_CONFIG) + # Install the generated header as __config. + install(FILES ${LIBCXX_BINARY_DIR}/__generated_config +- DESTINATION ${LIBCXX_INSTALL_HEADER_PREFIX}include/c++/v1 ++ DESTINATION ${LIBCXX_INSTALL_HEADER_PREFIX}${CMAKE_INSTALL_INCLUDEDIR}/c++/v1 + PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ + RENAME __config + COMPONENT cxx-headers) +diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt +index 24489e8fb5e8..7327e5ee4b85 100644 +--- a/lib/CMakeLists.txt ++++ b/lib/CMakeLists.txt +@@ -414,8 +414,8 @@ if (LIBCXX_INSTALL_LIBRARY) + set(experimental_lib cxx_experimental) + endif() + install(TARGETS ${LIBCXX_INSTALL_TARGETS} ${filesystem_lib} ${experimental_lib} +- LIBRARY DESTINATION ${LIBCXX_INSTALL_PREFIX}lib${LIBCXX_LIBDIR_SUFFIX} COMPONENT cxx +- ARCHIVE DESTINATION ${LIBCXX_INSTALL_PREFIX}lib${LIBCXX_LIBDIR_SUFFIX} COMPONENT cxx ++ LIBRARY DESTINATION ${LIBCXX_INSTALL_PREFIX}${CMAKE_INSTALL_LIBDIR}${LIBCXX_LIBDIR_SUFFIX} COMPONENT cxx ++ ARCHIVE DESTINATION ${LIBCXX_INSTALL_PREFIX}${CMAKE_INSTALL_LIBDIR}${LIBCXX_LIBDIR_SUFFIX} COMPONENT cxx + ) + # NOTE: This install command must go after the cxx install command otherwise + # it will not be executed after the library symlinks are installed. +@@ -423,7 +423,7 @@ if (LIBCXX_INSTALL_LIBRARY) + # Replace the libc++ filename with $ + # after we required CMake 3.0. + install(FILES "${LIBCXX_LIBRARY_DIR}/libc++${CMAKE_SHARED_LIBRARY_SUFFIX}" +- DESTINATION ${LIBCXX_INSTALL_PREFIX}lib${LIBCXX_LIBDIR_SUFFIX} ++ DESTINATION ${LIBCXX_INSTALL_PREFIX}${CMAKE_INSTALL_LIBDIR}${LIBCXX_LIBDIR_SUFFIX} + COMPONENT libcxx) + endif() + endif() diff --git a/pkgs/development/compilers/llvm/8/libc++abi/default.nix b/pkgs/development/compilers/llvm/8/libc++abi/default.nix index bde67f86640..5659bb4f14a 100644 --- a/pkgs/development/compilers/llvm/8/libc++abi/default.nix +++ b/pkgs/development/compilers/llvm/8/libc++abi/default.nix @@ -8,6 +8,25 @@ stdenv.mkDerivation { src = fetch "libcxxabi" "1vznz8n1z1h8af0ga451m98lc2hjnv4fyzl71napsvjhvk4g6nxp"; + outputs = [ "out" "dev" ]; + + postUnpack = '' + unpackFile ${libcxx.src} + unpackFile ${llvm.src} + cmakeFlags+=" -DLLVM_PATH=$PWD/$(ls -d llvm-*) -DLIBCXXABI_LIBCXX_PATH=$PWD/$(ls -d libcxx-*)" + '' + lib.optionalString stdenv.isDarwin '' + export TRIPLE=x86_64-apple-darwin + '' + lib.optionalString stdenv.hostPlatform.isMusl '' + patch -p1 -d $(ls -d libcxx-*) -i ${../../libcxx-0001-musl-hacks.patch} + '' + lib.optionalString stdenv.hostPlatform.isWasm '' + patch -p1 -d $(ls -d llvm-*) -i ${./wasm.patch} + ''; + + patches = [ + ./no-threads.patch + ./gnu-install-dirs.patch + ]; + nativeBuildInputs = [ cmake ]; buildInputs = lib.optional (!stdenv.isDarwin && !stdenv.isFreeBSD && !stdenv.hostPlatform.isWasm) libunwind; @@ -21,20 +40,6 @@ stdenv.mkDerivation { "-DLIBCXXABI_ENABLE_SHARED=OFF" ]; - patches = [ ./no-threads.patch ]; - - postUnpack = '' - unpackFile ${libcxx.src} - unpackFile ${llvm.src} - cmakeFlags+=" -DLLVM_PATH=$PWD/$(ls -d llvm-*) -DLIBCXXABI_LIBCXX_PATH=$PWD/$(ls -d libcxx-*)" - '' + lib.optionalString stdenv.isDarwin '' - export TRIPLE=x86_64-apple-darwin - '' + lib.optionalString stdenv.hostPlatform.isMusl '' - patch -p1 -d $(ls -d libcxx-*) -i ${../../libcxx-0001-musl-hacks.patch} - '' + lib.optionalString stdenv.hostPlatform.isWasm '' - patch -p1 -d $(ls -d llvm-*) -i ${./wasm.patch} - ''; - installPhase = if stdenv.isDarwin then '' for file in lib/*.dylib; do diff --git a/pkgs/development/compilers/llvm/8/libc++abi/gnu-install-dirs.patch b/pkgs/development/compilers/llvm/8/libc++abi/gnu-install-dirs.patch new file mode 100644 index 00000000000..3f924b0efbe --- /dev/null +++ b/pkgs/development/compilers/llvm/8/libc++abi/gnu-install-dirs.patch @@ -0,0 +1,28 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 92c7dc5dc557..556b3e05a042 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -20,6 +20,8 @@ set(CMAKE_MODULE_PATH + if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR) + project(libcxxabi CXX C) + ++ include(GNUInstallDirs) ++ + set(PACKAGE_NAME libcxxabi) + set(PACKAGE_VERSION 8.0.0) + set(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}") +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index 7e21fb2d7926..30711099a19c 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -220,8 +220,8 @@ add_custom_target(cxxabi DEPENDS ${LIBCXXABI_BUILD_TARGETS}) + + if (LIBCXXABI_INSTALL_LIBRARY) + install(TARGETS ${LIBCXXABI_INSTALL_TARGETS} +- LIBRARY DESTINATION ${LIBCXXABI_INSTALL_PREFIX}lib${LIBCXXABI_LIBDIR_SUFFIX} COMPONENT cxxabi +- ARCHIVE DESTINATION ${LIBCXXABI_INSTALL_PREFIX}lib${LIBCXXABI_LIBDIR_SUFFIX} COMPONENT cxxabi ++ LIBRARY DESTINATION ${LIBCXXABI_INSTALL_PREFIX}${CMAKE_INSTALL_LIBDIR}${LIBCXXABI_LIBDIR_SUFFIX} COMPONENT cxxabi ++ ARCHIVE DESTINATION ${LIBCXXABI_INSTALL_PREFIX}${CMAKE_INSTALL_LIBDIR}${LIBCXXABI_LIBDIR_SUFFIX} COMPONENT cxxabi + ) + endif() + diff --git a/pkgs/development/compilers/llvm/8/libunwind/default.nix b/pkgs/development/compilers/llvm/8/libunwind/default.nix index d1bd54fbd34..e38f2072ced 100644 --- a/pkgs/development/compilers/llvm/8/libunwind/default.nix +++ b/pkgs/development/compilers/llvm/8/libunwind/default.nix @@ -2,13 +2,11 @@ , enableShared ? !stdenv.hostPlatform.isStatic }: -stdenv.mkDerivation { +stdenv.mkDerivation rec { pname = "libunwind"; inherit version; - src = fetch "libunwind" "0vhgcgzsb33l83qaikrkj87ypqb48mi607rccczccwiiv8ficw0q"; - - nativeBuildInputs = [ cmake ]; + src = fetch pname "0vhgcgzsb33l83qaikrkj87ypqb48mi607rccczccwiiv8ficw0q"; patches = [ (fetchpatch { @@ -19,7 +17,12 @@ stdenv.mkDerivation { url = "https://github.com/llvm-mirror/libunwind/commit/e050272d2eb57eb4e56a37b429a61df2ebb8aa3e.patch"; sha256 = "1sxyx5xnax8k713jjcxgq3jq3cpnxygs2rcdf5vfja0f2k9jzldl"; }) + ./gnu-install-dirs.patch ]; + outputs = [ "out" "dev" ]; + + nativeBuildInputs = [ cmake ]; + cmakeFlags = lib.optional (!enableShared) "-DLIBUNWIND_ENABLE_SHARED=OFF"; } diff --git a/pkgs/development/compilers/llvm/8/libunwind/gnu-install-dirs.patch b/pkgs/development/compilers/llvm/8/libunwind/gnu-install-dirs.patch new file mode 100644 index 00000000000..ffabba8137d --- /dev/null +++ b/pkgs/development/compilers/llvm/8/libunwind/gnu-install-dirs.patch @@ -0,0 +1,28 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 3d06073cfe74..55c7d1635fcd 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -18,6 +18,8 @@ set(CMAKE_MODULE_PATH + if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR) + project(libunwind) + ++ include(GNUInstallDirs) ++ + # Rely on llvm-config. + set(CONFIG_OUTPUT) + if(NOT LLVM_CONFIG_PATH) +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index f7523f88b6ac..4060dad214de 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -151,8 +151,8 @@ add_custom_target(unwind DEPENDS ${LIBUNWIND_BUILD_TARGETS}) + + if (LIBUNWIND_INSTALL_LIBRARY) + install(TARGETS ${LIBUNWIND_INSTALL_TARGETS} +- LIBRARY DESTINATION ${LIBUNWIND_INSTALL_PREFIX}lib${LIBUNWIND_LIBDIR_SUFFIX} COMPONENT unwind +- ARCHIVE DESTINATION ${LIBUNWIND_INSTALL_PREFIX}lib${LIBUNWIND_LIBDIR_SUFFIX} COMPONENT unwind) ++ LIBRARY DESTINATION ${LIBUNWIND_INSTALL_PREFIX}${CMAKE_INSTALL_LIBDIR}${LIBUNWIND_LIBDIR_SUFFIX} COMPONENT unwind ++ ARCHIVE DESTINATION ${LIBUNWIND_INSTALL_PREFIX}${CMAKE_INSTALL_LIBDIR}${LIBUNWIND_LIBDIR_SUFFIX} COMPONENT unwind) + endif() + + if (NOT CMAKE_CONFIGURATION_TYPES AND LIBUNWIND_INSTALL_LIBRARY) diff --git a/pkgs/development/compilers/llvm/8/lld/default.nix b/pkgs/development/compilers/llvm/8/lld/default.nix index 8009beb7bc1..696403d1bf6 100644 --- a/pkgs/development/compilers/llvm/8/lld/default.nix +++ b/pkgs/development/compilers/llvm/8/lld/default.nix @@ -1,8 +1,9 @@ { lib, stdenv +, buildLlvmTools , fetch , cmake , libxml2 -, llvm +, libllvm , version }: @@ -12,15 +13,20 @@ stdenv.mkDerivation { src = fetch "lld" "121xhxrlvwy3k5nf6p1wv31whxlb635ssfkci8z93mwv4ja1xflz"; + patches = [ + ./gnu-install-dirs.patch + ]; + nativeBuildInputs = [ cmake ]; - buildInputs = [ llvm libxml2 ]; + buildInputs = [ libllvm libxml2 ]; - outputs = [ "out" "dev" ]; + cmakeFlags = [ + "-DLLVM_CONFIG_PATH=${libllvm.dev}/bin/llvm-config${lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) "-native"}" + ] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ + "-DLLVM_TABLEGEN_EXE=${buildLlvmTools.llvm}/bin/llvm-tblgen" + ]; - postInstall = '' - moveToOutput include "$dev" - moveToOutput lib "$dev" - ''; + outputs = [ "out" "lib" "dev" ]; meta = { description = "The LLVM Linker"; diff --git a/pkgs/development/compilers/llvm/8/lld/gnu-install-dirs.patch b/pkgs/development/compilers/llvm/8/lld/gnu-install-dirs.patch new file mode 100644 index 00000000000..acc2d3d4776 --- /dev/null +++ b/pkgs/development/compilers/llvm/8/lld/gnu-install-dirs.patch @@ -0,0 +1,68 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index e2fbdbfbbb47..d601b231ebb8 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -6,6 +6,8 @@ if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR) + set(CMAKE_INCLUDE_CURRENT_DIR ON) + set(LLD_BUILT_STANDALONE TRUE) + ++ include(GNUInstallDirs) ++ + find_program(LLVM_CONFIG_PATH "llvm-config" DOC "Path to llvm-config binary") + if(NOT LLVM_CONFIG_PATH) + message(FATAL_ERROR "llvm-config not found: specify LLVM_CONFIG_PATH") +@@ -203,7 +205,7 @@ include_directories(BEFORE + + if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY) + install(DIRECTORY include/ +- DESTINATION include ++ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} + FILES_MATCHING + PATTERN "*.h" + PATTERN ".svn" EXCLUDE +diff --git a/cmake/modules/AddLLD.cmake b/cmake/modules/AddLLD.cmake +index fa48b428d26b..e7967aad3ceb 100644 +--- a/cmake/modules/AddLLD.cmake ++++ b/cmake/modules/AddLLD.cmake +@@ -20,9 +20,9 @@ macro(add_lld_library name) + install(TARGETS ${name} + COMPONENT ${name} + ${export_to_lldtargets} +- LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX} +- ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX} +- RUNTIME DESTINATION bin) ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX} ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) + + if (${ARG_SHARED} AND NOT CMAKE_CONFIGURATION_TYPES) + add_llvm_install_targets(install-${name} +@@ -54,7 +54,7 @@ macro(add_lld_tool name) + + install(TARGETS ${name} + ${export_to_lldtargets} +- RUNTIME DESTINATION bin ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + COMPONENT ${name}) + + if(NOT CMAKE_CONFIGURATION_TYPES) +@@ -69,5 +69,5 @@ endmacro() + macro(add_lld_symlink name dest) + add_llvm_tool_symlink(${name} ${dest} ALWAYS_GENERATE) + # Always generate install targets +- llvm_install_symlink(${name} ${dest} ALWAYS_GENERATE) ++ llvm_install_symlink(${name} ${dest} ${CMAKE_INSTALL_FULL_BINDIR} ALWAYS_GENERATE) + endmacro() +diff --git a/tools/lld/CMakeLists.txt b/tools/lld/CMakeLists.txt +index d8829493fc22..df748a0e749b 100644 +--- a/tools/lld/CMakeLists.txt ++++ b/tools/lld/CMakeLists.txt +@@ -16,7 +16,7 @@ target_link_libraries(lld + ) + + install(TARGETS lld +- RUNTIME DESTINATION bin) ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) + + if(NOT LLD_SYMLINKS_TO_CREATE) + set(LLD_SYMLINKS_TO_CREATE lld-link ld.lld ld64.lld wasm-ld) diff --git a/pkgs/development/compilers/llvm/8/lldb/default.nix b/pkgs/development/compilers/llvm/8/lldb/default.nix index 83c171d2a57..95bf4aae054 100644 --- a/pkgs/development/compilers/llvm/8/lldb/default.nix +++ b/pkgs/development/compilers/llvm/8/lldb/default.nix @@ -7,47 +7,67 @@ , which , libedit , libxml2 -, llvm -, clang-unwrapped +, libllvm +, libclang , python3 , version , darwin }: -stdenv.mkDerivation { +stdenv.mkDerivation rec { pname = "lldb"; inherit version; src = fetch "lldb" "1mriw4adrwm6kzabrjr7yqmdiylxd6glf6samd80dp8idnm9p9z8"; + patches = [ + ./gnu-install-dirs.patch + ]; + postPatch = '' # Fix up various paths that assume llvm and clang are installed in the same place - sed -i 's,".*ClangConfig.cmake","${clang-unwrapped}/lib/cmake/clang/ClangConfig.cmake",' \ + sed -i 's,".*ClangConfig.cmake","${libclang.dev}/lib/cmake/clang/ClangConfig.cmake",' \ cmake/modules/LLDBStandalone.cmake - sed -i 's,".*tools/clang/include","${clang-unwrapped}/include",' \ + sed -i 's,".*tools/clang/include","${libclang.dev}/include",' \ cmake/modules/LLDBStandalone.cmake - sed -i 's,"$.LLVM_LIBRARY_DIR.",${llvm}/lib ${clang-unwrapped}/lib,' \ + sed -i 's,"$.LLVM_LIBRARY_DIR.",${libllvm.lib}/lib ${libclang.lib}/lib,' \ cmake/modules/LLDBStandalone.cmake ''; - nativeBuildInputs = [ cmake python3 which swig ]; - buildInputs = [ ncurses zlib libedit libxml2 llvm ] - ++ lib.optionals stdenv.isDarwin [ darwin.libobjc darwin.apple_sdk.libs.xpc darwin.apple_sdk.frameworks.Foundation darwin.bootstrap_cmds darwin.apple_sdk.frameworks.Carbon darwin.apple_sdk.frameworks.Cocoa ]; + outputs = [ "out" "lib" "dev" ]; + + nativeBuildInputs = [ + cmake python3 which swig + ]; + + buildInputs = [ + ncurses zlib libedit libxml2 libllvm + ] ++ lib.optionals stdenv.isDarwin [ + darwin.libobjc + darwin.apple_sdk.libs.xpc + darwin.apple_sdk.frameworks.Foundation darwin.bootstrap_cmds darwin.apple_sdk.frameworks.Carbon darwin.apple_sdk.frameworks.Cocoa + ]; CXXFLAGS = "-fno-rtti"; hardeningDisable = [ "format" ]; cmakeFlags = [ + "-DLLDB_INCLUDE_TESTS=${if doCheck then "YES" else "NO"}" "-DLLDB_CODESIGN_IDENTITY=" # codesigning makes nondeterministic + ] ++ lib.optionals doCheck [ + "-DLLDB_TEST_C_COMPILER=${stdenv.cc}/bin/${stdenv.cc.targetPrefix}cc" + "-DLLDB_TEST_CXX_COMPILER=${stdenv.cc}/bin/${stdenv.cc.targetPrefix}c++" ]; + doCheck = false; + postInstall = '' mkdir -p $out/share/man/man1 cp ../docs/lldb.1 $out/share/man/man1/ install -D ../tools/lldb-vscode/package.json $out/share/vscode/extensions/llvm-org.lldb-vscode-0.1.0/package.json - mkdir $out/share/vscode/extensions/llvm-org.lldb-vscode-0.1.0/bin - ln -s $out/bin/lldb-vscode $out/share/vscode/extensions/llvm-org.lldb-vscode-0.1.0/bin + mkdir -p $out/share/vscode/extensions/llvm-org.lldb-vscode-0.1.0/bin + ln -s $out/bin/llvm-vscode $out/share/vscode/extensions/llvm-org.lldb-vscode-0.1.0/bin ''; meta = with lib; { diff --git a/pkgs/development/compilers/llvm/8/lldb/gnu-install-dirs.patch b/pkgs/development/compilers/llvm/8/lldb/gnu-install-dirs.patch new file mode 100644 index 00000000000..b2e79086bed --- /dev/null +++ b/pkgs/development/compilers/llvm/8/lldb/gnu-install-dirs.patch @@ -0,0 +1,81 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index cdf22c4b0fc8..8def776f2b4a 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -7,6 +7,8 @@ set(CMAKE_MODULE_PATH + "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules" + ) + ++include(GNUInstallDirs) ++ + include(LLDBStandalone) + include(LLDBConfig) + include(AddLLDB) +diff --git a/cmake/modules/AddLLDB.cmake b/cmake/modules/AddLLDB.cmake +index f82c11d3d317..776e6d6ef9de 100644 +--- a/cmake/modules/AddLLDB.cmake ++++ b/cmake/modules/AddLLDB.cmake +@@ -63,18 +63,18 @@ function(add_lldb_library name) + set(install_dir ".") + endif() + else() +- set(install_dir lib${LLVM_LIBDIR_SUFFIX}) ++ set(install_dir ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}) + endif() + install(TARGETS ${name} + COMPONENT ${name} +- RUNTIME DESTINATION bin ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${install_dir} + ARCHIVE DESTINATION ${install_dir}) + else() + install(TARGETS ${name} + COMPONENT ${name} +- LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX} +- ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX}) ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}) + endif() + if (NOT CMAKE_CONFIGURATION_TYPES) + add_llvm_install_targets(install-${name} +@@ -122,7 +122,7 @@ function(add_lldb_executable name) + if(ARG_GENERATE_INSTALL) + install(TARGETS ${name} + COMPONENT ${name} +- RUNTIME DESTINATION bin) ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) + if (NOT CMAKE_CONFIGURATION_TYPES) + add_llvm_install_targets(install-${name} + DEPENDS ${name} +diff --git a/cmake/modules/LLDBConfig.cmake b/cmake/modules/LLDBConfig.cmake +index 109c5132d3be..8b9092faa29d 100644 +--- a/cmake/modules/LLDBConfig.cmake ++++ b/cmake/modules/LLDBConfig.cmake +@@ -319,7 +319,7 @@ include_directories(BEFORE + if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY) + install(DIRECTORY include/ + COMPONENT lldb-headers +- DESTINATION include ++ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} + FILES_MATCHING + PATTERN "*.h" + PATTERN ".svn" EXCLUDE +@@ -329,7 +329,7 @@ if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY) + + install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/include/ + COMPONENT lldb-headers +- DESTINATION include ++ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} + FILES_MATCHING + PATTERN "*.h" + PATTERN ".svn" EXCLUDE +diff --git a/tools/intel-features/CMakeLists.txt b/tools/intel-features/CMakeLists.txt +index b5316540fdf3..3c3c882d503f 100644 +--- a/tools/intel-features/CMakeLists.txt ++++ b/tools/intel-features/CMakeLists.txt +@@ -64,4 +64,4 @@ if (NOT LLDB_DISABLE_PYTHON AND LLDB_BUILD_INTEL_PT) + endif() + + install(TARGETS lldbIntelFeatures +- LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX}) ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}) diff --git a/pkgs/development/compilers/llvm/8/llvm/default.nix b/pkgs/development/compilers/llvm/8/llvm/default.nix index c0b88e7ff3e..8ea9b287c7c 100644 --- a/pkgs/development/compilers/llvm/8/llvm/default.nix +++ b/pkgs/development/compilers/llvm/8/llvm/default.nix @@ -1,4 +1,5 @@ { lib, stdenv +, pkgsBuildBuild , fetch , fetchpatch , cmake @@ -11,10 +12,10 @@ , version , release_version , zlib -, buildPackages +, buildLlvmTools , debugVersion ? false , enableManpages ? false -, enableSharedLibraries ? true +, enableSharedLibraries ? !stdenv.hostPlatform.isStatic , enablePFM ? !(stdenv.isDarwin || stdenv.isAarch64 # broken for Ampere eMAG 8180 (c2.large.arm on Packet) #56245 || stdenv.isAarch32 # broken for the armv7l builder @@ -45,8 +46,7 @@ in stdenv.mkDerivation ({ mv polly-* $sourceRoot/tools/polly ''; - outputs = [ "out" "python" ] - ++ optional enableSharedLibraries "lib"; + outputs = [ "out" "lib" "dev" "python" ]; nativeBuildInputs = [ cmake python3 ] ++ optionals enableManpages [ python3.pkgs.sphinx python3.pkgs.recommonmark ]; @@ -62,12 +62,13 @@ in stdenv.mkDerivation ({ url = "https://bugs.gentoo.org/attachment.cgi?id=612792"; sha256 = "0rwx6jpqq4xnf4mvfm8v2d4r34y1yi05am0mx5k2d5bha9j64lqg"; }) - ]; + ./gnu-install-dirs.patch + ] ++ lib.optional enablePolly ./gnu-install-dirs-polly.patch; postPatch = optionalString stdenv.isDarwin '' substituteInPlace cmake/modules/AddLLVM.cmake \ --replace 'set(_install_name_dir INSTALL_NAME_DIR "@rpath")' "set(_install_name_dir)" \ - --replace 'set(_install_rpath "@loader_path/../lib" ''${extra_libdir})' "" + --replace 'set(_install_rpath "@loader_path/../''${CMAKE_INSTALL_LIBDIR}" ''${extra_libdir})' "" '' # Patch llvm-config to return correct library path based on --link-{shared,static}. + optionalString (enableSharedLibraries) '' @@ -96,6 +97,7 @@ in stdenv.mkDerivation ({ ''; cmakeFlags = with stdenv; [ + "-DLLVM_INSTALL_CMAKE_DIR=${placeholder "dev"}/lib/cmake/llvm/" "-DCMAKE_BUILD_TYPE=${if debugVersion then "Debug" else "Release"}" "-DLLVM_INSTALL_UTILS=ON" # Needed by rustc "-DLLVM_BUILD_TESTS=ON" @@ -119,7 +121,20 @@ in stdenv.mkDerivation ({ "-DCAN_TARGET_i386=false" ] ++ optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ "-DCMAKE_CROSSCOMPILING=True" - "-DLLVM_TABLEGEN=${buildPackages.llvm_8}/bin/llvm-tblgen" + "-DLLVM_TABLEGEN=${buildLlvmTools.llvm}/bin/llvm-tblgen" + ( + let + nativeCC = pkgsBuildBuild.targetPackages.stdenv.cc; + nativeBintools = nativeCC.bintools.bintools; + nativeToolchainFlags = [ + "-DCMAKE_C_COMPILER=${nativeCC}/bin/${nativeCC.targetPrefix}cc" + "-DCMAKE_CXX_COMPILER=${nativeCC}/bin/${nativeCC.targetPrefix}c++" + "-DCMAKE_AR=${nativeBintools}/bin/${nativeBintools.targetPrefix}ar" + "-DCMAKE_STRIP=${nativeBintools}/bin/${nativeBintools.targetPrefix}strip" + "-DCMAKE_RANLIB=${nativeBintools}/bin/${nativeBintools.targetPrefix}ranlib" + ]; + in "-DCROSS_TOOLCHAIN_FLAGS_NATIVE:list=${lib.concatStringsSep ";" nativeToolchainFlags}" + ) ]; postBuild = '' @@ -133,18 +148,19 @@ in stdenv.mkDerivation ({ postInstall = '' mkdir -p $python/share mv $out/share/opt-viewer $python/share/opt-viewer - '' - + optionalString enableSharedLibraries '' - moveToOutput "lib/libLLVM-*" "$lib" - moveToOutput "lib/libLLVM${stdenv.hostPlatform.extensions.sharedLibrary}" "$lib" - substituteInPlace "$out/lib/cmake/llvm/LLVMExports-${if debugVersion then "debug" else "release"}.cmake" \ - --replace "\''${_IMPORT_PREFIX}/lib/libLLVM-" "$lib/lib/libLLVM-" + moveToOutput "bin/llvm-config*" "$dev" + substituteInPlace "$dev/lib/cmake/llvm/LLVMExports-${if debugVersion then "debug" else "release"}.cmake" \ + --replace "\''${_IMPORT_PREFIX}/lib/lib" "$lib/lib/lib" \ + --replace "$out/bin/llvm-config" "$dev/bin/llvm-config" + substituteInPlace "$dev/lib/cmake/llvm/LLVMConfig.cmake" \ + --replace 'set(LLVM_BINARY_DIR "''${LLVM_INSTALL_PREFIX}")' 'set(LLVM_BINARY_DIR "''${LLVM_INSTALL_PREFIX}'"$lib"'")' '' + optionalString (stdenv.isDarwin && enableSharedLibraries) '' - substituteInPlace "$out/lib/cmake/llvm/LLVMExports-${if debugVersion then "debug" else "release"}.cmake" \ - --replace "\''${_IMPORT_PREFIX}/lib/libLLVM.dylib" "$lib/lib/libLLVM.dylib" ln -s $lib/lib/libLLVM.dylib $lib/lib/libLLVM-${shortVersion}.dylib ln -s $lib/lib/libLLVM.dylib $lib/lib/libLLVM-${release_version}.dylib + '' + + optionalString (stdenv.buildPlatform != stdenv.hostPlatform) '' + cp NATIVE/bin/llvm-config $dev/bin/llvm-config-native ''; doCheck = stdenv.isLinux && (!stdenv.isx86_32); diff --git a/pkgs/development/compilers/llvm/8/llvm/gnu-install-dirs-polly.patch b/pkgs/development/compilers/llvm/8/llvm/gnu-install-dirs-polly.patch new file mode 100644 index 00000000000..7c477c7df58 --- /dev/null +++ b/pkgs/development/compilers/llvm/8/llvm/gnu-install-dirs-polly.patch @@ -0,0 +1,106 @@ +diff --git a/tools/polly/CMakeLists.txt b/tools/polly/CMakeLists.txt +index 9939097f743e..8cc538da912a 100644 +--- a/tools/polly/CMakeLists.txt ++++ b/tools/polly/CMakeLists.txt +@@ -2,7 +2,11 @@ + if (NOT DEFINED LLVM_MAIN_SRC_DIR) + project(Polly) + cmake_minimum_required(VERSION 3.4.3) ++endif() ++ ++include(GNUInstallDirs) + ++if (NOT DEFINED LLVM_MAIN_SRC_DIR) + # Where is LLVM installed? + find_package(LLVM CONFIG REQUIRED) + set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${LLVM_CMAKE_DIR}) +@@ -145,14 +149,14 @@ include_directories( + + if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY) + install(DIRECTORY include/ +- DESTINATION include ++ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} + FILES_MATCHING + PATTERN "*.h" + PATTERN ".svn" EXCLUDE + ) + + install(DIRECTORY ${POLLY_BINARY_DIR}/include/ +- DESTINATION include ++ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} + FILES_MATCHING + PATTERN "*.h" + PATTERN "CMakeFiles" EXCLUDE +diff --git a/tools/polly/cmake/CMakeLists.txt b/tools/polly/cmake/CMakeLists.txt +index 211f95512717..f9e04a4844b6 100644 +--- a/tools/polly/cmake/CMakeLists.txt ++++ b/tools/polly/cmake/CMakeLists.txt +@@ -79,18 +79,18 @@ file(GENERATE + + # Generate PollyConfig.cmake for the install tree. + unset(POLLY_EXPORTS) +-set(POLLY_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}") ++set(POLLY_INSTALL_PREFIX "") + set(POLLY_CONFIG_LLVM_CMAKE_DIR "${LLVM_BINARY_DIR}/${LLVM_INSTALL_PACKAGE_DIR}") +-set(POLLY_CONFIG_CMAKE_DIR "${POLLY_INSTALL_PREFIX}/${POLLY_INSTALL_PACKAGE_DIR}") +-set(POLLY_CONFIG_LIBRARY_DIRS "${POLLY_INSTALL_PREFIX}/lib${LLVM_LIBDIR_SUFFIX}") ++set(POLLY_CONFIG_CMAKE_DIR "${POLLY_INSTALL_PREFIX}${CMAKE_INSTALL_PREFIX}/${POLLY_INSTALL_PACKAGE_DIR}") ++set(POLLY_CONFIG_LIBRARY_DIRS "${POLLY_INSTALL_PREFIX}${CMAKE_INSTALL_FULL_LIBDIR}${LLVM_LIBDIR_SUFFIX}") + if (POLLY_BUNDLED_ISL) + set(POLLY_CONFIG_INCLUDE_DIRS +- "${POLLY_INSTALL_PREFIX}/include" +- "${POLLY_INSTALL_PREFIX}/include/polly" ++ "${POLLY_INSTALL_PREFIX}${CMAKE_INSTALL_FULL_LIBDIR}" ++ "${POLLY_INSTALL_PREFIX}${CMAKE_INSTALL_FULL_LIBDIR}/polly" + ) + else() + set(POLLY_CONFIG_INCLUDE_DIRS +- "${POLLY_INSTALL_PREFIX}/include" ++ "${POLLY_INSTALL_PREFIX}${CMAKE_INSTALL_FULL_INCLUDEDIR}" + ${ISL_INCLUDE_DIRS} + ) + endif() +@@ -100,12 +100,12 @@ endif() + foreach(tgt IN LISTS POLLY_CONFIG_EXPORTED_TARGETS) + get_target_property(tgt_type ${tgt} TYPE) + if (tgt_type STREQUAL "EXECUTABLE") +- set(tgt_prefix "bin/") ++ set(tgt_prefix "${CMAKE_INSTALL_BINDIR}/") + else() +- set(tgt_prefix "lib/") ++ set(tgt_prefix "${CMAKE_INSTALL_LIBDIR}/") + endif() + +- set(tgt_path "${CMAKE_INSTALL_PREFIX}/${tgt_prefix}$") ++ set(tgt_path "${tgt_prefix}$") + file(RELATIVE_PATH tgt_path ${POLLY_CONFIG_CMAKE_DIR} ${tgt_path}) + + if (NOT tgt_type STREQUAL "INTERFACE_LIBRARY") +diff --git a/tools/polly/cmake/polly_macros.cmake b/tools/polly/cmake/polly_macros.cmake +index e48203871884..5bc8a2a52541 100644 +--- a/tools/polly/cmake/polly_macros.cmake ++++ b/tools/polly/cmake/polly_macros.cmake +@@ -44,8 +44,8 @@ macro(add_polly_library name) + if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY OR ${name} STREQUAL "LLVMPolly") + install(TARGETS ${name} + EXPORT LLVMExports +- LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX} +- ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX}) ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}) + endif() + set_property(GLOBAL APPEND PROPERTY LLVM_EXPORTS ${name}) + endmacro(add_polly_library) +diff --git a/tools/polly/lib/External/CMakeLists.txt b/tools/polly/lib/External/CMakeLists.txt +index 8ffd984e542b..261cc19f3238 100644 +--- a/tools/polly/lib/External/CMakeLists.txt ++++ b/tools/polly/lib/External/CMakeLists.txt +@@ -274,7 +274,7 @@ if (POLLY_BUNDLED_ISL) + install(DIRECTORY + ${ISL_SOURCE_DIR}/include/ + ${ISL_BINARY_DIR}/include/ +- DESTINATION include/polly ++ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/polly + FILES_MATCHING + PATTERN "*.h" + PATTERN "CMakeFiles" EXCLUDE diff --git a/pkgs/development/compilers/llvm/8/llvm/gnu-install-dirs.patch b/pkgs/development/compilers/llvm/8/llvm/gnu-install-dirs.patch new file mode 100644 index 00000000000..027e43f7cac --- /dev/null +++ b/pkgs/development/compilers/llvm/8/llvm/gnu-install-dirs.patch @@ -0,0 +1,394 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 81c2bab39ec9..075e68be6125 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -251,15 +251,21 @@ if (CMAKE_BUILD_TYPE AND + message(FATAL_ERROR "Invalid value for CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}") + endif() + ++include(GNUInstallDirs) ++ + set(LLVM_LIBDIR_SUFFIX "" CACHE STRING "Define suffix of library directory name (32/64)" ) + +-set(LLVM_TOOLS_INSTALL_DIR "bin" CACHE STRING "Path for binary subdirectory (defaults to 'bin')") ++set(LLVM_TOOLS_INSTALL_DIR "${CMAKE_INSTALL_BINDIR}" CACHE STRING ++ "Path for binary subdirectory (defaults to 'bin')") + mark_as_advanced(LLVM_TOOLS_INSTALL_DIR) + + set(LLVM_UTILS_INSTALL_DIR "${LLVM_TOOLS_INSTALL_DIR}" CACHE STRING + "Path to install LLVM utilities (enabled by LLVM_INSTALL_UTILS=ON) (defaults to LLVM_TOOLS_INSTALL_DIR)") + mark_as_advanced(LLVM_UTILS_INSTALL_DIR) + ++set(LLVM_INSTALL_CMAKE_DIR "${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}/cmake/llvm" CACHE STRING ++ "Path for CMake subdirectory (defaults to lib/cmake/llvm)" ) ++ + # They are used as destination of target generators. + set(LLVM_RUNTIME_OUTPUT_INTDIR ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bin) + set(LLVM_LIBRARY_OUTPUT_INTDIR ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/lib${LLVM_LIBDIR_SUFFIX}) +@@ -517,9 +523,9 @@ option (LLVM_ENABLE_SPHINX "Use Sphinx to generate llvm documentation." OFF) + option (LLVM_ENABLE_OCAMLDOC "Build OCaml bindings documentation." ON) + option (LLVM_ENABLE_BINDINGS "Build bindings." ON) + +-set(LLVM_INSTALL_DOXYGEN_HTML_DIR "share/doc/llvm/doxygen-html" ++set(LLVM_INSTALL_DOXYGEN_HTML_DIR "${CMAKE_INSTALL_DOCDIR}/${project}/doxygen-html" + CACHE STRING "Doxygen-generated HTML documentation install directory") +-set(LLVM_INSTALL_OCAMLDOC_HTML_DIR "share/doc/llvm/ocaml-html" ++set(LLVM_INSTALL_OCAMLDOC_HTML_DIR "${CMAKE_INSTALL_DOCDIR}/${project}/ocaml-html" + CACHE STRING "OCamldoc-generated HTML documentation install directory") + + option (LLVM_BUILD_EXTERNAL_COMPILER_RT +@@ -956,7 +962,7 @@ endif() + + if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY) + install(DIRECTORY include/llvm include/llvm-c +- DESTINATION include ++ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} + COMPONENT llvm-headers + FILES_MATCHING + PATTERN "*.def" +@@ -968,7 +974,7 @@ if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY) + ) + + install(DIRECTORY ${LLVM_INCLUDE_DIR}/llvm ${LLVM_INCLUDE_DIR}/llvm-c +- DESTINATION include ++ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} + COMPONENT llvm-headers + FILES_MATCHING + PATTERN "*.def" +@@ -983,13 +989,13 @@ if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY) + + if (LLVM_INSTALL_MODULEMAPS) + install(DIRECTORY include/llvm include/llvm-c +- DESTINATION include ++ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} + COMPONENT llvm-headers + FILES_MATCHING + PATTERN "module.modulemap" + ) + install(FILES include/llvm/module.install.modulemap +- DESTINATION include/llvm ++ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/llvm + COMPONENT llvm-headers + RENAME "module.extern.modulemap" + ) +diff --git a/cmake/modules/AddLLVM.cmake b/cmake/modules/AddLLVM.cmake +index 1a417447278b..0c2aef338078 100644 +--- a/cmake/modules/AddLLVM.cmake ++++ b/cmake/modules/AddLLVM.cmake +@@ -646,11 +646,11 @@ macro(add_llvm_library name) + if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY OR ${name} STREQUAL "LTO" OR + ${name} STREQUAL "OptRemarks" OR + (LLVM_LINK_LLVM_DYLIB AND ${name} STREQUAL "LLVM")) +- set(install_dir lib${LLVM_LIBDIR_SUFFIX}) ++ set(install_dir ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}) + if(ARG_MODULE OR ARG_SHARED OR BUILD_SHARED_LIBS) + if(WIN32 OR CYGWIN OR MINGW) + set(install_type RUNTIME) +- set(install_dir bin) ++ set(install_dir ${CMAKE_INSTALL_BINDIR}) + else() + set(install_type LIBRARY) + endif() +@@ -898,7 +898,7 @@ macro(add_llvm_example name) + endif() + add_llvm_executable(${name} ${ARGN}) + if( LLVM_BUILD_EXAMPLES ) +- install(TARGETS ${name} RUNTIME DESTINATION examples) ++ install(TARGETS ${name} RUNTIME DESTINATION ${CMAKE_INSTALL_DOCDIR}/examples) + endif() + set_target_properties(${name} PROPERTIES FOLDER "Examples") + endmacro(add_llvm_example name) +@@ -1442,7 +1442,7 @@ function(llvm_install_library_symlink name dest type) + set(full_name ${CMAKE_${type}_LIBRARY_PREFIX}${name}${CMAKE_${type}_LIBRARY_SUFFIX}) + set(full_dest ${CMAKE_${type}_LIBRARY_PREFIX}${dest}${CMAKE_${type}_LIBRARY_SUFFIX}) + +- set(output_dir lib${LLVM_LIBDIR_SUFFIX}) ++ set(output_dir ${CMAKE_INSTALL_FULL_LIBDIR}${LLVM_LIBDIR_SUFFIX}) + if(WIN32 AND "${type}" STREQUAL "SHARED") + set(output_dir bin) + endif() +@@ -1458,7 +1458,7 @@ function(llvm_install_library_symlink name dest type) + endif() + endfunction() + +-function(llvm_install_symlink name dest) ++function(llvm_install_symlink name dest output_dir) + cmake_parse_arguments(ARG "ALWAYS_GENERATE" "COMPONENT" "" ${ARGN}) + foreach(path ${CMAKE_MODULE_PATH}) + if(EXISTS ${path}/LLVMInstallSymlink.cmake) +@@ -1481,7 +1481,7 @@ function(llvm_install_symlink name dest) + set(full_dest ${dest}${CMAKE_EXECUTABLE_SUFFIX}) + + install(SCRIPT ${INSTALL_SYMLINK} +- CODE "install_symlink(${full_name} ${full_dest} ${LLVM_TOOLS_INSTALL_DIR})" ++ CODE "install_symlink(${full_name} ${full_dest} ${output_dir})" + COMPONENT ${component}) + + if (NOT LLVM_ENABLE_IDE AND NOT ARG_ALWAYS_GENERATE) +@@ -1563,7 +1563,8 @@ function(add_llvm_tool_symlink link_name target) + endif() + + if ((TOOL_IS_TOOLCHAIN OR NOT LLVM_INSTALL_TOOLCHAIN_ONLY) AND LLVM_BUILD_TOOLS) +- llvm_install_symlink(${link_name} ${target}) ++ GNUInstallDirs_get_absolute_install_dir(output_dir LLVM_TOOLS_INSTALL_DIR) ++ llvm_install_symlink(${link_name} ${target} ${output_dir}) + endif() + endif() + endfunction() +@@ -1670,9 +1671,9 @@ function(llvm_setup_rpath name) + + if (APPLE) + set(_install_name_dir INSTALL_NAME_DIR "@rpath") +- set(_install_rpath "@loader_path/../lib" ${extra_libdir}) ++ set(_install_rpath "@loader_path/../${CMAKE_INSTALL_LIBDIR}" ${extra_libdir}) + elseif(UNIX) +- set(_install_rpath "\$ORIGIN/../lib${LLVM_LIBDIR_SUFFIX}" ${extra_libdir}) ++ set(_install_rpath "\$ORIGIN/../${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}" ${extra_libdir}) + if(${CMAKE_SYSTEM_NAME} MATCHES "(FreeBSD|DragonFly)") + set_property(TARGET ${name} APPEND_STRING PROPERTY + LINK_FLAGS " -Wl,-z,origin ") +diff --git a/cmake/modules/AddOCaml.cmake b/cmake/modules/AddOCaml.cmake +index 02bab6846376..eff26adb2efc 100644 +--- a/cmake/modules/AddOCaml.cmake ++++ b/cmake/modules/AddOCaml.cmake +@@ -140,9 +140,9 @@ function(add_ocaml_library name) + endforeach() + + if( APPLE ) +- set(ocaml_rpath "@executable_path/../../../lib${LLVM_LIBDIR_SUFFIX}") ++ set(ocaml_rpath "@executable_path/../../../${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}") + elseif( UNIX ) +- set(ocaml_rpath "\\$ORIGIN/../../../lib${LLVM_LIBDIR_SUFFIX}") ++ set(ocaml_rpath "\\$ORIGIN/../../../${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}") + endif() + list(APPEND ocaml_flags "-ldopt" "-Wl,-rpath,${ocaml_rpath}") + +diff --git a/cmake/modules/AddSphinxTarget.cmake b/cmake/modules/AddSphinxTarget.cmake +index 22e3dcb776aa..ba77b9c195e2 100644 +--- a/cmake/modules/AddSphinxTarget.cmake ++++ b/cmake/modules/AddSphinxTarget.cmake +@@ -73,7 +73,7 @@ function (add_sphinx_target builder project) + + elseif (builder STREQUAL html) + string(TOUPPER "${project}" project_upper) +- set(${project_upper}_INSTALL_SPHINX_HTML_DIR "share/doc/${project}/html" ++ set(${project_upper}_INSTALL_SPHINX_HTML_DIR "${CMAKE_INSTALL_DOCDIR}/${project}/html" + CACHE STRING "HTML documentation install directory for ${project}") + + # '/.' indicates: copy the contents of the directory directly into +diff --git a/cmake/modules/CMakeLists.txt b/cmake/modules/CMakeLists.txt +index f5cc0006fa06..77698aeaf000 100644 +--- a/cmake/modules/CMakeLists.txt ++++ b/cmake/modules/CMakeLists.txt +@@ -1,4 +1,4 @@ +-set(LLVM_INSTALL_PACKAGE_DIR lib${LLVM_LIBDIR_SUFFIX}/cmake/llvm) ++set(LLVM_INSTALL_PACKAGE_DIR ${LLVM_INSTALL_CMAKE_DIR} CACHE STRING "Path for CMake subdirectory (defaults to 'cmake/llvm')") + set(llvm_cmake_builddir "${LLVM_BINARY_DIR}/${LLVM_INSTALL_PACKAGE_DIR}") + + # First for users who use an installed LLVM, create the LLVMExports.cmake file. +@@ -90,11 +90,11 @@ foreach(p ${_count}) + set(LLVM_CONFIG_CODE "${LLVM_CONFIG_CODE} + get_filename_component(LLVM_INSTALL_PREFIX \"\${LLVM_INSTALL_PREFIX}\" PATH)") + endforeach(p) +-set(LLVM_CONFIG_INCLUDE_DIRS "\${LLVM_INSTALL_PREFIX}/include") +-set(LLVM_CONFIG_LIBRARY_DIRS "\${LLVM_INSTALL_PREFIX}/lib\${LLVM_LIBDIR_SUFFIX}") ++set(LLVM_CONFIG_INCLUDE_DIRS "\${LLVM_INSTALL_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR}") ++set(LLVM_CONFIG_LIBRARY_DIRS "\${LLVM_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}\${LLVM_LIBDIR_SUFFIX}") + set(LLVM_CONFIG_CMAKE_DIR "\${LLVM_INSTALL_PREFIX}/${LLVM_INSTALL_PACKAGE_DIR}") + set(LLVM_CONFIG_BINARY_DIR "\${LLVM_INSTALL_PREFIX}") +-set(LLVM_CONFIG_TOOLS_BINARY_DIR "\${LLVM_INSTALL_PREFIX}/bin") ++set(LLVM_CONFIG_TOOLS_BINARY_DIR "\${LLVM_INSTALL_PREFIX}/${CMAKE_INSTALL_BINDIR}") + set(LLVM_CONFIG_EXPORTS_FILE "\${LLVM_CMAKE_DIR}/LLVMExports.cmake") + set(LLVM_CONFIG_EXPORTS "${LLVM_EXPORTS}") + configure_file( +diff --git a/cmake/modules/LLVMInstallSymlink.cmake b/cmake/modules/LLVMInstallSymlink.cmake +index 1a04de931ff7..1c5ea4200635 100644 +--- a/cmake/modules/LLVMInstallSymlink.cmake ++++ b/cmake/modules/LLVMInstallSymlink.cmake +@@ -10,7 +10,7 @@ function(install_symlink name target outdir) + set(LINK_OR_COPY copy) + endif() + +- set(bindir "${DESTDIR}${CMAKE_INSTALL_PREFIX}/${outdir}/") ++ set(bindir "${DESTDIR}${outdir}/") + + message("Creating ${name}") + +diff --git a/docs/CMake.rst b/docs/CMake.rst +index eb219c58560b..6f32532f8ebf 100644 +--- a/docs/CMake.rst ++++ b/docs/CMake.rst +@@ -196,7 +196,7 @@ CMake manual, or execute ``cmake --help-variable VARIABLE_NAME``. + **LLVM_LIBDIR_SUFFIX**:STRING + Extra suffix to append to the directory where libraries are to be + installed. On a 64-bit architecture, one could use ``-DLLVM_LIBDIR_SUFFIX=64`` +- to install libraries to ``/usr/lib64``. ++ to install libraries to ``/usr/lib64``. See also ``CMAKE_INSTALL_LIBDIR``. + + **CMAKE_C_FLAGS**:STRING + Extra flags to use when compiling C source files. +@@ -479,8 +479,8 @@ LLVM-specific variables + + **LLVM_INSTALL_DOXYGEN_HTML_DIR**:STRING + The path to install Doxygen-generated HTML documentation to. This path can +- either be absolute or relative to the CMAKE_INSTALL_PREFIX. Defaults to +- `share/doc/llvm/doxygen-html`. ++ either be absolute or relative to the ``CMAKE_INSTALL_PREFIX``. Defaults to ++ `${CMAKE_INSTALL_DOCDIR}/${project}/doxygen-html`. + + **LLVM_ENABLE_SPHINX**:BOOL + If specified, CMake will search for the ``sphinx-build`` executable and will make +@@ -511,13 +511,33 @@ LLVM-specific variables + + **LLVM_INSTALL_SPHINX_HTML_DIR**:STRING + The path to install Sphinx-generated HTML documentation to. This path can +- either be absolute or relative to the CMAKE_INSTALL_PREFIX. Defaults to +- `share/doc/llvm/html`. ++ either be absolute or relative to the ``CMAKE_INSTALL_PREFIX``. Defaults to ++ `${CMAKE_INSTALL_DOCDIR}/${project}/html`. + + **LLVM_INSTALL_OCAMLDOC_HTML_DIR**:STRING + The path to install OCamldoc-generated HTML documentation to. This path can +- either be absolute or relative to the CMAKE_INSTALL_PREFIX. Defaults to +- `share/doc/llvm/ocaml-html`. ++ either be absolute or relative to the ``CMAKE_INSTALL_PREFIX``. Defaults to ++ `${CMAKE_INSTALL_DOCDIR}/${project}/ocaml-html`. ++ ++**CMAKE_INSTALL_BINDIR**:STRING ++ The path to install binary tools, relative to the ``CMAKE_INSTALL_PREFIX``. ++ Defaults to `bin`. ++ ++**CMAKE_INSTALL_LIBDIR**:STRING ++ The path to install libraries, relative to the ``CMAKE_INSTALL_PREFIX``. ++ Defaults to `lib`. ++ ++**CMAKE_INSTALL_INCLUDEDIR**:STRING ++ The path to install header files, relative to the ``CMAKE_INSTALL_PREFIX``. ++ Defaults to `include`. ++ ++**CMAKE_INSTALL_DOCDIR**:STRING ++ The path to install documentation, relative to the ``CMAKE_INSTALL_PREFIX``. ++ Defaults to `share/doc`. ++ ++**CMAKE_INSTALL_MANDIR**:STRING ++ The path to install manpage files, relative to the ``CMAKE_INSTALL_PREFIX``. ++ Defaults to `share/man`. + + **LLVM_CREATE_XCODE_TOOLCHAIN**:BOOL + OS X Only: If enabled CMake will generate a target named +@@ -691,9 +711,11 @@ the ``cmake`` command or by setting it directly in ``ccmake`` or ``cmake-gui``). + + This file is available in two different locations. + +-* ``/lib/cmake/llvm/LLVMConfig.cmake`` where +- ```` is the install prefix of an installed version of LLVM. +- On Linux typically this is ``/usr/lib/cmake/llvm/LLVMConfig.cmake``. ++* ``LLVMConfig.cmake`` where ++ ```` is the location where LLVM CMake modules are ++ installed as part of an installed version of LLVM. This is typically ++ ``cmake/llvm/`` within the lib directory. On Linux, this is typically ++ ``/usr/lib/cmake/llvm/LLVMConfig.cmake``. + + * ``/lib/cmake/llvm/LLVMConfig.cmake`` where + ```` is the root of the LLVM build tree. **Note: this is only +diff --git a/include/llvm/CMakeLists.txt b/include/llvm/CMakeLists.txt +index 1d5ca3ba92b0..026f5453c1da 100644 +--- a/include/llvm/CMakeLists.txt ++++ b/include/llvm/CMakeLists.txt +@@ -4,5 +4,5 @@ add_subdirectory(Support) + # If we're doing an out-of-tree build, copy a module map for generated + # header files into the build area. + if (NOT "${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}") +- configure_file(module.modulemap.build module.modulemap COPYONLY) ++ configure_file(module.modulemap.build ${LLVM_INCLUDE_DIR}/module.modulemap COPYONLY) + endif (NOT "${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}") +diff --git a/tools/llvm-config/BuildVariables.inc.in b/tools/llvm-config/BuildVariables.inc.in +index f201e1f7bff0..4582ed556a02 100644 +--- a/tools/llvm-config/BuildVariables.inc.in ++++ b/tools/llvm-config/BuildVariables.inc.in +@@ -24,6 +24,10 @@ + #define LLVM_CXXFLAGS "@LLVM_CXXFLAGS@" + #define LLVM_BUILDMODE "@LLVM_BUILDMODE@" + #define LLVM_LIBDIR_SUFFIX "@LLVM_LIBDIR_SUFFIX@" ++#define LLVM_INSTALL_BINDIR "@CMAKE_INSTALL_BINDIR@" ++#define LLVM_INSTALL_LIBDIR "@CMAKE_INSTALL_LIBDIR@" ++#define LLVM_INSTALL_INCLUDEDIR "@CMAKE_INSTALL_INCLUDEDIR@" ++#define LLVM_INSTALL_CMAKEDIR "@LLVM_INSTALL_CMAKE_DIR@" + #define LLVM_TARGETS_BUILT "@LLVM_TARGETS_BUILT@" + #define LLVM_SYSTEM_LIBS "@LLVM_SYSTEM_LIBS@" + #define LLVM_BUILD_SYSTEM "@LLVM_BUILD_SYSTEM@" +diff --git a/tools/llvm-config/llvm-config.cpp b/tools/llvm-config/llvm-config.cpp +index bec89fef98ca..31d78f925d45 100644 +--- a/tools/llvm-config/llvm-config.cpp ++++ b/tools/llvm-config/llvm-config.cpp +@@ -333,12 +333,26 @@ int main(int argc, char **argv) { + ("-I" + ActiveIncludeDir + " " + "-I" + ActiveObjRoot + "/include"); + } else { + ActivePrefix = CurrentExecPrefix; +- ActiveIncludeDir = ActivePrefix + "/include"; +- SmallString<256> path(StringRef(LLVM_TOOLS_INSTALL_DIR)); +- sys::fs::make_absolute(ActivePrefix, path); +- ActiveBinDir = path.str(); +- ActiveLibDir = ActivePrefix + "/lib" + LLVM_LIBDIR_SUFFIX; +- ActiveCMakeDir = ActiveLibDir + "/cmake/llvm"; ++ { ++ SmallString<256> path(StringRef(LLVM_INSTALL_INCLUDEDIR)); ++ sys::fs::make_absolute(ActivePrefix, path); ++ ActiveIncludeDir = std::string(path.str()); ++ } ++ { ++ SmallString<256> path(StringRef(LLVM_INSTALL_BINDIR)); ++ sys::fs::make_absolute(ActivePrefix, path); ++ ActiveBinDir = std::string(path.str()); ++ } ++ { ++ SmallString<256> path(StringRef(LLVM_INSTALL_LIBDIR LLVM_LIBDIR_SUFFIX)); ++ sys::fs::make_absolute(ActivePrefix, path); ++ ActiveLibDir = std::string(path.str()); ++ } ++ { ++ SmallString<256> path(StringRef(LLVM_INSTALL_CMAKEDIR)); ++ sys::fs::make_absolute(ActivePrefix, path); ++ ActiveCMakeDir = std::string(path.str()); ++ } + ActiveIncludeOption = "-I" + ActiveIncludeDir; + } + +diff --git a/tools/lto/CMakeLists.txt b/tools/lto/CMakeLists.txt +index 6e913519a809..85641eef721f 100644 +--- a/tools/lto/CMakeLists.txt ++++ b/tools/lto/CMakeLists.txt +@@ -19,7 +19,7 @@ set(LLVM_EXPORTED_SYMBOL_FILE ${CMAKE_CURRENT_SOURCE_DIR}/lto.exports) + add_llvm_library(LTO SHARED ${SOURCES} DEPENDS intrinsics_gen) + + install(FILES ${LLVM_MAIN_INCLUDE_DIR}/llvm-c/lto.h +- DESTINATION include/llvm-c ++ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/llvm-c + COMPONENT LTO) + + if (APPLE) +diff --git a/tools/opt-remarks/CMakeLists.txt b/tools/opt-remarks/CMakeLists.txt +index a87beae1e893..149ea3d10168 100644 +--- a/tools/opt-remarks/CMakeLists.txt ++++ b/tools/opt-remarks/CMakeLists.txt +@@ -11,7 +11,7 @@ set(LLVM_EXPORTED_SYMBOL_FILE ${CMAKE_CURRENT_SOURCE_DIR}/OptRemarks.exports) + add_llvm_library(OptRemarks SHARED ${SOURCES}) + + install(FILES ${LLVM_MAIN_INCLUDE_DIR}/llvm-c/OptRemarks.h +- DESTINATION include/llvm-c ++ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/llvm-c + COMPONENT OptRemarks) + + if (APPLE) +diff --git a/tools/opt-viewer/CMakeLists.txt b/tools/opt-viewer/CMakeLists.txt +index 19b606933082..27b9f71b3d79 100644 +--- a/tools/opt-viewer/CMakeLists.txt ++++ b/tools/opt-viewer/CMakeLists.txt +@@ -8,6 +8,6 @@ set (files + + foreach (file ${files}) + install(PROGRAMS ${file} +- DESTINATION share/opt-viewer ++ DESTINATION ${CMAKE_INSTALL_DATADIR}/opt-viewer + COMPONENT opt-viewer) + endforeach (file) diff --git a/pkgs/development/compilers/llvm/9/clang/default.nix b/pkgs/development/compilers/llvm/9/clang/default.nix index 87b29163f43..f1c21083bb6 100644 --- a/pkgs/development/compilers/llvm/9/clang/default.nix +++ b/pkgs/development/compilers/llvm/9/clang/default.nix @@ -1,4 +1,5 @@ -{ lib, stdenv, fetch, cmake, libxml2, llvm, version, clang-tools-extra_src, python3, lld +{ lib, stdenv, fetch, cmake, libxml2, libllvm, version, clang-tools-extra_src, python3 +, buildLlvmTools , fixDarwinDylibNames , enableManpages ? false , enablePolly ? false # TODO: get this info from llvm (passthru?) @@ -23,18 +24,22 @@ let ++ lib.optional enableManpages python3.pkgs.sphinx ++ lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames; - buildInputs = [ libxml2 llvm lld ]; + buildInputs = [ libxml2 libllvm ]; cmakeFlags = [ "-DCMAKE_CXX_FLAGS=-std=c++11" "-DCLANGD_BUILD_XPC=OFF" "-DLLVM_ENABLE_RTTI=ON" + "-DLLVM_CONFIG_PATH=${libllvm.dev}/bin/llvm-config${lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) "-native"}" ] ++ lib.optionals enableManpages [ "-DCLANG_INCLUDE_DOCS=ON" "-DLLVM_ENABLE_SPHINX=ON" "-DSPHINX_OUTPUT_MAN=ON" "-DSPHINX_OUTPUT_HTML=OFF" "-DSPHINX_WARNINGS_AS_ERRORS=OFF" + ] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ + "-DLLVM_TABLEGEN_EXE=${buildLlvmTools.llvm}/bin/llvm-tblgen" + "-DCLANG_TABLEGEN=${buildLlvmTools.libclang.dev}/bin/clang-tblgen" ] ++ lib.optionals enablePolly [ "-DWITH_POLLY=ON" "-DLINK_POLLY_INTO_TOOLS=ON" @@ -46,6 +51,7 @@ let ./compiler-rt-baremetal.patch # make clang -xhip use $PATH to find executables ./HIP-use-PATH-9.patch + ./gnu-install-dirs.patch ]; postPatch = '' @@ -62,12 +68,12 @@ let --replace "NOT HAVE_CXX_ATOMICS64_WITHOUT_LIB" FALSE ''; - outputs = [ "out" "lib" "python" ]; + outputs = [ "out" "lib" "dev" "python" ]; # Clang expects to find LLVMgold in its own prefix postInstall = '' - if [ -e ${llvm}/lib/LLVMgold.so ]; then - ln -sv ${llvm}/lib/LLVMgold.so $out/lib + 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 @@ -86,11 +92,14 @@ let fi mv $out/share/clang/*.py $python/share/clang rm $out/bin/c-index-test + + mkdir -p $dev/bin + cp bin/clang-tblgen $dev/bin ''; passthru = { isClang = true; - inherit llvm; + inherit libllvm; }; meta = { diff --git a/pkgs/development/compilers/llvm/9/clang/gnu-install-dirs.patch b/pkgs/development/compilers/llvm/9/clang/gnu-install-dirs.patch new file mode 100644 index 00000000000..625cbcc7236 --- /dev/null +++ b/pkgs/development/compilers/llvm/9/clang/gnu-install-dirs.patch @@ -0,0 +1,278 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 60937aa9db38..45522ff32998 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -9,6 +9,8 @@ endif() + if( CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR ) + project(Clang) + ++ include(GNUInstallDirs) ++ + # Rely on llvm-config. + set(CONFIG_OUTPUT) + if(LLVM_CONFIG) +@@ -413,7 +415,7 @@ include_directories(BEFORE + + if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY) + install(DIRECTORY include/clang include/clang-c +- DESTINATION include ++ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} + COMPONENT clang-headers + FILES_MATCHING + PATTERN "*.def" +@@ -423,7 +425,7 @@ if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY) + ) + + install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/include/clang +- DESTINATION include ++ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} + COMPONENT clang-headers + FILES_MATCHING + PATTERN "CMakeFiles" EXCLUDE +@@ -442,7 +444,7 @@ if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY) + endif() + + install(PROGRAMS utils/bash-autocomplete.sh +- DESTINATION share/clang ++ DESTINATION ${CMAKE_INSTALL_DATADIR}/clang + ) + endif() + +diff --git a/cmake/modules/AddClang.cmake b/cmake/modules/AddClang.cmake +index cbd618e18afb..63ba43f18e64 100644 +--- a/cmake/modules/AddClang.cmake ++++ b/cmake/modules/AddClang.cmake +@@ -109,9 +109,9 @@ macro(add_clang_library name) + install(TARGETS ${name} + COMPONENT ${name} + ${export_to_clangtargets} +- LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX} +- ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX} +- RUNTIME DESTINATION bin) ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX} ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) + + if (NOT LLVM_ENABLE_IDE) + add_llvm_install_targets(install-${name} +@@ -155,7 +155,7 @@ macro(add_clang_tool name) + + install(TARGETS ${name} + ${export_to_clangtargets} +- RUNTIME DESTINATION bin ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + COMPONENT ${name}) + + if(NOT LLVM_ENABLE_IDE) +@@ -170,7 +170,7 @@ endmacro() + macro(add_clang_symlink name dest) + add_llvm_tool_symlink(${name} ${dest} ALWAYS_GENERATE) + # Always generate install targets +- llvm_install_symlink(${name} ${dest} ALWAYS_GENERATE) ++ llvm_install_symlink(${name} ${dest} ${CMAKE_INSTALL_FULL_BINDIR} ALWAYS_GENERATE) + endmacro() + + function(clang_target_link_libraries target type) +diff --git a/lib/Headers/CMakeLists.txt b/lib/Headers/CMakeLists.txt +index a3c0b08fa364..aa4215c0999c 100644 +--- a/lib/Headers/CMakeLists.txt ++++ b/lib/Headers/CMakeLists.txt +@@ -185,7 +185,7 @@ set_target_properties(clang-resource-headers PROPERTIES + FOLDER "Misc" + RUNTIME_OUTPUT_DIRECTORY "${output_dir}") + +-set(header_install_dir lib${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION}/include) ++set(header_install_dir ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION}/include) + + install( + FILES ${files} ${generated_files} +diff --git a/tools/c-index-test/CMakeLists.txt b/tools/c-index-test/CMakeLists.txt +index ceef4b08637c..8efad5520ca4 100644 +--- a/tools/c-index-test/CMakeLists.txt ++++ b/tools/c-index-test/CMakeLists.txt +@@ -54,7 +54,7 @@ if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY) + set_property(TARGET c-index-test APPEND PROPERTY INSTALL_RPATH + "@executable_path/../../lib") + else() +- set(INSTALL_DESTINATION bin) ++ set(INSTALL_DESTINATION ${CMAKE_INSTALL_BINDIR}) + endif() + + install(TARGETS c-index-test +diff --git a/tools/clang-check/CMakeLists.txt b/tools/clang-check/CMakeLists.txt +index 4576d78bcfb4..7c3b302d8d59 100644 +--- a/tools/clang-check/CMakeLists.txt ++++ b/tools/clang-check/CMakeLists.txt +@@ -21,4 +21,4 @@ clang_target_link_libraries(clang-check + ) + + install(TARGETS clang-check +- RUNTIME DESTINATION bin) ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) +diff --git a/tools/clang-extdef-mapping/CMakeLists.txt b/tools/clang-extdef-mapping/CMakeLists.txt +index 4798bdb71ad0..02d07b9982ac 100644 +--- a/tools/clang-extdef-mapping/CMakeLists.txt ++++ b/tools/clang-extdef-mapping/CMakeLists.txt +@@ -18,4 +18,4 @@ clang_target_link_libraries(clang-extdef-mapping + ) + + install(TARGETS clang-extdef-mapping +- RUNTIME DESTINATION bin) ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) +diff --git a/tools/clang-format/CMakeLists.txt b/tools/clang-format/CMakeLists.txt +index 35ecdb11253c..d77d75de0094 100644 +--- a/tools/clang-format/CMakeLists.txt ++++ b/tools/clang-format/CMakeLists.txt +@@ -21,20 +21,20 @@ if( LLVM_LIB_FUZZING_ENGINE OR LLVM_USE_SANITIZE_COVERAGE ) + endif() + + install(PROGRAMS clang-format-bbedit.applescript +- DESTINATION share/clang ++ DESTINATION ${CMAKE_INSTALL_DATADIR}/clang + COMPONENT clang-format) + install(PROGRAMS clang-format-diff.py +- DESTINATION share/clang ++ DESTINATION ${CMAKE_INSTALL_DATADIR}/clang + COMPONENT clang-format) + install(PROGRAMS clang-format-sublime.py +- DESTINATION share/clang ++ DESTINATION ${CMAKE_INSTALL_DATADIR}/clang + COMPONENT clang-format) + install(PROGRAMS clang-format.el +- DESTINATION share/clang ++ DESTINATION ${CMAKE_INSTALL_DATADIR}/clang + COMPONENT clang-format) + install(PROGRAMS clang-format.py +- DESTINATION share/clang ++ DESTINATION ${CMAKE_INSTALL_DATADIR}/clang + COMPONENT clang-format) + install(PROGRAMS git-clang-format +- DESTINATION bin ++ DESTINATION ${CMAKE_INSTALL_BINDIR} + COMPONENT clang-format) +diff --git a/tools/clang-offload-bundler/CMakeLists.txt b/tools/clang-offload-bundler/CMakeLists.txt +index 465bef040a6c..729369ed9429 100644 +--- a/tools/clang-offload-bundler/CMakeLists.txt ++++ b/tools/clang-offload-bundler/CMakeLists.txt +@@ -22,4 +22,4 @@ clang_target_link_libraries(clang-offload-bundler + ${CLANG_OFFLOAD_BUNDLER_LIB_DEPS} + ) + +-install(TARGETS clang-offload-bundler RUNTIME DESTINATION bin) ++install(TARGETS clang-offload-bundler RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) +diff --git a/tools/clang-rename/CMakeLists.txt b/tools/clang-rename/CMakeLists.txt +index cda8e29ec5b1..0134d8ccd70b 100644 +--- a/tools/clang-rename/CMakeLists.txt ++++ b/tools/clang-rename/CMakeLists.txt +@@ -19,8 +19,8 @@ clang_target_link_libraries(clang-rename + ) + + install(PROGRAMS clang-rename.py +- DESTINATION share/clang ++ DESTINATION ${CMAKE_INSTALL_DATADIR}/clang + COMPONENT clang-rename) + install(PROGRAMS clang-rename.el +- DESTINATION share/clang ++ DESTINATION ${CMAKE_INSTALL_DATADIR}/clang + COMPONENT clang-rename) +diff --git a/tools/diagtool/CMakeLists.txt b/tools/diagtool/CMakeLists.txt +index a95444be40ee..136d96d9bf5b 100644 +--- a/tools/diagtool/CMakeLists.txt ++++ b/tools/diagtool/CMakeLists.txt +@@ -21,7 +21,7 @@ clang_target_link_libraries(diagtool + if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY) + install(TARGETS diagtool + COMPONENT diagtool +- RUNTIME DESTINATION bin) ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) + + if (NOT LLVM_ENABLE_IDE) + add_llvm_install_targets(install-diagtool +diff --git a/tools/libclang/CMakeLists.txt b/tools/libclang/CMakeLists.txt +index 613ead1a36b6..e5c7bf27f739 100644 +--- a/tools/libclang/CMakeLists.txt ++++ b/tools/libclang/CMakeLists.txt +@@ -137,7 +137,7 @@ endif() + if(INTERNAL_INSTALL_PREFIX) + set(LIBCLANG_HEADERS_INSTALL_DESTINATION "${INTERNAL_INSTALL_PREFIX}/include") + else() +- set(LIBCLANG_HEADERS_INSTALL_DESTINATION include) ++ set(LIBCLANG_HEADERS_INSTALL_DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) + endif() + + install(DIRECTORY ../../include/clang-c +@@ -168,7 +168,7 @@ foreach(PythonVersion ${CLANG_PYTHON_BINDINGS_VERSIONS}) + COMPONENT + libclang-python-bindings + DESTINATION +- "lib${LLVM_LIBDIR_SUFFIX}/python${PythonVersion}/site-packages") ++ "${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}/python${PythonVersion}/site-packages") + endforeach() + if(NOT LLVM_ENABLE_IDE) + add_custom_target(libclang-python-bindings) +diff --git a/tools/scan-build/CMakeLists.txt b/tools/scan-build/CMakeLists.txt +index 380379300b09..adfd58ed5f7d 100644 +--- a/tools/scan-build/CMakeLists.txt ++++ b/tools/scan-build/CMakeLists.txt +@@ -41,7 +41,7 @@ if(CLANG_INSTALL_SCANBUILD) + ${CMAKE_BINARY_DIR}/bin/ + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/bin/${BinFile}) + list(APPEND Depends ${CMAKE_BINARY_DIR}/bin/${BinFile}) +- install(PROGRAMS bin/${BinFile} DESTINATION bin) ++ install(PROGRAMS bin/${BinFile} DESTINATION ${CMAKE_INSTALL_BINDIR}) + endforeach() + + foreach(LibexecFile ${LibexecFiles}) +@@ -53,7 +53,7 @@ if(CLANG_INSTALL_SCANBUILD) + ${CMAKE_BINARY_DIR}/libexec/ + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/libexec/${LibexecFile}) + list(APPEND Depends ${CMAKE_BINARY_DIR}/libexec/${LibexecFile}) +- install(PROGRAMS libexec/${LibexecFile} DESTINATION libexec) ++ install(PROGRAMS libexec/${LibexecFile} DESTINATION ${CMAKE_INSTALL_LIBEXECDIR}) + endforeach() + + foreach(ManPage ${ManPages}) +@@ -77,7 +77,7 @@ if(CLANG_INSTALL_SCANBUILD) + ${CMAKE_BINARY_DIR}/share/scan-build/ + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/share/scan-build/${ShareFile}) + list(APPEND Depends ${CMAKE_BINARY_DIR}/share/scan-build/${ShareFile}) +- install(FILES share/scan-build/${ShareFile} DESTINATION share/scan-build) ++ install(FILES share/scan-build/${ShareFile} DESTINATION ${CMAKE_INSTALL_DATADIR}/scan-build) + endforeach() + + add_custom_target(scan-build ALL DEPENDS ${Depends}) +diff --git a/tools/scan-view/CMakeLists.txt b/tools/scan-view/CMakeLists.txt +index b305ca562a72..554bcb379061 100644 +--- a/tools/scan-view/CMakeLists.txt ++++ b/tools/scan-view/CMakeLists.txt +@@ -21,7 +21,7 @@ if(CLANG_INSTALL_SCANVIEW) + ${CMAKE_BINARY_DIR}/bin/ + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/bin/${BinFile}) + list(APPEND Depends ${CMAKE_BINARY_DIR}/bin/${BinFile}) +- install(PROGRAMS bin/${BinFile} DESTINATION bin) ++ install(PROGRAMS bin/${BinFile} DESTINATION ${CMAKE_INSTALL_BINDIR}) + endforeach() + + foreach(ShareFile ${ShareFiles}) +@@ -33,7 +33,7 @@ if(CLANG_INSTALL_SCANVIEW) + ${CMAKE_BINARY_DIR}/share/scan-view/ + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/share/${ShareFile}) + list(APPEND Depends ${CMAKE_BINARY_DIR}/share/scan-view/${ShareFile}) +- install(FILES share/${ShareFile} DESTINATION share/scan-view) ++ install(FILES share/${ShareFile} DESTINATION ${CMAKE_INSTALL_DATADIR}/scan-view) + endforeach() + + add_custom_target(scan-view ALL DEPENDS ${Depends}) +diff --git a/utils/hmaptool/CMakeLists.txt b/utils/hmaptool/CMakeLists.txt +index 5573009d343a..24b3a90f233f 100644 +--- a/utils/hmaptool/CMakeLists.txt ++++ b/utils/hmaptool/CMakeLists.txt +@@ -9,7 +9,7 @@ add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bin/${CLANG_HM + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${CLANG_HMAPTOOL}) + + list(APPEND Depends ${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bin/${CLANG_HMAPTOOL}) +-install(PROGRAMS ${CLANG_HMAPTOOL} DESTINATION bin) ++install(PROGRAMS ${CLANG_HMAPTOOL} DESTINATION ${CMAKE_INSTALL_BINDIR}) + + add_custom_target(hmaptool ALL DEPENDS ${Depends}) + set_target_properties(hmaptool PROPERTIES FOLDER "Utils") diff --git a/pkgs/development/compilers/llvm/9/compiler-rt/default.nix b/pkgs/development/compilers/llvm/9/compiler-rt/default.nix index cfc8e0ea74a..f6f5a9cf806 100644 --- a/pkgs/development/compilers/llvm/9/compiler-rt/default.nix +++ b/pkgs/development/compilers/llvm/9/compiler-rt/default.nix @@ -13,7 +13,7 @@ stdenv.mkDerivation rec { inherit version; src = fetch pname "0xwh79g3zggdabxgnd0bphry75asm1qz7mv3hcqihqwqr6aspgy2"; - nativeBuildInputs = [ cmake python3 llvm ]; + nativeBuildInputs = [ cmake python3 llvm.dev ]; buildInputs = lib.optional stdenv.hostPlatform.isDarwin libcxxabi; NIX_CFLAGS_COMPILE = [ @@ -21,6 +21,7 @@ stdenv.mkDerivation rec { ]; cmakeFlags = [ + "-DCOMPILER_RT_OS_DIR=" "-DCOMPILER_RT_DEFAULT_TARGET_ONLY=ON" "-DCMAKE_C_COMPILER_TARGET=${stdenv.hostPlatform.config}" "-DCMAKE_ASM_COMPILER_TARGET=${stdenv.hostPlatform.config}" @@ -54,6 +55,7 @@ stdenv.mkDerivation rec { # https://github.com/llvm/llvm-project/commit/947f9692440836dcb8d88b74b69dd379d85974ce ../../common/compiler-rt/glibc.patch ./codesign.patch # Revert compiler-rt commit that makes codesign mandatory + ./gnu-install-dirs.patch ]# ++ lib.optional stdenv.hostPlatform.isMusl ./sanitizers-nongnu.patch ++ lib.optional stdenv.hostPlatform.isAarch32 ./armv7l.patch; @@ -78,9 +80,7 @@ stdenv.mkDerivation rec { ''; # Hack around weird upsream RPATH bug - postInstall = lib.optionalString (stdenv.hostPlatform.isDarwin || stdenv.hostPlatform.isWasm) '' - ln -s "$out/lib"/*/* "$out/lib" - '' + lib.optionalString (useLLVM) '' + postInstall = lib.optionalString (useLLVM) '' ln -s $out/lib/*/clang_rt.crtbegin-*.o $out/lib/crtbegin.o ln -s $out/lib/*/clang_rt.crtend-*.o $out/lib/crtend.o ln -s $out/lib/*/clang_rt.crtbegin_shared-*.o $out/lib/crtbeginS.o diff --git a/pkgs/development/compilers/llvm/9/compiler-rt/gnu-install-dirs.patch b/pkgs/development/compilers/llvm/9/compiler-rt/gnu-install-dirs.patch new file mode 100644 index 00000000000..7967bbc4855 --- /dev/null +++ b/pkgs/development/compilers/llvm/9/compiler-rt/gnu-install-dirs.patch @@ -0,0 +1,117 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index f26ae25ada30..8ba536afdccc 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -12,6 +12,7 @@ endif() + # Check if compiler-rt is built as a standalone project. + if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR OR COMPILER_RT_STANDALONE_BUILD) + project(CompilerRT C CXX ASM) ++ include(GNUInstallDirs) + set(COMPILER_RT_STANDALONE_BUILD TRUE) + set_property(GLOBAL PROPERTY USE_FOLDERS ON) + endif() +diff --git a/cmake/Modules/AddCompilerRT.cmake b/cmake/Modules/AddCompilerRT.cmake +index f7ee932f214f..ef94a97c4be9 100644 +--- a/cmake/Modules/AddCompilerRT.cmake ++++ b/cmake/Modules/AddCompilerRT.cmake +@@ -488,7 +488,7 @@ macro(add_compiler_rt_resource_file target_name file_name component) + add_custom_target(${target_name} DEPENDS ${dst_file}) + # Install in Clang resource directory. + install(FILES ${file_name} +- DESTINATION ${COMPILER_RT_INSTALL_PATH}/share ++ DESTINATION ${COMPILER_RT_INSTALL_PATH}/${CMAKE_INSTALL_FULL_INCLUDEDIR} + COMPONENT ${component}) + add_dependencies(${component} ${target_name}) + +@@ -505,7 +505,7 @@ macro(add_compiler_rt_script name) + add_custom_target(${name} DEPENDS ${dst}) + install(FILES ${dst} + PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE +- DESTINATION ${COMPILER_RT_INSTALL_PATH}/bin) ++ DESTINATION ${COMPILER_RT_INSTALL_PATH}/${CMAKE_INSTALL_FULL_BINDIR}) + endmacro(add_compiler_rt_script src name) + + # Builds custom version of libc++ and installs it in . +diff --git a/cmake/Modules/CompilerRTDarwinUtils.cmake b/cmake/Modules/CompilerRTDarwinUtils.cmake +index b50d55b56940..7e5729ad9c8e 100644 +--- a/cmake/Modules/CompilerRTDarwinUtils.cmake ++++ b/cmake/Modules/CompilerRTDarwinUtils.cmake +@@ -386,7 +386,7 @@ macro(darwin_add_embedded_builtin_libraries) + set(DARWIN_macho_embedded_LIBRARY_OUTPUT_DIR + ${COMPILER_RT_OUTPUT_DIR}/lib/macho_embedded) + set(DARWIN_macho_embedded_LIBRARY_INSTALL_DIR +- ${COMPILER_RT_INSTALL_PATH}/lib/macho_embedded) ++ ${COMPILER_RT_INSTALL_PATH}/${CMAKE_INSTALL_FULL_LIBDIR}/macho_embedded) + + set(CFLAGS_armv7 "-target thumbv7-apple-darwin-eabi") + set(CFLAGS_i386 "-march=pentium") +diff --git a/cmake/Modules/CompilerRTUtils.cmake b/cmake/Modules/CompilerRTUtils.cmake +index 6e672b1e1818..64999709958e 100644 +--- a/cmake/Modules/CompilerRTUtils.cmake ++++ b/cmake/Modules/CompilerRTUtils.cmake +@@ -371,7 +371,7 @@ endfunction() + function(get_compiler_rt_install_dir arch install_dir) + if(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR AND NOT APPLE) + get_compiler_rt_target(${arch} target) +- set(${install_dir} ${COMPILER_RT_INSTALL_PATH}/lib/${target} PARENT_SCOPE) ++ set(${install_dir} ${COMPILER_RT_INSTALL_PATH}/${CMAKE_INSTALL_FULL_LIBDIR}/${target} PARENT_SCOPE) + else() + set(${install_dir} ${COMPILER_RT_LIBRARY_INSTALL_DIR} PARENT_SCOPE) + endif() +diff --git a/cmake/base-config-ix.cmake b/cmake/base-config-ix.cmake +index cef0e0d73d87..db33fb028287 100644 +--- a/cmake/base-config-ix.cmake ++++ b/cmake/base-config-ix.cmake +@@ -55,11 +55,11 @@ if (LLVM_TREE_AVAILABLE) + else() + # Take output dir and install path from the user. + set(COMPILER_RT_OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR} CACHE PATH +- "Path where built compiler-rt libraries should be stored.") ++ "Path where built compiler-rt build artifacts should be stored.") + set(COMPILER_RT_EXEC_OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR}/bin CACHE PATH + "Path where built compiler-rt executables should be stored.") +- set(COMPILER_RT_INSTALL_PATH ${CMAKE_INSTALL_PREFIX} CACHE PATH +- "Path where built compiler-rt libraries should be installed.") ++ set(COMPILER_RT_INSTALL_PATH "" CACHE PATH ++ "Prefix where built compiler-rt artifacts should be installed, comes before CMAKE_INSTALL_PREFIX.") + option(COMPILER_RT_INCLUDE_TESTS "Generate and build compiler-rt unit tests." OFF) + option(COMPILER_RT_ENABLE_WERROR "Fail and stop if warning is triggered" OFF) + # Use a host compiler to compile/link tests. +@@ -87,7 +87,7 @@ else(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR) + set(COMPILER_RT_LIBRARY_OUTPUT_DIR + ${COMPILER_RT_OUTPUT_DIR}/lib/${COMPILER_RT_OS_DIR}) + set(COMPILER_RT_LIBRARY_INSTALL_DIR +- ${COMPILER_RT_INSTALL_PATH}/lib/${COMPILER_RT_OS_DIR}) ++ ${COMPILER_RT_INSTALL_PATH}/${CMAKE_INSTALL_FULL_LIBDIR}/${COMPILER_RT_OS_DIR}) + endif() + + if(APPLE) +diff --git a/include/CMakeLists.txt b/include/CMakeLists.txt +index 38bd6e41a912..2092d0d08247 100644 +--- a/include/CMakeLists.txt ++++ b/include/CMakeLists.txt +@@ -50,12 +50,12 @@ set_target_properties(compiler-rt-headers PROPERTIES FOLDER "Compiler-RT Misc") + install(FILES ${SANITIZER_HEADERS} + COMPONENT compiler-rt-headers + PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ +- DESTINATION ${COMPILER_RT_INSTALL_PATH}/include/sanitizer) ++ DESTINATION ${COMPILER_RT_INSTALL_PATH}/${CMAKE_INSTALL_FULL_INCLUDEDIR}/sanitizer) + # Install xray headers. + install(FILES ${XRAY_HEADERS} + COMPONENT compiler-rt-headers + PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ +- DESTINATION ${COMPILER_RT_INSTALL_PATH}/include/xray) ++ DESTINATION ${COMPILER_RT_INSTALL_PATH}/${CMAKE_INSTALL_FULL_INCLUDEDIR}/xray) + + if (NOT CMAKE_CONFIGURATION_TYPES) # don't add this for IDEs. + add_custom_target(install-compiler-rt-headers +diff --git a/lib/dfsan/CMakeLists.txt b/lib/dfsan/CMakeLists.txt +index b3ae713cf02c..52b364b900f5 100644 +--- a/lib/dfsan/CMakeLists.txt ++++ b/lib/dfsan/CMakeLists.txt +@@ -54,4 +54,4 @@ add_custom_command(OUTPUT ${dfsan_abilist_filename} + DEPENDS done_abilist.txt libc_ubuntu1404_abilist.txt) + add_dependencies(dfsan dfsan_abilist) + install(FILES ${dfsan_abilist_filename} +- DESTINATION ${COMPILER_RT_INSTALL_PATH}/share) ++ DESTINATION ${COMPILER_RT_INSTALL_PATH}/${CMAKE_INSTALL_FULL_DATADIR}) diff --git a/pkgs/development/compilers/llvm/9/default.nix b/pkgs/development/compilers/llvm/9/default.nix index 1b8bdad07bb..14157842537 100644 --- a/pkgs/development/compilers/llvm/9/default.nix +++ b/pkgs/development/compilers/llvm/9/default.nix @@ -1,6 +1,5 @@ { lowPrio, newScope, pkgs, lib, stdenv, cmake, gccForLibs , libxml2, python3, isl, fetchurl, overrideCC, wrapCCWith, wrapBintoolsWith -, buildPackages , buildLlvmTools # tools, but from the previous stage, for cross , targetLlvmLibraries # libraries, but from the next stage, for cross }: @@ -18,43 +17,50 @@ let clang-tools-extra_src = fetch "clang-tools-extra" "01vgzd4k1q93nfs8gyl83mjlc4x0qsgfqw32lacbjzdxg0mdfvxj"; tools = lib.makeExtensible (tools: let - callPackage = newScope (tools // { inherit stdenv cmake libxml2 python3 isl release_version version fetch; }); + callPackage = newScope (tools // { inherit stdenv cmake libxml2 python3 isl release_version version fetch buildLlvmTools; }); mkExtraBuildCommands = cc: '' rsrc="$out/resource-root" mkdir "$rsrc" - ln -s "${cc}/lib/clang/${release_version}/include" "$rsrc" + ln -s "${cc.lib}/lib/clang/${release_version}/include" "$rsrc" ln -s "${targetLlvmLibraries.compiler-rt.out}/lib" "$rsrc/lib" echo "-resource-dir=$rsrc" >> $out/nix-support/cc-cflags ''; + in { - llvm = callPackage ./llvm { }; + libllvm = callPackage ./llvm { }; - llvm-polly = callPackage ./llvm { enablePolly = true; }; + # `llvm` historically had the binaries. But this migration + # technique also impedes `lib.get*`. Perhaps we will revisit it. + llvm = tools.libllvm.out; - clang-unwrapped = callPackage ./clang { - inherit (tools) lld; + libllvm-polly = callPackage ./llvm { enablePolly = true; }; + + llvm-polly = tools.libllvm-polly.lib; + + libclang = callPackage ./clang { inherit clang-tools-extra_src; }; + + clang-unwrapped = tools.libclang.out; + clang-polly-unwrapped = callPackage ./clang { inherit clang-tools-extra_src; - llvm = tools.llvm-polly; + libllvm = tools.libllvm-polly; enablePolly = true; }; # disabled until recommonmark supports sphinx 3 - #llvm-manpages = lowPrio (tools.llvm.override { + #llvm-manpages = lowPrio (tools.libllvm.override { # enableManpages = true; # python3 = pkgs.python3; # don't use python-boot #}); - clang-manpages = lowPrio (tools.clang-unwrapped.override { + clang-manpages = lowPrio (tools.libclang.override { enableManpages = true; python3 = pkgs.python3; # don't use python-boot }); - libclang = tools.clang-unwrapped.lib; - clang = if stdenv.cc.isGNU then tools.libstdcxxClang else tools.libcxxClang; libstdcxxClang = wrapCCWith rec { diff --git a/pkgs/development/compilers/llvm/9/libc++/default.nix b/pkgs/development/compilers/llvm/9/libc++/default.nix index 6ea1e28e7b4..3cdb4f32a05 100644 --- a/pkgs/development/compilers/llvm/9/libc++/default.nix +++ b/pkgs/development/compilers/llvm/9/libc++/default.nix @@ -13,7 +13,11 @@ stdenv.mkDerivation { export LIBCXXABI_INCLUDE_DIR="$PWD/$(ls -d libcxxabi-${version}*)/include" ''; - patches = lib.optional stdenv.hostPlatform.isMusl ../../libcxx-0001-musl-hacks.patch; + outputs = [ "out" "dev" ]; + + patches = [ + ./gnu-install-dirs.patch + ] ++ lib.optional stdenv.hostPlatform.isMusl ../../libcxx-0001-musl-hacks.patch; preConfigure = '' # Get headers from the cxxabi source so we can see private headers not installed by the cxxabi package diff --git a/pkgs/development/compilers/llvm/9/libc++/gnu-install-dirs.patch b/pkgs/development/compilers/llvm/9/libc++/gnu-install-dirs.patch new file mode 100644 index 00000000000..424488bd2e5 --- /dev/null +++ b/pkgs/development/compilers/llvm/9/libc++/gnu-install-dirs.patch @@ -0,0 +1,99 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index ec1869ddc7ae..a1c040235c8d 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -26,6 +26,8 @@ set(CMAKE_MODULE_PATH + if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR OR LIBCXX_STANDALONE_BUILD) + project(libcxx CXX C) + ++ include(GNUInstallDirs) ++ + set(PACKAGE_NAME libcxx) + set(PACKAGE_VERSION 9.0.1) + set(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}") +@@ -416,7 +418,7 @@ string(REGEX MATCH "[0-9]+\\.[0-9]+(\\.[0-9]+)?" CLANG_VERSION + if(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR AND NOT APPLE) + set(LIBCXX_LIBRARY_DIR ${LLVM_LIBRARY_OUTPUT_INTDIR}/${LLVM_DEFAULT_TARGET_TRIPLE}/c++) + set(LIBCXX_HEADER_DIR ${LLVM_BINARY_DIR}) +- set(LIBCXX_INSTALL_LIBRARY_DIR lib${LLVM_LIBDIR_SUFFIX}/${LLVM_DEFAULT_TARGET_TRIPLE}/c++) ++ set(LIBCXX_INSTALL_LIBRARY_DIR ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}/${LLVM_DEFAULT_TARGET_TRIPLE}/c++) + if(LIBCXX_LIBDIR_SUBDIR) + string(APPEND LIBCXX_LIBRARY_DIR /${LIBCXX_LIBDIR_SUBDIR}) + string(APPEND LIBCXX_INSTALL_LIBRARY_DIR /${LIBCXX_LIBDIR_SUBDIR}) +@@ -424,10 +426,10 @@ if(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR AND NOT APPLE) + elseif(LLVM_LIBRARY_OUTPUT_INTDIR) + set(LIBCXX_LIBRARY_DIR ${LLVM_LIBRARY_OUTPUT_INTDIR}) + set(LIBCXX_HEADER_DIR ${LLVM_BINARY_DIR}) +- set(LIBCXX_INSTALL_LIBRARY_DIR lib${LIBCXX_LIBDIR_SUFFIX}) ++ set(LIBCXX_INSTALL_LIBRARY_DIR ${CMAKE_INSTALL_LIBDIR}${LIBCXX_LIBDIR_SUFFIX}) + else() + set(LIBCXX_LIBRARY_DIR ${CMAKE_BINARY_DIR}/lib${LIBCXX_LIBDIR_SUFFIX}) +- set(LIBCXX_INSTALL_LIBRARY_DIR lib${LIBCXX_LIBDIR_SUFFIX}) ++ set(LIBCXX_INSTALL_LIBRARY_DIR ${CMAKE_INSTALL_LIBDIR}${LIBCXX_LIBDIR_SUFFIX}) + endif() + + file(MAKE_DIRECTORY "${LIBCXX_BINARY_INCLUDE_DIR}") +diff --git a/cmake/Modules/HandleLibCXXABI.cmake b/cmake/Modules/HandleLibCXXABI.cmake +index 10f100f7f0fb..95ed3978ab73 100644 +--- a/cmake/Modules/HandleLibCXXABI.cmake ++++ b/cmake/Modules/HandleLibCXXABI.cmake +@@ -61,7 +61,7 @@ macro(setup_abi_lib abidefines abishared abistatic abifiles abidirs) + + if (LIBCXX_INSTALL_HEADERS) + install(FILES "${LIBCXX_BINARY_INCLUDE_DIR}/${fpath}" +- DESTINATION ${LIBCXX_INSTALL_HEADER_PREFIX}include/c++/v1/${dstdir} ++ DESTINATION ${LIBCXX_INSTALL_HEADER_PREFIX}${CMAKE_INSTALL_INCLUDEDIR}/c++/v1/${dstdir} + COMPONENT cxx-headers + PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ + ) +diff --git a/include/CMakeLists.txt b/include/CMakeLists.txt +index 7cbf82caa81f..7cbde7accd78 100644 +--- a/include/CMakeLists.txt ++++ b/include/CMakeLists.txt +@@ -243,7 +243,7 @@ if (LIBCXX_INSTALL_HEADERS) + foreach(file ${files}) + get_filename_component(dir ${file} DIRECTORY) + install(FILES ${file} +- DESTINATION ${LIBCXX_INSTALL_HEADER_PREFIX}include/c++/v1/${dir} ++ DESTINATION ${LIBCXX_INSTALL_HEADER_PREFIX}${CMAKE_INSTALL_INCLUDEDIR}/c++/v1/${dir} + COMPONENT ${CXX_HEADER_TARGET} + PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ + ) +@@ -252,7 +252,7 @@ if (LIBCXX_INSTALL_HEADERS) + if (LIBCXX_NEEDS_SITE_CONFIG) + # Install the generated header as __config. + install(FILES ${LIBCXX_BINARY_DIR}/__generated_config +- DESTINATION ${LIBCXX_INSTALL_HEADER_PREFIX}include/c++/v1 ++ DESTINATION ${LIBCXX_INSTALL_HEADER_PREFIX}${CMAKE_INSTALL_INCLUDEDIR}/c++/v1 + PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ + RENAME __config + COMPONENT ${CXX_HEADER_TARGET}) +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index 31cd24333a5e..a419cef662b0 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -437,21 +437,21 @@ if (LIBCXX_INSTALL_LIBRARY) + install(TARGETS cxx_shared + ARCHIVE DESTINATION ${LIBCXX_INSTALL_PREFIX}${LIBCXX_INSTALL_LIBRARY_DIR} COMPONENT cxx + LIBRARY DESTINATION ${LIBCXX_INSTALL_PREFIX}${LIBCXX_INSTALL_LIBRARY_DIR} COMPONENT cxx +- RUNTIME DESTINATION ${LIBCXX_INSTALL_PREFIX}bin COMPONENT cxx) ++ RUNTIME DESTINATION ${LIBCXX_INSTALL_PREFIX}${CMAKE_INSTALL_BINDIR} COMPONENT cxx) + endif() + + if (LIBCXX_INSTALL_STATIC_LIBRARY) + install(TARGETS cxx_static + ARCHIVE DESTINATION ${LIBCXX_INSTALL_PREFIX}${LIBCXX_INSTALL_LIBRARY_DIR} COMPONENT cxx + LIBRARY DESTINATION ${LIBCXX_INSTALL_PREFIX}${LIBCXX_INSTALL_LIBRARY_DIR} COMPONENT cxx +- RUNTIME DESTINATION ${LIBCXX_INSTALL_PREFIX}bin COMPONENT cxx) ++ RUNTIME DESTINATION ${LIBCXX_INSTALL_PREFIX}${CMAKE_INSTALL_BINDIR} COMPONENT cxx) + endif() + + if(LIBCXX_INSTALL_EXPERIMENTAL_LIBRARY) + install(TARGETS ${LIBCXX_INSTALL_TARGETS} ${experimental_lib} + LIBRARY DESTINATION ${LIBCXX_INSTALL_PREFIX}${LIBCXX_INSTALL_LIBRARY_DIR} COMPONENT cxx + ARCHIVE DESTINATION ${LIBCXX_INSTALL_PREFIX}${LIBCXX_INSTALL_LIBRARY_DIR} COMPONENT cxx +- RUNTIME DESTINATION ${LIBCXX_INSTALL_PREFIX}bin COMPONENT cxx) ++ RUNTIME DESTINATION ${LIBCXX_INSTALL_PREFIX}${CMAKE_INSTALL_BINDIR} COMPONENT cxx) + endif() + + # NOTE: This install command must go after the cxx install command otherwise diff --git a/pkgs/development/compilers/llvm/9/libc++abi/default.nix b/pkgs/development/compilers/llvm/9/libc++abi/default.nix index 99d3918b89d..5358985f448 100644 --- a/pkgs/development/compilers/llvm/9/libc++abi/default.nix +++ b/pkgs/development/compilers/llvm/9/libc++abi/default.nix @@ -8,6 +8,25 @@ stdenv.mkDerivation { src = fetch "libcxxabi" "1b4aiaa8cirx52vk2p5kfk57qmbqf1ipb4nqnjhdgqps9jm7iyg8"; + outputs = [ "out" "dev" ]; + + postUnpack = '' + unpackFile ${libcxx.src} + unpackFile ${llvm.src} + cmakeFlags+=" -DLLVM_PATH=$PWD/$(ls -d llvm-*) -DLIBCXXABI_LIBCXX_PATH=$PWD/$(ls -d libcxx-*)" + '' + lib.optionalString stdenv.isDarwin '' + export TRIPLE=x86_64-apple-darwin + '' + lib.optionalString stdenv.hostPlatform.isMusl '' + patch -p1 -d $(ls -d libcxx-*) -i ${../../libcxx-0001-musl-hacks.patch} + '' + lib.optionalString stdenv.hostPlatform.isWasm '' + patch -p1 -d $(ls -d llvm-*) -i ${./wasm.patch} + ''; + + patches = [ + ./no-threads.patch + ./gnu-install-dirs.patch + ]; + nativeBuildInputs = [ cmake ]; buildInputs = lib.optional (!stdenv.isDarwin && !stdenv.isFreeBSD && !stdenv.hostPlatform.isWasm) libunwind; @@ -21,20 +40,6 @@ stdenv.mkDerivation { "-DLIBCXXABI_ENABLE_SHARED=OFF" ]; - patches = [ ./no-threads.patch ]; - - postUnpack = '' - unpackFile ${libcxx.src} - unpackFile ${llvm.src} - cmakeFlags+=" -DLLVM_PATH=$PWD/$(ls -d llvm-*) -DLIBCXXABI_LIBCXX_PATH=$PWD/$(ls -d libcxx-*)" - '' + lib.optionalString stdenv.isDarwin '' - export TRIPLE=x86_64-apple-darwin - '' + lib.optionalString stdenv.hostPlatform.isMusl '' - patch -p1 -d $(ls -d libcxx-*) -i ${../../libcxx-0001-musl-hacks.patch} - '' + lib.optionalString stdenv.hostPlatform.isWasm '' - patch -p1 -d $(ls -d llvm-*) -i ${./wasm.patch} - ''; - installPhase = if stdenv.isDarwin then '' for file in lib/*.dylib; do diff --git a/pkgs/development/compilers/llvm/9/libc++abi/gnu-install-dirs.patch b/pkgs/development/compilers/llvm/9/libc++abi/gnu-install-dirs.patch new file mode 100644 index 00000000000..70b41a6ff53 --- /dev/null +++ b/pkgs/development/compilers/llvm/9/libc++abi/gnu-install-dirs.patch @@ -0,0 +1,34 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index aa0b124fc3c4..d74373f465c5 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -20,6 +20,8 @@ set(CMAKE_MODULE_PATH + if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR OR LIBCXXABI_STANDALONE_BUILD) + project(libcxxabi CXX C) + ++ include(GNUInstallDirs) ++ + set(PACKAGE_NAME libcxxabi) + set(PACKAGE_VERSION 9.0.1) + set(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}") +@@ -181,17 +183,17 @@ string(REGEX MATCH "[0-9]+\\.[0-9]+(\\.[0-9]+)?" CLANG_VERSION + + if(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR AND NOT APPLE) + set(LIBCXXABI_LIBRARY_DIR ${LLVM_LIBRARY_OUTPUT_INTDIR}/${LLVM_DEFAULT_TARGET_TRIPLE}/c++) +- set(LIBCXXABI_INSTALL_LIBRARY_DIR lib${LLVM_LIBDIR_SUFFIX}/${LLVM_DEFAULT_TARGET_TRIPLE}/c++) ++ set(LIBCXXABI_INSTALL_LIBRARY_DIR ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}/${LLVM_DEFAULT_TARGET_TRIPLE}/c++) + if(LIBCXX_LIBDIR_SUBDIR) + string(APPEND LIBCXXABI_LIBRARY_DIR /${LIBCXXABI_LIBDIR_SUBDIR}) + string(APPEND LIBCXXABI_INSTALL_LIBRARY_DIR /${LIBCXXABI_LIBDIR_SUBDIR}) + endif() + elseif(LLVM_LIBRARY_OUTPUT_INTDIR) + set(LIBCXXABI_LIBRARY_DIR ${LLVM_LIBRARY_OUTPUT_INTDIR}) +- set(LIBCXXABI_INSTALL_LIBRARY_DIR lib${LIBCXXABI_LIBDIR_SUFFIX}) ++ set(LIBCXXABI_INSTALL_LIBRARY_DIR ${CMAKE_INSTALL_LIBDIR}${LIBCXXABI_LIBDIR_SUFFIX}) + else() + set(LIBCXXABI_LIBRARY_DIR ${CMAKE_BINARY_DIR}/lib${LIBCXXABI_LIBDIR_SUFFIX}) +- set(LIBCXXABI_INSTALL_LIBRARY_DIR lib${LIBCXXABI_LIBDIR_SUFFIX}) ++ set(LIBCXXABI_INSTALL_LIBRARY_DIR ${CMAKE_INSTALL_LIBDIR}${LIBCXXABI_LIBDIR_SUFFIX}) + endif() + + set(LIBCXXABI_INSTALL_PREFIX "" CACHE STRING "Define libc++abi destination prefix.") diff --git a/pkgs/development/compilers/llvm/9/libunwind/default.nix b/pkgs/development/compilers/llvm/9/libunwind/default.nix index 4c4c85512e3..fdb362dcd2e 100644 --- a/pkgs/development/compilers/llvm/9/libunwind/default.nix +++ b/pkgs/development/compilers/llvm/9/libunwind/default.nix @@ -8,6 +8,12 @@ stdenv.mkDerivation rec { src = fetch pname "1wb02ha3gl6p0a321hwpll74pz5qvjr11xmjqx62g288f1m10njk"; + patches = [ + ./gnu-install-dirs.patch + ]; + + outputs = [ "out" "dev" ]; + nativeBuildInputs = [ cmake ]; cmakeFlags = lib.optional (!enableShared) "-DLIBUNWIND_ENABLE_SHARED=OFF"; diff --git a/pkgs/development/compilers/llvm/9/libunwind/gnu-install-dirs.patch b/pkgs/development/compilers/llvm/9/libunwind/gnu-install-dirs.patch new file mode 100644 index 00000000000..12171bb5155 --- /dev/null +++ b/pkgs/development/compilers/llvm/9/libunwind/gnu-install-dirs.patch @@ -0,0 +1,34 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index df68491d686e..3b53267ae464 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -18,6 +18,8 @@ set(CMAKE_MODULE_PATH + if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR OR LIBUNWIND_STANDALONE_BUILD) + project(libunwind) + ++ include(GNUInstallDirs) ++ + # Rely on llvm-config. + set(CONFIG_OUTPUT) + if(NOT LLVM_CONFIG_PATH) +@@ -189,17 +191,17 @@ string(REGEX MATCH "[0-9]+\\.[0-9]+(\\.[0-9]+)?" CLANG_VERSION + + if(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR AND NOT APPLE) + set(LIBUNWIND_LIBRARY_DIR ${LLVM_LIBRARY_OUTPUT_INTDIR}/${LLVM_DEFAULT_TARGET_TRIPLE}/c++) +- set(LIBUNWIND_INSTALL_LIBRARY_DIR lib${LLVM_LIBDIR_SUFFIX}/${LLVM_DEFAULT_TARGET_TRIPLE}/c++) ++ set(LIBUNWIND_INSTALL_LIBRARY_DIR ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}/${LLVM_DEFAULT_TARGET_TRIPLE}/c++) + if(LIBCXX_LIBDIR_SUBDIR) + string(APPEND LIBUNWIND_LIBRARY_DIR /${LIBUNWIND_LIBDIR_SUBDIR}) + string(APPEND LIBUNWIND_INSTALL_LIBRARY_DIR /${LIBUNWIND_LIBDIR_SUBDIR}) + endif() + elseif(LLVM_LIBRARY_OUTPUT_INTDIR) + set(LIBUNWIND_LIBRARY_DIR ${LLVM_LIBRARY_OUTPUT_INTDIR}) +- set(LIBUNWIND_INSTALL_LIBRARY_DIR lib${LIBUNWIND_LIBDIR_SUFFIX}) ++ set(LIBUNWIND_INSTALL_LIBRARY_DIR ${CMAKE_INSTALL_LIBDIR}${LIBUNWIND_LIBDIR_SUFFIX}) + else() + set(LIBUNWIND_LIBRARY_DIR ${CMAKE_BINARY_DIR}/lib${LIBUNWIND_LIBDIR_SUFFIX}) +- set(LIBUNWIND_INSTALL_LIBRARY_DIR lib${LIBUNWIND_LIBDIR_SUFFIX}) ++ set(LIBUNWIND_INSTALL_LIBRARY_DIR ${CMAKE_INSTALL_LIBDIR}${LIBUNWIND_LIBDIR_SUFFIX}) + endif() + + set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${LIBUNWIND_LIBRARY_DIR}) diff --git a/pkgs/development/compilers/llvm/9/lld/default.nix b/pkgs/development/compilers/llvm/9/lld/default.nix index 8b12642d2a7..cd84afe70e4 100644 --- a/pkgs/development/compilers/llvm/9/lld/default.nix +++ b/pkgs/development/compilers/llvm/9/lld/default.nix @@ -1,8 +1,9 @@ { lib, stdenv +, buildLlvmTools , fetch , cmake , libxml2 -, llvm +, libllvm , version }: @@ -12,15 +13,20 @@ stdenv.mkDerivation rec { src = fetch pname "10hckfxpapfnh6y9apjiya2jpw9nmbbmh8ayijx89mrg7snjn9l6"; + patches = [ + ./gnu-install-dirs.patch + ]; + nativeBuildInputs = [ cmake ]; - buildInputs = [ llvm libxml2 ]; + buildInputs = [ libllvm libxml2 ]; - outputs = [ "out" "dev" ]; + cmakeFlags = [ + "-DLLVM_CONFIG_PATH=${libllvm.dev}/bin/llvm-config${lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) "-native"}" + ] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ + "-DLLVM_TABLEGEN_EXE=${buildLlvmTools.llvm}/bin/llvm-tblgen" + ]; - postInstall = '' - moveToOutput include "$dev" - moveToOutput lib "$dev" - ''; + outputs = [ "out" "lib" "dev" ]; meta = { description = "The LLVM Linker"; diff --git a/pkgs/development/compilers/llvm/9/lld/gnu-install-dirs.patch b/pkgs/development/compilers/llvm/9/lld/gnu-install-dirs.patch new file mode 100644 index 00000000000..232f5cbac9d --- /dev/null +++ b/pkgs/development/compilers/llvm/9/lld/gnu-install-dirs.patch @@ -0,0 +1,68 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 641f71c114ae..9d44c1463aff 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -6,6 +6,8 @@ if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR) + set(CMAKE_INCLUDE_CURRENT_DIR ON) + set(LLD_BUILT_STANDALONE TRUE) + ++ include(GNUInstallDirs) ++ + find_program(LLVM_CONFIG_PATH "llvm-config" DOC "Path to llvm-config binary") + if(NOT LLVM_CONFIG_PATH) + message(FATAL_ERROR "llvm-config not found: specify LLVM_CONFIG_PATH") +@@ -202,7 +204,7 @@ include_directories(BEFORE + + if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY) + install(DIRECTORY include/ +- DESTINATION include ++ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} + FILES_MATCHING + PATTERN "*.h" + PATTERN ".svn" EXCLUDE +diff --git a/cmake/modules/AddLLD.cmake b/cmake/modules/AddLLD.cmake +index fa48b428d26b..e7967aad3ceb 100644 +--- a/cmake/modules/AddLLD.cmake ++++ b/cmake/modules/AddLLD.cmake +@@ -20,9 +20,9 @@ macro(add_lld_library name) + install(TARGETS ${name} + COMPONENT ${name} + ${export_to_lldtargets} +- LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX} +- ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX} +- RUNTIME DESTINATION bin) ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX} ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) + + if (${ARG_SHARED} AND NOT CMAKE_CONFIGURATION_TYPES) + add_llvm_install_targets(install-${name} +@@ -54,7 +54,7 @@ macro(add_lld_tool name) + + install(TARGETS ${name} + ${export_to_lldtargets} +- RUNTIME DESTINATION bin ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + COMPONENT ${name}) + + if(NOT CMAKE_CONFIGURATION_TYPES) +@@ -69,5 +69,5 @@ endmacro() + macro(add_lld_symlink name dest) + add_llvm_tool_symlink(${name} ${dest} ALWAYS_GENERATE) + # Always generate install targets +- llvm_install_symlink(${name} ${dest} ALWAYS_GENERATE) ++ llvm_install_symlink(${name} ${dest} ${CMAKE_INSTALL_FULL_BINDIR} ALWAYS_GENERATE) + endmacro() +diff --git a/tools/lld/CMakeLists.txt b/tools/lld/CMakeLists.txt +index a15e296e31df..654c2cfdb9c0 100644 +--- a/tools/lld/CMakeLists.txt ++++ b/tools/lld/CMakeLists.txt +@@ -17,7 +17,7 @@ target_link_libraries(lld + ) + + install(TARGETS lld +- RUNTIME DESTINATION bin) ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) + + if(NOT LLD_SYMLINKS_TO_CREATE) + set(LLD_SYMLINKS_TO_CREATE lld-link ld.lld ld64.lld wasm-ld) diff --git a/pkgs/development/compilers/llvm/9/lldb/default.nix b/pkgs/development/compilers/llvm/9/lldb/default.nix index d75acf135f3..6d753ce1a86 100644 --- a/pkgs/development/compilers/llvm/9/lldb/default.nix +++ b/pkgs/development/compilers/llvm/9/lldb/default.nix @@ -7,8 +7,8 @@ , which , libedit , libxml2 -, llvm -, clang-unwrapped +, libllvm +, libclang , python3 , version , darwin @@ -21,17 +21,20 @@ stdenv.mkDerivation rec { src = fetch pname "02gb3fbz09kyw8n71218v5v77ip559x3gqbcp8y3w6n3jpbryywa"; - patches = [ ./procfs.patch ]; + patches = [ + ./procfs.patch + ./gnu-install-dirs.patch + ]; + + outputs = [ "out" "lib" "dev" ]; + + nativeBuildInputs = [ + cmake python3 which swig lit + ]; - nativeBuildInputs = [ cmake python3 which swig lit ]; buildInputs = [ - ncurses - zlib - libedit - libxml2 - llvm - ] - ++ lib.optionals stdenv.isDarwin [ + ncurses zlib libedit libxml2 libllvm + ] ++ lib.optionals stdenv.isDarwin [ darwin.libobjc darwin.apple_sdk.libs.xpc darwin.apple_sdk.frameworks.Foundation @@ -44,11 +47,17 @@ stdenv.mkDerivation rec { hardeningDisable = [ "format" ]; cmakeFlags = [ - "-DLLDB_CODESIGN_IDENTITY=" # codesigning makes nondeterministic - "-DClang_DIR=${clang-unwrapped}/lib/cmake" + "-DLLDB_INCLUDE_TESTS=${if doCheck then "YES" else "NO"}" + "-DClang_DIR=${libclang.dev}/lib/cmake" "-DLLVM_EXTERNAL_LIT=${lit}/bin/lit" + "-DLLDB_CODESIGN_IDENTITY=" # codesigning makes nondeterministic + ] ++ lib.optionals doCheck [ + "-DLLDB_TEST_C_COMPILER=${stdenv.cc}/bin/${stdenv.cc.targetPrefix}cc" + "-DLLDB_TEST_CXX_COMPILER=${stdenv.cc}/bin/${stdenv.cc.targetPrefix}c++" ]; + doCheck = false; + postInstall = '' # man page mkdir -p $out/share/man/man1 @@ -58,13 +67,13 @@ stdenv.mkDerivation rec { # vscode: install -D ../tools/lldb-vscode/package.json $out/share/vscode/extensions/llvm-org.lldb-vscode-0.1.0/package.json mkdir -p $out/share/vscode/extensions/llvm-org.lldb-vscode-0.1.0/bin - ln -s $out/bin/lldb-vscode $out/share/vscode/extensions/llvm-org.lldb-vscode-0.1.0/bin + ln -s $out/bin/llvm-vscode $out/share/vscode/extensions/llvm-org.lldb-vscode-0.1.0/bin ''; meta = with lib; { description = "A next-generation high-performance debugger"; - homepage = "https://llvm.org/"; - license = licenses.ncsa; - platforms = platforms.all; + homepage = "https://llvm.org/"; + license = licenses.ncsa; + platforms = platforms.all; }; } diff --git a/pkgs/development/compilers/llvm/9/lldb/gnu-install-dirs.patch b/pkgs/development/compilers/llvm/9/lldb/gnu-install-dirs.patch new file mode 100644 index 00000000000..cb4e400b367 --- /dev/null +++ b/pkgs/development/compilers/llvm/9/lldb/gnu-install-dirs.patch @@ -0,0 +1,65 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 5d52f6450657..a05130cf80b9 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -14,6 +14,8 @@ set(CMAKE_MODULE_PATH + # If we are not building as part of LLVM, build LLDB as a standalone project, + # using LLVM as an external library. + if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR) ++ include(GNUInstallDirs) ++ + include(LLDBStandalone) + endif() + +diff --git a/cmake/modules/AddLLDB.cmake b/cmake/modules/AddLLDB.cmake +index 4c99278c583b..36d3640a6afc 100644 +--- a/cmake/modules/AddLLDB.cmake ++++ b/cmake/modules/AddLLDB.cmake +@@ -94,13 +94,13 @@ function(add_lldb_library name) + endif() + + if(PARAM_SHARED) +- set(install_dest lib${LLVM_LIBDIR_SUFFIX}) ++ set(install_dest ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}) + if(PARAM_INSTALL_PREFIX) + set(install_dest ${PARAM_INSTALL_PREFIX}) + endif() + # RUNTIME is relevant for DLL platforms, FRAMEWORK for macOS + install(TARGETS ${name} COMPONENT ${name} +- RUNTIME DESTINATION bin ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${install_dest} + ARCHIVE DESTINATION ${install_dest} + FRAMEWORK DESTINATION ${install_dest}) +diff --git a/cmake/modules/LLDBConfig.cmake b/cmake/modules/LLDBConfig.cmake +index e1a133709ff2..357b4bb4492a 100644 +--- a/cmake/modules/LLDBConfig.cmake ++++ b/cmake/modules/LLDBConfig.cmake +@@ -335,7 +335,7 @@ include_directories(BEFORE + if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY) + install(DIRECTORY include/ + COMPONENT lldb-headers +- DESTINATION include ++ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} + FILES_MATCHING + PATTERN "*.h" + PATTERN ".svn" EXCLUDE +@@ -345,7 +345,7 @@ if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY) + + install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/include/ + COMPONENT lldb-headers +- DESTINATION include ++ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} + FILES_MATCHING + PATTERN "*.h" + PATTERN ".svn" EXCLUDE +diff --git a/tools/intel-features/CMakeLists.txt b/tools/intel-features/CMakeLists.txt +index b5316540fdf3..3c3c882d503f 100644 +--- a/tools/intel-features/CMakeLists.txt ++++ b/tools/intel-features/CMakeLists.txt +@@ -64,4 +64,4 @@ if (NOT LLDB_DISABLE_PYTHON AND LLDB_BUILD_INTEL_PT) + endif() + + install(TARGETS lldbIntelFeatures +- LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX}) ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}) diff --git a/pkgs/development/compilers/llvm/9/llvm/default.nix b/pkgs/development/compilers/llvm/9/llvm/default.nix index b795f07d472..78d8d7b30ef 100644 --- a/pkgs/development/compilers/llvm/9/llvm/default.nix +++ b/pkgs/development/compilers/llvm/9/llvm/default.nix @@ -1,4 +1,5 @@ { lib, stdenv +, pkgsBuildBuild , fetch , cmake , python3 @@ -10,10 +11,10 @@ , version , release_version , zlib -, buildPackages +, buildLlvmTools , debugVersion ? false , enableManpages ? false -, enableSharedLibraries ? true +, enableSharedLibraries ? !stdenv.hostPlatform.isStatic , enablePFM ? !(stdenv.isDarwin || stdenv.isAarch64 # broken for Ampere eMAG 8180 (c2.large.arm on Packet) #56245 || stdenv.isAarch32 # broken for the armv7l builder @@ -44,8 +45,7 @@ in stdenv.mkDerivation (rec { mv polly-* $sourceRoot/tools/polly ''; - outputs = [ "out" "python" ] - ++ optional enableSharedLibraries "lib"; + outputs = [ "out" "lib" "dev" "python" ]; nativeBuildInputs = [ cmake python3 ] ++ optionals enableManpages [ python3.pkgs.sphinx python3.pkgs.recommonmark ]; @@ -55,10 +55,14 @@ in stdenv.mkDerivation (rec { propagatedBuildInputs = [ ncurses zlib ]; + patches = [ + ./gnu-install-dirs.patch + ] ++ lib.optional enablePolly ./gnu-install-dirs-polly.patch; + postPatch = optionalString stdenv.isDarwin '' substituteInPlace cmake/modules/AddLLVM.cmake \ --replace 'set(_install_name_dir INSTALL_NAME_DIR "@rpath")' "set(_install_name_dir)" \ - --replace 'set(_install_rpath "@loader_path/../lib" ''${extra_libdir})' "" + --replace 'set(_install_rpath "@loader_path/../''${CMAKE_INSTALL_LIBDIR}" ''${extra_libdir})' "" '' # Patch llvm-config to return correct library path based on --link-{shared,static}. + optionalString (enableSharedLibraries) '' @@ -104,6 +108,7 @@ in stdenv.mkDerivation (rec { ''; cmakeFlags = with stdenv; [ + "-DLLVM_INSTALL_CMAKE_DIR=${placeholder "dev"}/lib/cmake/llvm/" "-DCMAKE_BUILD_TYPE=${if debugVersion then "Debug" else "Release"}" "-DLLVM_INSTALL_UTILS=ON" # Needed by rustc "-DLLVM_BUILD_TESTS=ON" @@ -127,7 +132,20 @@ in stdenv.mkDerivation (rec { "-DCAN_TARGET_i386=false" ] ++ optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ "-DCMAKE_CROSSCOMPILING=True" - "-DLLVM_TABLEGEN=${buildPackages.llvm_9}/bin/llvm-tblgen" + "-DLLVM_TABLEGEN=${buildLlvmTools.llvm}/bin/llvm-tblgen" + ( + let + nativeCC = pkgsBuildBuild.targetPackages.stdenv.cc; + nativeBintools = nativeCC.bintools.bintools; + nativeToolchainFlags = [ + "-DCMAKE_C_COMPILER=${nativeCC}/bin/${nativeCC.targetPrefix}cc" + "-DCMAKE_CXX_COMPILER=${nativeCC}/bin/${nativeCC.targetPrefix}c++" + "-DCMAKE_AR=${nativeBintools}/bin/${nativeBintools.targetPrefix}ar" + "-DCMAKE_STRIP=${nativeBintools}/bin/${nativeBintools.targetPrefix}strip" + "-DCMAKE_RANLIB=${nativeBintools}/bin/${nativeBintools.targetPrefix}ranlib" + ]; + in "-DCROSS_TOOLCHAIN_FLAGS_NATIVE:list=${lib.concatStringsSep ";" nativeToolchainFlags}" + ) ]; postBuild = '' @@ -141,18 +159,19 @@ in stdenv.mkDerivation (rec { postInstall = '' mkdir -p $python/share mv $out/share/opt-viewer $python/share/opt-viewer - '' - + optionalString enableSharedLibraries '' - moveToOutput "lib/libLLVM-*" "$lib" - moveToOutput "lib/libLLVM${stdenv.hostPlatform.extensions.sharedLibrary}" "$lib" - substituteInPlace "$out/lib/cmake/llvm/LLVMExports-${if debugVersion then "debug" else "release"}.cmake" \ - --replace "\''${_IMPORT_PREFIX}/lib/libLLVM-" "$lib/lib/libLLVM-" + moveToOutput "bin/llvm-config*" "$dev" + substituteInPlace "$dev/lib/cmake/llvm/LLVMExports-${if debugVersion then "debug" else "release"}.cmake" \ + --replace "\''${_IMPORT_PREFIX}/lib/lib" "$lib/lib/lib" \ + --replace "$out/bin/llvm-config" "$dev/bin/llvm-config" + substituteInPlace "$dev/lib/cmake/llvm/LLVMConfig.cmake" \ + --replace 'set(LLVM_BINARY_DIR "''${LLVM_INSTALL_PREFIX}")' 'set(LLVM_BINARY_DIR "''${LLVM_INSTALL_PREFIX}'"$lib"'")' '' + optionalString (stdenv.isDarwin && enableSharedLibraries) '' - substituteInPlace "$out/lib/cmake/llvm/LLVMExports-${if debugVersion then "debug" else "release"}.cmake" \ - --replace "\''${_IMPORT_PREFIX}/lib/libLLVM.dylib" "$lib/lib/libLLVM.dylib" ln -s $lib/lib/libLLVM.dylib $lib/lib/libLLVM-${shortVersion}.dylib ln -s $lib/lib/libLLVM.dylib $lib/lib/libLLVM-${release_version}.dylib + '' + + optionalString (stdenv.buildPlatform != stdenv.hostPlatform) '' + cp NATIVE/bin/llvm-config $dev/bin/llvm-config-native ''; doCheck = stdenv.isLinux && (!stdenv.isx86_32); diff --git a/pkgs/development/compilers/llvm/9/llvm/gnu-install-dirs-polly.patch b/pkgs/development/compilers/llvm/9/llvm/gnu-install-dirs-polly.patch new file mode 100644 index 00000000000..7c477c7df58 --- /dev/null +++ b/pkgs/development/compilers/llvm/9/llvm/gnu-install-dirs-polly.patch @@ -0,0 +1,106 @@ +diff --git a/tools/polly/CMakeLists.txt b/tools/polly/CMakeLists.txt +index 9939097f743e..8cc538da912a 100644 +--- a/tools/polly/CMakeLists.txt ++++ b/tools/polly/CMakeLists.txt +@@ -2,7 +2,11 @@ + if (NOT DEFINED LLVM_MAIN_SRC_DIR) + project(Polly) + cmake_minimum_required(VERSION 3.4.3) ++endif() ++ ++include(GNUInstallDirs) + ++if (NOT DEFINED LLVM_MAIN_SRC_DIR) + # Where is LLVM installed? + find_package(LLVM CONFIG REQUIRED) + set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${LLVM_CMAKE_DIR}) +@@ -145,14 +149,14 @@ include_directories( + + if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY) + install(DIRECTORY include/ +- DESTINATION include ++ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} + FILES_MATCHING + PATTERN "*.h" + PATTERN ".svn" EXCLUDE + ) + + install(DIRECTORY ${POLLY_BINARY_DIR}/include/ +- DESTINATION include ++ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} + FILES_MATCHING + PATTERN "*.h" + PATTERN "CMakeFiles" EXCLUDE +diff --git a/tools/polly/cmake/CMakeLists.txt b/tools/polly/cmake/CMakeLists.txt +index 211f95512717..f9e04a4844b6 100644 +--- a/tools/polly/cmake/CMakeLists.txt ++++ b/tools/polly/cmake/CMakeLists.txt +@@ -79,18 +79,18 @@ file(GENERATE + + # Generate PollyConfig.cmake for the install tree. + unset(POLLY_EXPORTS) +-set(POLLY_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}") ++set(POLLY_INSTALL_PREFIX "") + set(POLLY_CONFIG_LLVM_CMAKE_DIR "${LLVM_BINARY_DIR}/${LLVM_INSTALL_PACKAGE_DIR}") +-set(POLLY_CONFIG_CMAKE_DIR "${POLLY_INSTALL_PREFIX}/${POLLY_INSTALL_PACKAGE_DIR}") +-set(POLLY_CONFIG_LIBRARY_DIRS "${POLLY_INSTALL_PREFIX}/lib${LLVM_LIBDIR_SUFFIX}") ++set(POLLY_CONFIG_CMAKE_DIR "${POLLY_INSTALL_PREFIX}${CMAKE_INSTALL_PREFIX}/${POLLY_INSTALL_PACKAGE_DIR}") ++set(POLLY_CONFIG_LIBRARY_DIRS "${POLLY_INSTALL_PREFIX}${CMAKE_INSTALL_FULL_LIBDIR}${LLVM_LIBDIR_SUFFIX}") + if (POLLY_BUNDLED_ISL) + set(POLLY_CONFIG_INCLUDE_DIRS +- "${POLLY_INSTALL_PREFIX}/include" +- "${POLLY_INSTALL_PREFIX}/include/polly" ++ "${POLLY_INSTALL_PREFIX}${CMAKE_INSTALL_FULL_LIBDIR}" ++ "${POLLY_INSTALL_PREFIX}${CMAKE_INSTALL_FULL_LIBDIR}/polly" + ) + else() + set(POLLY_CONFIG_INCLUDE_DIRS +- "${POLLY_INSTALL_PREFIX}/include" ++ "${POLLY_INSTALL_PREFIX}${CMAKE_INSTALL_FULL_INCLUDEDIR}" + ${ISL_INCLUDE_DIRS} + ) + endif() +@@ -100,12 +100,12 @@ endif() + foreach(tgt IN LISTS POLLY_CONFIG_EXPORTED_TARGETS) + get_target_property(tgt_type ${tgt} TYPE) + if (tgt_type STREQUAL "EXECUTABLE") +- set(tgt_prefix "bin/") ++ set(tgt_prefix "${CMAKE_INSTALL_BINDIR}/") + else() +- set(tgt_prefix "lib/") ++ set(tgt_prefix "${CMAKE_INSTALL_LIBDIR}/") + endif() + +- set(tgt_path "${CMAKE_INSTALL_PREFIX}/${tgt_prefix}$") ++ set(tgt_path "${tgt_prefix}$") + file(RELATIVE_PATH tgt_path ${POLLY_CONFIG_CMAKE_DIR} ${tgt_path}) + + if (NOT tgt_type STREQUAL "INTERFACE_LIBRARY") +diff --git a/tools/polly/cmake/polly_macros.cmake b/tools/polly/cmake/polly_macros.cmake +index e48203871884..5bc8a2a52541 100644 +--- a/tools/polly/cmake/polly_macros.cmake ++++ b/tools/polly/cmake/polly_macros.cmake +@@ -44,8 +44,8 @@ macro(add_polly_library name) + if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY OR ${name} STREQUAL "LLVMPolly") + install(TARGETS ${name} + EXPORT LLVMExports +- LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX} +- ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX}) ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}) + endif() + set_property(GLOBAL APPEND PROPERTY LLVM_EXPORTS ${name}) + endmacro(add_polly_library) +diff --git a/tools/polly/lib/External/CMakeLists.txt b/tools/polly/lib/External/CMakeLists.txt +index 8ffd984e542b..261cc19f3238 100644 +--- a/tools/polly/lib/External/CMakeLists.txt ++++ b/tools/polly/lib/External/CMakeLists.txt +@@ -274,7 +274,7 @@ if (POLLY_BUNDLED_ISL) + install(DIRECTORY + ${ISL_SOURCE_DIR}/include/ + ${ISL_BINARY_DIR}/include/ +- DESTINATION include/polly ++ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/polly + FILES_MATCHING + PATTERN "*.h" + PATTERN "CMakeFiles" EXCLUDE diff --git a/pkgs/development/compilers/llvm/9/llvm/gnu-install-dirs.patch b/pkgs/development/compilers/llvm/9/llvm/gnu-install-dirs.patch new file mode 100644 index 00000000000..380cc3f6df3 --- /dev/null +++ b/pkgs/development/compilers/llvm/9/llvm/gnu-install-dirs.patch @@ -0,0 +1,395 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index b9a10685b99f..c2750500df99 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -242,15 +242,21 @@ if (CMAKE_BUILD_TYPE AND + message(FATAL_ERROR "Invalid value for CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}") + endif() + ++include(GNUInstallDirs) ++ + set(LLVM_LIBDIR_SUFFIX "" CACHE STRING "Define suffix of library directory name (32/64)" ) + +-set(LLVM_TOOLS_INSTALL_DIR "bin" CACHE STRING "Path for binary subdirectory (defaults to 'bin')") ++set(LLVM_TOOLS_INSTALL_DIR "${CMAKE_INSTALL_BINDIR}" CACHE STRING ++ "Path for binary subdirectory (defaults to 'bin')") + mark_as_advanced(LLVM_TOOLS_INSTALL_DIR) + + set(LLVM_UTILS_INSTALL_DIR "${LLVM_TOOLS_INSTALL_DIR}" CACHE STRING + "Path to install LLVM utilities (enabled by LLVM_INSTALL_UTILS=ON) (defaults to LLVM_TOOLS_INSTALL_DIR)") + mark_as_advanced(LLVM_UTILS_INSTALL_DIR) + ++set(LLVM_INSTALL_CMAKE_DIR "${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}/cmake/llvm" CACHE STRING ++ "Path for CMake subdirectory (defaults to lib/cmake/llvm)" ) ++ + # They are used as destination of target generators. + set(LLVM_RUNTIME_OUTPUT_INTDIR ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bin) + set(LLVM_LIBRARY_OUTPUT_INTDIR ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/lib${LLVM_LIBDIR_SUFFIX}) +@@ -534,9 +540,9 @@ option (LLVM_ENABLE_SPHINX "Use Sphinx to generate llvm documentation." OFF) + option (LLVM_ENABLE_OCAMLDOC "Build OCaml bindings documentation." ON) + option (LLVM_ENABLE_BINDINGS "Build bindings." ON) + +-set(LLVM_INSTALL_DOXYGEN_HTML_DIR "share/doc/llvm/doxygen-html" ++set(LLVM_INSTALL_DOXYGEN_HTML_DIR "${CMAKE_INSTALL_DOCDIR}/${project}/doxygen-html" + CACHE STRING "Doxygen-generated HTML documentation install directory") +-set(LLVM_INSTALL_OCAMLDOC_HTML_DIR "share/doc/llvm/ocaml-html" ++set(LLVM_INSTALL_OCAMLDOC_HTML_DIR "${CMAKE_INSTALL_DOCDIR}/${project}/ocaml-html" + CACHE STRING "OCamldoc-generated HTML documentation install directory") + + option (LLVM_BUILD_EXTERNAL_COMPILER_RT +@@ -1002,7 +1008,7 @@ endif() + + if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY) + install(DIRECTORY include/llvm include/llvm-c +- DESTINATION include ++ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} + COMPONENT llvm-headers + FILES_MATCHING + PATTERN "*.def" +@@ -1014,7 +1020,7 @@ if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY) + ) + + install(DIRECTORY ${LLVM_INCLUDE_DIR}/llvm ${LLVM_INCLUDE_DIR}/llvm-c +- DESTINATION include ++ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} + COMPONENT llvm-headers + FILES_MATCHING + PATTERN "*.def" +@@ -1029,13 +1035,13 @@ if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY) + + if (LLVM_INSTALL_MODULEMAPS) + install(DIRECTORY include/llvm include/llvm-c +- DESTINATION include ++ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} + COMPONENT llvm-headers + FILES_MATCHING + PATTERN "module.modulemap" + ) + install(FILES include/llvm/module.install.modulemap +- DESTINATION include/llvm ++ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/llvm + COMPONENT llvm-headers + RENAME "module.extern.modulemap" + ) +diff --git a/cmake/modules/AddLLVM.cmake b/cmake/modules/AddLLVM.cmake +index 619e986b8aa0..842b4f71d07e 100644 +--- a/cmake/modules/AddLLVM.cmake ++++ b/cmake/modules/AddLLVM.cmake +@@ -697,9 +697,9 @@ macro(add_llvm_library name) + + install(TARGETS ${name} + ${export_to_llvmexports} +- LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX} COMPONENT ${name} +- ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX} COMPONENT ${name} +- RUNTIME DESTINATION bin COMPONENT ${name}) ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX} COMPONENT ${name} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX} COMPONENT ${name} ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT ${name}) + + if (NOT LLVM_ENABLE_IDE) + add_llvm_install_targets(install-${name} +@@ -930,7 +930,7 @@ macro(add_llvm_example name) + endif() + add_llvm_executable(${name} ${ARGN}) + if( LLVM_BUILD_EXAMPLES ) +- install(TARGETS ${name} RUNTIME DESTINATION examples) ++ install(TARGETS ${name} RUNTIME DESTINATION ${CMAKE_INSTALL_DOCDIR}/examples) + endif() + set_target_properties(${name} PROPERTIES FOLDER "Examples") + endmacro(add_llvm_example name) +@@ -1485,7 +1485,7 @@ function(llvm_install_library_symlink name dest type) + set(full_name ${CMAKE_${type}_LIBRARY_PREFIX}${name}${CMAKE_${type}_LIBRARY_SUFFIX}) + set(full_dest ${CMAKE_${type}_LIBRARY_PREFIX}${dest}${CMAKE_${type}_LIBRARY_SUFFIX}) + +- set(output_dir lib${LLVM_LIBDIR_SUFFIX}) ++ set(output_dir ${CMAKE_INSTALL_FULL_LIBDIR}${LLVM_LIBDIR_SUFFIX}) + if(WIN32 AND "${type}" STREQUAL "SHARED") + set(output_dir bin) + endif() +@@ -1501,7 +1501,7 @@ function(llvm_install_library_symlink name dest type) + endif() + endfunction() + +-function(llvm_install_symlink name dest) ++function(llvm_install_symlink name dest output_dir) + cmake_parse_arguments(ARG "ALWAYS_GENERATE" "COMPONENT" "" ${ARGN}) + foreach(path ${CMAKE_MODULE_PATH}) + if(EXISTS ${path}/LLVMInstallSymlink.cmake) +@@ -1524,7 +1524,7 @@ function(llvm_install_symlink name dest) + set(full_dest ${dest}${CMAKE_EXECUTABLE_SUFFIX}) + + install(SCRIPT ${INSTALL_SYMLINK} +- CODE "install_symlink(${full_name} ${full_dest} ${LLVM_TOOLS_INSTALL_DIR})" ++ CODE "install_symlink(${full_name} ${full_dest} ${output_dir})" + COMPONENT ${component}) + + if (NOT LLVM_ENABLE_IDE AND NOT ARG_ALWAYS_GENERATE) +@@ -1606,7 +1606,8 @@ function(add_llvm_tool_symlink link_name target) + endif() + + if ((TOOL_IS_TOOLCHAIN OR NOT LLVM_INSTALL_TOOLCHAIN_ONLY) AND LLVM_BUILD_TOOLS) +- llvm_install_symlink(${link_name} ${target}) ++ GNUInstallDirs_get_absolute_install_dir(output_dir LLVM_TOOLS_INSTALL_DIR) ++ llvm_install_symlink(${link_name} ${target} ${output_dir}) + endif() + endif() + endfunction() +@@ -1728,9 +1729,9 @@ function(llvm_setup_rpath name) + + if (APPLE) + set(_install_name_dir INSTALL_NAME_DIR "@rpath") +- set(_install_rpath "@loader_path/../lib" ${extra_libdir}) ++ set(_install_rpath "@loader_path/../${CMAKE_INSTALL_LIBDIR}" ${extra_libdir}) + elseif(UNIX) +- set(_install_rpath "\$ORIGIN/../lib${LLVM_LIBDIR_SUFFIX}" ${extra_libdir}) ++ set(_install_rpath "\$ORIGIN/../${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}" ${extra_libdir}) + if(${CMAKE_SYSTEM_NAME} MATCHES "(FreeBSD|DragonFly)") + set_property(TARGET ${name} APPEND_STRING PROPERTY + LINK_FLAGS " -Wl,-z,origin ") +diff --git a/cmake/modules/AddOCaml.cmake b/cmake/modules/AddOCaml.cmake +index 02bab6846376..eff26adb2efc 100644 +--- a/cmake/modules/AddOCaml.cmake ++++ b/cmake/modules/AddOCaml.cmake +@@ -140,9 +140,9 @@ function(add_ocaml_library name) + endforeach() + + if( APPLE ) +- set(ocaml_rpath "@executable_path/../../../lib${LLVM_LIBDIR_SUFFIX}") ++ set(ocaml_rpath "@executable_path/../../../${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}") + elseif( UNIX ) +- set(ocaml_rpath "\\$ORIGIN/../../../lib${LLVM_LIBDIR_SUFFIX}") ++ set(ocaml_rpath "\\$ORIGIN/../../../${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}") + endif() + list(APPEND ocaml_flags "-ldopt" "-Wl,-rpath,${ocaml_rpath}") + +diff --git a/cmake/modules/AddSphinxTarget.cmake b/cmake/modules/AddSphinxTarget.cmake +index 22e3dcb776aa..ba77b9c195e2 100644 +--- a/cmake/modules/AddSphinxTarget.cmake ++++ b/cmake/modules/AddSphinxTarget.cmake +@@ -73,7 +73,7 @@ function (add_sphinx_target builder project) + + elseif (builder STREQUAL html) + string(TOUPPER "${project}" project_upper) +- set(${project_upper}_INSTALL_SPHINX_HTML_DIR "share/doc/${project}/html" ++ set(${project_upper}_INSTALL_SPHINX_HTML_DIR "${CMAKE_INSTALL_DOCDIR}/${project}/html" + CACHE STRING "HTML documentation install directory for ${project}") + + # '/.' indicates: copy the contents of the directory directly into +diff --git a/cmake/modules/CMakeLists.txt b/cmake/modules/CMakeLists.txt +index 9cf22b436fa7..486e40010cd8 100644 +--- a/cmake/modules/CMakeLists.txt ++++ b/cmake/modules/CMakeLists.txt +@@ -1,4 +1,4 @@ +-set(LLVM_INSTALL_PACKAGE_DIR lib${LLVM_LIBDIR_SUFFIX}/cmake/llvm) ++set(LLVM_INSTALL_PACKAGE_DIR ${LLVM_INSTALL_CMAKE_DIR} CACHE STRING "Path for CMake subdirectory (defaults to 'cmake/llvm')") + set(llvm_cmake_builddir "${LLVM_BINARY_DIR}/${LLVM_INSTALL_PACKAGE_DIR}") + + # First for users who use an installed LLVM, create the LLVMExports.cmake file. +@@ -96,13 +96,13 @@ foreach(p ${_count}) + set(LLVM_CONFIG_CODE "${LLVM_CONFIG_CODE} + get_filename_component(LLVM_INSTALL_PREFIX \"\${LLVM_INSTALL_PREFIX}\" PATH)") + endforeach(p) +-set(LLVM_CONFIG_INCLUDE_DIRS "\${LLVM_INSTALL_PREFIX}/include") ++set(LLVM_CONFIG_INCLUDE_DIRS "\${LLVM_INSTALL_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR}") + set(LLVM_CONFIG_INCLUDE_DIR "${LLVM_CONFIG_INCLUDE_DIRS}") + set(LLVM_CONFIG_MAIN_INCLUDE_DIR "${LLVM_CONFIG_INCLUDE_DIRS}") +-set(LLVM_CONFIG_LIBRARY_DIRS "\${LLVM_INSTALL_PREFIX}/lib\${LLVM_LIBDIR_SUFFIX}") ++set(LLVM_CONFIG_LIBRARY_DIRS "\${LLVM_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}\${LLVM_LIBDIR_SUFFIX}") + set(LLVM_CONFIG_CMAKE_DIR "\${LLVM_INSTALL_PREFIX}/${LLVM_INSTALL_PACKAGE_DIR}") + set(LLVM_CONFIG_BINARY_DIR "\${LLVM_INSTALL_PREFIX}") +-set(LLVM_CONFIG_TOOLS_BINARY_DIR "\${LLVM_INSTALL_PREFIX}/bin") ++set(LLVM_CONFIG_TOOLS_BINARY_DIR "\${LLVM_INSTALL_PREFIX}/${CMAKE_INSTALL_BINDIR}") + set(LLVM_CONFIG_EXPORTS_FILE "\${LLVM_CMAKE_DIR}/LLVMExports.cmake") + set(LLVM_CONFIG_EXPORTS "${LLVM_EXPORTS}") + configure_file( +diff --git a/cmake/modules/LLVMInstallSymlink.cmake b/cmake/modules/LLVMInstallSymlink.cmake +index 09fed8085c23..aa79f192abf0 100644 +--- a/cmake/modules/LLVMInstallSymlink.cmake ++++ b/cmake/modules/LLVMInstallSymlink.cmake +@@ -10,7 +10,7 @@ function(install_symlink name target outdir) + set(LINK_OR_COPY copy) + endif() + +- set(bindir "${DESTDIR}${CMAKE_INSTALL_PREFIX}/${outdir}/") ++ set(bindir "${DESTDIR}${outdir}/") + + message(STATUS "Creating ${name}") + +diff --git a/docs/CMake.rst b/docs/CMake.rst +index 91fb5282206f..d2c9fd94d131 100644 +--- a/docs/CMake.rst ++++ b/docs/CMake.rst +@@ -196,7 +196,7 @@ CMake manual, or execute ``cmake --help-variable VARIABLE_NAME``. + **LLVM_LIBDIR_SUFFIX**:STRING + Extra suffix to append to the directory where libraries are to be + installed. On a 64-bit architecture, one could use ``-DLLVM_LIBDIR_SUFFIX=64`` +- to install libraries to ``/usr/lib64``. ++ to install libraries to ``/usr/lib64``. See also ``CMAKE_INSTALL_LIBDIR``. + + **CMAKE_C_FLAGS**:STRING + Extra flags to use when compiling C source files. +@@ -492,8 +492,8 @@ LLVM-specific variables + + **LLVM_INSTALL_DOXYGEN_HTML_DIR**:STRING + The path to install Doxygen-generated HTML documentation to. This path can +- either be absolute or relative to the CMAKE_INSTALL_PREFIX. Defaults to +- `share/doc/llvm/doxygen-html`. ++ either be absolute or relative to the ``CMAKE_INSTALL_PREFIX``. Defaults to ++ `${CMAKE_INSTALL_DOCDIR}/${project}/doxygen-html`. + + **LLVM_ENABLE_SPHINX**:BOOL + If specified, CMake will search for the ``sphinx-build`` executable and will make +@@ -524,13 +524,33 @@ LLVM-specific variables + + **LLVM_INSTALL_SPHINX_HTML_DIR**:STRING + The path to install Sphinx-generated HTML documentation to. This path can +- either be absolute or relative to the CMAKE_INSTALL_PREFIX. Defaults to +- `share/doc/llvm/html`. ++ either be absolute or relative to the ``CMAKE_INSTALL_PREFIX``. Defaults to ++ `${CMAKE_INSTALL_DOCDIR}/${project}/html`. + + **LLVM_INSTALL_OCAMLDOC_HTML_DIR**:STRING + The path to install OCamldoc-generated HTML documentation to. This path can +- either be absolute or relative to the CMAKE_INSTALL_PREFIX. Defaults to +- `share/doc/llvm/ocaml-html`. ++ either be absolute or relative to the ``CMAKE_INSTALL_PREFIX``. Defaults to ++ `${CMAKE_INSTALL_DOCDIR}/${project}/ocaml-html`. ++ ++**CMAKE_INSTALL_BINDIR**:STRING ++ The path to install binary tools, relative to the ``CMAKE_INSTALL_PREFIX``. ++ Defaults to `bin`. ++ ++**CMAKE_INSTALL_LIBDIR**:STRING ++ The path to install libraries, relative to the ``CMAKE_INSTALL_PREFIX``. ++ Defaults to `lib`. ++ ++**CMAKE_INSTALL_INCLUDEDIR**:STRING ++ The path to install header files, relative to the ``CMAKE_INSTALL_PREFIX``. ++ Defaults to `include`. ++ ++**CMAKE_INSTALL_DOCDIR**:STRING ++ The path to install documentation, relative to the ``CMAKE_INSTALL_PREFIX``. ++ Defaults to `share/doc`. ++ ++**CMAKE_INSTALL_MANDIR**:STRING ++ The path to install manpage files, relative to the ``CMAKE_INSTALL_PREFIX``. ++ Defaults to `share/man`. + + **LLVM_CREATE_XCODE_TOOLCHAIN**:BOOL + macOS Only: If enabled CMake will generate a target named +@@ -710,9 +730,11 @@ the ``cmake`` command or by setting it directly in ``ccmake`` or ``cmake-gui``). + + This file is available in two different locations. + +-* ``/lib/cmake/llvm/LLVMConfig.cmake`` where +- ```` is the install prefix of an installed version of LLVM. +- On Linux typically this is ``/usr/lib/cmake/llvm/LLVMConfig.cmake``. ++* ``LLVMConfig.cmake`` where ++ ```` is the location where LLVM CMake modules are ++ installed as part of an installed version of LLVM. This is typically ++ ``cmake/llvm/`` within the lib directory. On Linux, this is typically ++ ``/usr/lib/cmake/llvm/LLVMConfig.cmake``. + + * ``/lib/cmake/llvm/LLVMConfig.cmake`` where + ```` is the root of the LLVM build tree. **Note: this is only +diff --git a/include/llvm/CMakeLists.txt b/include/llvm/CMakeLists.txt +index 1d5ca3ba92b0..026f5453c1da 100644 +--- a/include/llvm/CMakeLists.txt ++++ b/include/llvm/CMakeLists.txt +@@ -4,5 +4,5 @@ add_subdirectory(Support) + # If we're doing an out-of-tree build, copy a module map for generated + # header files into the build area. + if (NOT "${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}") +- configure_file(module.modulemap.build module.modulemap COPYONLY) ++ configure_file(module.modulemap.build ${LLVM_INCLUDE_DIR}/module.modulemap COPYONLY) + endif (NOT "${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}") +diff --git a/tools/llvm-config/BuildVariables.inc.in b/tools/llvm-config/BuildVariables.inc.in +index 3a24d3e974e1..987d82c1bb97 100644 +--- a/tools/llvm-config/BuildVariables.inc.in ++++ b/tools/llvm-config/BuildVariables.inc.in +@@ -23,6 +23,10 @@ + #define LLVM_CXXFLAGS "@LLVM_CXXFLAGS@" + #define LLVM_BUILDMODE "@LLVM_BUILDMODE@" + #define LLVM_LIBDIR_SUFFIX "@LLVM_LIBDIR_SUFFIX@" ++#define LLVM_INSTALL_BINDIR "@CMAKE_INSTALL_BINDIR@" ++#define LLVM_INSTALL_LIBDIR "@CMAKE_INSTALL_LIBDIR@" ++#define LLVM_INSTALL_INCLUDEDIR "@CMAKE_INSTALL_INCLUDEDIR@" ++#define LLVM_INSTALL_CMAKEDIR "@LLVM_INSTALL_CMAKE_DIR@" + #define LLVM_TARGETS_BUILT "@LLVM_TARGETS_BUILT@" + #define LLVM_SYSTEM_LIBS "@LLVM_SYSTEM_LIBS@" + #define LLVM_BUILD_SYSTEM "@LLVM_BUILD_SYSTEM@" +diff --git a/tools/llvm-config/llvm-config.cpp b/tools/llvm-config/llvm-config.cpp +index 7ef7c46a2627..1f71f8b0f820 100644 +--- a/tools/llvm-config/llvm-config.cpp ++++ b/tools/llvm-config/llvm-config.cpp +@@ -332,12 +332,26 @@ int main(int argc, char **argv) { + ("-I" + ActiveIncludeDir + " " + "-I" + ActiveObjRoot + "/include"); + } else { + ActivePrefix = CurrentExecPrefix; +- ActiveIncludeDir = ActivePrefix + "/include"; +- SmallString<256> path(StringRef(LLVM_TOOLS_INSTALL_DIR)); +- sys::fs::make_absolute(ActivePrefix, path); +- ActiveBinDir = path.str(); +- ActiveLibDir = ActivePrefix + "/lib" + LLVM_LIBDIR_SUFFIX; +- ActiveCMakeDir = ActiveLibDir + "/cmake/llvm"; ++ { ++ SmallString<256> path(StringRef(LLVM_INSTALL_INCLUDEDIR)); ++ sys::fs::make_absolute(ActivePrefix, path); ++ ActiveIncludeDir = std::string(path.str()); ++ } ++ { ++ SmallString<256> path(StringRef(LLVM_INSTALL_BINDIR)); ++ sys::fs::make_absolute(ActivePrefix, path); ++ ActiveBinDir = std::string(path.str()); ++ } ++ { ++ SmallString<256> path(StringRef(LLVM_INSTALL_LIBDIR LLVM_LIBDIR_SUFFIX)); ++ sys::fs::make_absolute(ActivePrefix, path); ++ ActiveLibDir = std::string(path.str()); ++ } ++ { ++ SmallString<256> path(StringRef(LLVM_INSTALL_CMAKEDIR)); ++ sys::fs::make_absolute(ActivePrefix, path); ++ ActiveCMakeDir = std::string(path.str()); ++ } + ActiveIncludeOption = "-I" + ActiveIncludeDir; + } + +diff --git a/tools/lto/CMakeLists.txt b/tools/lto/CMakeLists.txt +index b86e4abd01a7..02ce5773f17d 100644 +--- a/tools/lto/CMakeLists.txt ++++ b/tools/lto/CMakeLists.txt +@@ -23,7 +23,7 @@ set(LLVM_EXPORTED_SYMBOL_FILE ${CMAKE_CURRENT_SOURCE_DIR}/lto.exports) + add_llvm_library(LTO SHARED INSTALL_WITH_TOOLCHAIN ${SOURCES} DEPENDS intrinsics_gen) + + install(FILES ${LLVM_MAIN_INCLUDE_DIR}/llvm-c/lto.h +- DESTINATION include/llvm-c ++ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/llvm-c + COMPONENT LTO) + + if (APPLE) +diff --git a/tools/opt-viewer/CMakeLists.txt b/tools/opt-viewer/CMakeLists.txt +index 19b606933082..27b9f71b3d79 100644 +--- a/tools/opt-viewer/CMakeLists.txt ++++ b/tools/opt-viewer/CMakeLists.txt +@@ -8,6 +8,6 @@ set (files + + foreach (file ${files}) + install(PROGRAMS ${file} +- DESTINATION share/opt-viewer ++ DESTINATION ${CMAKE_INSTALL_DATADIR}/opt-viewer + COMPONENT opt-viewer) + endforeach (file) +diff --git a/tools/remarks-shlib/CMakeLists.txt b/tools/remarks-shlib/CMakeLists.txt +index e948496c603a..1f4df8a98b10 100644 +--- a/tools/remarks-shlib/CMakeLists.txt ++++ b/tools/remarks-shlib/CMakeLists.txt +@@ -11,7 +11,7 @@ set(LLVM_EXPORTED_SYMBOL_FILE ${CMAKE_CURRENT_SOURCE_DIR}/Remarks.exports) + add_llvm_library(Remarks SHARED INSTALL_WITH_TOOLCHAIN ${SOURCES}) + + install(FILES ${LLVM_MAIN_INCLUDE_DIR}/llvm-c/Remarks.h +- DESTINATION include/llvm-c ++ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/llvm-c + COMPONENT Remarks) + + if (APPLE) diff --git a/pkgs/development/compilers/llvm/rocm/default.nix b/pkgs/development/compilers/llvm/rocm/default.nix index 6a11ded0529..581d0574671 100644 --- a/pkgs/development/compilers/llvm/rocm/default.nix +++ b/pkgs/development/compilers/llvm/rocm/default.nix @@ -1,4 +1,4 @@ -{ lib, fetchFromGitHub, callPackage, wrapCCWith }: +{ lib, buildPackages, fetchFromGitHub, callPackage, wrapCCWith }: let version = "4.1.0"; @@ -15,7 +15,7 @@ in rec { clang_version=`${cc}/bin/clang -v 2>&1 | grep "clang version " | grep -E -o "[0-9.-]+"` rsrc="$out/resource-root" mkdir "$rsrc" - ln -s "${cc}/lib/clang/$clang_version/include" "$rsrc" + ln -s "${lib.getLib cc}/lib/clang/$clang_version/include" "$rsrc" echo "-resource-dir=$rsrc" >> $out/nix-support/cc-cflags echo "-Wno-unused-command-line-argument" >> $out/nix-support/cc-cflags rm $out/nix-support/add-hardening.sh @@ -31,6 +31,7 @@ in rec { lld = callPackage ./lld { inherit llvm version; src = "${src}/lld"; + buildLlvmTools = buildPackages.llvmPackages_rocm; }; llvm = callPackage ./llvm { diff --git a/pkgs/development/compilers/llvm/rocm/lld/default.nix b/pkgs/development/compilers/llvm/rocm/lld/default.nix index a6e993bb203..ef60747b013 100644 --- a/pkgs/development/compilers/llvm/rocm/lld/default.nix +++ b/pkgs/development/compilers/llvm/rocm/lld/default.nix @@ -1,4 +1,5 @@ { lib, stdenv +, buildLlvmTools , cmake , libxml2 , llvm @@ -13,12 +14,17 @@ stdenv.mkDerivation rec { pname = "lld"; nativeBuildInputs = [ cmake ]; - buildInputs = [ libxml2 llvm ]; - outputs = [ "out" "dev" ]; - cmakeFlags = [ "-DLLVM_MAIN_SRC_DIR=${llvm.src}" ]; + cmakeFlags = [ + "-DLLVM_MAIN_SRC_DIR=${llvm.src}" + ] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ + "-DLLVM_TABLEGEN_EXE=${buildLlvmTools.llvm}/bin/llvm-tblgen" + "-DLLVM_CONFIG_PATH=${llvm.dev}/bin/llvm-config-native" + ]; + + outputs = [ "out" "dev" ]; postInstall = '' moveToOutput include "$dev" diff --git a/pkgs/development/compilers/llvm/rocm/llvm/default.nix b/pkgs/development/compilers/llvm/rocm/llvm/default.nix index 62559bf1392..b3e8c06195f 100644 --- a/pkgs/development/compilers/llvm/rocm/llvm/default.nix +++ b/pkgs/development/compilers/llvm/rocm/llvm/default.nix @@ -9,7 +9,7 @@ , zlib , debugVersion ? false , enableManpages ? false -, enableSharedLibraries ? true +, enableSharedLibraries ? !stdenv.hostPlatform.isStatic , version , src diff --git a/pkgs/development/compilers/rust/1_45.nix b/pkgs/development/compilers/rust/1_45.nix index 13b1b3ef488..f499fc9e9b0 100644 --- a/pkgs/development/compilers/rust/1_45.nix +++ b/pkgs/development/compilers/rust/1_45.nix @@ -20,9 +20,9 @@ import ./default.nix { rustcVersion = "1.45.2"; rustcSha256 = "0273a1g3f59plyi1n0azf21qjzwml1yqdnj5z472crz37qggr8xp"; - llvmSharedForBuild = pkgsBuildBuild.llvm_10.override { enableSharedLibraries = true; }; - llvmSharedForHost = pkgsBuildHost.llvm_10.override { enableSharedLibraries = true; }; - llvmSharedForTarget = pkgsBuildTarget.llvm_10.override { enableSharedLibraries = true; }; + llvmSharedForBuild = pkgsBuildBuild.llvmPackages_10.libllvm.override { enableSharedLibraries = true; }; + llvmSharedForHost = pkgsBuildHost.llvmPackages_10.libllvm.override { enableSharedLibraries = true; }; + llvmSharedForTarget = pkgsBuildTarget.llvmPackages_10.libllvm.override { enableSharedLibraries = true; }; llvmBootstrapForDarwin = llvmPackages_5; diff --git a/pkgs/development/compilers/rust/1_51.nix b/pkgs/development/compilers/rust/1_51.nix index a489df471a8..17fafa4c7cb 100644 --- a/pkgs/development/compilers/rust/1_51.nix +++ b/pkgs/development/compilers/rust/1_51.nix @@ -22,9 +22,9 @@ import ./default.nix { rustcVersion = "1.51.0"; rustcSha256 = "0ixqkqglv3isxbvl4ldr4byrkx692wghsz3fasy1pn5kr2prnsvs"; - llvmSharedForBuild = pkgsBuildBuild.llvm_11.override { enableSharedLibraries = true; }; - llvmSharedForHost = pkgsBuildHost.llvm_11.override { enableSharedLibraries = true; }; - llvmSharedForTarget = pkgsBuildTarget.llvm_11.override { enableSharedLibraries = true; }; + llvmSharedForBuild = pkgsBuildBuild.llvmPackages_11.libllvm.override { enableSharedLibraries = true; }; + llvmSharedForHost = pkgsBuildHost.llvmPackages_11.libllvm.override { enableSharedLibraries = true; }; + llvmSharedForTarget = pkgsBuildTarget.llvmPackages_11.libllvm.override { enableSharedLibraries = true; }; llvmBootstrapForDarwin = llvmPackages_11; diff --git a/pkgs/development/interpreters/cling/default.nix b/pkgs/development/interpreters/cling/default.nix index dbc2751e789..f74eaf72bd4 100644 --- a/pkgs/development/interpreters/cling/default.nix +++ b/pkgs/development/interpreters/cling/default.nix @@ -76,8 +76,8 @@ let "-nostdinc" "-nostdinc++" "-isystem" "${lib.getDev stdenv.cc.libc}/include" - "-I" "${unwrapped}/include" - "-I" "${unwrapped}/lib/clang/5.0.2/include" + "-I" "${lib.getDev unwrapped}/include" + "-I" "${lib.getLib unwrapped}/lib/clang/5.0.2/include" ]; # Autodetect the include paths for the compiler used to build Cling, in the same way Cling does at diff --git a/pkgs/development/interpreters/pure/default.nix b/pkgs/development/interpreters/pure/default.nix index 863df66899b..d1c03bba5a3 100644 --- a/pkgs/development/interpreters/pure/default.nix +++ b/pkgs/development/interpreters/pure/default.nix @@ -1,5 +1,5 @@ { lib, stdenv, fetchurl, makeWrapper, - llvm, gmp, mpfr, readline, bison, flex }: + libllvm, gmp, mpfr, readline, bison, flex }: stdenv.mkDerivation rec { baseName="pure"; @@ -13,7 +13,7 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ makeWrapper ]; buildInputs = [ bison flex ]; - propagatedBuildInputs = [ llvm gmp mpfr readline ]; + propagatedBuildInputs = [ libllvm gmp mpfr readline ]; NIX_LDFLAGS = "-lLLVMJIT"; postPatch = '' @@ -25,10 +25,10 @@ stdenv.mkDerivation rec { configureFlags = [ "--enable-release" ]; doCheck = true; checkPhase = '' - LD_LIBRARY_PATH=$LD_LIBRARY_PATH''${LD_LIBRARY_PATH:+:}${llvm}/lib make check + LD_LIBRARY_PATH=$LD_LIBRARY_PATH''${LD_LIBRARY_PATH:+:}${libllvm}/lib make check ''; postInstall = '' - wrapProgram $out/bin/pure --prefix LD_LIBRARY_PATH : ${llvm}/lib + wrapProgram $out/bin/pure --prefix LD_LIBRARY_PATH : ${libllvm}/lib ''; meta = { diff --git a/pkgs/development/interpreters/spidermonkey/68.nix b/pkgs/development/interpreters/spidermonkey/68.nix index 0ac005b07de..f867e606140 100644 --- a/pkgs/development/interpreters/spidermonkey/68.nix +++ b/pkgs/development/interpreters/spidermonkey/68.nix @@ -55,7 +55,7 @@ in stdenv.mkDerivation rec { "--with-system-zlib" "--with-system-icu" - "--with-libclang-path=${llvmPackages.libclang}/lib" + "--with-libclang-path=${llvmPackages.libclang.lib}/lib" "--with-clang-path=${llvmPackages.clang}/bin/clang" "--enable-shared-js" diff --git a/pkgs/development/interpreters/wasmer/default.nix b/pkgs/development/interpreters/wasmer/default.nix index 8077177d8b8..eb17fda0830 100644 --- a/pkgs/development/interpreters/wasmer/default.nix +++ b/pkgs/development/interpreters/wasmer/default.nix @@ -35,7 +35,7 @@ rustPlatform.buildRustPackage rec { "--features" "test-cranelift,test-jit" ]; - LIBCLANG_PATH = "${llvmPackages.libclang}/lib"; + LIBCLANG_PATH = "${llvmPackages.libclang.lib}/lib"; meta = with lib; { description = "The Universal WebAssembly Runtime"; diff --git a/pkgs/development/interpreters/wasmtime/default.nix b/pkgs/development/interpreters/wasmtime/default.nix index 3d13dddb642..9afca8f1f71 100644 --- a/pkgs/development/interpreters/wasmtime/default.nix +++ b/pkgs/development/interpreters/wasmtime/default.nix @@ -17,7 +17,7 @@ rustPlatform.buildRustPackage rec { nativeBuildInputs = [ python cmake clang ]; buildInputs = [ llvmPackages.libclang ] ++ lib.optionals stdenv.isDarwin [ darwin.apple_sdk.frameworks.Security ]; - LIBCLANG_PATH = "${llvmPackages.libclang}/lib"; + LIBCLANG_PATH = "${llvmPackages.libclang.lib}/lib"; doCheck = true; diff --git a/pkgs/development/libraries/beignet/default.nix b/pkgs/development/libraries/beignet/default.nix index 8e8e455e59a..3d88c93784a 100644 --- a/pkgs/development/libraries/beignet/default.nix +++ b/pkgs/development/libraries/beignet/default.nix @@ -2,8 +2,8 @@ , fetchFromGitHub , cmake , pkg-config -, clang-unwrapped -, llvm +, libclang +, libllvm , libdrm , libX11 , libpthreadstubs @@ -35,11 +35,11 @@ stdenv.mkDerivation rec { patchShebangs src/git_sha1.sh ''; - cmakeFlags = [ "-DCLANG_LIBRARY_DIR=${clang-unwrapped}/lib" ]; + cmakeFlags = [ "-DCLANG_LIBRARY_DIR=${libclang.lib}/lib" ]; buildInputs = [ - llvm - clang-unwrapped + libllvm + libclang libX11 libXext libpthreadstubs diff --git a/pkgs/development/libraries/opencl-clang/default.nix b/pkgs/development/libraries/opencl-clang/default.nix index 8bbde9796d9..b87088a47fc 100644 --- a/pkgs/development/libraries/opencl-clang/default.nix +++ b/pkgs/development/libraries/opencl-clang/default.nix @@ -32,7 +32,9 @@ let passthru = rec { - clang-unwrapped = addPatches "clang" llvmPkgs.clang-unwrapped; + libclang = addPatches "clang" llvmPkgs.libclang; + + clang-unwrapped = libclang.out; clang = llvmPkgs.clang.override { cc = clang-unwrapped; @@ -53,7 +55,7 @@ let library = let inherit (llvmPkgs) llvm; - inherit (if buildWithPatches then passthru else llvmPkgs) clang-unwrapped spirv-llvm-translator; + inherit (if buildWithPatches then passthru else llvmPkgs) libclang spirv-llvm-translator; in stdenv.mkDerivation rec { pname = "opencl-clang"; @@ -76,11 +78,11 @@ let nativeBuildInputs = [ cmake git ]; - buildInputs = [ clang-unwrapped llvm spirv-llvm-translator ]; + buildInputs = [ libclang llvm spirv-llvm-translator ]; cmakeFlags = [ "-DPREFERRED_LLVM_VERSION=${getVersion llvm}" - "-DOPENCL_HEADERS_DIR=${clang-unwrapped}/lib/clang/${getVersion clang-unwrapped}/include/" + "-DOPENCL_HEADERS_DIR=${libclang.lib}/lib/clang/${getVersion libclang}/include/" "-DLLVMSPIRV_INCLUDED_IN_LLVM=OFF" "-DSPIRV_TRANSLATOR_DIR=${spirv-llvm-translator}" diff --git a/pkgs/development/libraries/qt-4.x/4.8/default.nix b/pkgs/development/libraries/qt-4.x/4.8/default.nix index a4ac41d81df..532a72c820c 100644 --- a/pkgs/development/libraries/qt-4.x/4.8/default.nix +++ b/pkgs/development/libraries/qt-4.x/4.8/default.nix @@ -204,7 +204,7 @@ stdenv.mkDerivation rec { ++ lib.optional stdenv.isLinux "-std=gnu++98" # gnu++ in (Obj)C flags is no good on Darwin ++ lib.optionals (stdenv.isFreeBSD || stdenv.isDarwin) [ "-I${glib.dev}/include/glib-2.0" "-I${glib.out}/lib/glib-2.0/include" ] - ++ lib.optional stdenv.isDarwin "-I${libcxx}/include/c++/v1"); + ++ lib.optional stdenv.isDarwin "-I${lib.getDev libcxx}/include/c++/v1"); NIX_LDFLAGS = lib.optionalString (stdenv.isFreeBSD || stdenv.isDarwin) "-lglib-2.0"; diff --git a/pkgs/development/ocaml-modules/eigen/default.nix b/pkgs/development/ocaml-modules/eigen/default.nix index c86b7cba010..47b002fd730 100644 --- a/pkgs/development/ocaml-modules/eigen/default.nix +++ b/pkgs/development/ocaml-modules/eigen/default.nix @@ -15,7 +15,7 @@ buildDunePackage rec { minimumOCamlVersion = "4.02"; - NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin "-I${libcxx}/include/c++/v1"; + NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin "-I${lib.getDev libcxx}/include/c++/v1"; propagatedBuildInputs = [ ctypes ]; diff --git a/pkgs/development/ocaml-modules/llvm/default.nix b/pkgs/development/ocaml-modules/llvm/default.nix index 34fe75a2943..f984a28869e 100644 --- a/pkgs/development/ocaml-modules/llvm/default.nix +++ b/pkgs/development/ocaml-modules/llvm/default.nix @@ -1,16 +1,16 @@ -{ stdenv, lib, fetchpatch, python, cmake, llvm, ocaml, findlib, ctypes }: +{ stdenv, lib, fetchpatch, python, cmake, libllvm, ocaml, findlib, ctypes }: -let version = lib.getVersion llvm; in +let version = lib.getVersion libllvm; in stdenv.mkDerivation { pname = "ocaml-llvm"; inherit version; - inherit (llvm) src; + inherit (libllvm) src; nativeBuildInputs = [ cmake ]; buildInputs = [ python ocaml findlib ctypes ]; - propagatedBuildInputs = [ llvm ]; + propagatedBuildInputs = [ libllvm ]; patches = [ (fetchpatch { url = "https://raw.githubusercontent.com/ocaml/opam-repository/2bdc193f5a9305ea93bf0f0dfc1fbc327c8b9306/packages/llvm/llvm.7.0.0/files/fix-shared.patch"; @@ -20,7 +20,7 @@ stdenv.mkDerivation { cmakeFlags = [ "-DLLVM_OCAML_OUT_OF_TREE=TRUE" "-DLLVM_OCAML_INSTALL_PATH=${placeholder "out"}/ocaml" - "-DLLVM_OCAML_EXTERNAL_LLVM_LIBDIR=${lib.getLib llvm}/lib" + "-DLLVM_OCAML_EXTERNAL_LLVM_LIBDIR=${lib.getLib libllvm}/lib" ]; buildFlags = [ "ocaml_all" ]; @@ -34,11 +34,11 @@ stdenv.mkDerivation { ''; passthru = { - inherit llvm; + inherit libllvm; }; meta = { - inherit (llvm.meta) license homepage; + inherit (libllvm.meta) license homepage; platforms = ocaml.meta.platforms or []; description = "OCaml bindings distributed with LLVM"; maintainers = with lib.maintainers; [ vbgl ]; diff --git a/pkgs/development/python-modules/datatable/default.nix b/pkgs/development/python-modules/datatable/default.nix index c5271e473e3..60eb0df1d09 100644 --- a/pkgs/development/python-modules/datatable/default.nix +++ b/pkgs/development/python-modules/datatable/default.nix @@ -39,7 +39,7 @@ buildPythonPackage rec { checkInputs = [ docutils pytestCheckHook ]; LLVM = llvm; - NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin "-isystem ${libcxx}/include/c++/v1"; + NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin "-isystem ${lib.getDev libcxx}/include/c++/v1"; pytestFlagsArray = let # ini file (not included in tarball) required to change python_files setting, diff --git a/pkgs/development/python-modules/kiwisolver/1_1.nix b/pkgs/development/python-modules/kiwisolver/1_1.nix index 0702e3518e0..762b5bc0b7b 100644 --- a/pkgs/development/python-modules/kiwisolver/1_1.nix +++ b/pkgs/development/python-modules/kiwisolver/1_1.nix @@ -14,7 +14,7 @@ buildPythonPackage rec { sha256 = "53eaed412477c836e1b9522c19858a8557d6e595077830146182225613b11a75"; }; - NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin "-I${libcxx}/include/c++/v1"; + NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin "-I${lib.getDev libcxx}/include/c++/v1"; # Does not include tests doCheck = false; diff --git a/pkgs/development/python-modules/kiwisolver/default.nix b/pkgs/development/python-modules/kiwisolver/default.nix index d4d62787092..2b157494f91 100644 --- a/pkgs/development/python-modules/kiwisolver/default.nix +++ b/pkgs/development/python-modules/kiwisolver/default.nix @@ -15,7 +15,7 @@ buildPythonPackage rec { sha256 = "950a199911a8d94683a6b10321f9345d5a3a8433ec58b217ace979e18f16e248"; }; - NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin "-I${libcxx}/include/c++/v1"; + NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin "-I${lib.getDev libcxx}/include/c++/v1"; nativeBuildInputs = [ cppy diff --git a/pkgs/development/python-modules/numba/default.nix b/pkgs/development/python-modules/numba/default.nix index 211e9d6185f..c49a4105abe 100644 --- a/pkgs/development/python-modules/numba/default.nix +++ b/pkgs/development/python-modules/numba/default.nix @@ -22,7 +22,7 @@ buildPythonPackage rec { sha256 = "55c11d7edbba2ba715f2b56f5294cad55cfd87bff98e2627c3047c2d5cc52d16"; }; - NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin "-I${libcxx}/include/c++/v1"; + NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin "-I${lib.getDev libcxx}/include/c++/v1"; propagatedBuildInputs = [ numpy llvmlite setuptools ]; pythonImportsCheck = [ "numba" ]; diff --git a/pkgs/development/python-modules/pandas/2.nix b/pkgs/development/python-modules/pandas/2.nix index 936a3db296e..8af4094b0cf 100644 --- a/pkgs/development/python-modules/pandas/2.nix +++ b/pkgs/development/python-modules/pandas/2.nix @@ -59,7 +59,7 @@ buildPythonPackage rec { # For OSX, we need to add a dependency on libcxx, which provides # `complex.h` and other libraries that pandas depends on to build. postPatch = lib.optionalString stdenv.isDarwin '' - cpp_sdk="${libcxx}/include/c++/v1"; + cpp_sdk="${lib.getDev libcxx}/include/c++/v1"; echo "Adding $cpp_sdk to the setup.py common_include variable" substituteInPlace setup.py \ --replace "['pandas/src/klib', 'pandas/src']" \ diff --git a/pkgs/development/python-modules/pandas/default.nix b/pkgs/development/python-modules/pandas/default.nix index 7fd551e192c..f3505e3c9a6 100644 --- a/pkgs/development/python-modules/pandas/default.nix +++ b/pkgs/development/python-modules/pandas/default.nix @@ -77,7 +77,7 @@ buildPythonPackage rec { # For OSX, we need to add a dependency on libcxx, which provides # `complex.h` and other libraries that pandas depends on to build. postPatch = lib.optionalString stdenv.isDarwin '' - cpp_sdk="${libcxx}/include/c++/v1"; + cpp_sdk="${lib.getDev libcxx}/include/c++/v1"; echo "Adding $cpp_sdk to the setup.py common_include variable" substituteInPlace setup.py \ --replace "['pandas/src/klib', 'pandas/src']" \ diff --git a/pkgs/development/python-modules/py3exiv2/default.nix b/pkgs/development/python-modules/py3exiv2/default.nix index 236a38c7e69..59d0cdb7299 100644 --- a/pkgs/development/python-modules/py3exiv2/default.nix +++ b/pkgs/development/python-modules/py3exiv2/default.nix @@ -13,7 +13,7 @@ buildPythonPackage rec { buildInputs = [ exiv2 boost ]; # work around python distutils compiling C++ with $CC (see issue #26709) - NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin "-I${libcxx}/include/c++/v1"; + NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin "-I${lib.getDev libcxx}/include/c++/v1"; meta = with lib; { homepage = "https://launchpad.net/py3exiv2"; diff --git a/pkgs/development/r-modules/generic-builder.nix b/pkgs/development/r-modules/generic-builder.nix index 1e96a64a5e2..bbee8c2122a 100644 --- a/pkgs/development/r-modules/generic-builder.nix +++ b/pkgs/development/r-modules/generic-builder.nix @@ -8,7 +8,7 @@ stdenv.mkDerivation ({ lib.optionals stdenv.isDarwin [Cocoa Foundation gfortran]; NIX_CFLAGS_COMPILE = - lib.optionalString stdenv.isDarwin "-I${libcxx}/include/c++/v1"; + lib.optionalString stdenv.isDarwin "-I${lib.getDev libcxx}/include/c++/v1"; configurePhase = '' runHook preConfigure diff --git a/pkgs/development/tools/build-managers/bazel/bazel_3/default.nix b/pkgs/development/tools/build-managers/bazel/bazel_3/default.nix index 5b20ece7680..fd29102b7e5 100644 --- a/pkgs/development/tools/build-managers/bazel/bazel_3/default.nix +++ b/pkgs/development/tools/build-managers/bazel/bazel_3/default.nix @@ -371,7 +371,7 @@ stdenv.mkDerivation rec { # libcxx includes aren't added by libcxx hook # https://github.com/NixOS/nixpkgs/pull/41589 - export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -isystem ${libcxx}/include/c++/v1" + export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -isystem ${lib.getDev libcxx}/include/c++/v1" # don't use system installed Xcode to run clang, use Nix clang instead sed -i -E "s;/usr/bin/xcrun (--sdk macosx )?clang;${stdenv.cc}/bin/clang $NIX_CFLAGS_COMPILE $(bazelLinkFlags) -framework CoreFoundation;g" \ diff --git a/pkgs/development/tools/build-managers/bazel/bazel_4/default.nix b/pkgs/development/tools/build-managers/bazel/bazel_4/default.nix index 31dbc2779cd..7fc03422016 100644 --- a/pkgs/development/tools/build-managers/bazel/bazel_4/default.nix +++ b/pkgs/development/tools/build-managers/bazel/bazel_4/default.nix @@ -388,7 +388,7 @@ stdenv.mkDerivation rec { # libcxx includes aren't added by libcxx hook # https://github.com/NixOS/nixpkgs/pull/41589 - export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -isystem ${libcxx}/include/c++/v1" + export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -isystem ${lib.getDev libcxx}/include/c++/v1" # don't use system installed Xcode to run clang, use Nix clang instead sed -i -E "s;/usr/bin/xcrun (--sdk macosx )?clang;${stdenv.cc}/bin/clang $NIX_CFLAGS_COMPILE $(bazelLinkFlags) -framework CoreFoundation;g" \ diff --git a/pkgs/development/tools/castxml/default.nix b/pkgs/development/tools/castxml/default.nix index f3d9b74181a..ce2641b239e 100644 --- a/pkgs/development/tools/castxml/default.nix +++ b/pkgs/development/tools/castxml/default.nix @@ -1,7 +1,6 @@ { lib , stdenv , fetchFromGitHub -, clang-unwrapped , cmake , libclang , libffi @@ -32,13 +31,12 @@ stdenv.mkDerivation rec { ]; cmakeFlags = [ - "-DCLANG_RESOURCE_DIR=${clang-unwrapped}/lib/clang/${lib.getVersion clang-unwrapped}/" + "-DCLANG_RESOURCE_DIR=${libclang.dev}/lib/clang/${lib.getVersion libclang}/" "-DSPHINX_HTML=${if withHTML then "ON" else "OFF"}" "-DSPHINX_MAN=${if withManual then "ON" else "OFF"}" ]; buildInputs = [ - clang-unwrapped libffi libxml2 zlib diff --git a/pkgs/development/tools/parinfer-rust/default.nix b/pkgs/development/tools/parinfer-rust/default.nix index ce733b8a213..2cd8ff4fdb6 100644 --- a/pkgs/development/tools/parinfer-rust/default.nix +++ b/pkgs/development/tools/parinfer-rust/default.nix @@ -15,7 +15,7 @@ rustPlatform.buildRustPackage rec { nativeBuildInputs = [ llvmPackages.clang ]; buildInputs = [ llvmPackages.libclang ]; - LIBCLANG_PATH = "${llvmPackages.libclang}/lib"; + LIBCLANG_PATH = "${llvmPackages.libclang.lib}/lib"; postInstall = '' mkdir -p $out/share/kak/autoload/plugins diff --git a/pkgs/development/tools/qtcreator/default.nix b/pkgs/development/tools/qtcreator/default.nix index dc5699ed373..2b0227407da 100644 --- a/pkgs/development/tools/qtcreator/default.nix +++ b/pkgs/development/tools/qtcreator/default.nix @@ -64,7 +64,7 @@ mkDerivation rec { # Fix paths to libclang library. substituteInPlace src/shared/clang/clang_installation.pri \ - --replace 'LIBCLANG_LIBS = -L$${LLVM_LIBDIR}' 'LIBCLANG_LIBS = -L${llvmPackages_8.libclang}/lib' \ + --replace 'LIBCLANG_LIBS = -L$${LLVM_LIBDIR}' 'LIBCLANG_LIBS = -L${llvmPackages_8.libclang.lib}/lib' \ --replace 'LIBCLANG_LIBS += $${CLANG_LIB}' 'LIBCLANG_LIBS += -lclang' \ --replace 'LIBTOOLING_LIBS = -L$${LLVM_LIBDIR}' 'LIBTOOLING_LIBS = -L${clang_qt_vendor}/lib' \ --replace 'LLVM_CXXFLAGS ~= s,-gsplit-dwarf,' '${lib.concatStringsSep "\n" ["LLVM_CXXFLAGS ~= s,-gsplit-dwarf," " LLVM_CXXFLAGS += -fno-rtti"]}' diff --git a/pkgs/development/tools/rq/default.nix b/pkgs/development/tools/rq/default.nix index 838740d1fd0..3922bcb3260 100644 --- a/pkgs/development/tools/rq/default.nix +++ b/pkgs/development/tools/rq/default.nix @@ -13,11 +13,11 @@ rustPlatform.buildRustPackage rec { cargoSha256 = "0c5vwy3c5ji602dj64z6jqvcpi2xff03zvjbnwihb3ydqwnb3v67"; - buildInputs = [ llvmPackages.clang-unwrapped v8 ] + buildInputs = [ llvmPackages.libclang v8 ] ++ lib.optionals stdenv.isDarwin [ libiconv ]; configurePhase = '' - export LIBCLANG_PATH="${llvmPackages.clang-unwrapped}/lib" + export LIBCLANG_PATH="${llvmPackages.libclang.lib}/lib" export V8_SOURCE="${v8}" ''; diff --git a/pkgs/development/tools/rust/bindgen/default.nix b/pkgs/development/tools/rust/bindgen/default.nix index 962e8c562c7..9568d8efefc 100644 --- a/pkgs/development/tools/rust/bindgen/default.nix +++ b/pkgs/development/tools/rust/bindgen/default.nix @@ -27,7 +27,7 @@ rustPlatform.buildRustPackage rec { propagatedBuildInputs = [ clang ]; # to populate NIX_CXXSTDLIB_COMPILE configurePhase = '' - export LIBCLANG_PATH="${libclang}/lib" + export LIBCLANG_PATH="${libclang.lib}/lib" ''; postInstall = '' diff --git a/pkgs/misc/vim-plugins/overrides.nix b/pkgs/misc/vim-plugins/overrides.nix index 8b7e41ed3bd..3a1c15bb77e 100644 --- a/pkgs/misc/vim-plugins/overrides.nix +++ b/pkgs/misc/vim-plugins/overrides.nix @@ -97,7 +97,7 @@ self: super: { # https://gist.github.com/Mic92/135e83803ed29162817fce4098dec144 preFixup = '' substituteInPlace "$out"/share/vim-plugins/clang_complete/plugin/clang_complete.vim \ - --replace "let g:clang_library_path = '' + "''" + ''" "let g:clang_library_path='${llvmPackages.clang.cc.lib}/lib/libclang.so'" + --replace "let g:clang_library_path = '' + "''" + ''" "let g:clang_library_path='${llvmPackages.libclang.lib}/lib/libclang.so'" substituteInPlace "$out"/share/vim-plugins/clang_complete/plugin/libclang.py \ --replace "/usr/lib/clang" "${llvmPackages.clang.cc}/lib/clang" diff --git a/pkgs/os-specific/darwin/maloader/default.nix b/pkgs/os-specific/darwin/maloader/default.nix index 3943092bcf0..9142484e043 100644 --- a/pkgs/os-specific/darwin/maloader/default.nix +++ b/pkgs/os-specific/darwin/maloader/default.nix @@ -16,7 +16,7 @@ stdenv.mkDerivation { ld-mac.cc ''; - NIX_CFLAGS_COMPILE = "-I${libcxx}/include/c++/v1"; + NIX_CFLAGS_COMPILE = "-I${lib.getDev libcxx}/include/c++/v1"; buildInputs = [ clang libcxx ]; buildFlags = [ "USE_LIBCXX=1" "release" ]; diff --git a/pkgs/servers/nosql/influxdb2/default.nix b/pkgs/servers/nosql/influxdb2/default.nix index bace331e05c..0f6cb5a438b 100644 --- a/pkgs/servers/nosql/influxdb2/default.nix +++ b/pkgs/servers/nosql/influxdb2/default.nix @@ -57,7 +57,7 @@ let sourceRoot = "source/libflux"; cargoSha256 = "0y5xjkqpaxp9qq1qj39zw3mnvkbbb9g4fa5cli77nhfwz288xx6h"; nativeBuildInputs = [ llvmPackages.libclang ]; - LIBCLANG_PATH = "${llvmPackages.libclang}/lib"; + LIBCLANG_PATH = "${llvmPackages.libclang.lib}/lib"; pkgcfg = '' Name: flux Version: ${libflux_version} diff --git a/pkgs/stdenv/darwin/default.nix b/pkgs/stdenv/darwin/default.nix index 227f53b02cc..ac10e858ed8 100644 --- a/pkgs/stdenv/darwin/default.nix +++ b/pkgs/stdenv/darwin/default.nix @@ -73,7 +73,7 @@ in rec { mkExtraBuildCommands = cc: '' rsrc="$out/resource-root" mkdir "$rsrc" - ln -s "${cc}/lib/clang/${cc.version}/include" "$rsrc" + ln -s "${cc.lib or cc}/lib/clang/${cc.version}/include" "$rsrc" ln -s "${last.pkgs.llvmPackages_7.compiler-rt.out}/lib" "$rsrc/lib" echo "-resource-dir=$rsrc" >> $out/nix-support/cc-cflags ''; @@ -407,7 +407,7 @@ in rec { allowedRequisites = [ bootstrapTools ] ++ (with pkgs; [ - xz.bin xz.out bash libcxx libcxxabi llvmPackages_7.compiler-rt + xz.bin xz.out bash libcxx libcxx.dev libcxxabi libcxxabi.dev llvmPackages_7.compiler-rt llvmPackages_7.clang-unwrapped zlib libxml2.out curl.out brotli.lib openssl.out libssh2.out nghttp2.lib libkrb5 coreutils gnugrep pcre.out gmp libiconv ]) ++ @@ -434,8 +434,8 @@ in rec { llvmPackages_7 = super.llvmPackages_7 // (let tools = super.llvmPackages_7.tools.extend (llvmSelf: _: { - clang-unwrapped = llvmPackages_7.clang-unwrapped.override { llvm = llvmSelf.llvm; }; - llvm = llvmPackages_7.llvm.override { inherit libxml2; }; + clang-unwrapped-all-outputs = llvmPackages_7.clang-unwrapped-all-outputs.override { llvm = llvmSelf.llvm; }; + libllvm = llvmPackages_7.libllvm.override { inherit libxml2; }; }); libraries = super.llvmPackages_7.libraries.extend (llvmSelf: _: { inherit (llvmPackages_7) libcxx libcxxabi compiler-rt; @@ -524,11 +524,13 @@ in rec { }; allowedRequisites = (with pkgs; [ - xz.out xz.bin libcxx libcxxabi gmp.out gnumake findutils bzip2.out + xz.out xz.bin libcxx libcxx.dev libcxxabi libcxxabi.dev gmp.out gnumake findutils bzip2.out bzip2.bin llvmPackages.llvm llvmPackages.llvm.lib llvmPackages.compiler-rt llvmPackages.compiler-rt.dev zlib.out zlib.dev libffi.out coreutils ed diffutils gnutar gzip ncurses.out ncurses.dev ncurses.man gnused bash gawk - gnugrep llvmPackages.clang-unwrapped llvmPackages.clang-unwrapped.lib patch pcre.out gettext + gnugrep llvmPackages.clang-unwrapped + llvmPackages.libclang.dev llvmPackages.libclang.lib + patch pcre.out gettext binutils.bintools darwin.binutils darwin.binutils.bintools curl.out brotli.lib openssl.out libssh2.out nghttp2.lib libkrb5 cc.expand-response-params libxml2.out diff --git a/pkgs/stdenv/darwin/make-bootstrap-tools.nix b/pkgs/stdenv/darwin/make-bootstrap-tools.nix index 7b68c877a6e..4b6562a205a 100644 --- a/pkgs/stdenv/darwin/make-bootstrap-tools.nix +++ b/pkgs/stdenv/darwin/make-bootstrap-tools.nix @@ -77,7 +77,7 @@ in rec { # Copy what we need of clang cp -d ${llvmPackages.clang-unwrapped}/bin/clang* $out/bin - cp -rL ${llvmPackages.clang-unwrapped}/lib/clang $out/lib + cp -rL ${llvmPackages.clang-unwrapped.lib}/lib/clang $out/lib cp -d ${llvmPackages.libcxx}/lib/libc++*.dylib $out/lib cp -d ${llvmPackages.libcxxabi}/lib/libc++abi*.dylib $out/lib @@ -85,7 +85,7 @@ in rec { cp -d ${libffi}/lib/libffi*.dylib $out/lib mkdir $out/include - cp -rd ${llvmPackages.libcxx}/include/c++ $out/include + cp -rd ${llvmPackages.libcxx.dev}/include/c++ $out/include cp -d ${darwin.ICU}/lib/libicu*.dylib $out/lib cp -d ${zlib.out}/lib/libz.* $out/lib diff --git a/pkgs/tools/backup/rdedup/default.nix b/pkgs/tools/backup/rdedup/default.nix index 3d908dd24a1..a0727286c40 100644 --- a/pkgs/tools/backup/rdedup/default.nix +++ b/pkgs/tools/backup/rdedup/default.nix @@ -24,7 +24,7 @@ rustPlatform.buildRustPackage rec { ++ (lib.optional stdenv.isDarwin Security); configurePhase = '' - export LIBCLANG_PATH="${llvmPackages.libclang}/lib" + export LIBCLANG_PATH="${llvmPackages.libclang.lib}/lib" ''; meta = with lib; { diff --git a/pkgs/tools/filesystems/irods/common.nix b/pkgs/tools/filesystems/irods/common.nix index 77c05a61666..87bb2b9051c 100644 --- a/pkgs/tools/filesystems/irods/common.nix +++ b/pkgs/tools/filesystems/irods/common.nix @@ -19,7 +19,7 @@ "-DIRODS_LINUX_DISTRIBUTION_NAME=nix" "-DIRODS_LINUX_DISTRIBUTION_VERSION_MAJOR=${builtins.nixVersion}" "-DCPACK_GENERATOR=TGZ" - "-DCMAKE_CXX_FLAGS=-I${libcxx}/include/c++/v1" + "-DCMAKE_CXX_FLAGS=-I${lib.getDev libcxx}/include/c++/v1" ]; preConfigure = '' diff --git a/pkgs/tools/filesystems/supertag/default.nix b/pkgs/tools/filesystems/supertag/default.nix index 3602f8e31f9..2e333b5b054 100644 --- a/pkgs/tools/filesystems/supertag/default.nix +++ b/pkgs/tools/filesystems/supertag/default.nix @@ -16,7 +16,7 @@ rustPlatform.buildRustPackage rec { cargoSha256 = "1mzmp1jcxgn2swp52r9y7k09fk0z67i1qafzkkzlfxxd10vfr70v"; - LIBCLANG_PATH = "${llvmPackages.libclang}/lib"; + LIBCLANG_PATH = "${llvmPackages.libclang.lib}/lib"; nativeBuildInputs = [ clang pkg-config ]; buildInputs = [ dbus fuse sqlite ]; diff --git a/pkgs/tools/inputmethods/kime/default.nix b/pkgs/tools/inputmethods/kime/default.nix index 35ed99b5a42..e550f7c35d9 100644 --- a/pkgs/tools/inputmethods/kime/default.nix +++ b/pkgs/tools/inputmethods/kime/default.nix @@ -101,7 +101,7 @@ stdenv.mkDerivation rec { ]; RUST_BACKTRACE = 1; - LIBCLANG_PATH = "${llvmPackages.libclang}/lib"; + LIBCLANG_PATH = "${llvmPackages.libclang.lib}/lib"; meta = with lib; { homepage = "https://github.com/Riey/kime"; diff --git a/pkgs/tools/misc/gringo/default.nix b/pkgs/tools/misc/gringo/default.nix index ae161af488d..f08bad03916 100644 --- a/pkgs/tools/misc/gringo/default.nix +++ b/pkgs/tools/misc/gringo/default.nix @@ -32,12 +32,12 @@ stdenv.mkDerivation { substituteInPlace ./SConstruct \ --replace \ "env['CPPPATH'] = []" \ - "env['CPPPATH'] = ['${libcxx}/include/c++/v1']" + "env['CPPPATH'] = ['${lib.getDev libcxx}/include/c++/v1']" substituteInPlace ./SConstruct \ --replace \ "env['LIBPATH'] = []" \ - "env['LIBPATH'] = ['${libcxx}/lib']" + "env['LIBPATH'] = ['${lib.getLib libcxx}/lib']" ''; buildPhase = '' diff --git a/pkgs/tools/misc/silicon/default.nix b/pkgs/tools/misc/silicon/default.nix index 0c338fd91bc..c8b0090375c 100644 --- a/pkgs/tools/misc/silicon/default.nix +++ b/pkgs/tools/misc/silicon/default.nix @@ -34,7 +34,7 @@ rustPlatform.buildRustPackage rec { nativeBuildInputs = [ cmake pkg-config ] ++ lib.optionals stdenv.isLinux [ python3 ]; - LIBCLANG_PATH = "${llvmPackages.libclang}/lib"; + LIBCLANG_PATH = "${llvmPackages.libclang.lib}/lib"; meta = with lib; { description = "Create beautiful image of your source code"; diff --git a/pkgs/tools/misc/tremor-rs/default.nix b/pkgs/tools/misc/tremor-rs/default.nix index 73640de76bf..853a999f600 100644 --- a/pkgs/tools/misc/tremor-rs/default.nix +++ b/pkgs/tools/misc/tremor-rs/default.nix @@ -29,7 +29,7 @@ rustPlatform.buildRustPackage rec { --zsh <($out/bin/tremor completions zsh) ''; - LIBCLANG_PATH = "${llvmPackages.libclang}/lib"; + LIBCLANG_PATH = "${llvmPackages.libclang.lib}/lib"; # OPENSSL_NO_VENDOR - If set, always find OpenSSL in the system, even if the vendored feature is enabled. OPENSSL_NO_VENDOR = 1; diff --git a/pkgs/tools/networking/innernet/default.nix b/pkgs/tools/networking/innernet/default.nix index af003396838..7a39c250ccf 100644 --- a/pkgs/tools/networking/innernet/default.nix +++ b/pkgs/tools/networking/innernet/default.nix @@ -19,7 +19,7 @@ rustPlatform.buildRustPackage rec { ]; buildInputs = [ sqlite ] ++ lib.optionals stdenv.isDarwin [ Security libiconv ]; - LIBCLANG_PATH = "${llvmPackages.libclang}/lib"; + LIBCLANG_PATH = "${llvmPackages.libclang.lib}/lib"; postInstall = '' installManPage doc/innernet-server.8.gz diff --git a/pkgs/tools/security/fido2luks/default.nix b/pkgs/tools/security/fido2luks/default.nix index 24115ba923f..26922c35f2d 100644 --- a/pkgs/tools/security/fido2luks/default.nix +++ b/pkgs/tools/security/fido2luks/default.nix @@ -22,7 +22,7 @@ rustPlatform.buildRustPackage rec { nativeBuildInputs = [ pkg-config clang ]; configurePhase = '' - export LIBCLANG_PATH="${llvmPackages.libclang}/lib" + export LIBCLANG_PATH="${llvmPackages.libclang.lib}/lib" ''; cargoSha256 = "sha256-4VuM1bPkl9XCI9XsZIJvw3kHSKgT4P7x6I83F2KCFD0="; diff --git a/pkgs/tools/security/sequoia/default.nix b/pkgs/tools/security/sequoia/default.nix index b0172ff1d50..35fc6e278b8 100644 --- a/pkgs/tools/security/sequoia/default.nix +++ b/pkgs/tools/security/sequoia/default.nix @@ -72,7 +72,7 @@ rustPlatform.buildRustPackage rec { "build-release" ]; - LIBCLANG_PATH = "${llvmPackages_10.libclang}/lib"; + LIBCLANG_PATH = "${llvmPackages_10.libclang.lib}/lib"; # Sometimes, tests fail on CI (ofborg) & hydra without this CARGO_TEST_ARGS = "--workspace --exclude sequoia-store"; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 328358c6e90..5bebae1fd7b 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -197,7 +197,7 @@ in castget = callPackage ../applications/networking/feedreaders/castget { }; castxml = callPackage ../development/tools/castxml { - inherit (llvmPackages) clang-unwrapped libclang llvm; + inherit (llvmPackages) libclang llvm; inherit (python3Packages) sphinx; }; @@ -10156,6 +10156,7 @@ in chez-matchable = callPackage ../development/chez-modules/chez-matchable { }; clang = llvmPackages.clang; + libclang = llvmPackages.libclang; clang-manpages = llvmPackages.clang-manpages; clang-sierraHack = clang.override { @@ -11080,6 +11081,7 @@ in lldb_12 = llvmPackages_12.lldb; llvm = llvmPackages.llvm; + libllvm = llvmPackages.libllvm; llvm-manpages = llvmPackages.llvm-manpages; llvm_12 = llvmPackages_12.llvm; @@ -11136,7 +11138,7 @@ in llvmPackages_10 = recurseIntoAttrs (callPackage ../development/compilers/llvm/10 { inherit (stdenvAdapters) overrideCC; buildLlvmTools = buildPackages.llvmPackages_10.tools; - targetLlvmLibraries = targetPackages.llvmPackages_10.libraries; + targetLlvmLibraries = targetPackages.llvmPackages_10.libraries or llvmPackages_10.libraries; }); llvmPackages_11 = recurseIntoAttrs (callPackage ../development/compilers/llvm/11 ({ @@ -11363,9 +11365,11 @@ in # So this commit doesn't remove the 1.45.2 release. rust_1_45 = callPackage ../development/compilers/rust/1_45.nix { inherit (darwin.apple_sdk.frameworks) CoreFoundation Security; + llvm_10 = llvmPackages_10.libllvm; }; rust_1_51 = callPackage ../development/compilers/rust/1_51.nix { inherit (darwin.apple_sdk.frameworks) CoreFoundation Security; + llvm_11 = llvmPackages_11.libllvm; }; rust = rust_1_51; @@ -13917,7 +13921,7 @@ in belr = callPackage ../development/libraries/belr { }; beignet = callPackage ../development/libraries/beignet { - inherit (llvmPackages_6) llvm clang-unwrapped; + inherit (llvmPackages_6) libllvm libclang; }; belle-sip = callPackage ../development/libraries/belle-sip { }; diff --git a/pkgs/top-level/ocaml-packages.nix b/pkgs/top-level/ocaml-packages.nix index a199ae83464..76d842531fe 100644 --- a/pkgs/top-level/ocaml-packages.nix +++ b/pkgs/top-level/ocaml-packages.nix @@ -584,7 +584,7 @@ let linenoise = callPackage ../development/ocaml-modules/linenoise { }; llvm = callPackage ../development/ocaml-modules/llvm { - llvm = pkgs.llvm_8; + libllvm = pkgs.llvmPackages_8.libllvm; }; logs = callPackage ../development/ocaml-modules/logs { }; From 81c3f7b8ff75572939ff8ad5781cb9f9a7906be5 Mon Sep 17 00:00:00 2001 From: George Shammas Date: Wed, 28 Apr 2021 15:42:44 -0400 Subject: [PATCH 142/263] postgresql: enable gssapi/kerberos support --- pkgs/servers/sql/postgresql/default.nix | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkgs/servers/sql/postgresql/default.nix b/pkgs/servers/sql/postgresql/default.nix index 35b46c673f8..63446a684b2 100644 --- a/pkgs/servers/sql/postgresql/default.nix +++ b/pkgs/servers/sql/postgresql/default.nix @@ -8,6 +8,8 @@ let # This is important to obtain a version of `libpq` that does not depend on systemd. , enableSystemd ? (lib.versionAtLeast version "9.6" && !stdenv.isDarwin) + , gssSupport ? with stdenv.hostPlatform; !isWindows && !isStatic, libkrb5 + # for postgreql.pkgs , this, self, newScope, buildEnv @@ -38,6 +40,7 @@ let [ zlib readline openssl libxml2 ] ++ lib.optionals icuEnabled [ icu ] ++ lib.optionals enableSystemd [ systemd ] + ++ lib.optionals gssSupport [ libkrb5 ] ++ lib.optionals (!stdenv.isDarwin) [ libossp_uuid ]; nativeBuildInputs = [ makeWrapper ] ++ lib.optionals icuEnabled [ pkg-config ]; @@ -62,7 +65,8 @@ let "--enable-debug" (lib.optionalString enableSystemd "--with-systemd") (if stdenv.isDarwin then "--with-uuid=e2fs" else "--with-ossp-uuid") - ] ++ lib.optionals icuEnabled [ "--with-icu" ]; + ] ++ lib.optionals icuEnabled [ "--with-icu" ] + ++ lib.optionals gssSupport [ "--with-gssapi" ]; patches = [ (if atLeast "9.4" then ./patches/disable-resolve_symlinks-94.patch else ./patches/disable-resolve_symlinks.patch) From f27de651fd1370fa1bac906a48e13ade6db38c92 Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Fri, 30 Apr 2021 13:56:27 +0000 Subject: [PATCH 143/263] netbsd.libcurses: fix build --- pkgs/os-specific/bsd/netbsd/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/os-specific/bsd/netbsd/default.nix b/pkgs/os-specific/bsd/netbsd/default.nix index ae5091a6a49..c6e4d0c95fd 100644 --- a/pkgs/os-specific/bsd/netbsd/default.nix +++ b/pkgs/os-specific/bsd/netbsd/default.nix @@ -621,6 +621,7 @@ in lib.makeScopeWithSplicing ] ++ lib.optional stdenv.isDarwin "-D__strong_alias(a,b)="; propagatedBuildInputs = with self; compatIfNeeded; MKDOC = "no"; # missing vfontedpr + makeFlags = [ "LIBDO.terminfo=${self.libterminfo}/lib" ]; postPatch = lib.optionalString (!stdenv.isDarwin) '' substituteInPlace printw.c \ --replace "funopen(win, NULL, __winwrite, NULL, NULL)" NULL \ From a7dd5ca90f1ffbee6033bc4d65e9d43e9a956bb4 Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Fri, 30 Apr 2021 12:23:00 +0000 Subject: [PATCH 144/263] systemd: fix build --- pkgs/os-specific/linux/systemd/default.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkgs/os-specific/linux/systemd/default.nix b/pkgs/os-specific/linux/systemd/default.nix index bd7c646c920..1971f6ad1c6 100644 --- a/pkgs/os-specific/linux/systemd/default.nix +++ b/pkgs/os-specific/linux/systemd/default.nix @@ -151,6 +151,12 @@ stdenv.mkDerivation { ./0017-path-util.h-add-placeholder-for-DEFAULT_PATH_NORMAL.patch ./0018-logind-seat-debus-show-CanMultiSession-again.patch ./0019-pkg-config-derive-prefix-from-prefix.patch + + # Fix -Werror=format. + (fetchpatch { + url = "https://github.com/systemd/systemd/commit/ab1aa6368a883bce88e3162fee2bea14aacedf23.patch"; + sha256 = "1b280l5jrjsg8qhsang199mpqjhkpix4c8bm3blknjnq9iv43add"; + }) ]; postPatch = '' From 1be22216349b44e6b8ded8580134b76c85593d9e Mon Sep 17 00:00:00 2001 From: Michael Weiss Date: Fri, 30 Apr 2021 21:39:22 +0200 Subject: [PATCH 145/263] wayland-protocols: 1.20 -> 1.21 Announcement: https://lists.freedesktop.org/archives/wayland-devel/2021-April/041815.html --- pkgs/development/libraries/wayland/protocols.nix | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/pkgs/development/libraries/wayland/protocols.nix b/pkgs/development/libraries/wayland/protocols.nix index 23258aff3e9..8a2b05aa4df 100644 --- a/pkgs/development/libraries/wayland/protocols.nix +++ b/pkgs/development/libraries/wayland/protocols.nix @@ -1,19 +1,15 @@ -{ lib, stdenv, fetchurl, pkg-config -, wayland -}: +{ lib, stdenv, fetchurl, wayland-scanner }: stdenv.mkDerivation rec { pname = "wayland-protocols"; - version = "1.20"; + version = "1.21"; src = fetchurl { url = "https://wayland.freedesktop.org/releases/${pname}-${version}.tar.xz"; - sha256 = "1rsdgvkkvxs3cjhpl6agvbkm53vm7k8rg127j9y2vn33m2hvg0lp"; + sha256 = "1rfdlkzz67qsb955zqb8jbw3m22pl6ppvrvfq8bqiqcb5n24b6dr"; }; - nativeBuildInputs = [ pkg-config ]; - - buildInputs = [ wayland ]; + nativeBuildInputs = [ wayland-scanner ]; meta = { description = "Wayland protocol extensions"; From 96f700fc2414ad822255460d5779ddf2ac87a709 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Fri, 30 Apr 2021 22:07:56 +0000 Subject: [PATCH 146/263] mesa: Fix build Needed more LLVM outputs --- pkgs/development/libraries/mesa/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/libraries/mesa/default.nix b/pkgs/development/libraries/mesa/default.nix index 3be50b5dbd9..743080ee82e 100644 --- a/pkgs/development/libraries/mesa/default.nix +++ b/pkgs/development/libraries/mesa/default.nix @@ -122,7 +122,7 @@ self = stdenv.mkDerivation { ]; buildInputs = with xorg; [ - expat llvmPackages.llvm libglvnd xorgproto + expat llvmPackages.libllvm libglvnd xorgproto libX11 libXext libxcb libXt libXfixes libxshmfence libXrandr libffi libvdpau libelf libXvMC libpthreadstubs openssl /*or another sha1 provider*/ From 50b66319294932c104e40fa1b33c973f5ee675fc Mon Sep 17 00:00:00 2001 From: John Ericson Date: Sat, 1 May 2021 02:03:30 +0000 Subject: [PATCH 147/263] rustc: Fix build Thanks @jonringer for catching, and sorry I didn't myself! --- pkgs/development/compilers/rust/rustc.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/development/compilers/rust/rustc.nix b/pkgs/development/compilers/rust/rustc.nix index 315fe7c0c6d..b9bccf9f16e 100644 --- a/pkgs/development/compilers/rust/rustc.nix +++ b/pkgs/development/compilers/rust/rustc.nix @@ -88,9 +88,9 @@ in stdenv.mkDerivation rec { "${setTarget}.cxx=${cxxForTarget}" ] ++ optionals (!withBundledLLVM) [ "--enable-llvm-link-shared" - "${setBuild}.llvm-config=${llvmSharedForBuild}/bin/llvm-config" - "${setHost}.llvm-config=${llvmSharedForHost}/bin/llvm-config" - "${setTarget}.llvm-config=${llvmSharedForTarget}/bin/llvm-config" + "${setBuild}.llvm-config=${llvmSharedForBuild.dev}/bin/llvm-config" + "${setHost}.llvm-config=${llvmSharedForHost.dev}/bin/llvm-config" + "${setTarget}.llvm-config=${llvmSharedForTarget.dev}/bin/llvm-config" ] ++ optionals (stdenv.isLinux && !stdenv.targetPlatform.isRedox) [ "--enable-profiler" # build libprofiler_builtins ] ++ optionals stdenv.buildPlatform.isMusl [ From 29271ef915bc7d62a208f3160d204d9dd99b5d1d Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Fri, 30 Apr 2021 13:59:47 +0000 Subject: [PATCH 148/263] netbsd.libedit: fix build --- pkgs/os-specific/bsd/netbsd/default.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkgs/os-specific/bsd/netbsd/default.nix b/pkgs/os-specific/bsd/netbsd/default.nix index c6e4d0c95fd..261704cba69 100644 --- a/pkgs/os-specific/bsd/netbsd/default.nix +++ b/pkgs/os-specific/bsd/netbsd/default.nix @@ -570,6 +570,8 @@ in lib.makeScopeWithSplicing sha256 = "0pmqh2mkfp70bwchiwyrkdyq9jcihx12g1awd6alqi9bpr3f9xmd"; buildInputs = with self; [ libterminfo libcurses ]; propagatedBuildInputs = with self; compatIfNeeded; + SHLIBINSTALLDIR = "$(out)/lib"; + makeFlags = [ "LIBDO.terminfo=${self.libterminfo}/lib" ]; postPatch = '' sed -i '1i #undef bool_t' el.h substituteInPlace config.h \ From 506fa8baf0f89a4f273fceeb4a4a60887f8caad1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Sat, 1 May 2021 16:43:04 +0200 Subject: [PATCH 149/263] pythonPackages.cffi: use pytestCheckHook --- pkgs/development/python-modules/cffi/default.nix | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/pkgs/development/python-modules/cffi/default.nix b/pkgs/development/python-modules/cffi/default.nix index afd9cfdc295..496124bfa11 100644 --- a/pkgs/development/python-modules/cffi/default.nix +++ b/pkgs/development/python-modules/cffi/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, buildPythonPackage, isPyPy, fetchPypi, libffi, pycparser, pytest }: +{ lib, stdenv, buildPythonPackage, isPyPy, fetchPypi, libffi, pycparser, pytestCheckHook }: if isPyPy then null else buildPythonPackage rec { pname = "cffi"; @@ -12,7 +12,6 @@ if isPyPy then null else buildPythonPackage rec { outputs = [ "out" "dev" ]; propagatedBuildInputs = [ libffi pycparser ]; - checkInputs = [ pytest ]; # On Darwin, the cffi tests want to hit libm a lot, and look for it in a global # impure search path. It's obnoxious how much repetition there is, and how difficult @@ -33,9 +32,8 @@ if isPyPy then null else buildPythonPackage rec { "-Wno-unused-command-line-argument -Wno-unreachable-code"; doCheck = !stdenv.hostPlatform.isMusl && !stdenv.isDarwin; # TODO: Investigate - checkPhase = '' - py.test -k "not test_char_pointer_conversion" - ''; + + checkInputs = [ pytestCheckHook ]; meta = with lib; { maintainers = with maintainers; [ domenkozar lnl7 ]; From eeeee817ca0cf7b60ddaa65d3021c3a4a241e0c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Sat, 1 May 2021 16:43:41 +0200 Subject: [PATCH 150/263] pythonPackages.cffi: move libffi to buildInputs --- pkgs/development/python-modules/cffi/default.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkgs/development/python-modules/cffi/default.nix b/pkgs/development/python-modules/cffi/default.nix index 496124bfa11..92899ed85e5 100644 --- a/pkgs/development/python-modules/cffi/default.nix +++ b/pkgs/development/python-modules/cffi/default.nix @@ -11,7 +11,9 @@ if isPyPy then null else buildPythonPackage rec { outputs = [ "out" "dev" ]; - propagatedBuildInputs = [ libffi pycparser ]; + buildInputs = [ libffi ]; + + propagatedBuildInputs = [ pycparser ]; # On Darwin, the cffi tests want to hit libm a lot, and look for it in a global # impure search path. It's obnoxious how much repetition there is, and how difficult From d4082387afac66dc56e8bc0c931fa8928cff84ab Mon Sep 17 00:00:00 2001 From: Michael Weiss Date: Fri, 30 Apr 2021 23:08:54 +0200 Subject: [PATCH 151/263] libglvnd: 1.3.2 -> 1.3.3 --- pkgs/development/libraries/libglvnd/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/libraries/libglvnd/default.nix b/pkgs/development/libraries/libglvnd/default.nix index 31a9579a892..65d0651ed41 100644 --- a/pkgs/development/libraries/libglvnd/default.nix +++ b/pkgs/development/libraries/libglvnd/default.nix @@ -5,14 +5,14 @@ stdenv.mkDerivation rec { pname = "libglvnd"; - version = "1.3.2"; + version = "1.3.3"; src = fetchFromGitLab { domain = "gitlab.freedesktop.org"; owner = "glvnd"; repo = "libglvnd"; rev = "v${version}"; - sha256 = "10x7fgb114r4gikdg6flszl3kwzcb9y5qa7sj9936mk0zxhjaylz"; + sha256 = "0gjk6m3gkdm12bmih2jflp0v5s1ibkixk7mrzrk0cj884m3hy1z6"; }; nativeBuildInputs = [ autoreconfHook pkg-config python3 addOpenGLRunpath ]; From 5ec403bf3f289496bd5b3704cd5e32a32e4189f8 Mon Sep 17 00:00:00 2001 From: taku0 Date: Sat, 12 Dec 2020 16:19:55 +0900 Subject: [PATCH 152/263] doptopenjdk: set CLASSPATH See: #106716. --- .../compilers/adoptopenjdk-bin/jdk-darwin-base.nix | 5 +++++ .../compilers/adoptopenjdk-bin/jdk-linux-base.nix | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/pkgs/development/compilers/adoptopenjdk-bin/jdk-darwin-base.nix b/pkgs/development/compilers/adoptopenjdk-bin/jdk-darwin-base.nix index 262e52c2521..71a55c68290 100644 --- a/pkgs/development/compilers/adoptopenjdk-bin/jdk-darwin-base.nix +++ b/pkgs/development/compilers/adoptopenjdk-bin/jdk-darwin-base.nix @@ -3,6 +3,7 @@ { swingSupport ? true # not used for now , lib, stdenv , fetchurl +, setJavaClassPath }: let cpuName = stdenv.hostPlatform.parsed.cpu.name; @@ -30,7 +31,11 @@ let cpuName = stdenv.hostPlatform.parsed.cpu.name; ln -s $out/Contents/Home/* $out/ + # Propagate the setJavaClassPath setup hook from the JDK so that + # any package that depends on the JDK has $CLASSPATH set up + # properly. mkdir -p $out/nix-support + printWords ${setJavaClassPath} > $out/nix-support/propagated-build-inputs # Set JAVA_HOME automatically. cat <> $out/nix-support/setup-hook diff --git a/pkgs/development/compilers/adoptopenjdk-bin/jdk-linux-base.nix b/pkgs/development/compilers/adoptopenjdk-bin/jdk-linux-base.nix index a433a2f1321..e304f67bd75 100644 --- a/pkgs/development/compilers/adoptopenjdk-bin/jdk-linux-base.nix +++ b/pkgs/development/compilers/adoptopenjdk-bin/jdk-linux-base.nix @@ -5,6 +5,7 @@ , fetchurl , autoPatchelfHook , makeWrapper +, setJavaClassPath # minimum dependencies , alsaLib , fontconfig @@ -74,7 +75,11 @@ let result = stdenv.mkDerivation rec { # https://github.com/NixOS/nixpkgs/issues/57733 find "$out" -name 'libfreetype.so*' -delete + # Propagate the setJavaClassPath setup hook from the JDK so that + # any package that depends on the JDK has $CLASSPATH set up + # properly. mkdir -p $out/nix-support + printWords ${setJavaClassPath} > $out/nix-support/propagated-build-inputs # Set JAVA_HOME automatically. cat <> "$out/nix-support/setup-hook" From 42df1f8b9839ff8a11d5bb29fde41f5255049572 Mon Sep 17 00:00:00 2001 From: Michael Weiss Date: Sun, 2 May 2021 13:26:57 +0200 Subject: [PATCH 153/263] libxkbcommon: 1.2.1 -> 1.3.0 --- pkgs/development/libraries/libxkbcommon/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/libraries/libxkbcommon/default.nix b/pkgs/development/libraries/libxkbcommon/default.nix index a4e1b125e64..b738089c853 100644 --- a/pkgs/development/libraries/libxkbcommon/default.nix +++ b/pkgs/development/libraries/libxkbcommon/default.nix @@ -20,11 +20,11 @@ stdenv.mkDerivation rec { pname = "libxkbcommon"; - version = "1.2.1"; + version = "1.3.0"; src = fetchurl { url = "https://xkbcommon.org/download/${pname}-${version}.tar.xz"; - sha256 = "1cqzd4vd5jw3ghibmdqvy90mb1h8vvazc81bxgavk6sc0b9sfcz8"; + sha256 = "0ysynzzgzd9jdrh1321r4bgw8wd5zljrlyn5y1a31g39xacf02bv"; }; outputs = [ "out" "dev" "doc" ]; From 96bbe339d47d4bc78cc9eaf0845734f80fe2d56b Mon Sep 17 00:00:00 2001 From: Dmitry Kalinkin Date: Sun, 2 May 2021 14:00:37 -0400 Subject: [PATCH 154/263] Revert "cc-wrapper: -nostdlib does not imply -nostdinc++" This made C++ standard headers passed to be passed when C compiler is executed, which is not a correct fix. This reverts commit 54c7a0f42287f63c2db8086a8ad46ac981364378. --- pkgs/build-support/cc-wrapper/cc-wrapper.sh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/pkgs/build-support/cc-wrapper/cc-wrapper.sh b/pkgs/build-support/cc-wrapper/cc-wrapper.sh index b402893100b..d08fd24cd2d 100644 --- a/pkgs/build-support/cc-wrapper/cc-wrapper.sh +++ b/pkgs/build-support/cc-wrapper/cc-wrapper.sh @@ -132,13 +132,12 @@ if [ "$NIX_ENFORCE_NO_NATIVE_@suffixSalt@" = 1 ]; then fi if [[ "$isCpp" = 1 ]]; then + if [[ "$cppInclude" = 1 ]]; then + NIX_CFLAGS_COMPILE_@suffixSalt@+=" $NIX_CXXSTDLIB_COMPILE_@suffixSalt@" + fi NIX_CFLAGS_LINK_@suffixSalt@+=" $NIX_CXXSTDLIB_LINK_@suffixSalt@" fi -if [[ "$cppInclude" = 1 ]]; then - NIX_CFLAGS_COMPILE_@suffixSalt@+=" $NIX_CXXSTDLIB_COMPILE_@suffixSalt@" -fi - source @out@/nix-support/add-hardening.sh # Add the flags for the C compiler proper. From d9bad0eae60c9226e4b405943cd67ec72d44b4d1 Mon Sep 17 00:00:00 2001 From: Dmitry Kalinkin Date: Sun, 2 May 2021 14:03:51 -0400 Subject: [PATCH 155/263] cc-wrapper.sh: rename variables cpp -> cxx CPP is the C PreProcessor CXX is C++ --- pkgs/build-support/cc-wrapper/cc-wrapper.sh | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/pkgs/build-support/cc-wrapper/cc-wrapper.sh b/pkgs/build-support/cc-wrapper/cc-wrapper.sh index d08fd24cd2d..5729fdc75e0 100644 --- a/pkgs/build-support/cc-wrapper/cc-wrapper.sh +++ b/pkgs/build-support/cc-wrapper/cc-wrapper.sh @@ -25,8 +25,8 @@ dontLink=0 nonFlagArgs=0 cc1=0 # shellcheck disable=SC2193 -[[ "@prog@" = *++ ]] && isCpp=1 || isCpp=0 -cppInclude=1 +[[ "@prog@" = *++ ]] && isCxx=1 || isCxx=0 +cxxInclude=1 cInclude=1 setDynamicLinker=1 @@ -50,15 +50,15 @@ while (( "$n" < "$nParams" )); do dontLink=1 elif [[ "$p" = -x && "$p2" = *-header ]]; then dontLink=1 - elif [[ "$p" = -x && "$p2" = c++* && "$isCpp" = 0 ]]; then - isCpp=1 + elif [[ "$p" = -x && "$p2" = c++* && "$isCxx" = 0 ]]; then + isCxx=1 elif [ "$p" = -nostdlib ]; then - isCpp=-1 + isCxx=-1 elif [ "$p" = -nostdinc ]; then cInclude=0 - cppInclude=0 + cxxInclude=0 elif [ "$p" = -nostdinc++ ]; then - cppInclude=0 + cxxInclude=0 elif [[ "$p" = -static || "$p" = -static-pie ]]; then setDynamicLinker=0 elif [[ "$p" != -?* ]]; then @@ -131,8 +131,8 @@ if [ "$NIX_ENFORCE_NO_NATIVE_@suffixSalt@" = 1 ]; then params=(${rest+"${rest[@]}"}) fi -if [[ "$isCpp" = 1 ]]; then - if [[ "$cppInclude" = 1 ]]; then +if [[ "$isCxx" = 1 ]]; then + if [[ "$cxxInclude" = 1 ]]; then NIX_CFLAGS_COMPILE_@suffixSalt@+=" $NIX_CXXSTDLIB_COMPILE_@suffixSalt@" fi NIX_CFLAGS_LINK_@suffixSalt@+=" $NIX_CXXSTDLIB_LINK_@suffixSalt@" From 11b744b59c09192c87b0c3f21b32036d7cf0bbf2 Mon Sep 17 00:00:00 2001 From: Dmitry Kalinkin Date: Sun, 2 May 2021 14:07:00 -0400 Subject: [PATCH 156/263] cc-wrapper.sh: make -nostdlib disable the standard C++ library, but not its includes Should be the correct fix for #111970 --- pkgs/build-support/cc-wrapper/cc-wrapper.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pkgs/build-support/cc-wrapper/cc-wrapper.sh b/pkgs/build-support/cc-wrapper/cc-wrapper.sh index 5729fdc75e0..2e62aef4604 100644 --- a/pkgs/build-support/cc-wrapper/cc-wrapper.sh +++ b/pkgs/build-support/cc-wrapper/cc-wrapper.sh @@ -27,6 +27,7 @@ cc1=0 # shellcheck disable=SC2193 [[ "@prog@" = *++ ]] && isCxx=1 || isCxx=0 cxxInclude=1 +cxxLibrary=1 cInclude=1 setDynamicLinker=1 @@ -53,7 +54,7 @@ while (( "$n" < "$nParams" )); do elif [[ "$p" = -x && "$p2" = c++* && "$isCxx" = 0 ]]; then isCxx=1 elif [ "$p" = -nostdlib ]; then - isCxx=-1 + cxxLibrary=0 elif [ "$p" = -nostdinc ]; then cInclude=0 cxxInclude=0 @@ -135,7 +136,9 @@ if [[ "$isCxx" = 1 ]]; then if [[ "$cxxInclude" = 1 ]]; then NIX_CFLAGS_COMPILE_@suffixSalt@+=" $NIX_CXXSTDLIB_COMPILE_@suffixSalt@" fi - NIX_CFLAGS_LINK_@suffixSalt@+=" $NIX_CXXSTDLIB_LINK_@suffixSalt@" + if [[ "$cxxLibrary" = 1 ]]; then + NIX_CFLAGS_LINK_@suffixSalt@+=" $NIX_CXXSTDLIB_LINK_@suffixSalt@" + fi fi source @out@/nix-support/add-hardening.sh From c9b192392c2e6202d371152829f0a641c411775e Mon Sep 17 00:00:00 2001 From: "R. RyanTM" Date: Mon, 3 May 2021 05:13:09 +0000 Subject: [PATCH 157/263] libass: 0.15.0 -> 0.15.1 --- pkgs/development/libraries/libass/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/libraries/libass/default.nix b/pkgs/development/libraries/libass/default.nix index 6a180cb62c1..3a8c2a2655a 100644 --- a/pkgs/development/libraries/libass/default.nix +++ b/pkgs/development/libraries/libass/default.nix @@ -17,11 +17,11 @@ in with lib; stdenv.mkDerivation rec { pname = "libass"; - version = "0.15.0"; + version = "0.15.1"; src = fetchurl { url = "https://github.com/libass/libass/releases/download/${version}/${pname}-${version}.tar.xz"; - sha256 = "0cz8v6kh3f2j5rdjrra2z0h715fa16vjm7kambvqx9hak86262cz"; + sha256 = "sha256-HN05ydAHsG5zfnc4AE1/OM+bHpKEPzcweyTn/2OrjlM="; }; configureFlags = [ From f63378f2dcf39ff68a0d1826daa5aaad3f727939 Mon Sep 17 00:00:00 2001 From: Alex Wied Date: Fri, 30 Apr 2021 05:19:08 -0400 Subject: [PATCH 158/263] rust-cbindgen: Update Cargo hash --- pkgs/development/tools/rust/cbindgen/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/tools/rust/cbindgen/default.nix b/pkgs/development/tools/rust/cbindgen/default.nix index 5dad37d0816..2e3391de94e 100644 --- a/pkgs/development/tools/rust/cbindgen/default.nix +++ b/pkgs/development/tools/rust/cbindgen/default.nix @@ -11,7 +11,7 @@ rustPlatform.buildRustPackage rec { sha256 = "sha256-S3t1hv/mRn6vwyzT78DPIacqiJV3CnjGdOKsdSyYs8g="; }; - cargoSha256 = "sha256-uaeJmGEQHVSuILlYlJOHmRWWdN6FPvrHu6CbJyb60MY="; + cargoSha256 = "1ycvbdgd50l1nahq63zi9yp3793smkswlwhsqjrmws5b1fqzv9w0"; buildInputs = lib.optional stdenv.isDarwin Security; From 1ba9be42322bbd0d57995ea7382eb4714fe4452f Mon Sep 17 00:00:00 2001 From: Jonathan Ringer Date: Mon, 3 May 2021 17:39:41 -0700 Subject: [PATCH 159/263] python3Packages.kmapper: fix tests sdist wasn't distributing conftest.py --- pkgs/development/python-modules/kmapper/default.nix | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/pkgs/development/python-modules/kmapper/default.nix b/pkgs/development/python-modules/kmapper/default.nix index 6c173661084..8859caaab5c 100644 --- a/pkgs/development/python-modules/kmapper/default.nix +++ b/pkgs/development/python-modules/kmapper/default.nix @@ -1,6 +1,6 @@ { lib , buildPythonPackage -, fetchPypi +, fetchFromGitHub , scikitlearn , numpy , scipy @@ -17,9 +17,11 @@ buildPythonPackage rec { pname = "kmapper"; version = "2.0.0"; - src = fetchPypi { - inherit pname version; - sha256 = "3708d889f96f6bbe89c52000dd9378ca4c35638180ff894b64ebbdfcfe62aab2"; + src = fetchFromGitHub { + owner = "scikit-tda"; + repo = "kepler-mapper"; + rev = "v${version}"; + sha256 = "0djm27si2bn18khrbb7rwhflc5ma6g9smhikhk5i1apwn5avm6l4"; }; propagatedBuildInputs = [ From 456c63ebc00b24b9259b0aa0e45bbd5b270a701e Mon Sep 17 00:00:00 2001 From: Jonathan Ringer Date: Mon, 3 May 2021 16:41:03 -0700 Subject: [PATCH 160/263] python3Packages.llvmlite: fix build Fix regression from #111487 --- pkgs/development/python-modules/llvmlite/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/python-modules/llvmlite/default.nix b/pkgs/development/python-modules/llvmlite/default.nix index b5e6847a9f0..c7d2221a22e 100644 --- a/pkgs/development/python-modules/llvmlite/default.nix +++ b/pkgs/development/python-modules/llvmlite/default.nix @@ -33,7 +33,7 @@ buildPythonPackage rec { ''; # Set directory containing llvm-config binary preConfigure = '' - export LLVM_CONFIG=${llvm}/bin/llvm-config + export LLVM_CONFIG=${llvm.dev}/bin/llvm-config ''; checkPhase = '' ${python.executable} runtests.py From 8d56f162e5edd61ba21367f1bf004e37ac1ff2ea Mon Sep 17 00:00:00 2001 From: Michael Weiss Date: Tue, 4 May 2021 13:56:41 +0200 Subject: [PATCH 161/263] libaom: 3.0.0 -> 3.1.0 We had to use fetchgit so far as the tarballs are generated on demand and have embedded timestamps which makes their hashes unstable [0][1]. This is a problem for fetchurl but fetchzip extracts the tarballs into the Nix store and therefore the contents will get normalized and the hashes remain stable. [0]: https://github.com/google/gitiles/issues/84 [1]: https://bugs.eclipse.org/bugs/show_bug.cgi?id=548312 --- pkgs/development/libraries/libaom/default.nix | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pkgs/development/libraries/libaom/default.nix b/pkgs/development/libraries/libaom/default.nix index 62045a79ebf..83f5de4d013 100644 --- a/pkgs/development/libraries/libaom/default.nix +++ b/pkgs/development/libraries/libaom/default.nix @@ -1,13 +1,13 @@ -{ lib, stdenv, fetchgit, yasm, perl, cmake, pkg-config, python3 }: +{ lib, stdenv, fetchzip, yasm, perl, cmake, pkg-config, python3 }: stdenv.mkDerivation rec { pname = "libaom"; - version = "3.0.0"; + version = "3.1.0"; - src = fetchgit { - url = "https://aomedia.googlesource.com/aom"; - rev = "v${version}"; - sha256 = "178rq1d7i9q4lg40bipkyhdrk18j9wi5k5avpa5bls0zm7g5ifsx"; + src = fetchzip { + url = "https://aomedia.googlesource.com/aom/+archive/v${version}.tar.gz"; + sha256 = "1v3i34jmbz1p3x8msj3vx46nl6jdzxbkr2lfbh06vard8adb16il"; + stripRoot = false; }; patches = [ ./outputs.patch ]; From b062135493d524de32106e2c70864c3e2d449e3f Mon Sep 17 00:00:00 2001 From: Michael Weiss Date: Tue, 4 May 2021 19:59:15 +0200 Subject: [PATCH 162/263] wayland{.bin,-scanner}: Add a pkg-config file for cross-compilation Only "wayland_scanner" and "Version" are required so it's easier to create wayland-scanner.pc manually than to copy it from $dev and avoid dependency cycles. --- pkgs/development/libraries/wayland/default.nix | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/pkgs/development/libraries/wayland/default.nix b/pkgs/development/libraries/wayland/default.nix index 07671ddebdd..4a685b43073 100644 --- a/pkgs/development/libraries/wayland/default.nix +++ b/pkgs/development/libraries/wayland/default.nix @@ -5,7 +5,7 @@ , meson , pkg-config , ninja -, wayland +, wayland-scanner , expat , libxml2 , withLibraries ? stdenv.isLinux @@ -64,7 +64,7 @@ stdenv.mkDerivation rec { pkg-config ninja ] ++ lib.optionals isCross [ - wayland # For wayland-scanner during the build + wayland-scanner ] ++ lib.optionals withDocumentation [ (graphviz-nox.override { pango = null; }) # To avoid an infinite recursion doxygen @@ -85,6 +85,18 @@ stdenv.mkDerivation rec { docbook_xml_dtd_42 ]; + postFixup = '' + # The pkg-config file is required for cross-compilation: + mkdir -p $bin/lib/pkgconfig/ + cat < $bin/lib/pkgconfig/wayland-scanner.pc + wayland_scanner=$bin/bin/wayland-scanner + + Name: Wayland Scanner + Description: Wayland scanner + Version: ${version} + EOF + ''; + meta = with lib; { description = "Core Wayland window system code and protocol"; longDescription = '' From 9677aba91e9208dc84490bc460dacd693cf72417 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Tue, 16 Mar 2021 20:39:46 +0100 Subject: [PATCH 163/263] python3Packages.txaio: update check part --- .../python-modules/txaio/default.nix | 51 ++++++++++++++----- 1 file changed, 38 insertions(+), 13 deletions(-) diff --git a/pkgs/development/python-modules/txaio/default.nix b/pkgs/development/python-modules/txaio/default.nix index c2f2c9451bd..fa219a94513 100644 --- a/pkgs/development/python-modules/txaio/default.nix +++ b/pkgs/development/python-modules/txaio/default.nix @@ -1,30 +1,55 @@ -{ lib, buildPythonPackage, fetchPypi, pytest, mock, six, twisted, isPy37, isPy27 }: +{ lib +, buildPythonPackage +, fetchPypi +, mock +, pytest-asyncio +, pytestCheckHook +, pythonOlder +, six +, twisted +, zope_interface +}: buildPythonPackage rec { pname = "txaio"; version = "21.2.1"; - disabled = isPy27; + disabled = pythonOlder "3.7"; src = fetchPypi { inherit pname version; - sha256 = "7d6f89745680233f1c4db9ddb748df5e88d2a7a37962be174c0fd04c8dba1dc8"; + sha256 = "sha256-fW+JdFaAIz8cTbndt0jfXojSp6N5Yr4XTA/QTI26Hcg="; }; - checkInputs = [ pytest mock ]; + propagatedBuildInputs = [ + six + twisted + zope_interface + ]; - propagatedBuildInputs = [ six twisted ]; + checkInputs = [ + mock + pytest-asyncio + pytestCheckHook + ]; - checkPhase = '' - py.test -k "not test_sdist" - ''; + disabledTests = [ + # No real value + "test_sdist" + # Some tests seems out-dated and require additional data + "test_as_future" + "test_errback" + "test_create_future" + "test_callback" + "test_immediate_result" + "test_cancel" + ]; - # Needs some fixing - doCheck = false; + pythonImportsCheck = [ "txaio" ]; meta = with lib; { - description = "Utilities to support code that runs unmodified on Twisted and asyncio."; - homepage = "https://github.com/crossbario/txaio"; - license = licenses.mit; + description = "Utilities to support code that runs unmodified on Twisted and asyncio"; + homepage = "https://github.com/crossbario/txaio"; + license = licenses.mit; maintainers = with maintainers; [ nand0p ]; }; } From 5396cc05d9a12ee135dbfa35e414b6f654ecfc69 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Sat, 17 Apr 2021 21:51:59 +0200 Subject: [PATCH 164/263] python3Packages.py-ubjson: init at 0.16.1 --- .../python-modules/py-ubjson/default.nix | 32 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 ++ 2 files changed, 34 insertions(+) create mode 100644 pkgs/development/python-modules/py-ubjson/default.nix diff --git a/pkgs/development/python-modules/py-ubjson/default.nix b/pkgs/development/python-modules/py-ubjson/default.nix new file mode 100644 index 00000000000..4efa2b8b6fd --- /dev/null +++ b/pkgs/development/python-modules/py-ubjson/default.nix @@ -0,0 +1,32 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub +, pytestCheckHook +}: + +buildPythonPackage rec { + pname = "py-ubjson"; + version = "0.16.1"; + + src = fetchFromGitHub { + owner = "Iotic-Labs"; + repo = pname; + rev = "v${version}"; + sha256 = "1frn97xfa88zrfmpnvdk1pc03yihlchhph99bhjayvzlfcrhm5v3"; + }; + + checkInputs = [ + pytestCheckHook + ]; + + pytestFlagsArray = [ "test/test.py" ]; + + pythonImportsCheck = [ "ubjson" ]; + + meta = with lib; { + description = "Universal Binary JSON draft-12 serializer for Python"; + homepage = "https://github.com/Iotic-Labs/py-ubjson"; + license = with licenses; [ asl20 ]; + maintainers = with maintainers; [ fab ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 7249173d707..2089342201d 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -5260,6 +5260,8 @@ in { py-air-control-exporter = callPackage ../development/python-modules/py-air-control-exporter { }; + py-ubjson = callPackage ../development/python-modules/py-ubjson { }; + py2bit = callPackage ../development/python-modules/py2bit { }; py3buddy = toPythonModule (callPackage ../development/python-modules/py3buddy { }); From 5c42f1081bde88d84bbea566b6de130e0234bd26 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Sat, 17 Apr 2021 22:14:41 +0200 Subject: [PATCH 165/263] python3Packages.autobahn: update check section --- .../python-modules/autobahn/default.nix | 78 +++++++++++++++---- 1 file changed, 61 insertions(+), 17 deletions(-) diff --git a/pkgs/development/python-modules/autobahn/default.nix b/pkgs/development/python-modules/autobahn/default.nix index 19015a5729a..2585cd539d7 100644 --- a/pkgs/development/python-modules/autobahn/default.nix +++ b/pkgs/development/python-modules/autobahn/default.nix @@ -1,34 +1,78 @@ -{ lib, buildPythonPackage, fetchPypi, isPy3k, - six, txaio, twisted, zope_interface, cffi, - mock, pytest, cryptography, pynacl +{ lib +, argon2_cffi +, attrs +, buildPythonPackage +, cbor +, cbor2 +, cffi +, cryptography +, fetchPypi +, flatbuffers +, mock +, msgpack +, passlib +, pynacl +, pytest-asyncio +, pytestCheckHook +, pythonOlder +, twisted +, py-ubjson +, txaio +, ujson +, zope_interface }: + buildPythonPackage rec { pname = "autobahn"; version = "21.3.1"; - disabled = !isPy3k; + disabled = pythonOlder "3.7"; src = fetchPypi { inherit pname version; - sha256 = "e126c1f583e872fb59e79d36977cfa1f2d0a8a79f90ae31f406faae7664b8e03"; + sha256 = "00wf9dkfgakg80gy62prg650lb8zz9y9fdlxwxcznwp8hgsw29p1"; }; - propagatedBuildInputs = [ six txaio twisted zope_interface cffi cryptography pynacl ]; + propagatedBuildInputs = [ + argon2_cffi + cbor + cbor2 + cffi + cryptography + flatbuffers + msgpack + passlib + py-ubjson + pynacl + twisted + txaio + ujson + zope_interface + ]; - checkInputs = [ mock pytest ]; - checkPhase = '' - runHook preCheck - USE_TWISTED=true py.test $out - runHook postCheck + checkInputs = [ + mock + pytest-asyncio + pytestCheckHook + ]; + + postPatch = '' + substituteInPlace setup.py \ + --replace "pytest>=2.8.6,<3.3.0" "pytest" ''; - # Tests do no seem to be compatible yet with pytest 5.1 - # https://github.com/crossbario/autobahn-python/issues/1235 - doCheck = false; + preCheck = '' + # Run asyncio tests (requires twisted) + export USE_ASYNCIO=1 + ''; + + pytestFlagsArray = [ "--pyargs autobahn" ]; + + pythonImportsCheck = [ "autobahn" ]; meta = with lib; { - description = "WebSocket and WAMP in Python for Twisted and asyncio."; - homepage = "https://crossbar.io/autobahn"; - license = licenses.mit; + description = "WebSocket and WAMP in Python for Twisted and asyncio"; + homepage = "https://crossbar.io/autobahn"; + license = licenses.mit; maintainers = with maintainers; [ nand0p ]; }; } From 29aaa03932e614724e0d907c39b929eedcbbd0e0 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Wed, 21 Apr 2021 08:56:22 +0200 Subject: [PATCH 166/263] pythonPackages.hyperlink: cleanups, add homepage --- pkgs/development/python-modules/hyperlink/default.nix | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/hyperlink/default.nix b/pkgs/development/python-modules/hyperlink/default.nix index ad56de86782..21927683b18 100644 --- a/pkgs/development/python-modules/hyperlink/default.nix +++ b/pkgs/development/python-modules/hyperlink/default.nix @@ -1,4 +1,10 @@ -{ lib, buildPythonPackage, fetchPypi, isPy27, idna, typing ? null }: +{ lib +, buildPythonPackage +, fetchPypi +, isPy27 +, idna +, typing ? null +}: buildPythonPackage rec { pname = "hyperlink"; @@ -6,7 +12,7 @@ buildPythonPackage rec { src = fetchPypi { inherit pname version; - sha256 = "427af957daa58bc909471c6c40f74c5450fa123dd093fc53efd2e91d2705a56b"; + sha256 = "0sx50lkivsfjxx9zr4yh7l9gll2l9kvl0v0w8w4wk2x5v9bzjyj2"; }; propagatedBuildInputs = [ idna ] @@ -14,6 +20,7 @@ buildPythonPackage rec { meta = with lib; { description = "A featureful, correct URL for Python"; + homepage = "https://github.com/python-hyper/hyperlink"; license = licenses.mit; platforms = platforms.all; maintainers = with maintainers; [ apeschar ]; From def35a9603277849498acb5df6ada7bbc0663f08 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Tue, 4 May 2021 23:33:02 +0200 Subject: [PATCH 167/263] python3Packages.py-cpuinfo: 7.0.0 -> 8.0.0 --- .../python-modules/py-cpuinfo/default.nix | 32 ++++++------------- 1 file changed, 10 insertions(+), 22 deletions(-) diff --git a/pkgs/development/python-modules/py-cpuinfo/default.nix b/pkgs/development/python-modules/py-cpuinfo/default.nix index f9e276b3bb5..12b9668f1ed 100644 --- a/pkgs/development/python-modules/py-cpuinfo/default.nix +++ b/pkgs/development/python-modules/py-cpuinfo/default.nix @@ -1,7 +1,6 @@ { lib , stdenv , fetchFromGitHub -, fetchpatch , buildPythonPackage , pytestCheckHook , sysctl @@ -9,28 +8,15 @@ buildPythonPackage rec { pname = "py-cpuinfo"; - version = "7.0.0"; + version = "8.0.0"; src = fetchFromGitHub { owner = "workhorsy"; repo = pname; rev = "v${version}"; - sha256 = "10qfaibyb2syiwiyv74l7d97vnmlk079qirgnw3ncklqjs0s3gbi"; + sha256 = "sha256-Mgzj1HTasUNHeHMVwV6d+TeyVqnBNUwCJ1EC3kfovf8="; }; - patches = [ - # Make it detect Apple Silicon, remove after https://github.com/workhorsy/py-cpuinfo/pull/161 is merged. - (fetchpatch { - url = "https://github.com/workhorsy/py-cpuinfo/commit/54c32da6678f9d75ec5acf4534056cdc85c2a04d.patch"; - sha256 = "sha256-3R46KrpACAQ1V0CQtz48V5mQXxvplUQrXnACtiE8WqY="; - }) - # Continuation of the patch above - (fetchpatch { - url = "https://github.com/workhorsy/py-cpuinfo/commit/0d00f4b99750f292c85ff23e1039ea9489cb7ec8.patch"; - sha256 = "sha256-mHoXoCAEG2v3xpQppRFWzSvhYCp5i9CZkbEgtiLVzMs="; - }) - ]; - checkInputs = [ pytestCheckHook ]; @@ -42,17 +28,19 @@ buildPythonPackage rec { --replace "_run_and_get_stdout(['sysctl'" "_run_and_get_stdout(['${sysctl}/bin/sysctl'" ''; - meta = { - description = "Get CPU info with pure Python 2 & 3"; + pythonImportsCheck = [ "cpuinfo" ]; + + meta = with lib; { + description = "Get CPU info with pure Python"; longDescription = '' Py-cpuinfo gets CPU info with pure Python and should work without any extra programs or libraries, beyond what your OS provides. It does not require any compilation (C/C++, assembly, etc.) to use and works with - Python 2 and 3. + Python. ''; - inherit (src.meta) homepage; + homepage = "https://github.com/workhorsy/py-cpuinfo"; changelog = "https://github.com/workhorsy/py-cpuinfo/blob/v${version}/ChangeLog"; - license = lib.licenses.mit; - maintainers = with lib.maintainers; [ costrouc ]; + license = licenses.mit; + maintainers = with maintainers; [ costrouc ]; }; } From 21ac8c9fa441fc38988054b0c9376acc8207f653 Mon Sep 17 00:00:00 2001 From: Mario Rodas Date: Thu, 6 May 2021 04:20:00 +0000 Subject: [PATCH 168/263] protobuf3_16: init at 3.16.0 --- pkgs/development/libraries/protobuf/3.16.nix | 6 ++++++ pkgs/top-level/all-packages.nix | 1 + 2 files changed, 7 insertions(+) create mode 100644 pkgs/development/libraries/protobuf/3.16.nix diff --git a/pkgs/development/libraries/protobuf/3.16.nix b/pkgs/development/libraries/protobuf/3.16.nix new file mode 100644 index 00000000000..df8d53b9f1c --- /dev/null +++ b/pkgs/development/libraries/protobuf/3.16.nix @@ -0,0 +1,6 @@ +{ callPackage, ... }: + +callPackage ./generic-v3.nix { + version = "3.16.0"; + sha256 = "0jc523ys6xh1fk3l52f5mfqxhb4g8aim1js7330v0fdc3fjr8ncf"; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 9f20e8c23a3..75f6bdd3c11 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -17137,6 +17137,7 @@ in protobuf = protobuf3_15; + protobuf3_16 = callPackage ../development/libraries/protobuf/3.16.nix { }; protobuf3_15 = callPackage ../development/libraries/protobuf/3.15.nix { }; protobuf3_14 = callPackage ../development/libraries/protobuf/3.14.nix { }; protobuf3_13 = callPackage ../development/libraries/protobuf/3.13.nix { }; From d4a8774ee26b1fdddc40427ddb2866d35ead542c Mon Sep 17 00:00:00 2001 From: Mario Rodas Date: Thu, 6 May 2021 04:20:00 +0000 Subject: [PATCH 169/263] protobuf: 3.15.7 -> 3.16.0 https://github.com/protocolbuffers/protobuf/releases/tag/v3.16.0 --- pkgs/top-level/all-packages.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 75f6bdd3c11..18b1fe25e41 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -17135,7 +17135,7 @@ in python = python37; }; - protobuf = protobuf3_15; + protobuf = protobuf3_16; protobuf3_16 = callPackage ../development/libraries/protobuf/3.16.nix { }; protobuf3_15 = callPackage ../development/libraries/protobuf/3.15.nix { }; From 0176ed1456a1ad6f82460216e6bc146560f9d652 Mon Sep 17 00:00:00 2001 From: "R. RyanTM" Date: Thu, 6 May 2021 06:28:35 +0000 Subject: [PATCH 170/263] libheif: 1.11.0 -> 1.12.0 --- pkgs/development/libraries/libheif/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/libraries/libheif/default.nix b/pkgs/development/libraries/libheif/default.nix index 71dfca5e643..d445a7c3867 100644 --- a/pkgs/development/libraries/libheif/default.nix +++ b/pkgs/development/libraries/libheif/default.nix @@ -3,7 +3,7 @@ stdenv.mkDerivation rec { pname = "libheif"; - version = "1.11.0"; + version = "1.12.0"; outputs = [ "bin" "out" "dev" "man" ]; @@ -11,7 +11,7 @@ stdenv.mkDerivation rec { owner = "strukturag"; repo = "libheif"; rev = "v${version}"; - sha256 = "sha256-xT0sfYPp5atYXnVpP8TYu2TC9/Z/ClyEP1OTSfcw1gw="; + sha256 = "sha256-RjGLaDSBO8T7ijRb5a16aUlkCy5vdFPs4O9caIJo4jI="; }; nativeBuildInputs = [ autoreconfHook pkg-config ]; From 2e0b8acd823c1166d48097891368d59aac821e0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Thu, 6 May 2021 15:18:50 +0200 Subject: [PATCH 171/263] python3Packages.django_2: 2.2.20 -> 2.2.22 https://www.djangoproject.com/weblog/2021/may/06/security-releases/ --- pkgs/development/python-modules/django/2.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/django/2.nix b/pkgs/development/python-modules/django/2.nix index 991c353df17..e0d3cd12f8f 100644 --- a/pkgs/development/python-modules/django/2.nix +++ b/pkgs/development/python-modules/django/2.nix @@ -6,13 +6,13 @@ buildPythonPackage rec { pname = "Django"; - version = "2.2.20"; + version = "2.2.22"; disabled = !isPy3k; src = fetchPypi { inherit pname version; - sha256 = "0r3a6gbhwngxl172yy6n0sq5knibl2vxc0wbk1g8licfbzfgjs95"; + sha256 = "db2214db1c99017cbd971e58824e6f424375154fe358afc30e976f5b99fc6060"; }; patches = lib.optional withGdal From ae65aae7954a30be024da6c99575717db1e61a7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Thu, 6 May 2021 15:20:30 +0200 Subject: [PATCH 172/263] python3Packages.django_3: 3.2 -> 3.2.2 https://www.djangoproject.com/weblog/2021/may/06/security-releases/ --- pkgs/development/python-modules/django/3.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/django/3.nix b/pkgs/development/python-modules/django/3.nix index 62ca390eac5..321582946b3 100644 --- a/pkgs/development/python-modules/django/3.nix +++ b/pkgs/development/python-modules/django/3.nix @@ -13,13 +13,13 @@ buildPythonPackage rec { pname = "Django"; - version = "3.2"; + version = "3.2.2"; disabled = pythonOlder "3.7"; src = fetchPypi { inherit pname version; - sha256 = "179qdxa438fnycnnf1j5z6359h1kbp2q7djf01v5jrr26xjgkw11"; + sha256 = "0a1d195ad65c52bf275b8277b3d49680bd1137a5f55039a806f25f6b9752ce3d"; }; patches = lib.optional withGdal From fc7a998748defeed086f1bcc68ab6310b248f673 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Fri, 7 May 2021 16:39:19 +0000 Subject: [PATCH 173/263] compiler-rt: Fix build by passing resource dir Before, clang was able to find some headers with a relative path to the `-B` flag pointing near the unwrapped clang binary. But with multiple outputs that doesn't work, so we use a "resource directory" as it done later in the bootstrap. --- pkgs/development/compilers/llvm/10/default.nix | 10 ++++++---- pkgs/development/compilers/llvm/11/default.nix | 10 ++++++---- pkgs/development/compilers/llvm/12/default.nix | 10 ++++++---- pkgs/development/compilers/llvm/7/default.nix | 10 ++++++---- pkgs/development/compilers/llvm/8/default.nix | 10 ++++++---- pkgs/development/compilers/llvm/9/default.nix | 10 ++++++---- 6 files changed, 36 insertions(+), 24 deletions(-) diff --git a/pkgs/development/compilers/llvm/10/default.nix b/pkgs/development/compilers/llvm/10/default.nix index 9bc79b58693..e6b55f369c3 100644 --- a/pkgs/development/compilers/llvm/10/default.nix +++ b/pkgs/development/compilers/llvm/10/default.nix @@ -18,13 +18,15 @@ let tools = lib.makeExtensible (tools: let callPackage = newScope (tools // { inherit stdenv cmake libxml2 python3 isl release_version version fetch buildLlvmTools; }); - mkExtraBuildCommands = cc: '' + mkExtraBuildCommands0 = cc: '' rsrc="$out/resource-root" mkdir "$rsrc" ln -s "${cc.lib}/lib/clang/${release_version}/include" "$rsrc" + echo "-resource-dir=$rsrc" >> $out/nix-support/cc-cflags + ''; + mkExtraBuildCommands = cc: mkExtraBuildCommands0 cc + '' ln -s "${targetLlvmLibraries.compiler-rt.out}/lib" "$rsrc/lib" ln -s "${targetLlvmLibraries.compiler-rt.out}/share" "$rsrc/share" - echo "-resource-dir=$rsrc" >> $out/nix-support/cc-cflags ''; in { @@ -147,7 +149,7 @@ let '' + mkExtraBuildCommands cc; }; - lldClangNoCompilerRt = wrapCCWith { + lldClangNoCompilerRt = wrapCCWith rec { cc = tools.clang-unwrapped; libcxx = null; bintools = wrapBintoolsWith { @@ -157,7 +159,7 @@ let extraPackages = [ ]; extraBuildCommands = '' echo "-nostartfiles" >> $out/nix-support/cc-cflags - ''; + '' + mkExtraBuildCommands0 cc; }; }); diff --git a/pkgs/development/compilers/llvm/11/default.nix b/pkgs/development/compilers/llvm/11/default.nix index cb5d08d9ff0..3852843e784 100644 --- a/pkgs/development/compilers/llvm/11/default.nix +++ b/pkgs/development/compilers/llvm/11/default.nix @@ -20,13 +20,15 @@ let tools = lib.makeExtensible (tools: let callPackage = newScope (tools // { inherit stdenv cmake libxml2 python3 isl release_version version fetch buildLlvmTools; }); - mkExtraBuildCommands = cc: '' + mkExtraBuildCommands0 = cc: '' rsrc="$out/resource-root" mkdir "$rsrc" ln -s "${cc.lib}/lib/clang/${release_version}/include" "$rsrc" + echo "-resource-dir=$rsrc" >> $out/nix-support/cc-cflags + ''; + mkExtraBuildCommands = cc: mkExtraBuildCommands0 cc + '' ln -s "${targetLlvmLibraries.compiler-rt.out}/lib" "$rsrc/lib" ln -s "${targetLlvmLibraries.compiler-rt.out}/share" "$rsrc/share" - echo "-resource-dir=$rsrc" >> $out/nix-support/cc-cflags ''; in { @@ -149,7 +151,7 @@ let '' + mkExtraBuildCommands cc; }; - lldClangNoCompilerRt = wrapCCWith { + lldClangNoCompilerRt = wrapCCWith rec { cc = tools.clang-unwrapped; libcxx = null; bintools = wrapBintoolsWith { @@ -159,7 +161,7 @@ let extraPackages = [ ]; extraBuildCommands = '' echo "-nostartfiles" >> $out/nix-support/cc-cflags - ''; + '' + mkExtraBuildCommands0 cc; }; }); diff --git a/pkgs/development/compilers/llvm/12/default.nix b/pkgs/development/compilers/llvm/12/default.nix index bfdb65ee9ac..33db315f625 100644 --- a/pkgs/development/compilers/llvm/12/default.nix +++ b/pkgs/development/compilers/llvm/12/default.nix @@ -27,13 +27,15 @@ let tools = lib.makeExtensible (tools: let callPackage = newScope (tools // { inherit stdenv cmake libxml2 python3 isl release_version version fetch buildLlvmTools; }); - mkExtraBuildCommands = cc: '' + mkExtraBuildCommands0 = cc: '' rsrc="$out/resource-root" mkdir "$rsrc" ln -s "${cc.lib}/lib/clang/${release_version}/include" "$rsrc" + echo "-resource-dir=$rsrc" >> $out/nix-support/cc-cflags + ''; + mkExtraBuildCommands = cc: mkExtraBuildCommands0 cc + '' ln -s "${targetLlvmLibraries.compiler-rt.out}/lib" "$rsrc/lib" ln -s "${targetLlvmLibraries.compiler-rt.out}/share" "$rsrc/share" - echo "-resource-dir=$rsrc" >> $out/nix-support/cc-cflags ''; in { @@ -166,7 +168,7 @@ let '' + mkExtraBuildCommands cc; }; - lldClangNoCompilerRt = wrapCCWith { + lldClangNoCompilerRt = wrapCCWith rec { cc = tools.clang-unwrapped; libcxx = null; bintools = wrapBintoolsWith { @@ -176,7 +178,7 @@ let extraPackages = [ ]; extraBuildCommands = '' echo "-nostartfiles" >> $out/nix-support/cc-cflags - ''; + '' + mkExtraBuildCommands0 cc; }; }); diff --git a/pkgs/development/compilers/llvm/7/default.nix b/pkgs/development/compilers/llvm/7/default.nix index 8a80c55d45a..b976c0e330a 100644 --- a/pkgs/development/compilers/llvm/7/default.nix +++ b/pkgs/development/compilers/llvm/7/default.nix @@ -18,13 +18,15 @@ let tools = lib.makeExtensible (tools: let callPackage = newScope (tools // { inherit stdenv cmake libxml2 python3 isl release_version version fetch buildLlvmTools; }); - mkExtraBuildCommands = cc: '' + mkExtraBuildCommands0 = cc: '' rsrc="$out/resource-root" mkdir "$rsrc" ln -s "${cc.lib}/lib/clang/${release_version}/include" "$rsrc" - ln -s "${targetLlvmLibraries.compiler-rt.out}/lib" "$rsrc/lib" echo "-resource-dir=$rsrc" >> $out/nix-support/cc-cflags ''; + mkExtraBuildCommands = cc: mkExtraBuildCommands0 cc + '' + ln -s "${targetLlvmLibraries.compiler-rt.out}/lib" "$rsrc/lib" + ''; in { @@ -147,7 +149,7 @@ let '' + mkExtraBuildCommands cc; }; - lldClangNoCompilerRt = wrapCCWith { + lldClangNoCompilerRt = wrapCCWith rec { cc = tools.clang-unwrapped; libcxx = null; bintools = wrapBintoolsWith { @@ -157,7 +159,7 @@ let extraPackages = [ ]; extraBuildCommands = '' echo "-nostartfiles" >> $out/nix-support/cc-cflags - ''; + '' + mkExtraBuildCommands0 cc; }; }); diff --git a/pkgs/development/compilers/llvm/8/default.nix b/pkgs/development/compilers/llvm/8/default.nix index 3e7ef892e3d..ebfe5f97245 100644 --- a/pkgs/development/compilers/llvm/8/default.nix +++ b/pkgs/development/compilers/llvm/8/default.nix @@ -18,13 +18,15 @@ let tools = lib.makeExtensible (tools: let callPackage = newScope (tools // { inherit stdenv cmake libxml2 python3 isl release_version version fetch buildLlvmTools; }); - mkExtraBuildCommands = cc: '' + mkExtraBuildCommands0 = cc: '' rsrc="$out/resource-root" mkdir "$rsrc" ln -s "${cc.lib}/lib/clang/${release_version}/include" "$rsrc" - ln -s "${targetLlvmLibraries.compiler-rt.out}/lib" "$rsrc/lib" echo "-resource-dir=$rsrc" >> $out/nix-support/cc-cflags ''; + mkExtraBuildCommands = cc: mkExtraBuildCommands0 cc + '' + ln -s "${targetLlvmLibraries.compiler-rt.out}/lib" "$rsrc/lib" + ''; in { @@ -150,7 +152,7 @@ let '' + mkExtraBuildCommands cc; }; - lldClangNoCompilerRt = wrapCCWith { + lldClangNoCompilerRt = wrapCCWith rec { cc = tools.clang-unwrapped; libcxx = null; bintools = wrapBintoolsWith { @@ -160,7 +162,7 @@ let extraPackages = [ ]; extraBuildCommands = '' echo "-nostartfiles" >> $out/nix-support/cc-cflags - ''; + '' + mkExtraBuildCommands0 cc; }; }); diff --git a/pkgs/development/compilers/llvm/9/default.nix b/pkgs/development/compilers/llvm/9/default.nix index 14157842537..4444456b469 100644 --- a/pkgs/development/compilers/llvm/9/default.nix +++ b/pkgs/development/compilers/llvm/9/default.nix @@ -18,13 +18,15 @@ let tools = lib.makeExtensible (tools: let callPackage = newScope (tools // { inherit stdenv cmake libxml2 python3 isl release_version version fetch buildLlvmTools; }); - mkExtraBuildCommands = cc: '' + mkExtraBuildCommands0 = cc: '' rsrc="$out/resource-root" mkdir "$rsrc" ln -s "${cc.lib}/lib/clang/${release_version}/include" "$rsrc" - ln -s "${targetLlvmLibraries.compiler-rt.out}/lib" "$rsrc/lib" echo "-resource-dir=$rsrc" >> $out/nix-support/cc-cflags ''; + mkExtraBuildCommands = cc: mkExtraBuildCommands0 cc + '' + ln -s "${targetLlvmLibraries.compiler-rt.out}/lib" "$rsrc/lib" + ''; in { @@ -150,7 +152,7 @@ let '' + mkExtraBuildCommands cc; }; - lldClangNoCompilerRt = wrapCCWith { + lldClangNoCompilerRt = wrapCCWith rec { cc = tools.clang-unwrapped; libcxx = null; bintools = wrapBintoolsWith { @@ -160,7 +162,7 @@ let extraPackages = [ ]; extraBuildCommands = '' echo "-nostartfiles" >> $out/nix-support/cc-cflags - ''; + '' + mkExtraBuildCommands0 cc; }; }); From 4756e8716d2a5812ace37b02d9857575a8e60e5a Mon Sep 17 00:00:00 2001 From: Jonathan Ringer Date: Wed, 5 May 2021 11:12:46 -0700 Subject: [PATCH 174/263] python3Packages.johnnycanencrypt: fix build Fix regression from #111487 --- pkgs/development/python-modules/johnnycanencrypt/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/python-modules/johnnycanencrypt/default.nix b/pkgs/development/python-modules/johnnycanencrypt/default.nix index 460b0cddf61..d2d4719dab4 100644 --- a/pkgs/development/python-modules/johnnycanencrypt/default.nix +++ b/pkgs/development/python-modules/johnnycanencrypt/default.nix @@ -39,7 +39,7 @@ buildPythonPackage rec { cargoSha256 = "0ifvpdizcdp2c5x2x2j1bhhy5a75q0pk7a63dmh52mlpmh45fy6r"; - LIBCLANG_PATH = llvmPackages.libclang + "/lib"; + LIBCLANG_PATH = "${llvmPackages.libclang.lib}/lib"; propagatedBuildInputs = [ requests From 01bf14784925e99944d198154007489a823ddfb3 Mon Sep 17 00:00:00 2001 From: Jonathan Ringer Date: Fri, 7 May 2021 14:07:59 -0700 Subject: [PATCH 175/263] haproxy: fix lua lib name --- pkgs/tools/networking/haproxy/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/tools/networking/haproxy/default.nix b/pkgs/tools/networking/haproxy/default.nix index eefa49acb93..bb79ad956a6 100644 --- a/pkgs/tools/networking/haproxy/default.nix +++ b/pkgs/tools/networking/haproxy/default.nix @@ -40,6 +40,7 @@ stdenv.mkDerivation rec { "USE_PCRE_JIT=yes" ] ++ lib.optionals useLua [ "USE_LUA=yes" + "LUA_LIB_NAME=lua" "LUA_LIB=${lua5_3}/lib" "LUA_INC=${lua5_3}/include" ] ++ lib.optionals stdenv.isLinux [ From 03ca2ca8cba983e88193a5b648bb2eda00cd17bf Mon Sep 17 00:00:00 2001 From: Jonathan Ringer Date: Fri, 7 May 2021 14:29:14 -0700 Subject: [PATCH 176/263] crystal: fix llvm_config --- pkgs/development/compilers/crystal/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/compilers/crystal/default.nix b/pkgs/development/compilers/crystal/default.nix index 58e4b3b355d..8fc4a15efce 100644 --- a/pkgs/development/compilers/crystal/default.nix +++ b/pkgs/development/compilers/crystal/default.nix @@ -146,7 +146,7 @@ let "CRYSTAL_CONFIG_VERSION=${version}" ]; - LLVM_CONFIG = "${llvmPackages.llvm}/bin/llvm-config"; + LLVM_CONFIG = "${llvmPackages.llvm.dev}/bin/llvm-config"; FLAGS = [ "--release" From afaf4b64b39de3a9ef4cfcf2eea5bc01de2d0925 Mon Sep 17 00:00:00 2001 From: Jonathan Ringer Date: Fri, 7 May 2021 14:31:58 -0700 Subject: [PATCH 177/263] mrustc: fix llvm_config path --- pkgs/development/compilers/mrustc/bootstrap.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/compilers/mrustc/bootstrap.nix b/pkgs/development/compilers/mrustc/bootstrap.nix index 35e7daaf210..85b328848b1 100644 --- a/pkgs/development/compilers/mrustc/bootstrap.nix +++ b/pkgs/development/compilers/mrustc/bootstrap.nix @@ -78,7 +78,7 @@ stdenv.mkDerivation rec { # Use shared mrustc/minicargo/llvm instead of rebuilding them "MRUSTC=${mrustc}/bin/mrustc" "MINICARGO=${mrustc-minicargo}/bin/minicargo" - "LLVM_CONFIG=${llvm_7}/bin/llvm-config" + "LLVM_CONFIG=${llvm_7.dev}/bin/llvm-config" "RUSTC_TARGET=${rust.toRustTarget stdenv.targetPlatform}" ]; From 2b79244f893a875f4e0ad0ea12ab8874f9807b53 Mon Sep 17 00:00:00 2001 From: Jonathan Ringer Date: Fri, 7 May 2021 14:38:32 -0700 Subject: [PATCH 178/263] poetry2nix: fix LLVM_CONFIG reference --- pkgs/development/tools/poetry2nix/poetry2nix/overrides.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/tools/poetry2nix/poetry2nix/overrides.nix b/pkgs/development/tools/poetry2nix/poetry2nix/overrides.nix index aa58864fed7..f217aefc2d2 100644 --- a/pkgs/development/tools/poetry2nix/poetry2nix/overrides.nix +++ b/pkgs/development/tools/poetry2nix/poetry2nix/overrides.nix @@ -512,7 +512,7 @@ self: super: # Set directory containing llvm-config binary preConfigure = '' - export LLVM_CONFIG=${pkgs.llvm}/bin/llvm-config + export LLVM_CONFIG=${pkgs.llvm.dev}/bin/llvm-config ''; __impureHostDeps = lib.optionals pkgs.stdenv.isDarwin [ "/usr/lib/libm.dylib" ]; From d8ee66107f28a0895cbf05027165bcfe1081b195 Mon Sep 17 00:00:00 2001 From: Jonathan Ringer Date: Fri, 7 May 2021 14:50:19 -0700 Subject: [PATCH 179/263] include-what-you-use: fix llvm references --- .../tools/analysis/include-what-you-use/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/development/tools/analysis/include-what-you-use/default.nix b/pkgs/development/tools/analysis/include-what-you-use/default.nix index db1cf9c6ead..6cc9409e94a 100644 --- a/pkgs/development/tools/analysis/include-what-you-use/default.nix +++ b/pkgs/development/tools/analysis/include-what-you-use/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, fetchurl, cmake, llvmPackages, python2 }: +{ lib, stdenv, fetchurl, cmake, llvmPackages, python3 }: stdenv.mkDerivation rec { pname = "include-what-you-use"; @@ -10,8 +10,8 @@ stdenv.mkDerivation rec { url = "${meta.homepage}/downloads/${pname}-${version}.src.tar.gz"; }; - buildInputs = with llvmPackages; [ clang-unwrapped llvm python2 ]; - nativeBuildInputs = [ cmake ]; + nativeBuildInputs = with llvmPackages; [ cmake llvm.dev llvm clang-unwrapped python3]; + buildInputs = [ llvmPackages.libclang ]; cmakeFlags = [ "-DIWYU_LLVM_ROOT_PATH=${llvmPackages.clang-unwrapped}" ]; From 606fef61b74f64bf754e715eae73a2c78553af17 Mon Sep 17 00:00:00 2001 From: Jonathan Ringer Date: Fri, 7 May 2021 14:51:22 -0700 Subject: [PATCH 180/263] irony-server: fix build, fix llvm references --- pkgs/development/tools/irony-server/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/tools/irony-server/default.nix b/pkgs/development/tools/irony-server/default.nix index 2f8afb176e6..2a7a7b1a16a 100644 --- a/pkgs/development/tools/irony-server/default.nix +++ b/pkgs/development/tools/irony-server/default.nix @@ -4,7 +4,7 @@ stdenv.mkDerivation { pname = "irony-server"; inherit (irony) src version; - nativeBuildInputs = [ cmake ]; + nativeBuildInputs = [ cmake llvmPackages.llvm.dev ]; buildInputs = [ llvmPackages.libclang llvmPackages.llvm ]; dontUseCmakeBuildDir = true; From 2804d0814fbb2c05d71b56ca8ddfdee3344a8399 Mon Sep 17 00:00:00 2001 From: Jonathan Ringer Date: Fri, 7 May 2021 14:53:48 -0700 Subject: [PATCH 181/263] afl: fix build --- pkgs/tools/security/afl/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/tools/security/afl/default.nix b/pkgs/tools/security/afl/default.nix index 056aa3b07fd..ccdbd78716d 100644 --- a/pkgs/tools/security/afl/default.nix +++ b/pkgs/tools/security/afl/default.nix @@ -21,7 +21,7 @@ let # Note: libcgroup isn't needed for building, just for the afl-cgroup # script. - nativeBuildInputs = [ makeWrapper which ]; + nativeBuildInputs = [ makeWrapper which llvm.dev ]; buildInputs = [ llvm ]; makeFlags = [ "PREFIX=$(out)" ]; From c50716556799d935fa555b3d105f1894b3afdf1e Mon Sep 17 00:00:00 2001 From: Jonathan Ringer Date: Fri, 7 May 2021 15:09:34 -0700 Subject: [PATCH 182/263] castxml: fix build --- pkgs/development/tools/castxml/default.nix | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pkgs/development/tools/castxml/default.nix b/pkgs/development/tools/castxml/default.nix index ce2641b239e..a233288a28e 100644 --- a/pkgs/development/tools/castxml/default.nix +++ b/pkgs/development/tools/castxml/default.nix @@ -25,13 +25,13 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ cmake - llvm + llvm.dev ] ++ lib.optionals (withManual || withHTML) [ sphinx ]; cmakeFlags = [ - "-DCLANG_RESOURCE_DIR=${libclang.dev}/lib/clang/${lib.getVersion libclang}/" + "-DCLANG_RESOURCE_DIR=${libclang.dev}/" "-DSPHINX_HTML=${if withHTML then "ON" else "OFF"}" "-DSPHINX_MAN=${if withManual then "ON" else "OFF"}" ]; @@ -40,6 +40,7 @@ stdenv.mkDerivation rec { libffi libxml2 zlib + libclang ]; propagatedBuildInputs = [ From 01d801fd72999fca9939351b3318a9eec4c508e8 Mon Sep 17 00:00:00 2001 From: Jonathan Ringer Date: Fri, 7 May 2021 15:09:45 -0700 Subject: [PATCH 183/263] ccls: fix build --- pkgs/development/tools/misc/ccls/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/tools/misc/ccls/default.nix b/pkgs/development/tools/misc/ccls/default.nix index 06f3723509f..986363b83ef 100644 --- a/pkgs/development/tools/misc/ccls/default.nix +++ b/pkgs/development/tools/misc/ccls/default.nix @@ -12,8 +12,8 @@ stdenv.mkDerivation rec { sha256 = "sha256-jipSipgD0avd7XODlpxnqjHK3s6nacaxbIQIddix7X8="; }; - nativeBuildInputs = [ cmake ]; - buildInputs = with llvmPackages; [ clang-unwrapped llvm rapidjson ]; + nativeBuildInputs = [ cmake llvmPackages.llvm.dev ]; + buildInputs = with llvmPackages; [ libclang llvm rapidjson ]; cmakeFlags = [ "-DCCLS_VERSION=${version}" ]; From 7c8bc2de09fec742800ad212db9ba68a45ea3c37 Mon Sep 17 00:00:00 2001 From: Jonathan Ringer Date: Fri, 7 May 2021 15:24:43 -0700 Subject: [PATCH 184/263] ldc: fix build --- pkgs/development/compilers/ldc/generic.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/compilers/ldc/generic.nix b/pkgs/development/compilers/ldc/generic.nix index 4261c2b6533..f79fb24a56b 100644 --- a/pkgs/development/compilers/ldc/generic.nix +++ b/pkgs/development/compilers/ldc/generic.nix @@ -54,7 +54,7 @@ stdenv.mkDerivation rec { ''; nativeBuildInputs = [ - cmake ldcBootstrap lit lit.python llvm_11 makeWrapper ninja unzip + cmake ldcBootstrap lit lit.python llvm_11.dev makeWrapper ninja unzip ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ darwin.apple_sdk.frameworks.Foundation From 60fdfb3c72763d2baf8f82e3a4ee30f72cdae376 Mon Sep 17 00:00:00 2001 From: Jonathan Ringer Date: Fri, 7 May 2021 16:31:10 -0700 Subject: [PATCH 185/263] dale: fix build --- pkgs/development/compilers/dale/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/compilers/dale/default.nix b/pkgs/development/compilers/dale/default.nix index addd7997d36..bf02d623e52 100644 --- a/pkgs/development/compilers/dale/default.nix +++ b/pkgs/development/compilers/dale/default.nix @@ -19,7 +19,7 @@ stdenv.mkDerivation { sha256 = "0v4ajrzrqvf279kd7wsd9flrpsav57lzxlwwimk9vnfwh7xpzf9v"; }; - nativeBuildInputs = [ cmake pkg-config ]; + nativeBuildInputs = [ cmake pkg-config llvm_6.dev ]; buildInputs = [ libffi llvm_6 ]; inherit doCheck; From 1d85caaa261bebd022338fff79b181a85e581d77 Mon Sep 17 00:00:00 2001 From: Jonathan Ringer Date: Sat, 8 May 2021 00:18:58 -0700 Subject: [PATCH 186/263] root: fix build --- pkgs/applications/science/misc/root/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/applications/science/misc/root/default.nix b/pkgs/applications/science/misc/root/default.nix index ab5352975f7..20b239dc677 100644 --- a/pkgs/applications/science/misc/root/default.nix +++ b/pkgs/applications/science/misc/root/default.nix @@ -13,7 +13,7 @@ stdenv.mkDerivation rec { sha256 = "0vrgi83hrw4n9zgx873fn4ba3vk54slrwk1cl4cc4plgxzv1y1kg"; }; - nativeBuildInputs = [ makeWrapper cmake pkg-config ]; + nativeBuildInputs = [ makeWrapper cmake pkg-config llvm_5.dev ]; buildInputs = [ ftgl gl2ps glew pcre zlib zstd llvm_5 libxml2 lz4 xz gsl xxHash libAfterImage giflib libjpeg libtiff libpng python.pkgs.numpy ] ++ lib.optionals (!stdenv.isDarwin) [ libX11 libXpm libXft libXext libGLU libGL ] ++ lib.optionals (stdenv.isDarwin) [ Cocoa OpenGL ] From 0388b1a029975489a4867ce3de11e89331a4381a Mon Sep 17 00:00:00 2001 From: Jonathan Ringer Date: Sat, 8 May 2021 00:35:15 -0700 Subject: [PATCH 187/263] rtags: fix build --- pkgs/development/tools/rtags/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/tools/rtags/default.nix b/pkgs/development/tools/rtags/default.nix index e5da0ddf59a..6ecbe058328 100644 --- a/pkgs/development/tools/rtags/default.nix +++ b/pkgs/development/tools/rtags/default.nix @@ -3,8 +3,8 @@ stdenv.mkDerivation rec { pname = "rtags"; version = "2.38"; - nativeBuildInputs = [ cmake pkg-config ]; - buildInputs = [ llvmPackages.llvm openssl emacs ] + nativeBuildInputs = [ cmake pkg-config llvmPackages.llvm.dev ]; + buildInputs = [ llvmPackages.llvm llvmPackages.libclang openssl emacs ] ++ lib.optionals stdenv.cc.isGNU [ llvmPackages.clang-unwrapped ] ++ lib.optionals stdenv.isDarwin [ apple_sdk.libs.xpc apple_sdk.frameworks.CoreServices ]; From 20549cae36c7bbc07fc7fd318b9da63190995383 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Sat, 8 May 2021 14:34:58 +0200 Subject: [PATCH 188/263] python3Packages.sphinx: fix build, enable tests, cleanup --- .../python-modules/sphinx/default.nix | 98 ++++++++++--------- 1 file changed, 53 insertions(+), 45 deletions(-) diff --git a/pkgs/development/python-modules/sphinx/default.nix b/pkgs/development/python-modules/sphinx/default.nix index 8168e4e0375..8d6567b3e91 100644 --- a/pkgs/development/python-modules/sphinx/default.nix +++ b/pkgs/development/python-modules/sphinx/default.nix @@ -1,24 +1,18 @@ { lib , buildPythonPackage -, fetchPypi -, pytest -, simplejson -, mock -, glibcLocales -, html5lib , pythonOlder -, enum34 -, python -, docutils -, jinja2 -, pygments -, alabaster +, fetchFromGitHub +# propagatedBuildInputs , Babel -, snowballstemmer -, six -, whoosh +, alabaster +, docutils , imagesize +, jinja2 +, packaging +, pygments , requests +, setuptools +, snowballstemmer , sphinxcontrib-applehelp , sphinxcontrib-devhelp , sphinxcontrib-htmlhelp @@ -26,56 +20,70 @@ , sphinxcontrib-qthelp , sphinxcontrib-serializinghtml , sphinxcontrib-websupport -, typing ? null -, setuptools -, packaging +# check phase +, html5lib +, imagemagick +, pytestCheckHook +, typed-ast }: buildPythonPackage rec { pname = "sphinx"; version = "3.5.4"; - src = fetchPypi { - pname = "Sphinx"; - inherit version; - sha256 = "19010b7b9fa0dc7756a6e105b2aacd3a80f798af3c25c273be64d7beeb482cb1"; - }; - LC_ALL = "en_US.UTF-8"; + disabled = pythonOlder "3.5"; + + src = fetchFromGitHub { + owner = "sphinx-doc"; + repo = pname; + rev = "v${version}"; + sha256 = "1xjii3dl01rq8x2bsxc6zywiy1s7arfgxrg5l8ml54w1748shadd"; + }; - checkInputs = [ pytest ]; - buildInputs = [ simplejson mock glibcLocales html5lib ] ++ lib.optional (pythonOlder "3.4") enum34; - # Disable two tests that require network access. - checkPhase = '' - cd tests; ${python.interpreter} run.py --ignore py35 -k 'not test_defaults and not test_anchors_ignored' - ''; propagatedBuildInputs = [ - docutils - jinja2 - pygments - alabaster Babel + alabaster + docutils + imagesize + jinja2 packaging + pygments + requests setuptools snowballstemmer - six - whoosh - imagesize - requests sphinxcontrib-applehelp sphinxcontrib-devhelp sphinxcontrib-htmlhelp sphinxcontrib-jsmath sphinxcontrib-qthelp sphinxcontrib-serializinghtml + # extra[docs] sphinxcontrib-websupport - ] ++ lib.optional (pythonOlder "3.5") typing; + ]; - # Lots of tests. Needs network as well at some point. - doCheck = false; + checkInputs = [ + imagemagick + html5lib + pytestCheckHook + ] ++ lib.optionals (pythonOlder "3.8") [ + typed-ast + ]; - meta = { - description = "A tool that makes it easy to create intelligent and beautiful documentation for Python projects"; + disabledTests = [ + # requires network access + "test_anchors_ignored" + "test_defaults" + "test_defaults_json" + "test_latex_images" + ]; + + meta = with lib; { + description = "Python documentation generator"; + longDescription = '' + A tool that makes it easy to create intelligent and beautiful + documentation for Python projects + ''; homepage = "https://www.sphinx-doc.org"; - license = lib.licenses.bsd3; - maintainers = with lib.maintainers; [ nand0p ]; + license = licenses.bsd3; + maintainers = with maintainers; [ nand0p ]; }; } From 88beb7d77ea3bfb05fedd7b3d757ded28c7c8420 Mon Sep 17 00:00:00 2001 From: Jonathan Ringer Date: Sat, 8 May 2021 15:52:23 -0700 Subject: [PATCH 189/263] cvis: fix llvm build --- pkgs/development/tools/misc/cvise/default.nix | 6 +++--- pkgs/top-level/all-packages.nix | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pkgs/development/tools/misc/cvise/default.nix b/pkgs/development/tools/misc/cvise/default.nix index fe33df530cf..e24c133e8b9 100644 --- a/pkgs/development/tools/misc/cvise/default.nix +++ b/pkgs/development/tools/misc/cvise/default.nix @@ -1,5 +1,5 @@ { lib, buildPythonApplication, fetchFromGitHub, cmake, flex -, clang-unwrapped, llvm, unifdef +, libclang, llvm, unifdef , pebble, psutil, pytestCheckHook, pytest-flake8 }: @@ -19,8 +19,8 @@ buildPythonApplication rec { ./unifdef.patch ]; - nativeBuildInputs = [ cmake flex ]; - buildInputs = [ clang-unwrapped llvm unifdef ]; + nativeBuildInputs = [ cmake flex llvm.dev ]; + buildInputs = [ libclang llvm llvm.dev unifdef ]; propagatedBuildInputs = [ pebble psutil ]; checkInputs = [ pytestCheckHook pytest-flake8 unifdef ]; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 99034889e34..2bbbc903aa8 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -12768,7 +12768,7 @@ in css-html-js-minify = with python3Packages; toPythonApplication css-html-js-minify; cvise = python3Packages.callPackage ../development/tools/misc/cvise { - inherit (llvmPackages_11) llvm clang-unwrapped; + inherit (llvmPackages_11) llvm libclang; }; libcxx = llvmPackages.libcxx; From 2171463a0f3017ec14dfa0c41021f9c8ad8ae0fa Mon Sep 17 00:00:00 2001 From: Jonathan Ringer Date: Sat, 8 May 2021 15:58:11 -0700 Subject: [PATCH 190/263] cling: fix llvm build --- pkgs/development/interpreters/cling/default.nix | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pkgs/development/interpreters/cling/default.nix b/pkgs/development/interpreters/cling/default.nix index f74eaf72bd4..73ed5b523dd 100644 --- a/pkgs/development/interpreters/cling/default.nix +++ b/pkgs/development/interpreters/cling/default.nix @@ -10,6 +10,7 @@ , runCommandNoCC , llvmPackages_5 , glibc +, ncurses }: let @@ -38,8 +39,8 @@ let chmod -R a+w ./tools/cling ''; - nativeBuildInputs = [ python3 git cmake ]; - buildInputs = [ libffi llvmPackages_5.llvm zlib ]; + nativeBuildInputs = [ python3 git cmake llvmPackages_5.llvm.dev ]; + buildInputs = [ libffi llvmPackages_5.llvm zlib ncurses ]; strictDeps = true; From 76ab96811b8dbe0ffa3e3b7a0c7b920f6ec65b29 Mon Sep 17 00:00:00 2001 From: Jonathan Ringer Date: Sat, 8 May 2021 16:00:08 -0700 Subject: [PATCH 191/263] creduce: fix llvm build --- pkgs/development/tools/misc/creduce/default.nix | 6 +++--- pkgs/top-level/all-packages.nix | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pkgs/development/tools/misc/creduce/default.nix b/pkgs/development/tools/misc/creduce/default.nix index 75234fde6ca..0ae900060b9 100644 --- a/pkgs/development/tools/misc/creduce/default.nix +++ b/pkgs/development/tools/misc/creduce/default.nix @@ -1,5 +1,5 @@ { lib, stdenv, fetchurl, cmake, makeWrapper -, llvm, clang-unwrapped +, llvm, libclang , flex , zlib , perlPackages @@ -15,12 +15,12 @@ stdenv.mkDerivation rec { sha256 = "1b833z0g1hich68kzbkpfc26xb8w2phfl5savy8c6ir9ihwy1a8w"; }; - nativeBuildInputs = [ cmake makeWrapper ]; + nativeBuildInputs = [ cmake makeWrapper llvm.dev ]; buildInputs = [ # Ensure stdenv's CC is on PATH before clang-unwrapped stdenv.cc # Actual deps: - llvm clang-unwrapped + llvm libclang flex zlib ] ++ (with perlPackages; [ perl ExporterLite FileWhich GetoptTabular RegexpCommon TermReadKey ]); diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 2bbbc903aa8..8538cd67d09 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -12756,7 +12756,7 @@ in credstash = with python3Packages; toPythonApplication credstash; creduce = callPackage ../development/tools/misc/creduce { - inherit (llvmPackages_7) llvm clang-unwrapped; + inherit (llvmPackages_7) llvm libclang; }; cscope = callPackage ../development/tools/misc/cscope { }; From a748e4f47eb2c4e8d84dd206feebb0b74f489d2a Mon Sep 17 00:00:00 2001 From: Jonathan Ringer Date: Sat, 8 May 2021 16:05:05 -0700 Subject: [PATCH 192/263] linuxPackages.bcc: fix llvm build --- pkgs/os-specific/linux/bcc/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/os-specific/linux/bcc/default.nix b/pkgs/os-specific/linux/bcc/default.nix index 4235ecb38d3..5053a4d5f37 100644 --- a/pkgs/os-specific/linux/bcc/default.nix +++ b/pkgs/os-specific/linux/bcc/default.nix @@ -19,7 +19,7 @@ python.pkgs.buildPythonApplication rec { format = "other"; buildInputs = with llvmPackages; [ - llvm clang-unwrapped kernel + llvm llvm.dev libclang kernel elfutils luajit netperf iperf systemtap.stapBuild flex bash libbpf @@ -32,7 +32,7 @@ python.pkgs.buildPythonApplication rec { ]; propagatedBuildInputs = [ python.pkgs.netaddr ]; - nativeBuildInputs = [ makeWrapper cmake flex bison ] + nativeBuildInputs = [ makeWrapper cmake flex bison llvmPackages.llvm.dev ] # libelf is incompatible with elfutils-libelf ++ lib.filter (x: x != libelf) kernel.moduleBuildDependencies; From fbedc3d54cda539de2444467d012f87a417bffc5 Mon Sep 17 00:00:00 2001 From: Jonathan Ringer Date: Sat, 8 May 2021 16:08:50 -0700 Subject: [PATCH 193/263] spirv-llvm-translator: fix llvm build --- pkgs/development/compilers/spirv-llvm-translator/default.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkgs/development/compilers/spirv-llvm-translator/default.nix b/pkgs/development/compilers/spirv-llvm-translator/default.nix index 324e0b07ad8..e4549a7d65d 100644 --- a/pkgs/development/compilers/spirv-llvm-translator/default.nix +++ b/pkgs/development/compilers/spirv-llvm-translator/default.nix @@ -1,6 +1,7 @@ { lib, stdenv , fetchFromGitHub , cmake +, pkg-config , lit , llvm_8 @@ -17,7 +18,7 @@ stdenv.mkDerivation rec { sha256 = "0hxalc3fkliqs61hpr97phbm3qsx4b8vgnlg30aimzr6aas403r5"; }; - nativeBuildInputs = [ cmake ]; + nativeBuildInputs = [ pkg-config cmake llvm_8.dev ]; buildInputs = [ llvm_8 ]; From 7f1726ffca56139d007eda9a798304ad1c37fa50 Mon Sep 17 00:00:00 2001 From: Jonathan Ringer Date: Sat, 8 May 2021 16:18:46 -0700 Subject: [PATCH 194/263] zig: fix llvm build --- pkgs/development/compilers/zig/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/compilers/zig/default.nix b/pkgs/development/compilers/zig/default.nix index bd96010e8bf..415bca87493 100644 --- a/pkgs/development/compilers/zig/default.nix +++ b/pkgs/development/compilers/zig/default.nix @@ -11,9 +11,9 @@ llvmPackages.stdenv.mkDerivation rec { sha256 = "1z6c4ym9jmga46cw2arn7zv2drcpmrf3vw139gscxp27n7q2z5md"; }; - nativeBuildInputs = [ cmake ]; + nativeBuildInputs = [ cmake llvmPackages.llvm.dev ]; buildInputs = [ - llvmPackages.clang-unwrapped + llvmPackages.libclang llvmPackages.llvm llvmPackages.lld libxml2 From 981170a3683173b6fc72b7ad374deccd710f12f8 Mon Sep 17 00:00:00 2001 From: Jonathan Ringer Date: Sat, 8 May 2021 16:27:53 -0700 Subject: [PATCH 195/263] ispc: fix llvm build --- pkgs/development/compilers/ispc/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/development/compilers/ispc/default.nix b/pkgs/development/compilers/ispc/default.nix index fd748158711..bbe17e0755c 100644 --- a/pkgs/development/compilers/ispc/default.nix +++ b/pkgs/development/compilers/ispc/default.nix @@ -28,10 +28,9 @@ stdenv.mkDerivation rec { }) ]; - nativeBuildInputs = [ cmake which m4 bison flex python3 ]; + nativeBuildInputs = [ cmake which m4 bison flex python3 llvmPackages.llvm.dev ]; buildInputs = with llvmPackages; [ - # we need to link against libclang, so we need the unwrapped - llvm llvmPackages.clang-unwrapped + llvm llvmPackages.libclang ]; postPatch = '' @@ -66,6 +65,7 @@ stdenv.mkDerivation rec { ''; cmakeFlags = [ + "-DLLVM_CONFIG_EXECUTABLE=${llvmPackages.llvm.dev}/bin/llvm-config" "-DCLANG_EXECUTABLE=${llvmPackages.clang}/bin/clang" "-DCLANGPP_EXECUTABLE=${llvmPackages.clang}/bin/clang++" "-DISPC_INCLUDE_EXAMPLES=OFF" From c07fad9b40117ec00c21ca8aa3d4677678bf81b5 Mon Sep 17 00:00:00 2001 From: Jonathan Ringer Date: Sat, 8 May 2021 16:30:09 -0700 Subject: [PATCH 196/263] umr: fix llvm build --- pkgs/development/misc/umr/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/misc/umr/default.nix b/pkgs/development/misc/umr/default.nix index 158cef2eed1..3dba51022d3 100644 --- a/pkgs/development/misc/umr/default.nix +++ b/pkgs/development/misc/umr/default.nix @@ -12,7 +12,7 @@ stdenv.mkDerivation rec { sha256 = "IwTkHEuJ82hngPjFVIihU2rSolLBqHxQTNsP8puYPaY="; }; - nativeBuildInputs = [ cmake pkg-config ]; + nativeBuildInputs = [ cmake pkg-config llvmPackages.llvm.dev ]; buildInputs = [ bash-completion From 0ef9059dd40654b563c566f411a8bd217427f317 Mon Sep 17 00:00:00 2001 From: Jonathan Ringer Date: Sat, 8 May 2021 16:50:12 -0700 Subject: [PATCH 197/263] linuxPackages.bpftrace: fix llvm build --- pkgs/os-specific/linux/bpftrace/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/os-specific/linux/bpftrace/default.nix b/pkgs/os-specific/linux/bpftrace/default.nix index 701fed06bb6..3a18202c6c0 100644 --- a/pkgs/os-specific/linux/bpftrace/default.nix +++ b/pkgs/os-specific/linux/bpftrace/default.nix @@ -16,12 +16,12 @@ stdenv.mkDerivation rec { }; buildInputs = with llvmPackages; - [ llvm clang-unwrapped + [ llvm libclang kernel elfutils libelf bcc libbpf libbfd libopcodes ]; - nativeBuildInputs = [ cmake pkg-config flex bison ] + nativeBuildInputs = [ cmake pkg-config flex bison llvmPackages.llvm.dev ] # libelf is incompatible with elfutils-libelf ++ lib.filter (x: x != libelf) kernel.moduleBuildDependencies; From 9efeb1ee8374a4230a590de5c4c4a43f181b3579 Mon Sep 17 00:00:00 2001 From: Jonathan Ringer Date: Sat, 8 May 2021 17:21:12 -0700 Subject: [PATCH 198/263] blender: fix llvm build --- pkgs/applications/misc/blender/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/applications/misc/blender/default.nix b/pkgs/applications/misc/blender/default.nix index 95a0e41d2ae..8d345cdefe0 100644 --- a/pkgs/applications/misc/blender/default.nix +++ b/pkgs/applications/misc/blender/default.nix @@ -35,7 +35,7 @@ stdenv.mkDerivation rec { patches = lib.optional stdenv.isDarwin ./darwin.patch; - nativeBuildInputs = [ cmake makeWrapper python3Packages.wrapPython ] + nativeBuildInputs = [ cmake makeWrapper python3Packages.wrapPython llvmPackages.llvm.dev ] ++ optionals cudaSupport [ addOpenGLRunpath ]; buildInputs = [ boost ffmpeg gettext glew ilmbase From 9f024e4c929bee8ed4a45a39e8fc5d5ff9bf7185 Mon Sep 17 00:00:00 2001 From: Jonathan Ringer Date: Sat, 8 May 2021 17:26:37 -0700 Subject: [PATCH 199/263] opencl-clang: fix llvm build --- pkgs/development/libraries/opencl-clang/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/libraries/opencl-clang/default.nix b/pkgs/development/libraries/opencl-clang/default.nix index b87088a47fc..c40fb9c1203 100644 --- a/pkgs/development/libraries/opencl-clang/default.nix +++ b/pkgs/development/libraries/opencl-clang/default.nix @@ -76,7 +76,7 @@ let ./opencl-headers-dir.patch ]; - nativeBuildInputs = [ cmake git ]; + nativeBuildInputs = [ cmake git llvm.dev ]; buildInputs = [ libclang llvm spirv-llvm-translator ]; From 675c4123bb08560b708f4606a980e61a83c25eea Mon Sep 17 00:00:00 2001 From: fortuneteller2k Date: Tue, 11 May 2021 00:45:40 +0800 Subject: [PATCH 200/263] dasher: 2018-04-03 -> unstable-2021-04-25 --- .../accessibility/dasher/default.nix | 49 ++++++++++++------- 1 file changed, 31 insertions(+), 18 deletions(-) diff --git a/pkgs/applications/accessibility/dasher/default.nix b/pkgs/applications/accessibility/dasher/default.nix index fe0d8fe8634..6f2a185b309 100644 --- a/pkgs/applications/accessibility/dasher/default.nix +++ b/pkgs/applications/accessibility/dasher/default.nix @@ -1,22 +1,33 @@ -{ stdenv, lib, fetchFromGitHub -, autoreconfHook, pkg-config, wrapGAppsHook -, glib, gtk3, expat, gnome-doc-utils, which -, at-spi2-core, dbus -, libxslt, libxml2 -, speechSupport ? true, speechd ? null +{ stdenv +, lib +, fetchFromGitLab +, autoreconfHook +, pkg-config +, wrapGAppsHook +, glib +, gtk3 +, expat +, itstool +, gnome-doc-utils +, which +, at-spi2-core +, dbus +, libxslt +, libxml2 +, speechSupport ? true +, speechd }: -assert speechSupport -> speechd != null; - stdenv.mkDerivation { pname = "dasher"; - version = "2018-04-03"; + version = "unstable-2021-04-25"; - src = fetchFromGitHub { - owner = "dasher-project"; + src = fetchFromGitLab { + domain = "gitlab.gnome.org"; + owner = "GNOME"; repo = "dasher"; - rev = "9ab12462e51d17a38c0ddc7f7ffe1cb5fe83b627"; - sha256 = "1r9xn966nx3pv2bidd6i3pxmprvlw6insnsb38zabmac609h9d9s"; + rev = "90c753b87564fa3f42cb2d04e1eb6662dc8e0f8f"; + sha256 = "sha256-aM05CV68pCRlhfIPyhuHWeRL+tDroB3fVsoX08OU8hY="; }; prePatch = '' @@ -33,23 +44,25 @@ stdenv.mkDerivation { # doc generation gnome-doc-utils which - libxslt libxml2 + libxslt + libxml2 ]; buildInputs = [ glib gtk3 expat + itstool # at-spi2 needs dbus to be recognized by pkg-config - at-spi2-core dbus + at-spi2-core + dbus ] ++ lib.optional speechSupport speechd; meta = { - homepage = "http://www.inference.org.uk/dasher/"; + homepage = "https://www.inference.org.uk/dasher/"; description = "Information-efficient text-entry interface, driven by natural continuous pointing gestures"; - license = lib.licenses.gpl2; + license = lib.licenses.gpl2Only; maintainers = [ lib.maintainers.Profpatsch ]; platforms = lib.platforms.all; }; - } From 08a26e45796e456278d75201fadb2498fe08dd7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eduardo=20S=C3=A1nchez=20Mu=C3=B1oz?= Date: Mon, 3 May 2021 13:43:20 +0200 Subject: [PATCH 201/263] pythonPackages.sip: rename to sip_4 sip 4 is the old and unmaintained version --- pkgs/applications/gis/qgis/unwrapped.nix | 2 +- pkgs/applications/graphics/krita/default.nix | 2 +- pkgs/applications/misc/cura/lulzbot/default.nix | 4 ++-- pkgs/applications/misc/cura/lulzbot/libarcus.nix | 4 ++-- pkgs/applications/misc/cura/lulzbot/libsavitar.nix | 4 ++-- pkgs/applications/misc/openlp/lib.nix | 4 ++-- pkgs/applications/networking/gns3/gui.nix | 2 +- .../science/machine-learning/labelimg/default.nix | 2 +- .../version-management/git-and-tools/git-cola/default.nix | 4 ++-- pkgs/applications/video/openshot-qt/default.nix | 2 +- pkgs/development/python-modules/enaml/default.nix | 4 ++-- pkgs/development/python-modules/libarcus/default.nix | 4 ++-- pkgs/development/python-modules/libsavitar/default.nix | 4 ++-- pkgs/development/python-modules/pykdl/default.nix | 4 ++-- pkgs/development/python-modules/pynest2d/default.nix | 4 ++-- pkgs/development/python-modules/pyqt/4.x.nix | 4 ++-- pkgs/development/python-modules/pyqt/5.x.nix | 2 +- pkgs/development/python-modules/qscintilla-qt5/default.nix | 4 ++-- pkgs/development/python-modules/sip/{default.nix => 4.x.nix} | 0 pkgs/misc/drivers/hplip/3.18.5.nix | 2 +- pkgs/misc/drivers/hplip/default.nix | 2 +- pkgs/misc/frescobaldi/default.nix | 2 +- pkgs/top-level/python-packages.nix | 2 +- 23 files changed, 34 insertions(+), 34 deletions(-) rename pkgs/development/python-modules/sip/{default.nix => 4.x.nix} (100%) diff --git a/pkgs/applications/gis/qgis/unwrapped.nix b/pkgs/applications/gis/qgis/unwrapped.nix index a8dd7787a52..3669cf0771b 100644 --- a/pkgs/applications/gis/qgis/unwrapped.nix +++ b/pkgs/applications/gis/qgis/unwrapped.nix @@ -19,7 +19,7 @@ let urllib3 pygments pyqt5 - sip + sip_4 owslib six ]; diff --git a/pkgs/applications/graphics/krita/default.nix b/pkgs/applications/graphics/krita/default.nix index 282db23f475..15d8096e549 100644 --- a/pkgs/applications/graphics/krita/default.nix +++ b/pkgs/applications/graphics/krita/default.nix @@ -17,7 +17,7 @@ mkDerivation rec { sha256 = "0rwghzci2wn2jmisvnzs23yxc2z3d4dcx2qbbhcvjyi3q8ij61nl"; }; - nativeBuildInputs = [ cmake extra-cmake-modules python3Packages.sip makeWrapper ]; + nativeBuildInputs = [ cmake extra-cmake-modules python3Packages.sip_4 makeWrapper ]; buildInputs = [ karchive kconfig kwidgetsaddons kcompletion kcoreaddons kguiaddons diff --git a/pkgs/applications/misc/cura/lulzbot/default.nix b/pkgs/applications/misc/cura/lulzbot/default.nix index 229966561c6..360ef47ecf1 100644 --- a/pkgs/applications/misc/cura/lulzbot/default.nix +++ b/pkgs/applications/misc/cura/lulzbot/default.nix @@ -10,10 +10,10 @@ let }; libarcusLulzbot = callPackage ./libarcus.nix { - inherit (python3.pkgs) buildPythonPackage sip pythonOlder; + inherit (python3.pkgs) buildPythonPackage sip_4 pythonOlder; }; libsavitarLulzbot = callPackage ./libsavitar.nix { - inherit (python3.pkgs) buildPythonPackage sip pythonOlder; + inherit (python3.pkgs) buildPythonPackage sip_4 pythonOlder; }; inherit (python3.pkgs) buildPythonPackage pyqt5 numpy scipy shapely pythonOlder; diff --git a/pkgs/applications/misc/cura/lulzbot/libarcus.nix b/pkgs/applications/misc/cura/lulzbot/libarcus.nix index 7b1dbf4d85e..15e221a8f74 100644 --- a/pkgs/applications/misc/cura/lulzbot/libarcus.nix +++ b/pkgs/applications/misc/cura/lulzbot/libarcus.nix @@ -1,4 +1,4 @@ -{ lib, buildPythonPackage, fetchgit, fetchurl, cmake, sip, protobuf, pythonOlder }: +{ lib, buildPythonPackage, fetchgit, fetchurl, cmake, sip_4, protobuf, pythonOlder }: buildPythonPackage { pname = "libarcus"; @@ -13,7 +13,7 @@ buildPythonPackage { disabled = pythonOlder "3.4.0"; - propagatedBuildInputs = [ sip ]; + propagatedBuildInputs = [ sip_4 ]; nativeBuildInputs = [ cmake ]; buildInputs = [ protobuf ]; diff --git a/pkgs/applications/misc/cura/lulzbot/libsavitar.nix b/pkgs/applications/misc/cura/lulzbot/libsavitar.nix index f12059e6317..dd84173ffce 100644 --- a/pkgs/applications/misc/cura/lulzbot/libsavitar.nix +++ b/pkgs/applications/misc/cura/lulzbot/libsavitar.nix @@ -1,4 +1,4 @@ -{ lib, buildPythonPackage, pythonOlder, fetchgit, cmake, sip }: +{ lib, buildPythonPackage, pythonOlder, fetchgit, cmake, sip_4 }: buildPythonPackage { pname = "libsavitar-lulzbot"; @@ -19,7 +19,7 @@ buildPythonPackage { nativeBuildInputs = [ cmake ]; - propagatedBuildInputs = [ sip ]; + propagatedBuildInputs = [ sip_4 ]; disabled = pythonOlder "3.4.0"; diff --git a/pkgs/applications/misc/openlp/lib.nix b/pkgs/applications/misc/openlp/lib.nix index 6f0634b5c93..c044e76c597 100644 --- a/pkgs/applications/misc/openlp/lib.nix +++ b/pkgs/applications/misc/openlp/lib.nix @@ -5,7 +5,7 @@ # python deps , python, buildPythonPackage , alembic, beautifulsoup4, chardet, lxml, Mako, pyenchant -, pyqt5_with_qtwebkit, pyxdg, sip, sqlalchemy, sqlalchemy_migrate +, pyqt5_with_qtwebkit, pyxdg, sip_4, sqlalchemy, sqlalchemy_migrate }: buildPythonPackage rec { @@ -41,7 +41,7 @@ buildPythonPackage rec { pyenchant pyqt5_with_qtwebkit pyxdg - sip + sip_4 sqlalchemy sqlalchemy_migrate ]; diff --git a/pkgs/applications/networking/gns3/gui.nix b/pkgs/applications/networking/gns3/gui.nix index f206c645ae2..5f5594c0537 100644 --- a/pkgs/applications/networking/gns3/gui.nix +++ b/pkgs/applications/networking/gns3/gui.nix @@ -24,7 +24,7 @@ in python.pkgs.buildPythonPackage rec { propagatedBuildInputs = with python.pkgs; [ sentry-sdk psutil jsonschema # tox for check # Runtime dependencies - sip (pyqt5.override { withWebSockets = true; }) distro setuptools + sip_4 (pyqt5.override { withWebSockets = true; }) distro setuptools ]; doCheck = false; # Failing diff --git a/pkgs/applications/science/machine-learning/labelimg/default.nix b/pkgs/applications/science/machine-learning/labelimg/default.nix index 50d0aa6f9d1..620ccfb084e 100644 --- a/pkgs/applications/science/machine-learning/labelimg/default.nix +++ b/pkgs/applications/science/machine-learning/labelimg/default.nix @@ -15,7 +15,7 @@ propagatedBuildInputs = with python3Packages; [ pyqt5 lxml - sip + sip_4 ]; preBuild = '' make qt5py3 diff --git a/pkgs/applications/version-management/git-and-tools/git-cola/default.nix b/pkgs/applications/version-management/git-and-tools/git-cola/default.nix index 37c10bf2f98..707e0855d15 100644 --- a/pkgs/applications/version-management/git-and-tools/git-cola/default.nix +++ b/pkgs/applications/version-management/git-and-tools/git-cola/default.nix @@ -1,7 +1,7 @@ { lib, fetchFromGitHub, python3Packages, gettext, git, qt5 }: let - inherit (python3Packages) buildPythonApplication pyqt5 sip pyinotify; + inherit (python3Packages) buildPythonApplication pyqt5 sip_4 pyinotify; in buildPythonApplication rec { pname = "git-cola"; @@ -15,7 +15,7 @@ in buildPythonApplication rec { }; buildInputs = [ git gettext ]; - propagatedBuildInputs = [ pyqt5 sip pyinotify ]; + propagatedBuildInputs = [ pyqt5 sip_4 pyinotify ]; nativeBuildInputs = [ qt5.wrapQtAppsHook ]; doCheck = false; diff --git a/pkgs/applications/video/openshot-qt/default.nix b/pkgs/applications/video/openshot-qt/default.nix index 5951f4665e4..c25e53b657b 100644 --- a/pkgs/applications/video/openshot-qt/default.nix +++ b/pkgs/applications/video/openshot-qt/default.nix @@ -18,7 +18,7 @@ mkDerivationWith python3Packages.buildPythonApplication rec { buildInputs = [ gtk3 ]; - propagatedBuildInputs = with python3Packages; [ libopenshot pyqt5_with_qtwebkit requests sip httplib2 pyzmq ]; + propagatedBuildInputs = with python3Packages; [ libopenshot pyqt5_with_qtwebkit requests sip_4 httplib2 pyzmq ]; dontWrapGApps = true; dontWrapQtApps = true; diff --git a/pkgs/development/python-modules/enaml/default.nix b/pkgs/development/python-modules/enaml/default.nix index 1102443884f..8896c5c706a 100644 --- a/pkgs/development/python-modules/enaml/default.nix +++ b/pkgs/development/python-modules/enaml/default.nix @@ -5,7 +5,7 @@ , ply , kiwisolver , qtpy -, sip +, sip_4 , cppy , bytecode }: @@ -44,7 +44,7 @@ buildPythonPackage rec { ply kiwisolver qtpy - sip + sip_4 cppy bytecode ]; diff --git a/pkgs/development/python-modules/libarcus/default.nix b/pkgs/development/python-modules/libarcus/default.nix index edea85876a8..a48d70c544c 100644 --- a/pkgs/development/python-modules/libarcus/default.nix +++ b/pkgs/development/python-modules/libarcus/default.nix @@ -1,5 +1,5 @@ { lib, buildPythonPackage, python, fetchFromGitHub -, cmake, sip, protobuf, pythonOlder }: +, cmake, sip_4, protobuf, pythonOlder }: buildPythonPackage rec { pname = "libarcus"; @@ -15,7 +15,7 @@ buildPythonPackage rec { disabled = pythonOlder "3.4.0"; - propagatedBuildInputs = [ sip ]; + propagatedBuildInputs = [ sip_4 ]; nativeBuildInputs = [ cmake ]; buildInputs = [ protobuf ]; diff --git a/pkgs/development/python-modules/libsavitar/default.nix b/pkgs/development/python-modules/libsavitar/default.nix index f6aa1b378f5..7ecd09160ff 100644 --- a/pkgs/development/python-modules/libsavitar/default.nix +++ b/pkgs/development/python-modules/libsavitar/default.nix @@ -1,4 +1,4 @@ -{ lib, buildPythonPackage, python, pythonOlder, fetchFromGitHub, cmake, sip }: +{ lib, buildPythonPackage, python, pythonOlder, fetchFromGitHub, cmake, sip_4 }: buildPythonPackage rec { pname = "libsavitar"; @@ -18,7 +18,7 @@ buildPythonPackage rec { nativeBuildInputs = [ cmake ]; - propagatedBuildInputs = [ sip ]; + propagatedBuildInputs = [ sip_4 ]; disabled = pythonOlder "3.4.0"; diff --git a/pkgs/development/python-modules/pykdl/default.nix b/pkgs/development/python-modules/pykdl/default.nix index 674a43f5f3e..9a0431b2b85 100644 --- a/pkgs/development/python-modules/pykdl/default.nix +++ b/pkgs/development/python-modules/pykdl/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, toPythonModule, fetchpatch, cmake, orocos-kdl, python, sip }: +{ lib, stdenv, toPythonModule, fetchpatch, cmake, orocos-kdl, python, sip_4 }: toPythonModule (stdenv.mkDerivation { pname = "pykdl"; @@ -18,7 +18,7 @@ toPythonModule (stdenv.mkDerivation { nativeBuildInputs = [ cmake ]; buildInputs = [ orocos-kdl ]; - propagatedBuildInputs = [ python sip ]; + propagatedBuildInputs = [ python sip_4 ]; meta = with lib; { description = "Kinematics and Dynamics Library (Python bindings)"; diff --git a/pkgs/development/python-modules/pynest2d/default.nix b/pkgs/development/python-modules/pynest2d/default.nix index 7ca72293382..f3b5b9ba685 100644 --- a/pkgs/development/python-modules/pynest2d/default.nix +++ b/pkgs/development/python-modules/pynest2d/default.nix @@ -1,5 +1,5 @@ { lib, buildPythonPackage, fetchFromGitHub, python3, cmake -, pythonOlder, libnest2d, sip, clipper }: +, pythonOlder, libnest2d, sip_4, clipper }: buildPythonPackage rec { version = "4.8.0"; @@ -13,7 +13,7 @@ buildPythonPackage rec { sha256 = "18dn92vgr4gvf9scfh93yg9bwrhdjvq62di08rpi7pqjrrvq2nvp"; }; - propagatedBuildInputs = [ libnest2d sip clipper ]; + propagatedBuildInputs = [ libnest2d sip_4 clipper ]; nativeBuildInputs = [ cmake ]; CLIPPER_PATH = "${clipper.out}"; diff --git a/pkgs/development/python-modules/pyqt/4.x.nix b/pkgs/development/python-modules/pyqt/4.x.nix index 3427438b8a2..27616d69d3e 100644 --- a/pkgs/development/python-modules/pyqt/4.x.nix +++ b/pkgs/development/python-modules/pyqt/4.x.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, fetchurl, buildPythonPackage, python, dbus-python, sip, qt4, pkg-config, lndir, dbus, makeWrapper }: +{ lib, stdenv, fetchurl, buildPythonPackage, python, dbus-python, sip_4, qt4, pkg-config, lndir, dbus, makeWrapper }: buildPythonPackage rec { pname = "PyQt-x11-gpl"; @@ -45,7 +45,7 @@ buildPythonPackage rec { nativeBuildInputs = [ pkg-config lndir makeWrapper qt4 ]; buildInputs = [ qt4 dbus ]; - propagatedBuildInputs = [ sip ]; + propagatedBuildInputs = [ sip_4 ]; postInstall = '' for i in $out/bin/*; do diff --git a/pkgs/development/python-modules/pyqt/5.x.nix b/pkgs/development/python-modules/pyqt/5.x.nix index 6e4b4d37f28..06ab11ce8d3 100644 --- a/pkgs/development/python-modules/pyqt/5.x.nix +++ b/pkgs/development/python-modules/pyqt/5.x.nix @@ -18,7 +18,7 @@ let sip = if isPy3k then pythonPackages.sip_5 else - (pythonPackages.sip.override { sip-module = "PyQt5.sip"; }).overridePythonAttrs(oldAttrs: { + (pythonPackages.sip_4.override { sip-module = "PyQt5.sip"; }).overridePythonAttrs(oldAttrs: { # If we install sip in another folder, then we need to create a __init__.py as well # if we want to be able to import it with Python 2. # Python 3 could rely on it being an implicit namespace package, however, diff --git a/pkgs/development/python-modules/qscintilla-qt5/default.nix b/pkgs/development/python-modules/qscintilla-qt5/default.nix index dcbe213966f..05c12c1c62a 100644 --- a/pkgs/development/python-modules/qscintilla-qt5/default.nix +++ b/pkgs/development/python-modules/qscintilla-qt5/default.nix @@ -10,7 +10,7 @@ buildPythonPackage { src = qscintilla.src; format = "other"; - nativeBuildInputs = [ sip qtbase ]; + nativeBuildInputs = [ sip_4 qtbase ]; buildInputs = [ qscintilla ]; propagatedBuildInputs = [ pyqt5 ]; @@ -40,7 +40,7 @@ buildPythonPackage { --qsci-libdir=${qscintilla}/lib \ --pyqt-sipdir=${pyqt5}/share/sip/PyQt5 \ --qsci-sipdir=$out/share/sip/PyQt5 \ - --sip-incdir=${sip}/include + --sip-incdir=${sip_4}/include ''; meta = with lib; { diff --git a/pkgs/development/python-modules/sip/default.nix b/pkgs/development/python-modules/sip/4.x.nix similarity index 100% rename from pkgs/development/python-modules/sip/default.nix rename to pkgs/development/python-modules/sip/4.x.nix diff --git a/pkgs/misc/drivers/hplip/3.18.5.nix b/pkgs/misc/drivers/hplip/3.18.5.nix index c62161c96f8..3c2f8fa2a08 100644 --- a/pkgs/misc/drivers/hplip/3.18.5.nix +++ b/pkgs/misc/drivers/hplip/3.18.5.nix @@ -75,7 +75,7 @@ python2Packages.buildPythonApplication { pygobject2 reportlab usbutils - sip + sip_4 ] ++ lib.optionals withQt5 [ pyqt5 ]; diff --git a/pkgs/misc/drivers/hplip/default.nix b/pkgs/misc/drivers/hplip/default.nix index 6a7eb35ae52..9fcdbd8c515 100644 --- a/pkgs/misc/drivers/hplip/default.nix +++ b/pkgs/misc/drivers/hplip/default.nix @@ -79,7 +79,7 @@ python3Packages.buildPythonApplication { pygobject3 reportlab usbutils - sip + sip_4 dbus-python ] ++ lib.optionals withQt5 [ pyqt5 diff --git a/pkgs/misc/frescobaldi/default.nix b/pkgs/misc/frescobaldi/default.nix index 070babc0cbc..60fee5a6c86 100644 --- a/pkgs/misc/frescobaldi/default.nix +++ b/pkgs/misc/frescobaldi/default.nix @@ -12,7 +12,7 @@ buildPythonApplication rec { }; propagatedBuildInputs = with python3Packages; [ - lilypond pygame python-ly sip + lilypond pygame python-ly sip_4 pyqt5 poppler-qt5 pyqtwebengine ]; diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index b1c796667aa..f767fdbeea4 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -7524,7 +7524,7 @@ in { signify = callPackage ../development/python-modules/signify { }; - sip = callPackage ../development/python-modules/sip { }; + sip_4 = callPackage ../development/python-modules/sip/4.x.nix { }; sip_5 = callPackage ../development/python-modules/sip/5.x.nix { }; From e02445f4d8e9460ba4147778a875539e763da6ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eduardo=20S=C3=A1nchez=20Mu=C3=B1oz?= Date: Mon, 3 May 2021 13:46:31 +0200 Subject: [PATCH 202/263] pythonPackages.sip_5: rename to sip --- pkgs/applications/misc/calibre/default.nix | 4 ++-- pkgs/development/python-modules/poppler-qt5/default.nix | 6 +++--- pkgs/development/python-modules/pyqt-builder/default.nix | 4 ++-- pkgs/development/python-modules/pyqt/5.x.nix | 2 +- .../development/python-modules/sip/{5.x.nix => default.nix} | 0 pkgs/top-level/python-packages.nix | 4 ++-- 6 files changed, 10 insertions(+), 10 deletions(-) rename pkgs/development/python-modules/sip/{5.x.nix => default.nix} (100%) diff --git a/pkgs/applications/misc/calibre/default.nix b/pkgs/applications/misc/calibre/default.nix index aff203cce61..f5c4acb1f99 100644 --- a/pkgs/applications/misc/calibre/default.nix +++ b/pkgs/applications/misc/calibre/default.nix @@ -45,7 +45,7 @@ mkDerivation rec { prePatch = '' sed -i "s/\[tool.sip.project\]/[tool.sip.project]\nsip-include-dirs = [\"${escaped_pyqt5_dir}\/share\/sip\/PyQt5\"]/g" \ setup/build.py - sed -i "s/\[tool.sip.bindings.pictureflow\]/[tool.sip.bindings.pictureflow]\ntags = [\"${python3Packages.sip_5.platform_tag}\"]/g" \ + sed -i "s/\[tool.sip.bindings.pictureflow\]/[tool.sip.bindings.pictureflow]\ntags = [\"${python3Packages.sip.platform_tag}\"]/g" \ setup/build.py # Remove unneeded files and libs @@ -95,7 +95,7 @@ mkDerivation rec { pyqtwebengine python regex - sip_5 + sip zeroconf # the following are distributed with calibre, but we use upstream instead odfpy diff --git a/pkgs/development/python-modules/poppler-qt5/default.nix b/pkgs/development/python-modules/poppler-qt5/default.nix index 94d86f7b713..4a9fdfa4262 100644 --- a/pkgs/development/python-modules/poppler-qt5/default.nix +++ b/pkgs/development/python-modules/poppler-qt5/default.nix @@ -4,7 +4,7 @@ , isPy3k , fetchPypi , pythonPackages -, sip_5 +, sip , qtbase , qmake , pyqt5 @@ -34,7 +34,7 @@ buildPythonPackage rec { ]; buildInputs = [ qtbase.dev poppler pyqt-builder ]; - nativeBuildInputs = [ pkg-config qmake sip_5 ]; + nativeBuildInputs = [ pkg-config qmake sip ]; propagatedBuildInputs = [ pyqt5.dev ]; format = "pyproject"; @@ -46,7 +46,7 @@ buildPythonPackage rec { [tool.sip.bindings.Poppler-Qt5] include-dirs = ["${poppler.dev}/include/poppler"] - tags = ["${sip_5.platform_tag}"] + tags = ["${sip.platform_tag}"] EOF ''; diff --git a/pkgs/development/python-modules/pyqt-builder/default.nix b/pkgs/development/python-modules/pyqt-builder/default.nix index d7f15d966b3..d371fd7bcee 100644 --- a/pkgs/development/python-modules/pyqt-builder/default.nix +++ b/pkgs/development/python-modules/pyqt-builder/default.nix @@ -1,4 +1,4 @@ -{ lib, fetchPypi, buildPythonPackage, packaging, sip_5 }: +{ lib, fetchPypi, buildPythonPackage, packaging, sip }: buildPythonPackage rec { pname = "pyqt-builder"; @@ -10,7 +10,7 @@ buildPythonPackage rec { sha256 = "0g51yak53zzjs4gpq65i01cmpz7w8cjny9wfyxlgr2vi0wag107v"; }; - propagatedBuildInputs = [ packaging sip_5 ]; + propagatedBuildInputs = [ packaging sip ]; pythonImportsCheck = [ "pyqtbuild" ]; diff --git a/pkgs/development/python-modules/pyqt/5.x.nix b/pkgs/development/python-modules/pyqt/5.x.nix index 06ab11ce8d3..2671b27a630 100644 --- a/pkgs/development/python-modules/pyqt/5.x.nix +++ b/pkgs/development/python-modules/pyqt/5.x.nix @@ -16,7 +16,7 @@ let inherit (pythonPackages) buildPythonPackage python isPy3k dbus-python enum34; sip = if isPy3k then - pythonPackages.sip_5 + pythonPackages.sip else (pythonPackages.sip_4.override { sip-module = "PyQt5.sip"; }).overridePythonAttrs(oldAttrs: { # If we install sip in another folder, then we need to create a __init__.py as well diff --git a/pkgs/development/python-modules/sip/5.x.nix b/pkgs/development/python-modules/sip/default.nix similarity index 100% rename from pkgs/development/python-modules/sip/5.x.nix rename to pkgs/development/python-modules/sip/default.nix diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index f767fdbeea4..ff985ae2158 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -7524,9 +7524,9 @@ in { signify = callPackage ../development/python-modules/signify { }; - sip_4 = callPackage ../development/python-modules/sip/4.x.nix { }; + sip = callPackage ../development/python-modules/sip/default.nix { }; - sip_5 = callPackage ../development/python-modules/sip/5.x.nix { }; + sip_4 = callPackage ../development/python-modules/sip/4.x.nix { }; six = callPackage ../development/python-modules/six { }; From e951b632f680563b9c3e3b4ca6c6202be0dca56e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eduardo=20S=C3=A1nchez=20Mu=C3=B1oz?= Date: Mon, 3 May 2021 13:47:55 +0200 Subject: [PATCH 203/263] pythonPackages.sip_4: 4.19.24 -> 4.19.25 --- pkgs/development/python-modules/sip/4.x.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/sip/4.x.nix b/pkgs/development/python-modules/sip/4.x.nix index 0027c1c0ba5..5334d119634 100644 --- a/pkgs/development/python-modules/sip/4.x.nix +++ b/pkgs/development/python-modules/sip/4.x.nix @@ -2,14 +2,14 @@ buildPythonPackage rec { pname = sip-module; - version = "4.19.24"; + version = "4.19.25"; format = "other"; disabled = isPyPy; src = fetchurl { url = "https://www.riverbankcomputing.com/static/Downloads/sip/${version}/sip-${version}.tar.gz"; - sha256 = "1ra15vb5i9gkg2vdvh16cq9x2mmzw1yi3xphxs8q34q1pf83gkgd"; + sha256 = "04a23cgsnx150xq86w1z44b6vr2zyazysy9mqax0fy346zlr77dk"; }; configurePhase = '' From 6b3b7940ff3050aefc343dd0e855b5a7dc79f6d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20=C4=8Cun=C3=A1t?= Date: Tue, 11 May 2021 10:35:41 +0200 Subject: [PATCH 204/263] llvm*Packages: fix output selection (lib.get*) --- pkgs/development/compilers/llvm/10/default.nix | 8 ++++---- pkgs/development/compilers/llvm/11/default.nix | 9 ++++----- pkgs/development/compilers/llvm/12/default.nix | 8 ++++---- pkgs/development/compilers/llvm/5/default.nix | 10 +++++----- pkgs/development/compilers/llvm/6/default.nix | 10 +++++----- pkgs/development/compilers/llvm/7/default.nix | 10 +++++----- pkgs/development/compilers/llvm/8/default.nix | 10 +++++----- pkgs/development/compilers/llvm/9/default.nix | 10 +++++----- 8 files changed, 37 insertions(+), 38 deletions(-) diff --git a/pkgs/development/compilers/llvm/10/default.nix b/pkgs/development/compilers/llvm/10/default.nix index 9bc79b58693..909a7ce6d21 100644 --- a/pkgs/development/compilers/llvm/10/default.nix +++ b/pkgs/development/compilers/llvm/10/default.nix @@ -31,15 +31,15 @@ let libllvm = callPackage ./llvm { }; - # `llvm` historically had the binaries. But this migration - # technique also impedes `lib.get*`. Perhaps we will revisit it. - llvm = tools.libllvm.out; + # `llvm` historically had the binaries. When choosing an output explicitly, + # we need to reintroduce `outputUnspecified` to get the expected behavior e.g. of lib.get* + llvm = tools.libllvm.out // { outputUnspecified = true; }; libclang = callPackage ./clang { inherit clang-tools-extra_src; }; - clang-unwrapped = tools.libclang.out; + clang-unwrapped = tools.libclang.out // { outputUnspecified = true; }; # disabled until recommonmark supports sphinx 3 #Llvm-manpages = lowPrio (tools.libllvm.override { diff --git a/pkgs/development/compilers/llvm/11/default.nix b/pkgs/development/compilers/llvm/11/default.nix index cb5d08d9ff0..9d1aa1e77cb 100644 --- a/pkgs/development/compilers/llvm/11/default.nix +++ b/pkgs/development/compilers/llvm/11/default.nix @@ -33,16 +33,15 @@ let libllvm = callPackage ./llvm { }; - # `llvm` historically had the binaries. But this migration - # technique also impedes `lib.get*`. Perhaps we will revisit it. - llvm = tools.libllvm.out; + # `llvm` historically had the binaries. When choosing an output explicitly, + # we need to reintroduce `outputUnspecified` to get the expected behavior e.g. of lib.get* + llvm = tools.libllvm.out // { outputUnspecified = true; }; libclang = callPackage ./clang { inherit clang-tools-extra_src; }; - clang-unwrapped = tools.libclang.out; - + clang-unwrapped = tools.libclang.out // { outputUnspecified = true; }; # disabled until recommonmark supports sphinx 3 #Llvm-manpages = lowPrio (tools.libllvm.override { # enableManpages = true; diff --git a/pkgs/development/compilers/llvm/12/default.nix b/pkgs/development/compilers/llvm/12/default.nix index bfdb65ee9ac..0df54540d2b 100644 --- a/pkgs/development/compilers/llvm/12/default.nix +++ b/pkgs/development/compilers/llvm/12/default.nix @@ -42,15 +42,15 @@ let inherit llvm_meta; }; - # `llvm` historically had the binaries. But this migration - # technique also impedes `lib.get*`. Perhaps we will revisit it. - llvm = tools.libllvm.out; + # `llvm` historically had the binaries. When choosing an output explicitly, + # we need to reintroduce `outputUnspecified` to get the expected behavior e.g. of lib.get* + llvm = tools.libllvm.out // { outputUnspecified = true; }; libclang = callPackage ./clang { inherit clang-tools-extra_src llvm_meta; }; - clang-unwrapped = tools.libclang.out; + clang-unwrapped = tools.libclang.out // { outputUnspecified = true; }; # disabled until recommonmark supports sphinx 3 #Llvm-manpages = lowPrio (tools.libllvm.override { diff --git a/pkgs/development/compilers/llvm/5/default.nix b/pkgs/development/compilers/llvm/5/default.nix index 97a295d2d29..c416964b22a 100644 --- a/pkgs/development/compilers/llvm/5/default.nix +++ b/pkgs/development/compilers/llvm/5/default.nix @@ -30,19 +30,19 @@ let libllvm = callPackage ./llvm { }; - # `llvm` historically had the binaries. But this migration - # technique also impedes `lib.get*`. Perhaps we will revisit it. - llvm = tools.libllvm.out; + # `llvm` historically had the binaries. When choosing an output explicitly, + # we need to reintroduce `outputUnspecified` to get the expected behavior e.g. of lib.get* + llvm = tools.libllvm.out // { outputUnspecified = true; }; libllvm-polly = callPackage ./llvm { enablePolly = true; }; - llvm-polly = tools.libllvm-polly.lib; + llvm-polly = tools.libllvm-polly.lib // { outputUnspecified = true; }; libclang = callPackage ./clang { inherit clang-tools-extra_src; }; - clang-unwrapped = tools.libclang.out; + clang-unwrapped = tools.libclang.out // { outputUnspecified = true; }; llvm-manpages = lowPrio (tools.libllvm.override { enableManpages = true; diff --git a/pkgs/development/compilers/llvm/6/default.nix b/pkgs/development/compilers/llvm/6/default.nix index 0fc49844b5d..b78f7a62506 100644 --- a/pkgs/development/compilers/llvm/6/default.nix +++ b/pkgs/development/compilers/llvm/6/default.nix @@ -30,19 +30,19 @@ let libllvm = callPackage ./llvm { }; - # `llvm` historically had the binaries. But this migration - # technique also impedes `lib.get*`. Perhaps we will revisit it. - llvm = tools.libllvm.out; + # `llvm` historically had the binaries. When choosing an output explicitly, + # we need to reintroduce `outputUnspecified` to get the expected behavior e.g. of lib.get* + llvm = tools.libllvm.out // { outputUnspecified = true; }; libllvm-polly = callPackage ./llvm { enablePolly = true; }; - llvm-polly = tools.libllvm-polly.lib; + llvm-polly = tools.libllvm-polly.lib // { outputUnspecified = true; }; libclang = callPackage ./clang { inherit clang-tools-extra_src; }; - clang-unwrapped = tools.libclang.out; + clang-unwrapped = tools.libclang.out // { outputUnspecified = true; }; llvm-manpages = lowPrio (tools.libllvm.override { enableManpages = true; diff --git a/pkgs/development/compilers/llvm/7/default.nix b/pkgs/development/compilers/llvm/7/default.nix index 8a80c55d45a..6a51f9d4264 100644 --- a/pkgs/development/compilers/llvm/7/default.nix +++ b/pkgs/development/compilers/llvm/7/default.nix @@ -30,19 +30,19 @@ let libllvm = callPackage ./llvm { }; - # `llvm` historically had the binaries. But this migration - # technique also impedes `lib.get*`. Perhaps we will revisit it. - llvm = tools.libllvm.out; + # `llvm` historically had the binaries. When choosing an output explicitly, + # we need to reintroduce `outputUnspecified` to get the expected behavior e.g. of lib.get* + llvm = tools.libllvm.out // { outputUnspecified = true; }; libllvm-polly = callPackage ./llvm { enablePolly = true; }; - llvm-polly = tools.libllvm-polly.lib; + llvm-polly = tools.libllvm-polly.lib // { outputUnspecified = true; }; libclang = callPackage ./clang { inherit clang-tools-extra_src; }; - clang-unwrapped = tools.libclang.out; + clang-unwrapped = tools.libclang.out // { outputUnspecified = true; }; clang-polly-unwrapped = callPackage ./clang { inherit clang-tools-extra_src; diff --git a/pkgs/development/compilers/llvm/8/default.nix b/pkgs/development/compilers/llvm/8/default.nix index 3e7ef892e3d..251f0f8a8e9 100644 --- a/pkgs/development/compilers/llvm/8/default.nix +++ b/pkgs/development/compilers/llvm/8/default.nix @@ -30,19 +30,19 @@ let libllvm = callPackage ./llvm { }; - # `llvm` historically had the binaries. But this migration - # technique also impedes `lib.get*`. Perhaps we will revisit it. - llvm = tools.libllvm.out; + # `llvm` historically had the binaries. When choosing an output explicitly, + # we need to reintroduce `outputUnspecified` to get the expected behavior e.g. of lib.get* + llvm = tools.libllvm.out // { outputUnspecified = true; }; libllvm-polly = callPackage ./llvm { enablePolly = true; }; - llvm-polly = tools.libllvm-polly.lib; + llvm-polly = tools.libllvm-polly.lib // { outputUnspecified = true; }; libclang = callPackage ./clang { inherit clang-tools-extra_src; }; - clang-unwrapped = tools.libclang.out; + clang-unwrapped = tools.libclang.out // { outputUnspecified = true; }; clang-polly-unwrapped = callPackage ./clang { inherit clang-tools-extra_src; diff --git a/pkgs/development/compilers/llvm/9/default.nix b/pkgs/development/compilers/llvm/9/default.nix index 14157842537..c4a55e36094 100644 --- a/pkgs/development/compilers/llvm/9/default.nix +++ b/pkgs/development/compilers/llvm/9/default.nix @@ -30,19 +30,19 @@ let libllvm = callPackage ./llvm { }; - # `llvm` historically had the binaries. But this migration - # technique also impedes `lib.get*`. Perhaps we will revisit it. - llvm = tools.libllvm.out; + # `llvm` historically had the binaries. When choosing an output explicitly, + # we need to reintroduce `outputUnspecified` to get the expected behavior e.g. of lib.get* + llvm = tools.libllvm.out // { outputUnspecified = true; }; libllvm-polly = callPackage ./llvm { enablePolly = true; }; - llvm-polly = tools.libllvm-polly.lib; + llvm-polly = tools.libllvm-polly.lib // { outputUnspecified = true; }; libclang = callPackage ./clang { inherit clang-tools-extra_src; }; - clang-unwrapped = tools.libclang.out; + clang-unwrapped = tools.libclang.out // { outputUnspecified = true; }; clang-polly-unwrapped = callPackage ./clang { inherit clang-tools-extra_src; From 717884806406da949074c4c1f4c80f6a1e3f0231 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20=C4=8Cun=C3=A1t?= Date: Wed, 12 May 2021 10:51:11 +0200 Subject: [PATCH 205/263] ghdl-llvm: fix llvm output selection --- pkgs/development/compilers/ghdl/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/compilers/ghdl/default.nix b/pkgs/development/compilers/ghdl/default.nix index ec07331dc52..e7886eb8f5e 100644 --- a/pkgs/development/compilers/ghdl/default.nix +++ b/pkgs/development/compilers/ghdl/default.nix @@ -25,7 +25,7 @@ stdenv.mkDerivation rec { ''; configureFlags = [ "--enable-synth" ] ++ lib.optional (backend == "llvm") - "--with-llvm-config=${llvm}/bin/llvm-config"; + "--with-llvm-config=${llvm.dev}/bin/llvm-config"; hardeningDisable = [ "format" ]; From 22da55072861c4c42b8e85a2d89a53af9024d50f Mon Sep 17 00:00:00 2001 From: John Ericson Date: Sun, 9 May 2021 19:28:59 -0400 Subject: [PATCH 206/263] Fast-forward PR #122399 from staging to staging-next compiler-rt: Revert passing `COMPILER_RT_OS_DIR` and not symlinking libs (cherry picked from commit 680b33fe37d4b6fd0bd8fe596ed438c88bfb3637) https://github.com/NixOS/nixpkgs/pull/111487#issuecomment-840078869 --- pkgs/development/compilers/llvm/10/compiler-rt/default.nix | 5 +++-- pkgs/development/compilers/llvm/11/compiler-rt/default.nix | 5 +++-- pkgs/development/compilers/llvm/12/compiler-rt/default.nix | 5 +++-- pkgs/development/compilers/llvm/5/compiler-rt/default.nix | 5 +++-- pkgs/development/compilers/llvm/6/compiler-rt/default.nix | 5 +++-- pkgs/development/compilers/llvm/7/compiler-rt/default.nix | 5 +++-- pkgs/development/compilers/llvm/8/compiler-rt/default.nix | 5 +++-- pkgs/development/compilers/llvm/9/compiler-rt/default.nix | 5 +++-- 8 files changed, 24 insertions(+), 16 deletions(-) diff --git a/pkgs/development/compilers/llvm/10/compiler-rt/default.nix b/pkgs/development/compilers/llvm/10/compiler-rt/default.nix index 15fb0a7b910..1f990ac433d 100644 --- a/pkgs/development/compilers/llvm/10/compiler-rt/default.nix +++ b/pkgs/development/compilers/llvm/10/compiler-rt/default.nix @@ -21,7 +21,6 @@ stdenv.mkDerivation rec { ]; cmakeFlags = [ - "-DCOMPILER_RT_OS_DIR=" "-DCOMPILER_RT_DEFAULT_TARGET_ONLY=ON" "-DCMAKE_C_COMPILER_TARGET=${stdenv.hostPlatform.config}" "-DCMAKE_ASM_COMPILER_TARGET=${stdenv.hostPlatform.config}" @@ -81,7 +80,9 @@ stdenv.mkDerivation rec { ''; # Hack around weird upsream RPATH bug - postInstall = lib.optionalString (useLLVM) '' + postInstall = lib.optionalString (stdenv.hostPlatform.isDarwin || stdenv.hostPlatform.isWasm) '' + ln -s "$out/lib"/*/* "$out/lib" + '' + lib.optionalString (useLLVM) '' ln -s $out/lib/*/clang_rt.crtbegin-*.o $out/lib/crtbegin.o ln -s $out/lib/*/clang_rt.crtend-*.o $out/lib/crtend.o ln -s $out/lib/*/clang_rt.crtbegin_shared-*.o $out/lib/crtbeginS.o diff --git a/pkgs/development/compilers/llvm/11/compiler-rt/default.nix b/pkgs/development/compilers/llvm/11/compiler-rt/default.nix index 5ec37508c5e..257bc34092f 100644 --- a/pkgs/development/compilers/llvm/11/compiler-rt/default.nix +++ b/pkgs/development/compilers/llvm/11/compiler-rt/default.nix @@ -21,7 +21,6 @@ stdenv.mkDerivation rec { ]; cmakeFlags = [ - "-DCOMPILER_RT_OS_DIR=" "-DCOMPILER_RT_DEFAULT_TARGET_ONLY=ON" "-DCMAKE_C_COMPILER_TARGET=${stdenv.hostPlatform.config}" "-DCMAKE_ASM_COMPILER_TARGET=${stdenv.hostPlatform.config}" @@ -84,7 +83,9 @@ stdenv.mkDerivation rec { ''; # Hack around weird upsream RPATH bug - postInstall = lib.optionalString (useLLVM) '' + postInstall = lib.optionalString (stdenv.hostPlatform.isDarwin || stdenv.hostPlatform.isWasm) '' + ln -s "$out/lib"/*/* "$out/lib" + '' + lib.optionalString (useLLVM) '' ln -s $out/lib/*/clang_rt.crtbegin-*.o $out/lib/crtbegin.o ln -s $out/lib/*/clang_rt.crtend-*.o $out/lib/crtend.o ln -s $out/lib/*/clang_rt.crtbegin_shared-*.o $out/lib/crtbeginS.o diff --git a/pkgs/development/compilers/llvm/12/compiler-rt/default.nix b/pkgs/development/compilers/llvm/12/compiler-rt/default.nix index 7126deb8f0a..b880a0071b9 100644 --- a/pkgs/development/compilers/llvm/12/compiler-rt/default.nix +++ b/pkgs/development/compilers/llvm/12/compiler-rt/default.nix @@ -21,7 +21,6 @@ stdenv.mkDerivation rec { ]; cmakeFlags = [ - "-DCOMPILER_RT_OS_DIR=" "-DCOMPILER_RT_DEFAULT_TARGET_ONLY=ON" "-DCMAKE_C_COMPILER_TARGET=${stdenv.hostPlatform.config}" "-DCMAKE_ASM_COMPILER_TARGET=${stdenv.hostPlatform.config}" @@ -84,7 +83,9 @@ stdenv.mkDerivation rec { ''; # Hack around weird upsream RPATH bug - postInstall = lib.optionalString (useLLVM) '' + postInstall = lib.optionalString (stdenv.hostPlatform.isDarwin || stdenv.hostPlatform.isWasm) '' + ln -s "$out/lib"/*/* "$out/lib" + '' + lib.optionalString (useLLVM) '' ln -s $out/lib/*/clang_rt.crtbegin-*.o $out/lib/crtbegin.o ln -s $out/lib/*/clang_rt.crtend-*.o $out/lib/crtend.o ln -s $out/lib/*/clang_rt.crtbegin_shared-*.o $out/lib/crtbeginS.o diff --git a/pkgs/development/compilers/llvm/5/compiler-rt/default.nix b/pkgs/development/compilers/llvm/5/compiler-rt/default.nix index 237cea11a7c..7e85c420da0 100644 --- a/pkgs/development/compilers/llvm/5/compiler-rt/default.nix +++ b/pkgs/development/compilers/llvm/5/compiler-rt/default.nix @@ -21,7 +21,6 @@ stdenv.mkDerivation { ]; cmakeFlags = [ - "-DCOMPILER_RT_OS_DIR=" "-DCOMPILER_RT_DEFAULT_TARGET_ONLY=ON" "-DCMAKE_C_COMPILER_TARGET=${stdenv.hostPlatform.config}" "-DCMAKE_ASM_COMPILER_TARGET=${stdenv.hostPlatform.config}" @@ -78,7 +77,9 @@ stdenv.mkDerivation { ''; # Hack around weird upsream RPATH bug - postInstall = lib.optionalString (useLLVM) '' + postInstall = lib.optionalString (stdenv.hostPlatform.isDarwin || stdenv.hostPlatform.isWasm) '' + ln -s "$out/lib"/*/* "$out/lib" + '' + lib.optionalString (useLLVM) '' ln -s $out/lib/*/clang_rt.crtbegin-*.o $out/lib/linux/crtbegin.o ln -s $out/lib/*/clang_rt.crtend-*.o $out/lib/linux/crtend.o ln -s $out/lib/*/clang_rt.crtbegin_shared-*.o $out/lib/linux/crtbeginS.o diff --git a/pkgs/development/compilers/llvm/6/compiler-rt/default.nix b/pkgs/development/compilers/llvm/6/compiler-rt/default.nix index c74693629d3..384305f5cf2 100644 --- a/pkgs/development/compilers/llvm/6/compiler-rt/default.nix +++ b/pkgs/development/compilers/llvm/6/compiler-rt/default.nix @@ -21,7 +21,6 @@ stdenv.mkDerivation { ]; cmakeFlags = [ - "-DCOMPILER_RT_OS_DIR=" "-DCOMPILER_RT_DEFAULT_TARGET_ONLY=ON" "-DCMAKE_C_COMPILER_TARGET=${stdenv.hostPlatform.config}" "-DCMAKE_ASM_COMPILER_TARGET=${stdenv.hostPlatform.config}" @@ -80,7 +79,9 @@ stdenv.mkDerivation { ''; # Hack around weird upsream RPATH bug - postInstall = lib.optionalString (useLLVM) '' + postInstall = lib.optionalString (stdenv.hostPlatform.isDarwin || stdenv.hostPlatform.isWasm) '' + ln -s "$out/lib"/*/* "$out/lib" + '' + lib.optionalString (useLLVM) '' ln -s $out/lib/*/clang_rt.crtbegin-*.o $out/lib/linux/crtbegin.o ln -s $out/lib/*/clang_rt.crtend-*.o $out/lib/linux/crtend.o ln -s $out/lib/*/clang_rt.crtbegin_shared-*.o $out/lib/linux/crtbeginS.o diff --git a/pkgs/development/compilers/llvm/7/compiler-rt/default.nix b/pkgs/development/compilers/llvm/7/compiler-rt/default.nix index d083347dde5..75d61a51e60 100644 --- a/pkgs/development/compilers/llvm/7/compiler-rt/default.nix +++ b/pkgs/development/compilers/llvm/7/compiler-rt/default.nix @@ -21,7 +21,6 @@ stdenv.mkDerivation { ]; cmakeFlags = [ - "-DCOMPILER_RT_OS_DIR=" "-DCOMPILER_RT_DEFAULT_TARGET_ONLY=ON" "-DCMAKE_C_COMPILER_TARGET=${stdenv.hostPlatform.config}" "-DCMAKE_ASM_COMPILER_TARGET=${stdenv.hostPlatform.config}" @@ -81,7 +80,9 @@ stdenv.mkDerivation { ''; # Hack around weird upsream RPATH bug - postInstall = lib.optionalString (useLLVM) '' + postInstall = lib.optionalString (stdenv.hostPlatform.isDarwin || stdenv.hostPlatform.isWasm) '' + ln -s "$out/lib"/*/* "$out/lib" + '' + lib.optionalString (useLLVM) '' ln -s $out/lib/*/clang_rt.crtbegin-*.o $out/lib/linux/crtbegin.o ln -s $out/lib/*/clang_rt.crtend-*.o $out/lib/linux/crtend.o ln -s $out/lib/*/clang_rt.crtbegin_shared-*.o $out/lib/linux/crtbeginS.o diff --git a/pkgs/development/compilers/llvm/8/compiler-rt/default.nix b/pkgs/development/compilers/llvm/8/compiler-rt/default.nix index 0f07e78dded..d370de031bb 100644 --- a/pkgs/development/compilers/llvm/8/compiler-rt/default.nix +++ b/pkgs/development/compilers/llvm/8/compiler-rt/default.nix @@ -21,7 +21,6 @@ stdenv.mkDerivation { ]; cmakeFlags = [ - "-DCOMPILER_RT_OS_DIR=" "-DCOMPILER_RT_DEFAULT_TARGET_ONLY=ON" "-DCMAKE_C_COMPILER_TARGET=${stdenv.hostPlatform.config}" "-DCMAKE_ASM_COMPILER_TARGET=${stdenv.hostPlatform.config}" @@ -81,7 +80,9 @@ stdenv.mkDerivation { ''; # Hack around weird upsream RPATH bug - postInstall = lib.optionalString (useLLVM) '' + postInstall = lib.optionalString (stdenv.hostPlatform.isDarwin || stdenv.hostPlatform.isWasm) '' + ln -s "$out/lib"/*/* "$out/lib" + '' + lib.optionalString (useLLVM) '' ln -s $out/lib/*/clang_rt.crtbegin-*.o $out/lib/crtbegin.o ln -s $out/lib/*/clang_rt.crtend-*.o $out/lib/crtend.o ln -s $out/lib/*/clang_rt.crtbegin_shared-*.o $out/lib/crtbeginS.o diff --git a/pkgs/development/compilers/llvm/9/compiler-rt/default.nix b/pkgs/development/compilers/llvm/9/compiler-rt/default.nix index f6f5a9cf806..285fe811514 100644 --- a/pkgs/development/compilers/llvm/9/compiler-rt/default.nix +++ b/pkgs/development/compilers/llvm/9/compiler-rt/default.nix @@ -21,7 +21,6 @@ stdenv.mkDerivation rec { ]; cmakeFlags = [ - "-DCOMPILER_RT_OS_DIR=" "-DCOMPILER_RT_DEFAULT_TARGET_ONLY=ON" "-DCMAKE_C_COMPILER_TARGET=${stdenv.hostPlatform.config}" "-DCMAKE_ASM_COMPILER_TARGET=${stdenv.hostPlatform.config}" @@ -80,7 +79,9 @@ stdenv.mkDerivation rec { ''; # Hack around weird upsream RPATH bug - postInstall = lib.optionalString (useLLVM) '' + postInstall = lib.optionalString (stdenv.hostPlatform.isDarwin || stdenv.hostPlatform.isWasm) '' + ln -s "$out/lib"/*/* "$out/lib" + '' + lib.optionalString (useLLVM) '' ln -s $out/lib/*/clang_rt.crtbegin-*.o $out/lib/crtbegin.o ln -s $out/lib/*/clang_rt.crtend-*.o $out/lib/crtend.o ln -s $out/lib/*/clang_rt.crtbegin_shared-*.o $out/lib/crtbeginS.o From 548818a448ea8fc37a75fe584b886544cbdbc6f6 Mon Sep 17 00:00:00 2001 From: Rick van Schijndel Date: Thu, 13 May 2021 00:22:52 +0200 Subject: [PATCH 207/263] rtl_433: 20.11 -> 21.05 --- pkgs/applications/radio/rtl_433/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/radio/rtl_433/default.nix b/pkgs/applications/radio/rtl_433/default.nix index b926e29bc47..18941bff68a 100644 --- a/pkgs/applications/radio/rtl_433/default.nix +++ b/pkgs/applications/radio/rtl_433/default.nix @@ -3,14 +3,14 @@ }: stdenv.mkDerivation rec { - version = "20.11"; + version = "21.05"; pname = "rtl_433"; src = fetchFromGitHub { owner = "merbanan"; repo = "rtl_433"; rev = version; - sha256 = "093bxjxkg7yf78wqj5gpijbfa2p05ny09qqsj84kzi1svnzsa369"; + sha256 = "sha256-01mXOwLv16yTR65BboN+TFm2aE2EMfW1D5teDdW2wLg="; }; nativeBuildInputs = [ pkg-config cmake ]; From 9db789244dd642a8542b104685e7b317b0b7d386 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20K=C3=B6gler?= Date: Thu, 13 May 2021 15:20:36 +0200 Subject: [PATCH 208/263] luaformatter: 1.3.4 -> 1.3.5 --- pkgs/development/tools/luaformatter/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/tools/luaformatter/default.nix b/pkgs/development/tools/luaformatter/default.nix index 991f1a37717..ee34886a063 100644 --- a/pkgs/development/tools/luaformatter/default.nix +++ b/pkgs/development/tools/luaformatter/default.nix @@ -2,13 +2,13 @@ stdenv.mkDerivation rec { pname = "luaformatter"; - version = "1.3.4"; + version = "1.3.5"; src = fetchFromGitHub { owner = "koihik"; repo = "luaformatter"; rev = version; - sha256 = "163190g37r6npg5k5mhdwckdhv9nwy2gnfp5jjk8p0s6cyvydqjw"; + sha256 = "sha256-TMo6zRfhVAXVh0tIC0PecaJCKr0ev45jOKm2+reTtS4="; fetchSubmodules = true; }; From 1e36af2854da5cb6ab48d1384c9985460c22d775 Mon Sep 17 00:00:00 2001 From: "Robert T. McGibbon" Date: Sun, 9 May 2021 11:21:19 -0400 Subject: [PATCH 209/263] python39Packages.random2: fix build --- pkgs/development/python-modules/random2/default.nix | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pkgs/development/python-modules/random2/default.nix b/pkgs/development/python-modules/random2/default.nix index 6845a5707da..cb84d32ef41 100644 --- a/pkgs/development/python-modules/random2/default.nix +++ b/pkgs/development/python-modules/random2/default.nix @@ -2,6 +2,7 @@ , buildPythonPackage , fetchPypi , isPyPy +, fetchpatch }: buildPythonPackage rec { @@ -15,6 +16,14 @@ buildPythonPackage rec { sha256 = "34ad30aac341039872401595df9ab2c9dc36d0b7c077db1cea9ade430ed1c007"; }; + patches = [ + # Patch test suite for python >= 3.9 + (fetchpatch { + url = "https://github.com/strichter/random2/pull/3/commits/1bac6355d9c65de847cc445d782c466778b94fbd.patch"; + sha256 = "064137pg1ilv3f9r10123lqbqz45070jca8pjjyp6gpfd0yk74pi"; + }) + ]; + meta = with lib; { homepage = "http://pypi.python.org/pypi/random2"; description = "Python 3 compatible Python 2 `random` Module"; From 207ffd8ce2eeefc4827095adfc0e4febc009d47d Mon Sep 17 00:00:00 2001 From: Graham Bennett Date: Mon, 10 May 2021 23:31:34 +0100 Subject: [PATCH 210/263] python-engineio: 3.x on python 3.9 Darwin broken The tests are failing, but the package appears to be generally broken for python 3.9 and above on Darwin. Co-authored-by: Jonathan Ringer --- pkgs/development/python-modules/python-engineio/3.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkgs/development/python-modules/python-engineio/3.nix b/pkgs/development/python-modules/python-engineio/3.nix index e4c71782f99..5deeec0bb57 100644 --- a/pkgs/development/python-modules/python-engineio/3.nix +++ b/pkgs/development/python-modules/python-engineio/3.nix @@ -13,6 +13,7 @@ , websocket_client , websockets , pytestCheckHook +, pythonAtLeast }: buildPythonPackage rec { @@ -63,5 +64,6 @@ buildPythonPackage rec { homepage = "https://github.com/miguelgrinberg/python-engineio/"; license = with licenses; [ mit ]; maintainers = with maintainers; [ graham33 ]; + broken = stdenv.isDarwin && (pythonAtLeast "3.9"); # See https://github.com/miguelgrinberg/python-socketio/issues/567 }; } From 060fb3b67260f0c87a7f8a64872cdb7e4250fc04 Mon Sep 17 00:00:00 2001 From: polygon Date: Fri, 14 May 2021 00:18:29 +0200 Subject: [PATCH 211/263] boomerang: Add cstdint include needed with GCC10 Include cstdint as needed with GCC10. This follows an upstream patch for the same issue that is not yet part of a release. https://github.com/BoomerangDecompiler/boomerang/commit/3342b0eac6b7617d9913226c06c1470820593e74 --- pkgs/development/tools/boomerang/cstdint.patch | 12 ++++++++++++ pkgs/development/tools/boomerang/default.nix | 4 ++++ 2 files changed, 16 insertions(+) create mode 100644 pkgs/development/tools/boomerang/cstdint.patch diff --git a/pkgs/development/tools/boomerang/cstdint.patch b/pkgs/development/tools/boomerang/cstdint.patch new file mode 100644 index 00000000000..69e35261b4c --- /dev/null +++ b/pkgs/development/tools/boomerang/cstdint.patch @@ -0,0 +1,12 @@ +diff --git a/src/boomerang-plugins/codegen/c/ControlFlowAnalyzer.h b/src/boomerang-plugins/codegen/c/ControlFlowAnalyzer.h +index 011b9c9..40c343a 100644 +--- a/src/boomerang-plugins/codegen/c/ControlFlowAnalyzer.h ++++ b/src/boomerang-plugins/codegen/c/ControlFlowAnalyzer.h +@@ -10,6 +10,7 @@ + #pragma once + + ++#include + #include + #include + diff --git a/pkgs/development/tools/boomerang/default.nix b/pkgs/development/tools/boomerang/default.nix index 4ac9159520f..eb5ae33f919 100644 --- a/pkgs/development/tools/boomerang/default.nix +++ b/pkgs/development/tools/boomerang/default.nix @@ -3,6 +3,9 @@ mkDerivation rec { pname = "boomerang"; version = "0.5.2"; + # NOTE: When bumping version beyond 0.5.2, you likely need to remove + # the cstdint.patch below. The patch does a fix that has already + # been done upstream but is not yet part of a release src = fetchFromGitHub { owner = "BoomerangDecompiler"; @@ -13,6 +16,7 @@ mkDerivation rec { nativeBuildInputs = [ cmake bison flex ]; buildInputs = [ qtbase capstone ]; + patches = [ ./cstdint.patch ]; meta = with lib; { homepage = "https://github.com/BoomerangDecompiler/boomerang"; From 7b1fad07a5b37aa42a1937da7454ec8db709b018 Mon Sep 17 00:00:00 2001 From: polygon Date: Fri, 14 May 2021 01:06:34 +0200 Subject: [PATCH 212/263] caprice32: Add include --- pkgs/misc/emulators/caprice32/default.nix | 5 +++++ pkgs/misc/emulators/caprice32/string.patch | 12 ++++++++++++ 2 files changed, 17 insertions(+) create mode 100644 pkgs/misc/emulators/caprice32/string.patch diff --git a/pkgs/misc/emulators/caprice32/default.nix b/pkgs/misc/emulators/caprice32/default.nix index 3e20ba61642..6c2932f7e10 100644 --- a/pkgs/misc/emulators/caprice32/default.nix +++ b/pkgs/misc/emulators/caprice32/default.nix @@ -5,6 +5,9 @@ stdenv.mkDerivation rec { pname = "caprice32"; version = "4.6.0"; + # NOTE: When bumping version beyond 4.6.0, you likely need to remove + # string.patch below. The fix of this patch has already been + # done upstream but is not yet part of a release src = fetchFromGitHub { repo = "caprice32"; @@ -16,6 +19,8 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ desktop-file-utils pkg-config ]; buildInputs = [ libpng SDL freetype zlib ]; + patches = [ ./string.patch ]; + makeFlags = [ "APP_PATH=${placeholder "out"}/share/caprice32" "RELEASE=1" diff --git a/pkgs/misc/emulators/caprice32/string.patch b/pkgs/misc/emulators/caprice32/string.patch new file mode 100644 index 00000000000..fabbbd80d5d --- /dev/null +++ b/pkgs/misc/emulators/caprice32/string.patch @@ -0,0 +1,12 @@ +diff --git a/src/configuration.h b/src/configuration.h +index 34fd690..97fb0e5 100644 +--- a/src/configuration.h ++++ b/src/configuration.h +@@ -2,6 +2,7 @@ + #define CONFIGURATION_H + + #include ++#include + + namespace config + { From 92ac079673e7ec0749062b4c93c64b56d64828ea Mon Sep 17 00:00:00 2001 From: polygon Date: Fri, 14 May 2021 15:04:44 +0200 Subject: [PATCH 213/263] boomerang: Replace inline patch with fetchpatch --- pkgs/development/tools/boomerang/cstdint.patch | 12 ------------ pkgs/development/tools/boomerang/default.nix | 10 ++++++++-- 2 files changed, 8 insertions(+), 14 deletions(-) delete mode 100644 pkgs/development/tools/boomerang/cstdint.patch diff --git a/pkgs/development/tools/boomerang/cstdint.patch b/pkgs/development/tools/boomerang/cstdint.patch deleted file mode 100644 index 69e35261b4c..00000000000 --- a/pkgs/development/tools/boomerang/cstdint.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff --git a/src/boomerang-plugins/codegen/c/ControlFlowAnalyzer.h b/src/boomerang-plugins/codegen/c/ControlFlowAnalyzer.h -index 011b9c9..40c343a 100644 ---- a/src/boomerang-plugins/codegen/c/ControlFlowAnalyzer.h -+++ b/src/boomerang-plugins/codegen/c/ControlFlowAnalyzer.h -@@ -10,6 +10,7 @@ - #pragma once - - -+#include - #include - #include - diff --git a/pkgs/development/tools/boomerang/default.nix b/pkgs/development/tools/boomerang/default.nix index eb5ae33f919..b37ab9a2d3f 100644 --- a/pkgs/development/tools/boomerang/default.nix +++ b/pkgs/development/tools/boomerang/default.nix @@ -1,4 +1,4 @@ -{ mkDerivation, lib, fetchFromGitHub, cmake, qtbase, capstone, bison, flex }: +{ mkDerivation, lib, fetchFromGitHub, fetchpatch, cmake, qtbase, capstone, bison, flex }: mkDerivation rec { pname = "boomerang"; @@ -16,7 +16,13 @@ mkDerivation rec { nativeBuildInputs = [ cmake bison flex ]; buildInputs = [ qtbase capstone ]; - patches = [ ./cstdint.patch ]; + patches = [ + (fetchpatch { + name = "include-missing-cstdint.patch"; + url = "https://github.com/BoomerangDecompiler/boomerang/commit/3342b0eac6b7617d9913226c06c1470820593e74.patch"; + sha256 = "sha256-941IydcV3mqj7AWvXTM6GePW5VgawEcL0wrBCXqeWvc="; + }) + ]; meta = with lib; { homepage = "https://github.com/BoomerangDecompiler/boomerang"; From 803a16442dd634054fb922f02444468951106834 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Fri, 14 May 2021 15:20:29 +0200 Subject: [PATCH 214/263] python3Packages.pycurl: disable failing tests (#122950) and clean up and refactor the package. --- .../python-modules/pycurl/default.nix | 64 ++++++++++++------- 1 file changed, 42 insertions(+), 22 deletions(-) diff --git a/pkgs/development/python-modules/pycurl/default.nix b/pkgs/development/python-modules/pycurl/default.nix index fe62d1be1ea..e202d1928f2 100644 --- a/pkgs/development/python-modules/pycurl/default.nix +++ b/pkgs/development/python-modules/pycurl/default.nix @@ -1,11 +1,12 @@ -{ buildPythonPackage +{ lib +, buildPythonPackage , isPyPy , fetchPypi , pythonOlder , curl , openssl , bottle -, pytest +, pytestCheckHook , nose , flaky }: @@ -20,6 +21,11 @@ buildPythonPackage rec { sha256 = "8301518689daefa53726b59ded6b48f33751c383cf987b0ccfbbc4ed40281325"; }; + preConfigure = '' + substituteInPlace setup.py --replace '--static-libs' '--libs' + export PYCURL_SSL_LIBRARY=openssl + ''; + buildInputs = [ curl openssl.out @@ -31,34 +37,48 @@ buildPythonPackage rec { checkInputs = [ bottle - pytest + pytestCheckHook nose flaky ]; - # skip impure or flakey tests - # See also: - # * https://github.com/NixOS/nixpkgs/issues/77304 - checkPhase = '' - HOME=$TMPDIR pytest tests -k "not test_ssl_in_static_libs \ - and not test_keyfunction \ - and not test_keyfunction_bogus_return \ - and not test_libcurl_ssl_gnutls \ - and not test_libcurl_ssl_nss \ - and not test_libcurl_ssl_openssl" \ - --ignore=tests/getinfo_test.py \ - --ignore=tests/memory_mgmt_test.py \ - --ignore=tests/multi_memory_mgmt_test.py \ - --ignore=tests/multi_timer_test.py + pytestFlagsArray = [ + # don't pick up the tests directory below examples/ + "tests" + ]; + + preCheck = '' + export HOME=$TMPDIR ''; - preConfigure = '' - substituteInPlace setup.py --replace '--static-libs' '--libs' - export PYCURL_SSL_LIBRARY=openssl - ''; + disabledTests = [ + # libcurl stopped passing the reason phrase from the HTTP status line + # https://github.com/pycurl/pycurl/issues/679 + "test_failonerror" + "test_failonerror_status_line_invalid_utf8_python3" + # bottle>=0.12.17 escapes utf8 properly, so these test don't work anymore + # https://github.com/pycurl/pycurl/issues/669 + "test_getinfo_content_type_invalid_utf8_python3" + "test_getinfo_cookie_invalid_utf8_python3" + "test_getinfo_raw_content_type_invalid_utf8" + "test_getinfo_raw_cookie_invalid_utf8" + # tests that require network access + "test_keyfunction" + "test_keyfunction_bogus_return" + # OSError: tests/fake-curl/libcurl/with_openssl.so: cannot open shared object file: No such file or directory + "test_libcurl_ssl_openssl" + # OSError: tests/fake-curl/libcurl/with_nss.so: cannot open shared object file: No such file or directory + "test_libcurl_ssl_nss" + # OSError: tests/fake-curl/libcurl/with_gnutls.so: cannot open shared object file: No such file or directory + "test_libcurl_ssl_gnutls" + # AssertionError: assert 'crypto' in ['curl'] + "test_ssl_in_static_libs" + ]; - meta = { + meta = with lib; { homepage = "http://pycurl.sourceforge.net/"; description = "Python wrapper for libcurl"; + license = licenses.lgpl2Only; + maintainers = with maintainers; []; }; } From 8184d8b0f2b85f97bee7af0c4df7de28cf732634 Mon Sep 17 00:00:00 2001 From: Julien Moutinho Date: Fri, 14 May 2021 17:19:37 +0200 Subject: [PATCH 215/263] apparmor: fix profile building on darwin --- pkgs/applications/networking/p2p/transmission/default.nix | 3 ++- pkgs/os-specific/linux/iputils/default.nix | 3 ++- pkgs/tools/networking/inetutils/default.nix | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/pkgs/applications/networking/p2p/transmission/default.nix b/pkgs/applications/networking/p2p/transmission/default.nix index b3a2a3eb212..d80a3bf2678 100644 --- a/pkgs/applications/networking/p2p/transmission/default.nix +++ b/pkgs/applications/networking/p2p/transmission/default.nix @@ -78,7 +78,8 @@ in stdenv.mkDerivation { NIX_LDFLAGS = lib.optionalString stdenv.isDarwin "-framework CoreFoundation"; postInstall = '' - install -D -m 644 /dev/stdin $apparmor/bin.transmission-daemon <$apparmor/bin.transmission-daemon < $out/bin/transmission-daemon { include diff --git a/pkgs/os-specific/linux/iputils/default.nix b/pkgs/os-specific/linux/iputils/default.nix index 122a9ca1b7b..495860ef576 100644 --- a/pkgs/os-specific/linux/iputils/default.nix +++ b/pkgs/os-specific/linux/iputils/default.nix @@ -38,7 +38,8 @@ in stdenv.mkDerivation rec { buildInputs = [ libcap ] ++ lib.optional (!stdenv.hostPlatform.isMusl) libidn2; postInstall = '' - install -D -m 644 /dev/stdin $apparmor/bin.ping <$apparmor/bin.ping < $out/bin/ping { include diff --git a/pkgs/tools/networking/inetutils/default.nix b/pkgs/tools/networking/inetutils/default.nix index fe5a0d91585..285031aaca5 100644 --- a/pkgs/tools/networking/inetutils/default.nix +++ b/pkgs/tools/networking/inetutils/default.nix @@ -46,7 +46,8 @@ stdenv.mkDerivation rec { installFlags = [ "SUIDMODE=" ]; postInstall = '' - install -D -m 644 /dev/stdin $apparmor/bin.ping <$apparmor/bin.ping < include From fdbf305e3b7d784a34cfb8709c483b2fc07edf83 Mon Sep 17 00:00:00 2001 From: Michael Weiss Date: Fri, 14 May 2021 19:11:19 +0200 Subject: [PATCH 216/263] wio: Build with wlroots 0.13 --- .../window-managers/wio/default.nix | 5 + .../window-managers/wio/wlroots-0.13.patch | 254 ++++++++++++++++++ pkgs/top-level/all-packages.nix | 4 +- 3 files changed, 260 insertions(+), 3 deletions(-) create mode 100644 pkgs/applications/window-managers/wio/wlroots-0.13.patch diff --git a/pkgs/applications/window-managers/wio/default.nix b/pkgs/applications/window-managers/wio/default.nix index c330bbe0e0f..72fa23de9dd 100644 --- a/pkgs/applications/window-managers/wio/default.nix +++ b/pkgs/applications/window-managers/wio/default.nix @@ -25,6 +25,11 @@ stdenv.mkDerivation rec { sha256 = "1vpvlahv6dmr7vfb11p5cc5ds2y2vfvcb877nkqx18yin6pg357l"; }; + patches = [ + # To fix the build with wlroots 0.13: + ./wlroots-0.13.patch + ]; + nativeBuildInputs = [ meson ninja pkg-config makeWrapper ]; buildInputs = [ cairo diff --git a/pkgs/applications/window-managers/wio/wlroots-0.13.patch b/pkgs/applications/window-managers/wio/wlroots-0.13.patch new file mode 100644 index 00000000000..989e812bb53 --- /dev/null +++ b/pkgs/applications/window-managers/wio/wlroots-0.13.patch @@ -0,0 +1,254 @@ +commit 8a3f903b20d646ebb2472c4f094ca1bf225a96c7 +Author: Michael Weiss +Date: Fri May 14 19:19:05 2021 +0200 + + Fix the build with wlroots 0.13 + +diff --git a/main.c b/main.c +index 5d7dcda..870fdb0 100644 +--- a/main.c ++++ b/main.c +@@ -1,6 +1,7 @@ + #define _POSIX_C_SOURCE 200809L + #include + #include ++#include + #include + #include + #include +@@ -49,7 +50,7 @@ static void gen_menu_textures(struct wio_server *server) { + cairo_surface_flush(surf); + unsigned char *data = cairo_image_surface_get_data(surf); + server->menu.inactive_textures[i] = wlr_texture_from_pixels(renderer, +- WL_SHM_FORMAT_ARGB8888, ++ DRM_FORMAT_ARGB8888, + cairo_image_surface_get_stride(surf), + extents.width + 2, extents.height + 2, data); + } +@@ -66,7 +67,7 @@ static void gen_menu_textures(struct wio_server *server) { + cairo_surface_flush(surf); + unsigned char *data = cairo_image_surface_get_data(surf); + server->menu.active_textures[i] = wlr_texture_from_pixels(renderer, +- WL_SHM_FORMAT_ARGB8888, ++ DRM_FORMAT_ARGB8888, + cairo_image_surface_get_stride(surf), + extents.width + 2, extents.height + 2, data); + } +@@ -152,7 +153,7 @@ int main(int argc, char **argv) { + } + + server.wl_display = wl_display_create(); +- server.backend = wlr_backend_autocreate(server.wl_display, NULL); ++ server.backend = wlr_backend_autocreate(server.wl_display); + server.renderer = wlr_backend_get_renderer(server.backend); + wlr_renderer_init_wl_display(server.renderer, server.wl_display); + +diff --git a/protocols/wlr-layer-shell-unstable-v1.xml b/protocols/wlr-layer-shell-unstable-v1.xml +index 90b8bc8..d62fd51 100644 +--- a/protocols/wlr-layer-shell-unstable-v1.xml ++++ b/protocols/wlr-layer-shell-unstable-v1.xml +@@ -25,7 +25,7 @@ + THIS SOFTWARE. + + +- ++ + + Clients can use this interface to assign the surface_layer role to + wl_surfaces. Such surfaces are assigned to a "layer" of the output and +@@ -47,6 +47,12 @@ + or manipulate a buffer prior to the first layer_surface.configure call + must also be treated as errors. + ++ After creating a layer_surface object and setting it up, the client ++ must perform an initial commit without any buffer attached. ++ The compositor will reply with a layer_surface.configure event. ++ The client must acknowledge it and is then allowed to attach a buffer ++ to map the surface. ++ + You may pass NULL for output to allow the compositor to decide which + output to use. Generally this will be the one that the user most + recently interacted with. +@@ -82,17 +88,35 @@ + + + ++ ++ ++ ++ ++ ++ This request indicates that the client will not use the layer_shell ++ object any more. Objects that have been created through this instance ++ are not affected. ++ ++ + + +- ++ + + An interface that may be implemented by a wl_surface, for surfaces that + are designed to be rendered as a layer of a stacked desktop-like + environment. + +- Layer surface state (size, anchor, exclusive zone, margin, interactivity) +- is double-buffered, and will be applied at the time wl_surface.commit of +- the corresponding wl_surface is called. ++ Layer surface state (layer, size, anchor, exclusive zone, ++ margin, interactivity) is double-buffered, and will be applied at the ++ time wl_surface.commit of the corresponding wl_surface is called. ++ ++ Attaching a null buffer to a layer surface unmaps it. ++ ++ Unmapping a layer_surface means that the surface cannot be shown by the ++ compositor until it is explicitly mapped again. The layer_surface ++ returns to the state it had right after layer_shell.get_layer_surface. ++ The client can re-map the surface by performing a commit without any ++ buffer attached, waiting for a configure event and handling it as usual. + + + +@@ -127,14 +151,19 @@ + + + +- Requests that the compositor avoids occluding an area of the surface +- with other surfaces. The compositor's use of this information is ++ Requests that the compositor avoids occluding an area with other ++ surfaces. The compositor's use of this information is + implementation-dependent - do not assume that this region will not + actually be occluded. + +- A positive value is only meaningful if the surface is anchored to an +- edge, rather than a corner. The zone is the number of surface-local +- coordinates from the edge that is considered exclusive. ++ A positive value is only meaningful if the surface is anchored to one ++ edge or an edge and both perpendicular edges. If the surface is not ++ anchored, anchored to only two perpendicular edges (a corner), anchored ++ to only two parallel edges or anchored to all edges, a positive value ++ will be treated the same as zero. ++ ++ A positive zone is the distance from the edge in surface-local ++ coordinates to consider exclusive. + + Surfaces that do not wish to have an exclusive zone may instead specify + how they should interact with surfaces that do. If set to zero, the +@@ -174,21 +203,85 @@ + + + ++ ++ ++ Types of keyboard interaction possible for layer shell surfaces. The ++ rationale for this is twofold: (1) some applications are not interested ++ in keyboard events and not allowing them to be focused can improve the ++ desktop experience; (2) some applications will want to take exclusive ++ keyboard focus. ++ ++ ++ ++ ++ This value indicates that this surface is not interested in keyboard ++ events and the compositor should never assign it the keyboard focus. ++ ++ This is the default value, set for newly created layer shell surfaces. ++ ++ This is useful for e.g. desktop widgets that display information or ++ only have interaction with non-keyboard input devices. ++ ++ ++ ++ ++ Request exclusive keyboard focus if this surface is above the shell surface layer. ++ ++ For the top and overlay layers, the seat will always give ++ exclusive keyboard focus to the top-most layer which has keyboard ++ interactivity set to exclusive. If this layer contains multiple ++ surfaces with keyboard interactivity set to exclusive, the compositor ++ determines the one receiving keyboard events in an implementation- ++ defined manner. In this case, no guarantee is made when this surface ++ will receive keyboard focus (if ever). ++ ++ For the bottom and background layers, the compositor is allowed to use ++ normal focus semantics. ++ ++ This setting is mainly intended for applications that need to ensure ++ they receive all keyboard events, such as a lock screen or a password ++ prompt. ++ ++ ++ ++ ++ This requests the compositor to allow this surface to be focused and ++ unfocused by the user in an implementation-defined manner. The user ++ should be able to unfocus this surface even regardless of the layer ++ it is on. ++ ++ Typically, the compositor will want to use its normal mechanism to ++ manage keyboard focus between layer shell surfaces with this setting ++ and regular toplevels on the desktop layer (e.g. click to focus). ++ Nevertheless, it is possible for a compositor to require a special ++ interaction to focus or unfocus layer shell surfaces (e.g. requiring ++ a click even if focus follows the mouse normally, or providing a ++ keybinding to switch focus between layers). ++ ++ This setting is mainly intended for desktop shell components (e.g. ++ panels) that allow keyboard interaction. Using this option can allow ++ implementing a desktop shell that can be fully usable without the ++ mouse. ++ ++ ++ ++ + + +- Set to 1 to request that the seat send keyboard events to this layer +- surface. For layers below the shell surface layer, the seat will use +- normal focus semantics. For layers above the shell surface layers, the +- seat will always give exclusive keyboard focus to the top-most layer +- which has keyboard interactivity set to true. ++ Set how keyboard events are delivered to this surface. By default, ++ layer shell surfaces do not receive keyboard events; this request can ++ be used to change this. ++ ++ This setting is inherited by child surfaces set by the get_popup ++ request. + + Layer surfaces receive pointer, touch, and tablet events normally. If + you do not want to receive them, set the input region on your surface + to an empty region. + +- Events is double-buffered, see wl_surface.commit. ++ Keyboard interactivity is double-buffered, see wl_surface.commit. + +- ++ + + + +@@ -273,6 +366,7 @@ + + + ++ + + + +@@ -281,5 +375,16 @@ + + + ++ ++ ++ ++ ++ ++ Change the layer that the surface is rendered on. ++ ++ Layer is double-buffered, see wl_surface.commit. ++ ++ ++ + + diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 9ae283aa6b3..b92f3a009c0 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -27015,9 +27015,7 @@ in weston = callPackage ../applications/window-managers/weston { pipewire = pipewire_0_2; }; - wio = callPackage ../applications/window-managers/wio { - wlroots = wlroots_0_12; - }; + wio = callPackage ../applications/window-managers/wio { }; whitebox-tools = callPackage ../applications/gis/whitebox-tools { inherit (darwin.apple_sdk.frameworks) Security; From 55282bd6f60f9a10dbbce7a35c20bc78f0b3b7d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20=C4=8Cun=C3=A1t?= Date: Fri, 14 May 2021 22:08:38 +0200 Subject: [PATCH 217/263] lua5_1: fixup a recent regression Commit 57832e625c (PR #119860) switched to using SYSCFLAGS, but lua 5.1 calls it MYCFLAGS. We noticed due to broken luarocks build: https://hydra.nixos.org/build/142663274 --- pkgs/development/interpreters/lua-5/interpreter.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkgs/development/interpreters/lua-5/interpreter.nix b/pkgs/development/interpreters/lua-5/interpreter.nix index 973e9296435..506f9ca7207 100644 --- a/pkgs/development/interpreters/lua-5/interpreter.nix +++ b/pkgs/development/interpreters/lua-5/interpreter.nix @@ -61,7 +61,8 @@ self = stdenv.mkDerivation rec { configurePhase = '' runHook preConfigure - makeFlagsArray+=(CFLAGS='-O2 -fPIC${lib.optionalString compat " -DLUA_COMPAT_ALL"} $(SYSCFLAGS)' ) + makeFlagsArray+=(CFLAGS='-O2 -fPIC${lib.optionalString compat " -DLUA_COMPAT_ALL"} $(${ + if lib.versionAtLeast luaversion "5.2" then "SYSCFLAGS" else "MYCFLAGS"})' ) makeFlagsArray+=(${lib.optionalString stdenv.isDarwin "CC=\"$CC\""}${lib.optionalString (stdenv.buildPlatform != stdenv.hostPlatform) " 'AR=${stdenv.cc.targetPrefix}ar rcu'"}) installFlagsArray=( TO_BIN="lua luac" INSTALL_DATA='cp -d' \ From 827f69cf0df7104cb43d2488dc057a7a159b76e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Milan=20P=C3=A4ssler?= Date: Sat, 15 May 2021 01:17:51 +0200 Subject: [PATCH 218/263] nixos/tests/minecraft-server: fix build on i686 "at most 2047 MB RAM can be simulated" --- nixos/tests/minecraft-server.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nixos/tests/minecraft-server.nix b/nixos/tests/minecraft-server.nix index e6e0bca972a..dbe2cd6d56f 100644 --- a/nixos/tests/minecraft-server.nix +++ b/nixos/tests/minecraft-server.nix @@ -24,7 +24,7 @@ in import ./make-test-python.nix ({ pkgs, ... }: { }; }; - virtualisation.memorySize = 2048; + virtualisation.memorySize = 2047; }; testScript = '' From 777c73d75d9dfedc386a3fef4d811fd5b8027c20 Mon Sep 17 00:00:00 2001 From: "R. RyanTM" Date: Sat, 15 May 2021 04:08:09 +0000 Subject: [PATCH 219/263] libmwaw: 0.3.18 -> 0.3.19 --- pkgs/development/libraries/libmwaw/default.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkgs/development/libraries/libmwaw/default.nix b/pkgs/development/libraries/libmwaw/default.nix index 1b8c30f9a8f..aa42edfeadb 100644 --- a/pkgs/development/libraries/libmwaw/default.nix +++ b/pkgs/development/libraries/libmwaw/default.nix @@ -3,11 +3,11 @@ let s = # Generated upstream information rec { baseName="libmwaw"; - version="0.3.18"; + version="0.3.19"; name="${baseName}-${version}"; - hash="sha256-/F0FFoD4AAvmT/68CwxYcWscm/BgA+w5k4exCdHtHg8="; - url="mirror://sourceforge/libmwaw/libmwaw/libmwaw-0.3.18/libmwaw-0.3.18.tar.xz"; - sha256="sha256-/F0FFoD4AAvmT/68CwxYcWscm/BgA+w5k4exCdHtHg8="; + hash="sha256-snLiNO78goxLuDRK8PBHpi4HD1MOni+6EbBMjbjtpa8="; + url="mirror://sourceforge/libmwaw/libmwaw/libmwaw-0.3.19/libmwaw-0.3.19.tar.xz"; + sha256="sha256-snLiNO78goxLuDRK8PBHpi4HD1MOni+6EbBMjbjtpa8="; }; nativeBuildInputs = [ pkg-config ]; From 537a1940e80dfd2332064823435095f56eb87b32 Mon Sep 17 00:00:00 2001 From: Jonathan Ringer Date: Fri, 14 May 2021 23:37:56 -0700 Subject: [PATCH 220/263] staging-next: lua5: fix eval, add lib.so.patch --- .../interpreters/lua-5/liblua.so.patch | 60 +++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 pkgs/development/interpreters/lua-5/liblua.so.patch diff --git a/pkgs/development/interpreters/lua-5/liblua.so.patch b/pkgs/development/interpreters/lua-5/liblua.so.patch new file mode 100644 index 00000000000..197832116c1 --- /dev/null +++ b/pkgs/development/interpreters/lua-5/liblua.so.patch @@ -0,0 +1,60 @@ +diff --git a/Makefile b/Makefile +index 416f444..eeaff03 100644 +--- a/Makefile ++++ b/Makefile +@@ -52,7 +52,7 @@ R= $V.0 + all: $(PLAT) + + $(PLATS) help test clean: +- @cd src && $(MAKE) $@ ++ @cd src && $(MAKE) $@ V=$(V) R=$(R) + + install: dummy + cd src && $(MKDIR) $(INSTALL_BIN) $(INSTALL_INC) $(INSTALL_LIB) $(INSTALL_MAN) $(INSTALL_LMOD) $(INSTALL_CMOD) +diff --git a/src/Makefile b/src/Makefile +index 514593d..372a6dc 100644 +--- a/src/Makefile ++++ b/src/Makefile +@@ -33,6 +33,7 @@ CMCFLAGS= -Os + PLATS= guess aix bsd c89 freebsd generic linux linux-readline macosx mingw posix solaris + + LUA_A= liblua.a ++LUA_SO= liblua.so + CORE_O= lapi.o lcode.o lctype.o ldebug.o ldo.o ldump.o lfunc.o lgc.o llex.o lmem.o lobject.o lopcodes.o lparser.o lstate.o lstring.o ltable.o ltm.o lundump.o lvm.o lzio.o + LIB_O= lauxlib.o lbaselib.o lcorolib.o ldblib.o liolib.o lmathlib.o loadlib.o loslib.o lstrlib.o ltablib.o lutf8lib.o linit.o + BASE_O= $(CORE_O) $(LIB_O) $(MYOBJS) +@@ -44,7 +45,7 @@ LUAC_T= luac + LUAC_O= luac.o + + ALL_O= $(BASE_O) $(LUA_O) $(LUAC_O) +-ALL_T= $(LUA_A) $(LUA_T) $(LUAC_T) ++ALL_T= $(LUA_A) $(LUA_T) $(LUAC_T) $(LUA_SO) + ALL_A= $(LUA_A) + + # Targets start here. +@@ -60,6 +61,12 @@ $(LUA_A): $(BASE_O) + $(AR) $@ $(BASE_O) + $(RANLIB) $@ + ++$(LUA_SO): $(CORE_O) $(LIB_O) ++ $(CC) -shared -ldl -Wl,-soname,$(LUA_SO).$(V) -o $@.$(R) $? -lm $(MYLDFLAGS) ++ ln -sf $(LUA_SO).$(R) $(LUA_SO).$(V) ++ ln -sf $(LUA_SO).$(R) $(LUA_SO) ++ ++ + $(LUA_T): $(LUA_O) $(LUA_A) + $(CC) -o $@ $(LDFLAGS) $(LUA_O) $(LUA_A) $(LIBS) + +diff --git a/src/luaconf.h b/src/luaconf.h +index bdf927e..7e15198 100644 +--- a/src/luaconf.h ++++ b/src/luaconf.h +@@ -227,7 +227,7 @@ + + #else /* }{ */ + +-#define LUA_ROOT "/usr/local/" ++#define LUA_ROOT "/usr/" + #define LUA_LDIR LUA_ROOT "share/lua/" LUA_VDIR "/" + #define LUA_CDIR LUA_ROOT "lib/lua/" LUA_VDIR "/" + From 322ec24acd417b20e3a8d0620c990e0af15ea777 Mon Sep 17 00:00:00 2001 From: Jonathan Ringer Date: Sat, 15 May 2021 00:27:53 -0700 Subject: [PATCH 221/263] lua51Packages.luxio: fix build --- pkgs/top-level/lua-packages.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkgs/top-level/lua-packages.nix b/pkgs/top-level/lua-packages.nix index 62ddc14ff93..d1b47e6bcad 100644 --- a/pkgs/top-level/lua-packages.nix +++ b/pkgs/top-level/lua-packages.nix @@ -123,6 +123,8 @@ with self; { ); ''; + NIX_LDFLAGS = [ "-ldl" ]; + meta = with lib; { description = "Lightweight UNIX I/O and POSIX binding for Lua"; homepage = "https://www.gitano.org.uk/luxio/"; From 960cd687732f92737d2dff931348b138330be643 Mon Sep 17 00:00:00 2001 From: Zane van Iperen Date: Sat, 15 May 2021 16:52:25 +1000 Subject: [PATCH 222/263] mplayer: fix build failure with ffmpeg 4.4 Backport SVN revision 38199. --- pkgs/applications/video/mplayer/default.nix | 2 ++ .../mplayer/svn-r38199-ffmpeg44fix.patch | 22 +++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 pkgs/applications/video/mplayer/svn-r38199-ffmpeg44fix.patch diff --git a/pkgs/applications/video/mplayer/default.nix b/pkgs/applications/video/mplayer/default.nix index 0162a999709..b6bfa9d0dcf 100644 --- a/pkgs/applications/video/mplayer/default.nix +++ b/pkgs/applications/video/mplayer/default.nix @@ -106,6 +106,8 @@ stdenv.mkDerivation rec { rm -rf ffmpeg ''; + patches = [ ./svn-r38199-ffmpeg44fix.patch ]; + depsBuildBuild = [ buildPackages.stdenv.cc ]; nativeBuildInputs = [ pkg-config yasm ]; buildInputs = with lib; diff --git a/pkgs/applications/video/mplayer/svn-r38199-ffmpeg44fix.patch b/pkgs/applications/video/mplayer/svn-r38199-ffmpeg44fix.patch new file mode 100644 index 00000000000..4137989fcb5 --- /dev/null +++ b/pkgs/applications/video/mplayer/svn-r38199-ffmpeg44fix.patch @@ -0,0 +1,22 @@ +Index: libmpcodecs/ad_spdif.c +=================================================================== +diff --git a/libmpcodecs/ad_spdif.c b/libmpcodecs/ad_spdif.c +--- a/libmpcodecs/ad_spdif.c (revision 38198) ++++ b/libmpcodecs/ad_spdif.c (revision 38199) +@@ -298,14 +298,8 @@ + if (spdif_ctx->header_written) + av_write_trailer(lavf_ctx); + av_freep(&lavf_ctx->pb); +- if (lavf_ctx->streams) { +- av_freep(&lavf_ctx->streams[0]->codec); +- av_freep(&lavf_ctx->streams[0]->info); +- av_freep(&lavf_ctx->streams[0]); +- } +- av_freep(&lavf_ctx->streams); +- av_freep(&lavf_ctx->priv_data); ++ avformat_free_context(lavf_ctx); ++ lavf_ctx = NULL; + } +- av_freep(&lavf_ctx); + av_freep(&spdif_ctx); + } From 539ad4f81140545b60e0d5aba55d36ef02ebebba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20=C4=8Cun=C3=A1t?= Date: Sat, 15 May 2021 09:32:18 +0200 Subject: [PATCH 223/263] lua5_*: tweak linking libraries All liblua.so were missing a library or two; I'm not sure if there's a better way to add them. Check: ldd -r ./result/lib/liblua.so --- pkgs/development/interpreters/lua-5/interpreter.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkgs/development/interpreters/lua-5/interpreter.nix b/pkgs/development/interpreters/lua-5/interpreter.nix index 506f9ca7207..4c45a3c6bdd 100644 --- a/pkgs/development/interpreters/lua-5/interpreter.nix +++ b/pkgs/development/interpreters/lua-5/interpreter.nix @@ -72,6 +72,8 @@ self = stdenv.mkDerivation rec { ''; inherit postConfigure; + NIX_LDFLAGS = [ "-lm" ] ++ lib.optional (lib.versionOlder luaversion "5.2") "-ldl"; + inherit postBuild; postInstall = '' @@ -93,7 +95,7 @@ self = stdenv.mkDerivation rec { Description: An Extensible Extension Language Version: ${version} Requires: - Libs: -L$out/lib -llua -lm + Libs: -L$out/lib -llua Cflags: -I$out/include EOF ln -s "$out/lib/pkgconfig/lua.pc" "$out/lib/pkgconfig/lua-${luaversion}.pc" From 4e8fa08311ff20105c9d708b920bf3485b3689a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20=C4=8Cun=C3=A1t?= Date: Sat, 15 May 2021 09:37:32 +0200 Subject: [PATCH 224/263] Revert "lua51Packages.luxio: fix build" This reverts commit 322ec24acd417b20e3a8d0620c990e0af15ea777. After the parent commit we don't need to fix individual lua users. --- pkgs/top-level/lua-packages.nix | 2 -- 1 file changed, 2 deletions(-) diff --git a/pkgs/top-level/lua-packages.nix b/pkgs/top-level/lua-packages.nix index d1b47e6bcad..62ddc14ff93 100644 --- a/pkgs/top-level/lua-packages.nix +++ b/pkgs/top-level/lua-packages.nix @@ -123,8 +123,6 @@ with self; { ); ''; - NIX_LDFLAGS = [ "-ldl" ]; - meta = with lib; { description = "Lightweight UNIX I/O and POSIX binding for Lua"; homepage = "https://www.gitano.org.uk/luxio/"; From 30b5330e85883acdcb0502349ce67878529f58ce Mon Sep 17 00:00:00 2001 From: Stefan Frijters Date: Sun, 9 May 2021 11:39:58 +0200 Subject: [PATCH 225/263] eukleides: Fix build, expose tex package --- .../science/math/eukleides/default.nix | 50 +++++++++++++++---- 1 file changed, 39 insertions(+), 11 deletions(-) diff --git a/pkgs/applications/science/math/eukleides/default.nix b/pkgs/applications/science/math/eukleides/default.nix index 5f7fe58465d..94a90127ed8 100644 --- a/pkgs/applications/science/math/eukleides/default.nix +++ b/pkgs/applications/science/math/eukleides/default.nix @@ -1,21 +1,49 @@ -{ lib, stdenv, fetchurl, bison, flex, texinfo, readline, texLive }: +{ lib, stdenv, fetchurl, bison, flex, makeWrapper, texinfo, readline, texLive }: -let - name = "eukleides"; +lib.fix (eukleides: stdenv.mkDerivation rec { + pname = "eukleides"; version = "1.5.4"; -in -stdenv.mkDerivation { - name = "${name}-${version}"; src = fetchurl { - url = "http://www.eukleides.org/files/${name}-${version}.tar.bz2"; + url = "http://www.eukleides.org/files/${pname}-${version}.tar.bz2"; sha256 = "0s8cyh75hdj89v6kpm3z24i48yzpkr8qf0cwxbs9ijxj1i38ki0q"; }; - buildInputs = [bison flex texinfo readline texLive]; + nativeBuildInputs = [ bison flex texinfo makeWrapper ]; - preConfigure = "sed -i 's/ginstall-info/install-info/g' doc/Makefile"; - installPhase = "mkdir -p $out/bin ; make PREFIX=$out install"; + buildInputs = [ readline texLive ]; + + preConfigure = '' + substituteInPlace Makefile \ + --replace mktexlsr true + + substituteInPlace doc/Makefile \ + --replace ginstall-info install-info + + substituteInPlace Config \ + --replace '/usr/local' "$out" \ + --replace '$(SHARE_DIR)/texmf' "$tex" + ''; + + preInstall = '' + mkdir -p $out/bin + ''; + + postInstall = '' + wrapProgram $out/bin/euktoeps \ + --set-default TEXINPUTS : \ + --prefix TEXINPUTS : "$tex/tex/latex/eukleides" \ + --prefix PATH : "${texLive}/bin" + wrapProgram $out/bin/euktopdf \ + --set-default TEXINPUTS : \ + --prefix TEXINPUTS : "$tex/tex/latex/eukleides" \ + --prefix PATH : "${texLive}/bin" + ''; + + outputs = [ "out" "doc" "tex" ]; + + passthru.tlType = "run"; + passthru.pkgs = [ eukleides.tex ]; meta = { description = "Geometry Drawing Language"; @@ -34,4 +62,4 @@ stdenv.mkDerivation { platforms = lib.platforms.linux; maintainers = [ lib.maintainers.peti ]; }; -} +}) From 06e7dc2f436dadcaefe946d43f3810b67f34fef7 Mon Sep 17 00:00:00 2001 From: Stefan Frijters Date: Sun, 9 May 2021 13:39:46 +0200 Subject: [PATCH 226/263] eukleides: Update license See license section in the README. --- pkgs/applications/science/math/eukleides/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/applications/science/math/eukleides/default.nix b/pkgs/applications/science/math/eukleides/default.nix index 94a90127ed8..fe498fdbd8a 100644 --- a/pkgs/applications/science/math/eukleides/default.nix +++ b/pkgs/applications/science/math/eukleides/default.nix @@ -48,7 +48,7 @@ lib.fix (eukleides: stdenv.mkDerivation rec { meta = { description = "Geometry Drawing Language"; homepage = "http://www.eukleides.org/"; - license = lib.licenses.gpl2; + license = lib.licenses.gpl3Plus; longDescription = '' Eukleides is a computer language devoted to elementary plane From 77549f4b751305d5c435cf377dc06d3b559945d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20=C4=8Cun=C3=A1t?= Date: Sat, 15 May 2021 11:07:47 +0200 Subject: [PATCH 227/263] wlroots_0_12: fixup build with ffmpeg-4.4 -Werror=deprecated-declarations is nice upstream but not in distro. https://nix-cache.s3.amazonaws.com/log/cfmk2qkvck88qc002bvxzgsb2zc5b1h2-wlroots-0.12.0.drv --- pkgs/development/libraries/wlroots/0.12.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkgs/development/libraries/wlroots/0.12.nix b/pkgs/development/libraries/wlroots/0.12.nix index 66d4fab2bf9..c21205beabc 100644 --- a/pkgs/development/libraries/wlroots/0.12.nix +++ b/pkgs/development/libraries/wlroots/0.12.nix @@ -30,6 +30,8 @@ stdenv.mkDerivation rec { mesonFlags = [ "-Dlogind-provider=systemd" "-Dlibseat=disabled" ]; + CFLAGS = "-Wno-error=deprecated-declarations"; + postFixup = '' # Install ALL example programs to $examples: # screencopy dmabuf-capture input-inhibitor layer-shell idle-inhibit idle From 841c900baabc93b5dac79b8aed80560cc663156f Mon Sep 17 00:00:00 2001 From: Louis Tim Larsen Date: Sat, 15 May 2021 13:12:30 +0200 Subject: [PATCH 228/263] hunspell-dict-da-dk: 2.5.137 -> 2.5.189 --- pkgs/development/libraries/hunspell/dictionaries.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/libraries/hunspell/dictionaries.nix b/pkgs/development/libraries/hunspell/dictionaries.nix index 37b56789635..f1bcd4ad00c 100644 --- a/pkgs/development/libraries/hunspell/dictionaries.nix +++ b/pkgs/development/libraries/hunspell/dictionaries.nix @@ -761,11 +761,11 @@ in rec { da_DK = da-dk; da-dk = mkDict rec { name = "hunspell-dict-da-dk-${version}"; - version = "2.5.137"; + version = "2.5.189"; src = fetchurl { url = "https://stavekontrolden.dk/dictionaries/da_DK/da_DK-${version}.oxt"; - sha256 = "16y0smkg1mq0133r1fbw5ak6s2xw39281knk5ivhanakayq789qx"; + sha256 = "sha256:0i1cw0nfg24b0sg2yc3q7315ng5vc5245nvh0l1cndkn2c9z4978"; }; shortName = "da-dk"; From a53747a2df4e950b7d43a48d5cc665c6a548217d Mon Sep 17 00:00:00 2001 From: Rick van Schijndel Date: Sat, 15 May 2021 15:20:46 +0200 Subject: [PATCH 229/263] rtl_433: update license to gpl2Plus --- pkgs/applications/radio/rtl_433/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/applications/radio/rtl_433/default.nix b/pkgs/applications/radio/rtl_433/default.nix index 18941bff68a..72aa865176c 100644 --- a/pkgs/applications/radio/rtl_433/default.nix +++ b/pkgs/applications/radio/rtl_433/default.nix @@ -22,7 +22,7 @@ stdenv.mkDerivation rec { meta = with lib; { description = "Decode traffic from devices that broadcast on 433.9 MHz, 868 MHz, 315 MHz, 345 MHz and 915 MHz"; homepage = "https://github.com/merbanan/rtl_433"; - license = licenses.gpl2; + license = licenses.gpl2Plus; maintainers = with maintainers; [ earldouglas ]; platforms = platforms.all; }; From 91cba7b0a9841b9e63aaff51cf00ea3d3e2229dd Mon Sep 17 00:00:00 2001 From: sternenseemann <0rpkxez4ksa01gb3typccl0i@systemli.org> Date: Sat, 15 May 2021 17:40:24 +0200 Subject: [PATCH 230/263] llvmPackages_{10,11,12}.compiler-rt: install resource txts to $out/share 7869d1654517c028aa76fc1dedc9b5ac301a867a changed how resource files are installed. Likely by accident, now some of the resource files are installed to $dev/include instead of $out/share. This causes the cc wrapper's resource-root to miss those files from compiler-rt as they are in a different place than expected. This commit fixes all instances of this incorrect installation for llvmPackages_10, 11 and 12 which are the only llvm package sets which link ${targetLlvmLibraries.compiler-rt.out}/share to the resource-root. For the other llvm package set this will likely also need to be fixed, but it doesn't have to have immediate urgency and doing it in two steps allows us to (hopefully) fix the chromium build without causing a darwin stdenv rebuild. The full fix can be found in #123103 and should probably be included in the next staging-next rotation. --- .../compilers/llvm/10/compiler-rt/gnu-install-dirs.patch | 2 +- .../compilers/llvm/11/compiler-rt/gnu-install-dirs.patch | 2 +- .../compilers/llvm/12/compiler-rt/gnu-install-dirs.patch | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/development/compilers/llvm/10/compiler-rt/gnu-install-dirs.patch b/pkgs/development/compilers/llvm/10/compiler-rt/gnu-install-dirs.patch index 7bc835914a3..db0bd006eaf 100644 --- a/pkgs/development/compilers/llvm/10/compiler-rt/gnu-install-dirs.patch +++ b/pkgs/development/compilers/llvm/10/compiler-rt/gnu-install-dirs.patch @@ -19,7 +19,7 @@ index 35a48c6af29c..e4300f256091 100644 # Install in Clang resource directory. install(FILES ${file_name} - DESTINATION ${COMPILER_RT_INSTALL_PATH}/share -+ DESTINATION ${COMPILER_RT_INSTALL_PATH}/${CMAKE_INSTALL_FULL_INCLUDEDIR} ++ DESTINATION ${COMPILER_RT_INSTALL_PATH}/${CMAKE_INSTALL_FULL_DATADIR} COMPONENT ${component}) add_dependencies(${component} ${target_name}) diff --git a/pkgs/development/compilers/llvm/11/compiler-rt/gnu-install-dirs.patch b/pkgs/development/compilers/llvm/11/compiler-rt/gnu-install-dirs.patch index 1d1ebb570ce..91e20882929 100644 --- a/pkgs/development/compilers/llvm/11/compiler-rt/gnu-install-dirs.patch +++ b/pkgs/development/compilers/llvm/11/compiler-rt/gnu-install-dirs.patch @@ -19,7 +19,7 @@ index 7c127a93dfa7..6a95a65b70a7 100644 # Install in Clang resource directory. install(FILES ${file_name} - DESTINATION ${COMPILER_RT_INSTALL_PATH}/share -+ DESTINATION ${COMPILER_RT_INSTALL_PATH}/${CMAKE_INSTALL_FULL_INCLUDEDIR} ++ DESTINATION ${COMPILER_RT_INSTALL_PATH}/${CMAKE_INSTALL_FULL_DATADIR} COMPONENT ${component}) add_dependencies(${component} ${target_name}) diff --git a/pkgs/development/compilers/llvm/12/compiler-rt/gnu-install-dirs.patch b/pkgs/development/compilers/llvm/12/compiler-rt/gnu-install-dirs.patch index c18d7924890..5f025764de1 100644 --- a/pkgs/development/compilers/llvm/12/compiler-rt/gnu-install-dirs.patch +++ b/pkgs/development/compilers/llvm/12/compiler-rt/gnu-install-dirs.patch @@ -19,7 +19,7 @@ index 361538a58e47..f0d8d9ab80f1 100644 # Install in Clang resource directory. install(FILES ${file_name} - DESTINATION ${COMPILER_RT_INSTALL_PATH}/share -+ DESTINATION ${COMPILER_RT_INSTALL_PATH}/${CMAKE_INSTALL_FULL_INCLUDEDIR} ++ DESTINATION ${COMPILER_RT_INSTALL_PATH}/${CMAKE_INSTALL_FULL_DATADIR} COMPONENT ${component}) add_dependencies(${component} ${target_name}) From dd9525240f296855514a5e505f2446d1f5ec8a36 Mon Sep 17 00:00:00 2001 From: ajs124 Date: Sat, 15 May 2021 17:55:43 +0200 Subject: [PATCH 231/263] thunderbird-68: drop --- .../networking/mailreaders/thunderbird/68.nix | 343 ------------------ .../thunderbird/no-buildconfig-68.patch | 36 -- pkgs/top-level/all-packages.nix | 7 - 3 files changed, 386 deletions(-) delete mode 100644 pkgs/applications/networking/mailreaders/thunderbird/68.nix delete mode 100644 pkgs/applications/networking/mailreaders/thunderbird/no-buildconfig-68.patch diff --git a/pkgs/applications/networking/mailreaders/thunderbird/68.nix b/pkgs/applications/networking/mailreaders/thunderbird/68.nix deleted file mode 100644 index 4433551d2e1..00000000000 --- a/pkgs/applications/networking/mailreaders/thunderbird/68.nix +++ /dev/null @@ -1,343 +0,0 @@ -# This pakcage is keeped until Thunderbird 78 supports OpenPGP. -# https://www.thunderbird.net/en-US/thunderbird/78.0.1/releasenotes/ -{ autoconf213 -, bzip2 -, cargo -, common-updater-scripts -, copyDesktopItems -, coreutils -, curl -, dbus -, dbus-glib -, fetchurl -, file -, fontconfig -, freetype -, glib -, gnugrep -, gnused -, icu -, jemalloc -, lib -, libGL -, libGLU -, libevent -, libjpeg -, libnotify -, libpng -, libstartup_notification -, libvpx -, libwebp -, llvmPackages -, m4 -, makeDesktopItem -, nasm -, nodejs -, nspr -, nss -, pango -, perl -, pkg-config -, python2 -, python3 -, runtimeShell -, rust-cbindgen -, rustc -, sqlite -, stdenv -, systemd -, unzip -, which -, writeScript -, xidel -, xorg -, yasm -, zip -, zlib - -, debugBuild ? false - -, alsaSupport ? stdenv.isLinux, alsaLib -, pulseaudioSupport ? stdenv.isLinux, libpulseaudio -, gtk3Support ? true, gtk2, gtk3, wrapGAppsHook -, waylandSupport ? true -, libxkbcommon, calendarSupport ? true - -# Use official trademarked branding. Permission obtained at: -# https://github.com/NixOS/nixpkgs/pull/94880#issuecomment-675907971 -, enableOfficialBranding ? true -}: - -assert waylandSupport -> gtk3Support == true; - -stdenv.mkDerivation rec { - pname = "thunderbird"; - version = "68.12.0"; - - src = fetchurl { - url = - "mirror://mozilla/thunderbird/releases/${version}/source/thunderbird-${version}.source.tar.xz"; - sha512 = - "33350vjgzvsg6sdhdld92z75k1xcf1wmngdcvzsj4f3y3aal73pyw03mlvgg6y36bm0j8fhaxvgbbg5zm7hxhn779z78970m4v9amg7"; - }; - - nativeBuildInputs = [ - autoconf213 - cargo - copyDesktopItems - gnused - llvmPackages.llvm - m4 - nasm - nodejs - perl - pkg-config - python2 - python3 - rust-cbindgen - rustc - which - yasm - unzip - ] ++ lib.optional gtk3Support wrapGAppsHook; - - buildInputs = [ - bzip2 - dbus - dbus-glib - file - fontconfig - freetype - glib - gtk2 - icu - jemalloc - libGL - libGLU - libevent - libjpeg - libnotify - libpng - libstartup_notification - libvpx - libwebp - nspr - nss - pango - perl - sqlite - xorg.libX11 - xorg.libXScrnSaver - xorg.libXcursor - xorg.libXext - xorg.libXft - xorg.libXi - xorg.libXrender - xorg.libXt - xorg.pixman - xorg.xorgproto - zip - zlib - ] ++ lib.optional alsaSupport alsaLib - ++ lib.optional gtk3Support gtk3 - ++ lib.optional pulseaudioSupport libpulseaudio - ++ lib.optional waylandSupport libxkbcommon; - - NIX_CFLAGS_COMPILE =[ - "-I${glib.dev}/include/gio-unix-2.0" - "-I${nss.dev}/include/nss" - ]; - - patches = [ - ./no-buildconfig-68.patch - ]; - - postPatch = '' - rm -rf obj-x86_64-pc-linux-gnu - ''; - - hardeningDisable = [ "format" ]; - - preConfigure = '' - # remove distributed configuration files - rm -f configure - rm -f js/src/configure - rm -f .mozconfig* - - configureScript="$(realpath ./mach) configure" - # AS=as in the environment causes build failure https://bugzilla.mozilla.org/show_bug.cgi?id=1497286 - unset AS - - export MOZCONFIG=$(pwd)/mozconfig - - # Set C flags for Rust's bindgen program. Unlike ordinary C - # compilation, bindgen does not invoke $CC directly. Instead it - # uses LLVM's libclang. To make sure all necessary flags are - # included we need to look in a few places. - # TODO: generalize this process for other use-cases. - - BINDGEN_CFLAGS="$(< ${stdenv.cc}/nix-support/libc-cflags) \ - $(< ${stdenv.cc}/nix-support/cc-cflags) \ - $(< ${stdenv.cc}/nix-support/libcxx-cxxflags) \ - ${ - lib.optionalString stdenv.cc.isClang - "-idirafter ${stdenv.cc.cc}/lib/clang/${ - lib.getVersion stdenv.cc.cc - }/include" - } \ - ${ - lib.optionalString stdenv.cc.isGNU - "-isystem ${stdenv.cc.cc}/include/c++/${ - lib.getVersion stdenv.cc.cc - } -isystem ${stdenv.cc.cc}/include/c++/${ - lib.getVersion stdenv.cc.cc - }/${stdenv.hostPlatform.config}" - } \ - $NIX_CFLAGS_COMPILE" - - echo "ac_add_options BINDGEN_CFLAGS='$BINDGEN_CFLAGS'" >> $MOZCONFIG - ''; - - configureFlags = let - toolkitSlug = if gtk3Support then - "3${lib.optionalString waylandSupport "-wayland"}" - else - "2"; - toolkitValue = "cairo-gtk${toolkitSlug}"; - in [ - "--enable-application=comm/mail" - - "--with-system-bz2" - "--with-system-icu" - "--with-system-jpeg" - "--with-system-libevent" - "--with-system-nspr" - "--with-system-nss" - "--with-system-png" # needs APNG support - "--with-system-icu" - "--with-system-zlib" - "--with-system-webp" - "--with-system-libvpx" - - "--enable-rust-simd" - "--enable-crashreporter" - "--enable-default-toolkit=${toolkitValue}" - "--enable-js-shell" - "--enable-necko-wifi" - "--enable-startup-notification" - "--enable-system-ffi" - "--enable-system-pixman" - "--enable-system-sqlite" - - "--disable-gconf" - "--disable-tests" - "--disable-updater" - "--enable-jemalloc" - ] ++ (if debugBuild then [ - "--enable-debug" - "--enable-profiling" - ] else [ - "--disable-debug" - "--enable-release" - "--disable-debug-symbols" - "--enable-optimize" - "--enable-strip" - ]) ++ lib.optionals (!stdenv.hostPlatform.isi686) [ - # on i686-linux: --with-libclang-path is not available in this configuration - "--with-libclang-path=${llvmPackages.libclang}/lib" - "--with-clang-path=${llvmPackages.clang}/bin/clang" - ] ++ lib.optional alsaSupport "--enable-alsa" - ++ lib.optional calendarSupport "--enable-calendar" - ++ lib.optional enableOfficialBranding "--enable-official-branding" - ++ lib.optional pulseaudioSupport "--enable-pulseaudio"; - - enableParallelBuilding = true; - - postConfigure = '' - cd obj-* - ''; - - makeFlags = lib.optionals enableOfficialBranding [ - "MOZILLA_OFFICIAL=1" - "BUILD_OFFICIAL=1" - ]; - - doCheck = false; - - desktopItems = [ - (makeDesktopItem { - categories = lib.concatStringsSep ";" [ "Application" "Network" ]; - desktopName = "Thunderbird"; - genericName = "Mail Reader"; - name = "thunderbird"; - exec = "thunderbird %U"; - icon = "$out/lib/thunderbird/chrome/icons/default/default256.png"; - mimeType = lib.concatStringsSep ";" [ - # Email - "x-scheme-handler/mailto" - "message/rfc822" - # Feeds - "x-scheme-handler/feed" - "application/rss+xml" - "application/x-extension-rss" - # Newsgroups - "x-scheme-handler/news" - "x-scheme-handler/snews" - "x-scheme-handler/nntp" - ]; - }) - ]; - postInstall = '' - # TODO: Move to a dev output? - rm -rf $out/include $out/lib/thunderbird-devel-* $out/share/idl - ''; - - preFixup = '' - # Needed to find Mozilla runtime - gappsWrapperArgs+=( - --argv0 "$out/bin/thunderbird" - --set MOZ_APP_LAUNCHER thunderbird - # https://github.com/NixOS/nixpkgs/pull/61980 - --set SNAP_NAME "thunderbird" - --set MOZ_LEGACY_PROFILES 1 - --set MOZ_ALLOW_DOWNGRADE 1 - ) - ''; - - # FIXME: The XUL portion of this can probably be removed as soon as we - # package a Thunderbird >=71.0 since XUL shouldn't be anymore (in use)? - postFixup = '' - local xul="$out/lib/thunderbird/libxul.so" - patchelf --set-rpath "${libnotify}/lib:${lib.getLib systemd}/lib:$(patchelf --print-rpath $xul)" $xul - ''; - - doInstallCheck = true; - installCheckPhase = '' - "$out/bin/thunderbird" --version - ''; - - disallowedRequisites = [ - stdenv.cc - ]; - - passthru.updateScript = import ./../../browsers/firefox/update.nix { - attrPath = "thunderbird"; - baseUrl = "http://archive.mozilla.org/pub/thunderbird/releases/"; - inherit writeScript lib common-updater-scripts xidel coreutils gnused - gnugrep curl runtimeShell; - }; - - meta = with lib; { - description = "A full-featured e-mail client"; - homepage = "https://www.thunderbird.net"; - maintainers = with maintainers; [ - eelco - lovesegfault - pierron - vcunat - ]; - platforms = platforms.linux; - license = licenses.mpl20; - knownVulnerabilities = [ "Support ended around Semptember 2020." ]; - }; -} diff --git a/pkgs/applications/networking/mailreaders/thunderbird/no-buildconfig-68.patch b/pkgs/applications/networking/mailreaders/thunderbird/no-buildconfig-68.patch deleted file mode 100644 index 482c10bd1cf..00000000000 --- a/pkgs/applications/networking/mailreaders/thunderbird/no-buildconfig-68.patch +++ /dev/null @@ -1,36 +0,0 @@ -Remove about:buildconfig. If used as-is, it would add unnecessary runtime dependencies. -diff -ru -x '*~' a/docshell/base/nsAboutRedirector.cpp b/docshell/base/nsAboutRedirector.cpp ---- a/docshell/base/nsAboutRedirector.cpp 2017-07-31 18:20:51.000000000 +0200 -+++ b/docshell/base/nsAboutRedirector.cpp 2017-09-26 22:02:00.814151731 +0200 -@@ -32,8 +32,6 @@ - {"about", "chrome://global/content/aboutAbout.xhtml", 0}, - {"addons", "chrome://mozapps/content/extensions/extensions.xul", - nsIAboutModule::ALLOW_SCRIPT}, -- {"buildconfig", "chrome://global/content/buildconfig.html", -- nsIAboutModule::URI_SAFE_FOR_UNTRUSTED_CONTENT}, - {"checkerboard", "chrome://global/content/aboutCheckerboard.xhtml", - nsIAboutModule::URI_SAFE_FOR_UNTRUSTED_CONTENT | - nsIAboutModule::ALLOW_SCRIPT}, -diff -ru -x '*~' a/toolkit/content/jar.mn b/toolkit/content/jar.mn ---- a/toolkit/content/jar.mn 2017-07-31 18:20:52.000000000 +0200 -+++ b/toolkit/content/jar.mn 2017-09-26 22:01:42.383350314 +0200 -@@ -39,7 +39,6 @@ - content/global/plugins.css - content/global/browser-child.js - content/global/browser-content.js --* content/global/buildconfig.html - content/global/buildconfig.css - content/global/contentAreaUtils.js - content/global/datepicker.xhtml ---- a/comm/mail/base/jar.mn -+++ b/comm/mail/base/jar.mn -@@ -117,9 +117,7 @@ - % override chrome://mozapps/content/profile/profileDowngrade.js chrome://messenger/content/profileDowngrade.js - % override chrome://mozapps/content/profile/profileDowngrade.xul chrome://messenger/content/profileDowngrade.xul - --* content/messenger/buildconfig.html (content/buildconfig.html) - content/messenger/buildconfig.css (content/buildconfig.css) --% override chrome://global/content/buildconfig.html chrome://messenger/content/buildconfig.html - % override chrome://global/content/buildconfig.css chrome://messenger/content/buildconfig.css - - # L10n resources and overrides. diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 177e25ea3c9..8fb98e28c1c 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -26486,13 +26486,6 @@ in gtk3Support = true; }; - thunderbird-68 = callPackage ../applications/networking/mailreaders/thunderbird/68.nix { - inherit (rustPackages) cargo rustc; - libpng = libpng_apng; - nss = nss_3_44; - gtk3Support = true; - }; - thunderbolt = callPackage ../os-specific/linux/thunderbolt {}; thunderbird-bin = thunderbird-bin-78; From 36d2488cb67e9c76b7f7dfbcdadccf703ba3d332 Mon Sep 17 00:00:00 2001 From: ajs124 Date: Sat, 15 May 2021 17:59:27 +0200 Subject: [PATCH 232/263] nss_3_44: drop --- pkgs/development/libraries/nss/3.44.nix | 144 ------------------ .../libraries/nss/85_security_load-3.44.patch | 81 ---------- pkgs/top-level/all-packages.nix | 1 - 3 files changed, 226 deletions(-) delete mode 100644 pkgs/development/libraries/nss/3.44.nix delete mode 100644 pkgs/development/libraries/nss/85_security_load-3.44.patch diff --git a/pkgs/development/libraries/nss/3.44.nix b/pkgs/development/libraries/nss/3.44.nix deleted file mode 100644 index b08b8b3ed2a..00000000000 --- a/pkgs/development/libraries/nss/3.44.nix +++ /dev/null @@ -1,144 +0,0 @@ -{ lib, stdenv, fetchurl, nspr, perl, zlib, sqlite, fixDarwinDylibNames, buildPackages }: - -let - nssPEM = fetchurl { - url = "http://dev.gentoo.org/~polynomial-c/mozilla/nss-3.15.4-pem-support-20140109.patch.xz"; - sha256 = "10ibz6y0hknac15zr6dw4gv9nb5r5z9ym6gq18j3xqx7v7n3vpdw"; - }; - version = "3.44.4"; - underscoreVersion = builtins.replaceStrings ["."] ["_"] version; - -in stdenv.mkDerivation rec { - pname = "nss"; - inherit version; - - src = fetchurl { - url = "mirror://mozilla/security/nss/releases/NSS_${underscoreVersion}_RTM/src/${pname}-${version}.tar.gz"; - sha256 = "7ec1a52e20fd9a23e1907eeba8f4f2ecd619dac5d20fa023ec5b4faa1843e847"; - }; - - depsBuildBuild = [ buildPackages.stdenv.cc ]; - - nativeBuildInputs = [ perl ] - ++ lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames; - - buildInputs = [ zlib sqlite ]; - - propagatedBuildInputs = [ nspr ]; - - prePatch = '' - xz -d < ${nssPEM} | patch -p1 - ''; - - patches = - [ - # Based on http://patch-tracker.debian.org/patch/series/dl/nss/2:3.15.4-1/85_security_load.patch - ./85_security_load-3.44.patch - ./ckpem.patch - ]; - - patchFlags = [ "-p0" ]; - - postPatch = lib.optionalString stdenv.isDarwin '' - substituteInPlace nss/coreconf/Darwin.mk --replace '@executable_path/$(notdir $@)' "$out/lib/\$(notdir \$@)" - ''; - - outputs = [ "out" "dev" "tools" ]; - - preConfigure = "cd nss"; - - makeFlags = let - # NSS's build systems expects aarch32 to be called arm; if we pass in armv6l/armv7l, it - # fails with a linker error - cpu = if stdenv.hostPlatform.isAarch32 then "arm" else stdenv.hostPlatform.parsed.cpu.name; - in [ - "NSPR_INCLUDE_DIR=${nspr.dev}/include" - "NSPR_LIB_DIR=${nspr.out}/lib" - "NSDISTMODE=copy" - "BUILD_OPT=1" - "SOURCE_PREFIX=\$(out)" - "NSS_ENABLE_ECC=1" - "USE_SYSTEM_ZLIB=1" - "NSS_USE_SYSTEM_SQLITE=1" - "NATIVE_CC=${buildPackages.stdenv.cc}/bin/cc" - ] ++ lib.optionals (!stdenv.isDarwin) [ - # Pass in CPU even if we're not cross compiling, because otherwise it tries to guess with - # uname, which can be wrong if e.g. we're compiling for aarch32 on aarch64 - "OS_TEST=${cpu}" - "CPU_ARCH=${cpu}" - ] ++ lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) [ - "CROSS_COMPILE=1" - "NSS_DISABLE_GTESTS=1" # don't want to build tests when cross-compiling - ] ++ lib.optional stdenv.is64bit "USE_64=1" - ++ lib.optional stdenv.isDarwin "CCC=clang++"; - - NIX_CFLAGS_COMPILE = "-Wno-error"; - - # TODO(@oxij): investigate this: `make -n check` works but `make - # check` fails with "no rule", same for "installcheck". - doCheck = false; - doInstallCheck = false; - - postInstall = '' - rm -rf $out/private - mv $out/public $out/include - mv $out/*.OBJ/* $out/ - rmdir $out/*.OBJ - - ln -s lib $out/lib64 - - # Upstream issue: https://bugzilla.mozilla.org/show_bug.cgi?id=530672 - # https://gitweb.gentoo.org/repo/gentoo.git/plain/dev-libs/nss/files/nss-3.32-gentoo-fixups.patch?id=af1acce6c6d2c3adb17689261dfe2c2b6771ab8a - NSS_MAJOR_VERSION=`grep "NSS_VMAJOR" lib/nss/nss.h | awk '{print $3}'` - NSS_MINOR_VERSION=`grep "NSS_VMINOR" lib/nss/nss.h | awk '{print $3}'` - NSS_PATCH_VERSION=`grep "NSS_VPATCH" lib/nss/nss.h | awk '{print $3}'` - PREFIX="$out" - - mkdir -p $out/lib/pkgconfig - sed -e "s,%prefix%,$PREFIX," \ - -e "s,%exec_prefix%,$PREFIX," \ - -e "s,%libdir%,$PREFIX/lib64," \ - -e "s,%includedir%,$dev/include/nss," \ - -e "s,%NSS_VERSION%,$NSS_MAJOR_VERSION.$NSS_MINOR_VERSION.$NSS_PATCH_VERSION,g" \ - -e "s,%NSPR_VERSION%,4.16,g" \ - pkg/pkg-config/nss.pc.in > $out/lib/pkgconfig/nss.pc - chmod 0644 $out/lib/pkgconfig/nss.pc - - sed -e "s,@prefix@,$PREFIX," \ - -e "s,@MOD_MAJOR_VERSION@,$NSS_MAJOR_VERSION," \ - -e "s,@MOD_MINOR_VERSION@,$NSS_MINOR_VERSION," \ - -e "s,@MOD_PATCH_VERSION@,$NSS_PATCH_VERSION," \ - pkg/pkg-config/nss-config.in > $out/bin/nss-config - chmod 0755 $out/bin/nss-config - ''; - - postFixup = let - isCross = stdenv.hostPlatform != stdenv.buildPlatform; - nss = if isCross then buildPackages.nss.tools else "$out"; - in '' - for libname in freebl3 nssdbm3 softokn3 - do '' + - (if stdenv.isDarwin - then '' - libfile="$out/lib/lib$libname.dylib" - DYLD_LIBRARY_PATH=$out/lib:${nspr.out}/lib \ - '' else '' - libfile="$out/lib/lib$libname.so" - LD_LIBRARY_PATH=$out/lib:${nspr.out}/lib \ - '') + '' - ${nss}/bin/shlibsign -v -i "$libfile" - done - - moveToOutput bin "$tools" - moveToOutput bin/nss-config "$dev" - moveToOutput lib/libcrmf.a "$dev" # needed by firefox, for example - rm -f "$out"/lib/*.a - ''; - - meta = with lib; { - homepage = "https://developer.mozilla.org/en-US/docs/NSS"; - description = "A set of libraries for development of security-enabled client and server applications"; - license = licenses.mpl20; - platforms = platforms.all; - }; -} diff --git a/pkgs/development/libraries/nss/85_security_load-3.44.patch b/pkgs/development/libraries/nss/85_security_load-3.44.patch deleted file mode 100644 index 132d5a96b29..00000000000 --- a/pkgs/development/libraries/nss/85_security_load-3.44.patch +++ /dev/null @@ -1,81 +0,0 @@ -diff -ru -x '*~' -x '*.orig' -x '*.rej' nss/cmd/shlibsign/shlibsign.c nss/cmd/shlibsign/shlibsign.c ---- nss/cmd/shlibsign/shlibsign.c 2017-01-04 15:24:24.000000000 +0100 -+++ nss/cmd/shlibsign/shlibsign.c 2017-01-24 14:43:31.030420852 +0100 -@@ -875,6 +875,8 @@ - goto cleanup; - } - lib = PR_LoadLibrary(libname); -+ if (!lib) -+ lib = PR_LoadLibrary(NIX_NSS_LIBDIR"libsoftokn3.so"); - assert(lib != NULL); - if (!lib) { - PR_fprintf(PR_STDERR, "loading softokn3 failed"); -diff -ru -x '*~' -x '*.orig' -x '*.rej' nss/coreconf/config.mk nss/coreconf/config.mk ---- nss/coreconf/config.mk 2017-01-04 15:24:24.000000000 +0100 -+++ nss/coreconf/config.mk 2017-01-24 14:43:47.989432372 +0100 -@@ -202,3 +202,6 @@ - - # Hide old, deprecated, TLS cipher suite names when building NSS - DEFINES += -DSSL_DISABLE_DEPRECATED_CIPHER_SUITE_NAMES -+ -+# Nix specific stuff. -+DEFINES += -DNIX_NSS_LIBDIR=\"$(out)/lib/\" -diff -ru -x '*~' -x '*.orig' -x '*.rej' nss/lib/pk11wrap/pk11load.c nss/lib/pk11wrap/pk11load.c ---- nss/lib/pk11wrap/pk11load.c 2017-01-04 15:24:24.000000000 +0100 -+++ nss/lib/pk11wrap/pk11load.c 2017-01-24 14:45:06.883485652 +0100 -@@ -440,6 +440,13 @@ - * unload the library if anything goes wrong from here on out... - */ - library = PR_LoadLibrary(mod->dllName); -+ if ((library == NULL) && -+ !rindex(mod->dllName, PR_GetDirectorySeparator())) { -+ library = PORT_LoadLibraryFromOrigin(my_shlib_name, -+ (PRFuncPtr) &softoken_LoadDSO, -+ mod->dllName); -+ } -+ - mod->library = (void *)library; - - if (library == NULL) { -diff -ru -x '*~' -x '*.orig' -x '*.rej' nss/lib/util/secload.c nss/lib/util/secload.c ---- nss/lib/util/secload.c 2017-01-04 15:24:24.000000000 +0100 -+++ nss/lib/util/secload.c 2017-01-24 14:43:31.030420852 +0100 -@@ -70,9 +70,14 @@ - - /* Remove the trailing filename from referencePath and add the new one */ - c = strrchr(referencePath, PR_GetDirectorySeparator()); -+ if (!c) { /* referencePath doesn't contain a / means that dladdr gave us argv[0] -+ * and program was called from $PATH. Hack to get libs from NIX_NSS_LIBDIR */ -+ referencePath = NIX_NSS_LIBDIR; -+ c = (char*) &referencePath[sizeof(NIX_NSS_LIBDIR) - 1]; /* last / */ -+ } - if (c) { - size_t referencePathSize = 1 + c - referencePath; -- fullName = (char*)PORT_Alloc(strlen(name) + referencePathSize + 1); -+ fullName = (char*) PORT_Alloc(strlen(name) + referencePathSize + 5); - if (fullName) { - memcpy(fullName, referencePath, referencePathSize); - strcpy(fullName + referencePathSize, name); -@@ -82,6 +87,11 @@ - #endif - libSpec.type = PR_LibSpec_Pathname; - libSpec.value.pathname = fullName; -+ if ((referencePathSize >= 4) && -+ (strncmp(fullName + referencePathSize - 4, "bin", 3) == 0)) { -+ memcpy(fullName + referencePathSize -4, "lib", 3); -+ } -+ strcpy(fullName + referencePathSize, name); - dlh = PR_LoadLibraryWithFlags(libSpec, PR_LD_NOW | PR_LD_LOCAL - #ifdef PR_LD_ALT_SEARCH_PATH - /* allow library's dependencies to be found in the same directory -@@ -89,6 +99,10 @@ - | PR_LD_ALT_SEARCH_PATH - #endif - ); -+ if (! dlh) { -+ strcpy(fullName + referencePathSize, name); -+ dlh = PR_LoadLibraryWithFlags(libSpec, PR_LD_NOW | PR_LD_LOCAL); -+ } - PORT_Free(fullName); - } - } diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 8fb98e28c1c..1d7a4eced0f 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -16927,7 +16927,6 @@ in }; nss = lowPrio (callPackage ../development/libraries/nss { }); - nss_3_44 = lowPrio (callPackage ../development/libraries/nss/3.44.nix { }); nssTools = nss.tools; # required for stable thunderbird and firefox-esr-78 From 829b324e6d4ef7dd88fcbb8289561e243d5de426 Mon Sep 17 00:00:00 2001 From: ajs124 Date: Sat, 15 May 2021 17:58:25 +0200 Subject: [PATCH 233/263] thunderbird-bin-68: drop --- .../mailreaders/thunderbird-bin/68.nix | 184 ------ .../thunderbird-bin/68_sources.nix | 615 ------------------ pkgs/top-level/all-packages.nix | 2 - 3 files changed, 801 deletions(-) delete mode 100644 pkgs/applications/networking/mailreaders/thunderbird-bin/68.nix delete mode 100644 pkgs/applications/networking/mailreaders/thunderbird-bin/68_sources.nix diff --git a/pkgs/applications/networking/mailreaders/thunderbird-bin/68.nix b/pkgs/applications/networking/mailreaders/thunderbird-bin/68.nix deleted file mode 100644 index 83e8984db7b..00000000000 --- a/pkgs/applications/networking/mailreaders/thunderbird-bin/68.nix +++ /dev/null @@ -1,184 +0,0 @@ -# This pakcage is keeped until Thunderbird 78 supports OpenPGP. -# https://www.thunderbird.net/en-US/thunderbird/78.0.1/releasenotes/ -{ lib, stdenv, fetchurl, config, makeWrapper -, alsaLib -, at-spi2-atk -, atk -, cairo -, cups -, curl -, dbus-glib -, dbus -, fontconfig -, freetype -, gdk-pixbuf -, glib -, glibc -, gtk2 -, gtk3 -, libkrb5 -, libX11 -, libXScrnSaver -, libXcomposite -, libXcursor -, libXdamage -, libXext -, libXfixes -, libXi -, libXinerama -, libXrender -, libXt -, libxcb -, libcanberra -, gnome -, libGLU, libGL -, nspr -, nss -, pango -, writeScript -, xidel -, coreutils -, gnused -, gnugrep -, gnupg -, runtimeShell -}: - -# imports `version` and `sources` -with (import ./68_sources.nix); - -let - arch = if stdenv.hostPlatform.system == "i686-linux" - then "linux-i686" - else "linux-x86_64"; - - isPrefixOf = prefix: string: - builtins.substring 0 (builtins.stringLength prefix) string == prefix; - - sourceMatches = locale: source: - (isPrefixOf source.locale locale) && source.arch == arch; - - systemLocale = config.i18n.defaultLocale or "en-US"; - - defaultSource = lib.findFirst (sourceMatches "en-US") {} sources; - - source = lib.findFirst (sourceMatches systemLocale) defaultSource sources; - - name = "thunderbird-bin-${version}"; -in - -stdenv.mkDerivation { - inherit name; - - src = fetchurl { - url = "https://download-installer.cdn.mozilla.net/pub/thunderbird/releases/${version}/${source.arch}/${source.locale}/thunderbird-${version}.tar.bz2"; - inherit (source) sha256; - }; - - phases = "unpackPhase installPhase"; - - libPath = lib.makeLibraryPath - [ stdenv.cc.cc - alsaLib - at-spi2-atk - atk - cairo - cups - curl - dbus-glib - dbus - fontconfig - freetype - gdk-pixbuf - glib - glibc - gtk2 - gtk3 - libkrb5 - libX11 - libXScrnSaver - libXcomposite - libXcursor - libXdamage - libXext - libXfixes - libXi - libXinerama - libXrender - libXt - libxcb - libcanberra - libGLU libGL - nspr - nss - pango - ] + ":" + lib.makeSearchPathOutput "lib" "lib64" [ - stdenv.cc.cc - ]; - - buildInputs = [ gtk3 gnome.adwaita-icon-theme ]; - - nativeBuildInputs = [ makeWrapper ]; - - installPhase = - '' - mkdir -p "$prefix/usr/lib/thunderbird-bin-${version}" - cp -r * "$prefix/usr/lib/thunderbird-bin-${version}" - - mkdir -p "$out/bin" - ln -s "$prefix/usr/lib/thunderbird-bin-${version}/thunderbird" "$out/bin/" - - for executable in \ - thunderbird crashreporter thunderbird-bin plugin-container updater - do - patchelf --interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \ - "$out/usr/lib/thunderbird-bin-${version}/$executable" - done - - find . -executable -type f -exec \ - patchelf --set-rpath "$libPath" \ - "$out/usr/lib/thunderbird-bin-${version}/{}" \; - - # Create a desktop item. - mkdir -p $out/share/applications - cat > $out/share/applications/thunderbird.desktop < Date: Sat, 15 May 2021 18:01:28 +0200 Subject: [PATCH 234/263] thunderbird{,-bin}-68: add aliases --- pkgs/top-level/aliases.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkgs/top-level/aliases.nix b/pkgs/top-level/aliases.nix index b8a804f9aaa..cbff3f6cb8d 100644 --- a/pkgs/top-level/aliases.nix +++ b/pkgs/top-level/aliases.nix @@ -670,6 +670,8 @@ mapAliases ({ rxvt_unicode-with-plugins = rxvt-unicode; # added 2020-02-02 rxvt_unicode = rxvt-unicode-unwrapped; # added 2020-02-02 subversion19 = throw "subversion19 has been removed as it has reached its end of life"; # added 2021-03-31 + thunderbird-68 = throw "Thunderbird 68 reached end of life with its final release 68.12.0 on 2020-08-25 and was therefore removed from nixpkgs"; + thunderbird-bin-68 = throw "Thunderbird 68 reached end of life with its final release 68.12.0 on 2020-08-25 and was therefore removed from nixpkgs"; togglesg-download = throw "togglesg-download was removed 2021-04-30 as it's unmaintained"; urxvt_autocomplete_all_the_things = rxvt-unicode-plugins.autocomplete-all-the-things; # added 2020-02-02 urxvt_perl = rxvt-unicode-plugins.perl; # added 2020-02-02 From 399223fdf7d9815ae107f5046187ee16818727ba Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Sat, 15 May 2021 14:07:14 +0000 Subject: [PATCH 235/263] Revert "lua5_*: tweak linking libraries" This reverts commit 539ad4f81140545b60e0d5aba55d36ef02ebebba. The correct fix here is to fix our addition to the Makefile. --- pkgs/development/interpreters/lua-5/interpreter.nix | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/pkgs/development/interpreters/lua-5/interpreter.nix b/pkgs/development/interpreters/lua-5/interpreter.nix index 4c45a3c6bdd..506f9ca7207 100644 --- a/pkgs/development/interpreters/lua-5/interpreter.nix +++ b/pkgs/development/interpreters/lua-5/interpreter.nix @@ -72,8 +72,6 @@ self = stdenv.mkDerivation rec { ''; inherit postConfigure; - NIX_LDFLAGS = [ "-lm" ] ++ lib.optional (lib.versionOlder luaversion "5.2") "-ldl"; - inherit postBuild; postInstall = '' @@ -95,7 +93,7 @@ self = stdenv.mkDerivation rec { Description: An Extensible Extension Language Version: ${version} Requires: - Libs: -L$out/lib -llua + Libs: -L$out/lib -llua -lm Cflags: -I$out/include EOF ln -s "$out/lib/pkgconfig/lua.pc" "$out/lib/pkgconfig/lua-${luaversion}.pc" From 3f5ecec6133f6dbea729a0febcefe396432ed5d1 Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Sat, 15 May 2021 14:08:33 +0000 Subject: [PATCH 236/263] Revert "staging-next: lua5: fix eval, add lib.so.patch" This reverts commit 537a1940e80dfd2332064823435095f56eb87b32. This patch was deliberately removed in 34f8d7e15a3 ("lua: one dso patch to rule them all"). The correct fix is to remove the reference to it that was reintroduced, rather than re-adding the patch. --- .../interpreters/lua-5/liblua.so.patch | 60 ------------------- 1 file changed, 60 deletions(-) delete mode 100644 pkgs/development/interpreters/lua-5/liblua.so.patch diff --git a/pkgs/development/interpreters/lua-5/liblua.so.patch b/pkgs/development/interpreters/lua-5/liblua.so.patch deleted file mode 100644 index 197832116c1..00000000000 --- a/pkgs/development/interpreters/lua-5/liblua.so.patch +++ /dev/null @@ -1,60 +0,0 @@ -diff --git a/Makefile b/Makefile -index 416f444..eeaff03 100644 ---- a/Makefile -+++ b/Makefile -@@ -52,7 +52,7 @@ R= $V.0 - all: $(PLAT) - - $(PLATS) help test clean: -- @cd src && $(MAKE) $@ -+ @cd src && $(MAKE) $@ V=$(V) R=$(R) - - install: dummy - cd src && $(MKDIR) $(INSTALL_BIN) $(INSTALL_INC) $(INSTALL_LIB) $(INSTALL_MAN) $(INSTALL_LMOD) $(INSTALL_CMOD) -diff --git a/src/Makefile b/src/Makefile -index 514593d..372a6dc 100644 ---- a/src/Makefile -+++ b/src/Makefile -@@ -33,6 +33,7 @@ CMCFLAGS= -Os - PLATS= guess aix bsd c89 freebsd generic linux linux-readline macosx mingw posix solaris - - LUA_A= liblua.a -+LUA_SO= liblua.so - CORE_O= lapi.o lcode.o lctype.o ldebug.o ldo.o ldump.o lfunc.o lgc.o llex.o lmem.o lobject.o lopcodes.o lparser.o lstate.o lstring.o ltable.o ltm.o lundump.o lvm.o lzio.o - LIB_O= lauxlib.o lbaselib.o lcorolib.o ldblib.o liolib.o lmathlib.o loadlib.o loslib.o lstrlib.o ltablib.o lutf8lib.o linit.o - BASE_O= $(CORE_O) $(LIB_O) $(MYOBJS) -@@ -44,7 +45,7 @@ LUAC_T= luac - LUAC_O= luac.o - - ALL_O= $(BASE_O) $(LUA_O) $(LUAC_O) --ALL_T= $(LUA_A) $(LUA_T) $(LUAC_T) -+ALL_T= $(LUA_A) $(LUA_T) $(LUAC_T) $(LUA_SO) - ALL_A= $(LUA_A) - - # Targets start here. -@@ -60,6 +61,12 @@ $(LUA_A): $(BASE_O) - $(AR) $@ $(BASE_O) - $(RANLIB) $@ - -+$(LUA_SO): $(CORE_O) $(LIB_O) -+ $(CC) -shared -ldl -Wl,-soname,$(LUA_SO).$(V) -o $@.$(R) $? -lm $(MYLDFLAGS) -+ ln -sf $(LUA_SO).$(R) $(LUA_SO).$(V) -+ ln -sf $(LUA_SO).$(R) $(LUA_SO) -+ -+ - $(LUA_T): $(LUA_O) $(LUA_A) - $(CC) -o $@ $(LDFLAGS) $(LUA_O) $(LUA_A) $(LIBS) - -diff --git a/src/luaconf.h b/src/luaconf.h -index bdf927e..7e15198 100644 ---- a/src/luaconf.h -+++ b/src/luaconf.h -@@ -227,7 +227,7 @@ - - #else /* }{ */ - --#define LUA_ROOT "/usr/local/" -+#define LUA_ROOT "/usr/" - #define LUA_LDIR LUA_ROOT "share/lua/" LUA_VDIR "/" - #define LUA_CDIR LUA_ROOT "lib/lua/" LUA_VDIR "/" - From 1758c0ac6531a6840ed78769022fd63765d713e1 Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Sat, 15 May 2021 10:34:52 +0000 Subject: [PATCH 237/263] lua5_4: fix eval This patch was removed in 34f8d7e15a3 ("lua: one dso patch to rule them all"), and the reference to it in lua5_4 was removed at the time, but it seems to have found its way back somehow (probably through a merge?). (cherry picked from commit 5b278213a2bcf07c3dc2f71305100bba9010e8f5) --- pkgs/development/interpreters/lua-5/default.nix | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/pkgs/development/interpreters/lua-5/default.nix b/pkgs/development/interpreters/lua-5/default.nix index 3f525e6d6f0..95b593fb5db 100644 --- a/pkgs/development/interpreters/lua-5/default.nix +++ b/pkgs/development/interpreters/lua-5/default.nix @@ -6,11 +6,7 @@ rec { sourceVersion = { major = "5"; minor = "4"; patch = "2"; }; hash = "0ksj5zpj74n0jkamy3di1p6l10v4gjnd2zjnb453qc6px6bhsmqi"; - patches = if stdenv.isDarwin then [ ./5.4.darwin.patch ] else [ - # build lua as a shared library as well, MIT-licensed from - # https://github.com/archlinux/svntogit-packages/tree/packages/lua/trunk - ./liblua.so.patch - ]; + patches = lib.optional stdenv.isDarwin ./5.4.darwin.patch; }; lua5_4_compat = lua5_4.override({ From 665732d8779f7edbbc05f7e2428da4f40abcc3a8 Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Sat, 15 May 2021 14:40:26 +0000 Subject: [PATCH 238/263] lua: fix linkage This fixes a couple of problems: * Lua 5.1 doesn't have SYSLIBS, so wasn't being linked with any libraries. * SYSLIBS doesn't include -lm, so we had to add that manually to pkgconfig. LIBS includes -lm, so we don't need that hack any more. --- pkgs/development/interpreters/lua-5/interpreter.nix | 2 +- pkgs/development/interpreters/lua-5/lua-dso.make | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/interpreters/lua-5/interpreter.nix b/pkgs/development/interpreters/lua-5/interpreter.nix index 506f9ca7207..fd8c47d751b 100644 --- a/pkgs/development/interpreters/lua-5/interpreter.nix +++ b/pkgs/development/interpreters/lua-5/interpreter.nix @@ -93,7 +93,7 @@ self = stdenv.mkDerivation rec { Description: An Extensible Extension Language Version: ${version} Requires: - Libs: -L$out/lib -llua -lm + Libs: -L$out/lib -llua Cflags: -I$out/include EOF ln -s "$out/lib/pkgconfig/lua.pc" "$out/lib/pkgconfig/lua-${luaversion}.pc" diff --git a/pkgs/development/interpreters/lua-5/lua-dso.make b/pkgs/development/interpreters/lua-5/lua-dso.make index 11ac71fd819..19c57685677 100644 --- a/pkgs/development/interpreters/lua-5/lua-dso.make +++ b/pkgs/development/interpreters/lua-5/lua-dso.make @@ -1,4 +1,4 @@ $(LUA_SO): $(CORE_O) $(LIB_O) - $(CC) -shared $(SYSLIBS) -Wl,-soname,$(LUA_SO).$(V) -o $@.$(R) $? $(MYLDFLAGS) + $(CC) -shared $(LIBS) -Wl,-soname,$(LUA_SO).$(V) -o $@.$(R) $? $(MYLDFLAGS) ln -sf $(LUA_SO).$(R) $(LUA_SO).$(V) ln -sf $(LUA_SO).$(R) $(LUA_SO) From e7115b7da455e2bf8214b43621a1a3d7d91e3cc5 Mon Sep 17 00:00:00 2001 From: DavHau Date: Sun, 9 May 2021 19:02:37 +0700 Subject: [PATCH 239/263] python3Packages.flask-appbuilder: unbreak --- .../flask-appbuilder/default.nix | 28 ++++++++++++------- .../python-modules/prison/default.nix | 4 +-- 2 files changed, 20 insertions(+), 12 deletions(-) diff --git a/pkgs/development/python-modules/flask-appbuilder/default.nix b/pkgs/development/python-modules/flask-appbuilder/default.nix index 6e98f6e80ac..e2c077162b1 100644 --- a/pkgs/development/python-modules/flask-appbuilder/default.nix +++ b/pkgs/development/python-modules/flask-appbuilder/default.nix @@ -6,6 +6,7 @@ , colorama , click , email_validator +, fetchpatch , flask , flask-babel , flask_login @@ -20,21 +21,27 @@ , python-dateutil , prison , pyjwt +, pyyaml , sqlalchemy-utils }: buildPythonPackage rec { pname = "flask-appbuilder"; - version = "3.1.1"; + version = "3.2.3"; src = fetchPypi { pname = "Flask-AppBuilder"; inherit version; - sha256 = "076b020b0ba125339a2e710e74eab52648cde2b18599f7cb0fa1eada9bbb648c"; + sha256 = "sha256-+ZYrn2LnVORyYsnZtsH3JX+4XbGgAZZ/Eh6O5gUP+y4="; }; - checkInputs = [ - nose + patches = [ + (fetchpatch { + name = "flask_jwt_extended-and-pyjwt-patch"; + url = "https://github.com/dpgaspar/Flask-AppBuilder/commit/7097a7b133f27c78d2b54d2a46e4a4c24478a066.patch"; + sha256 = "sha256-ZpY8+2Hoz3z01GVtw2OIbQcsmAwa7iwilFWzgcGhY1w="; + includes = [ "flask_appbuilder/security/manager.py" "setup.py" ]; + }) ]; propagatedBuildInputs = [ @@ -56,22 +63,23 @@ buildPythonPackage rec { python-dateutil prison pyjwt + pyyaml sqlalchemy-utils ]; postPatch = '' substituteInPlace setup.py \ - --replace "apispec[yaml]>=3.3, <4" "apispec" \ - --replace "Flask-Login>=0.3, <0.5" "Flask-Login" \ - --replace "Flask-Babel>=1, <2" "Flask-Babel" \ - --replace "marshmallow-sqlalchemy>=0.22.0, <0.24.0" "marshmallow-sqlalchemy" \ - --replace "prison>=0.1.3, <1.0.0" "prison" + --replace "apispec[yaml]>=3.3, <4" "apispec[yaml] >=3.3, <5" \ + --replace "Flask-Login>=0.3, <0.5" "Flask-Login >=0.3, <0.6" \ + --replace "Flask-Babel>=1, <2" "Flask-Babel >=1, <3" \ + --replace "marshmallow-sqlalchemy>=0.22.0, <0.24.0" "marshmallow-sqlalchemy >=0.22.0, <0.25.0" ''; - # majority of tests require network access or mongo doCheck = false; + pythonImportsCheck = [ "flask_appbuilder" ]; + meta = with lib; { description = "Simple and rapid application development framework, built on top of Flask"; homepage = "https://github.com/dpgaspar/flask-appbuilder/"; diff --git a/pkgs/development/python-modules/prison/default.nix b/pkgs/development/python-modules/prison/default.nix index 941da2bf9af..95a79ea1896 100644 --- a/pkgs/development/python-modules/prison/default.nix +++ b/pkgs/development/python-modules/prison/default.nix @@ -7,13 +7,13 @@ buildPythonPackage rec { pname = "prison"; - version = "0.1.2"; + version = "0.1.3"; src = fetchFromGitHub { owner = "betodealmeida"; repo = "python-rison"; rev = version; - sha256 = "14vb468iznf9416z993bbqihywp9ibyslw5vp67wfr200zyxjwak"; + sha256 = "sha256-qor40vUQeTdlO3vwug3GGNX5vkNaF0H7EWlRdsY4bvc="; }; propagatedBuildInputs = [ From c4c147cd15ae61313a134cf9de311bece0555c26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20K=C3=B6gler?= Date: Sat, 15 May 2021 23:37:45 +0200 Subject: [PATCH 240/263] gonic: Fix build error Add missing zlib ZHF: #122042 --- pkgs/servers/gonic/default.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkgs/servers/gonic/default.nix b/pkgs/servers/gonic/default.nix index b807a1ff757..4be2bdfb5b8 100644 --- a/pkgs/servers/gonic/default.nix +++ b/pkgs/servers/gonic/default.nix @@ -1,5 +1,6 @@ { lib, buildGoModule, fetchFromGitHub , pkg-config, taglib, alsaLib +, zlib # Disable on-the-fly transcoding, # removing the dependency on ffmpeg. @@ -20,7 +21,7 @@ buildGoModule rec { }; nativeBuildInputs = [ pkg-config ]; - buildInputs = [ taglib alsaLib ]; + buildInputs = [ taglib alsaLib zlib ]; vendorSha256 = "0inxlqxnkglz4j14jav8080718a80nqdcl866lkql8r6zcxb4fm9"; # TODO(Profpatsch): write a test for transcoding support, From 8f64c5d9fcce5981b8ea2a861566e382ddbc9731 Mon Sep 17 00:00:00 2001 From: Zane van Iperen Date: Sun, 16 May 2021 08:05:03 +1000 Subject: [PATCH 241/263] ffmpeg_4: fix build error on darwin See https://trac.ffmpeg.org/ticket/9242 --- pkgs/development/libraries/ffmpeg/4.nix | 3 ++ ...toolboxenc-define-TARGET_CPU_ARM64-t.patch | 35 +++++++++++++++++++ 2 files changed, 38 insertions(+) create mode 100644 pkgs/development/libraries/ffmpeg/v2-0001-avcodec-videotoolboxenc-define-TARGET_CPU_ARM64-t.patch diff --git a/pkgs/development/libraries/ffmpeg/4.nix b/pkgs/development/libraries/ffmpeg/4.nix index c765cdf73c5..3a1b1c489c0 100644 --- a/pkgs/development/libraries/ffmpeg/4.nix +++ b/pkgs/development/libraries/ffmpeg/4.nix @@ -9,4 +9,7 @@ callPackage ./generic.nix (rec { branch = "4.4"; sha256 = "03kxc29y8190k4y8s8qdpsghlbpmchv1m8iqygq2qn0vfm4ka2a2"; darwinFrameworks = [ Cocoa CoreMedia VideoToolbox ]; + + /* Work around https://trac.ffmpeg.org/ticket/9242 */ + patches = [ ./v2-0001-avcodec-videotoolboxenc-define-TARGET_CPU_ARM64-t.patch ]; } // args) diff --git a/pkgs/development/libraries/ffmpeg/v2-0001-avcodec-videotoolboxenc-define-TARGET_CPU_ARM64-t.patch b/pkgs/development/libraries/ffmpeg/v2-0001-avcodec-videotoolboxenc-define-TARGET_CPU_ARM64-t.patch new file mode 100644 index 00000000000..c0c2c1fb23b --- /dev/null +++ b/pkgs/development/libraries/ffmpeg/v2-0001-avcodec-videotoolboxenc-define-TARGET_CPU_ARM64-t.patch @@ -0,0 +1,35 @@ +From 5b562aaddbc6e7a94a079c2e88230b205a7f4d73 Mon Sep 17 00:00:00 2001 +From: Zane van Iperen +Date: Sat, 15 May 2021 19:33:52 +1000 +Subject: [PATCH v2] avcodec/videotoolboxenc: #define TARGET_CPU_ARM64 to 0 if + not provided by the SDK + +Fixes build failure on older SDKs without it. + +Fixes #9242 + +Signed-off-by: Zane van Iperen +--- + libavcodec/videotoolboxenc.c | 4 ++++ + 1 file changed, 4 insertions(+) + +NB: This is untested, I do not have a Mac to try it on. + +diff --git a/libavcodec/videotoolboxenc.c b/libavcodec/videotoolboxenc.c +index 58239e0ab9..f063a86e73 100644 +--- a/libavcodec/videotoolboxenc.c ++++ b/libavcodec/videotoolboxenc.c +@@ -50,6 +50,10 @@ enum { kCVPixelFormatType_420YpCbCr10BiPlanarFullRange = 'xf20' }; + enum { kCVPixelFormatType_420YpCbCr10BiPlanarVideoRange = 'x420' }; + #endif + ++#ifndef TARGET_CPU_ARM64 ++# define TARGET_CPU_ARM64 0 ++#endif ++ + typedef OSStatus (*getParameterSetAtIndex)(CMFormatDescriptionRef videoDesc, + size_t parameterSetIndex, + const uint8_t **parameterSetPointerOut, +-- +2.29.3 + From d5d750fa540b2a9d9a8354d7652faf7aacbd7511 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20K=C3=B6gler?= Date: Sun, 16 May 2021 00:07:50 +0200 Subject: [PATCH 242/263] vdr: 2.4.6 -> 2.4.7 --- pkgs/applications/video/vdr/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/applications/video/vdr/default.nix b/pkgs/applications/video/vdr/default.nix index eeb61624409..bfb9fb6a17a 100644 --- a/pkgs/applications/video/vdr/default.nix +++ b/pkgs/applications/video/vdr/default.nix @@ -5,12 +5,12 @@ }: stdenv.mkDerivation rec { pname = "vdr"; - version = "2.4.6"; + version = "2.4.7"; src = fetchgit { url = "git://git.tvdr.de/vdr.git"; - rev = "V20406"; - sha256 = "sha256-te9lMmnWpesv+np2gJUDL17pI0WyVxhUnoBsFSRtOco="; + rev = version; + sha256 = "sha256-hDJ/DemWuLddDvXGqxkSTIqATlWUjolcP7ojjhK2CDk="; }; enableParallelBuilding = true; From 5b31dece4dd545cb49701a08551f76eca00608ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Romildo?= Date: Sat, 15 May 2021 19:19:06 -0300 Subject: [PATCH 243/263] marwaita: 9.1 -> 9.2.1 --- pkgs/data/themes/marwaita/default.nix | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pkgs/data/themes/marwaita/default.nix b/pkgs/data/themes/marwaita/default.nix index d06d9be9aa9..5eeab879743 100644 --- a/pkgs/data/themes/marwaita/default.nix +++ b/pkgs/data/themes/marwaita/default.nix @@ -1,4 +1,5 @@ -{ lib, stdenv +{ lib +, stdenv , fetchFromGitHub , gdk-pixbuf , gtk-engine-murrine @@ -8,13 +9,13 @@ stdenv.mkDerivation rec { pname = "marwaita"; - version = "9.1"; + version = "9.2.1"; src = fetchFromGitHub { owner = "darkomarko42"; repo = pname; rev = version; - sha256 = "0974pfcdbhajxvd6fnp2kix963s28n2il9w879h5zm1f6ayglsfz"; + sha256 = "08392ybpxnbq3wswa7bvz8nnxryjg9aczvw3arnhfvmbigwq5q0s"; }; buildInputs = [ From 61d8677ddfadc5bd6f039eadd4071c9990e6818b Mon Sep 17 00:00:00 2001 From: Bernardo Meurer Date: Sat, 15 May 2021 17:57:38 -0700 Subject: [PATCH 244/263] corectrl: 1.1.2 -> 1.1.3 --- pkgs/applications/misc/corectrl/default.nix | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/pkgs/applications/misc/corectrl/default.nix b/pkgs/applications/misc/corectrl/default.nix index 5245d559d44..32ca4b0e06c 100644 --- a/pkgs/applications/misc/corectrl/default.nix +++ b/pkgs/applications/misc/corectrl/default.nix @@ -5,6 +5,7 @@ , karchive , kauth , libdrm +, hwdata , mesa-demos , procps , util-linux @@ -20,13 +21,13 @@ stdenv.mkDerivation rec{ pname = "corectrl"; - version = "1.1.2"; + version = "1.1.3"; src = fetchFromGitLab { owner = "corectrl"; repo = "corectrl"; rev = "v${version}"; - sha256 = "sha256-hKYZkKQOvNu2qDSOq1cjoiLwwOvEqdJfqGG5p3Vhkhs="; + sha256 = "sha256-xRyc7FYzG8MnhQ8DjIUHYLeUZCZQdi4j1v1fG7F0+G8="; }; nativeBuildInputs = [ @@ -50,7 +51,9 @@ stdenv.mkDerivation rec{ qtxmlpatterns ]; - runtimeDeps = [ mesa-demos vulkan-tools ]; + cmakeFlags = [ "-DWITH_PCI_IDS_PATH=${hwdata}/share/hwdata/pci.ids" ]; + + runtimeDeps = [ hwdata mesa-demos vulkan-tools ]; binPath = lib.makeBinPath runtimeDeps; dontWrapQtApps = true; From 8749ba1165c5cece22badf21a599793c23d46d91 Mon Sep 17 00:00:00 2001 From: "R. RyanTM" Date: Sun, 16 May 2021 03:26:38 +0000 Subject: [PATCH 245/263] findomain: 4.2.0 -> 4.2.1 --- pkgs/tools/networking/findomain/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/tools/networking/findomain/default.nix b/pkgs/tools/networking/findomain/default.nix index ddcb8579318..cdea68e5698 100644 --- a/pkgs/tools/networking/findomain/default.nix +++ b/pkgs/tools/networking/findomain/default.nix @@ -10,16 +10,16 @@ rustPlatform.buildRustPackage rec { pname = "findomain"; - version = "4.2.0"; + version = "4.2.1"; src = fetchFromGitHub { owner = "Edu4rdSHL"; repo = pname; rev = version; - sha256 = "sha256-bNvgENyBa+BOY7QVPbBGKFKqYd9JNek+fyPnCT9+PUs="; + sha256 = "sha256-yVjxwgReZhdArTXr1rUsU+pKIlxCVVf3NfR0znqzfxA="; }; - cargoSha256 = "sha256-FDiIM1LlWEFmiIvebdCsznkB7egspNKhY6xUXB838g8="; + cargoSha256 = "sha256-t1/BQD8ostyMJh/HoZ7n3bKw5LfDZQeq03AO7JY0G8E="; nativeBuildInputs = [ installShellFiles perl ]; buildInputs = lib.optionals stdenv.isDarwin [ libiconv Security ]; From 201e1a4fb870c8b904c078f3e22790b0d873adc3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20K=C3=B6gler?= Date: Sun, 16 May 2021 08:17:25 +0200 Subject: [PATCH 246/263] vdr: Update license --- pkgs/applications/video/vdr/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/applications/video/vdr/default.nix b/pkgs/applications/video/vdr/default.nix index bfb9fb6a17a..265ef82528d 100644 --- a/pkgs/applications/video/vdr/default.nix +++ b/pkgs/applications/video/vdr/default.nix @@ -51,6 +51,6 @@ description = "Video Disc Recorder"; maintainers = [ maintainers.ck3d ]; platforms = [ "i686-linux" "x86_64-linux" ]; - license = licenses.gpl2; + license = licenses.gpl2Plus; }; } From 3e43d42f87388db13783701993e96f115501cd27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20=C4=8Cun=C3=A1t?= Date: Sun, 16 May 2021 09:31:27 +0200 Subject: [PATCH 247/263] ffmpeg_4: only apply the patch on darwin It's not a big deal, but why rebuild the linux dependencies now. --- pkgs/development/libraries/ffmpeg/4.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkgs/development/libraries/ffmpeg/4.nix b/pkgs/development/libraries/ffmpeg/4.nix index 3a1b1c489c0..df3d0732393 100644 --- a/pkgs/development/libraries/ffmpeg/4.nix +++ b/pkgs/development/libraries/ffmpeg/4.nix @@ -1,6 +1,7 @@ { callPackage # Darwin frameworks , Cocoa, CoreMedia, VideoToolbox +, stdenv, lib , ... }@args: @@ -11,5 +12,6 @@ callPackage ./generic.nix (rec { darwinFrameworks = [ Cocoa CoreMedia VideoToolbox ]; /* Work around https://trac.ffmpeg.org/ticket/9242 */ - patches = [ ./v2-0001-avcodec-videotoolboxenc-define-TARGET_CPU_ARM64-t.patch ]; + patches = lib.optional stdenv.isDarwin + ./v2-0001-avcodec-videotoolboxenc-define-TARGET_CPU_ARM64-t.patch; } // args) From 11ac26ba22948f0a076afa811eb33d0223e7c586 Mon Sep 17 00:00:00 2001 From: "R. RyanTM" Date: Sun, 16 May 2021 07:33:05 +0000 Subject: [PATCH 248/263] bctoolbox: 4.5.7 -> 4.5.15 --- pkgs/development/libraries/bctoolbox/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/libraries/bctoolbox/default.nix b/pkgs/development/libraries/bctoolbox/default.nix index 1d8f35cd01c..c482b55c60b 100644 --- a/pkgs/development/libraries/bctoolbox/default.nix +++ b/pkgs/development/libraries/bctoolbox/default.nix @@ -7,7 +7,7 @@ stdenv.mkDerivation rec { pname = "bctoolbox"; - version = "4.5.7"; + version = "4.5.15"; nativeBuildInputs = [ cmake bcunit ]; buildInputs = [ mbedtls ]; @@ -18,7 +18,7 @@ stdenv.mkDerivation rec { group = "BC"; repo = pname; rev = version; - sha256 = "sha256-JQ2HgFVqgO+LLXmN95ZTHyT+htCFUC3VRreKLwPYo9Y="; + sha256 = "sha256-yN9dfeJBuUxXfG7zDoawn2nKGsrhetBcXpGDmcekU20="; }; # Do not build static libraries From 9018f5eb0148cc500e786906d8109e2cafe30878 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20=C4=8Cun=C3=A1t?= Date: Sun, 16 May 2021 10:46:09 +0200 Subject: [PATCH 249/263] dasher: enableParallelBuilding = true I'm a bit impatient :-) and this seems to build without issues, even on an idle 32-threaded machine. --- pkgs/applications/accessibility/dasher/default.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkgs/applications/accessibility/dasher/default.nix b/pkgs/applications/accessibility/dasher/default.nix index 6f2a185b309..328ff2c5c57 100644 --- a/pkgs/applications/accessibility/dasher/default.nix +++ b/pkgs/applications/accessibility/dasher/default.nix @@ -58,6 +58,8 @@ stdenv.mkDerivation { dbus ] ++ lib.optional speechSupport speechd; + enableParallelBuilding = true; + meta = { homepage = "https://www.inference.org.uk/dasher/"; description = "Information-efficient text-entry interface, driven by natural continuous pointing gestures"; From 02b121bf85433d7501ee99a44e6a558998091f84 Mon Sep 17 00:00:00 2001 From: 06kellyjac Date: Sun, 16 May 2021 10:38:36 +0100 Subject: [PATCH 250/263] minio: fix license change Update from #123130 has moved from Apache 2.0 to AGPLv3 --- pkgs/servers/minio/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/servers/minio/default.nix b/pkgs/servers/minio/default.nix index ae27fe751de..47a790bd197 100644 --- a/pkgs/servers/minio/default.nix +++ b/pkgs/servers/minio/default.nix @@ -51,6 +51,6 @@ buildGoModule rec { description = "An S3-compatible object storage server"; maintainers = with maintainers; [ eelco bachp ]; platforms = platforms.unix; - license = licenses.asl20; + license = licenses.agpl3Plus; }; } From acec233fcdca924e87e669ef548f7d0c24bd3ede Mon Sep 17 00:00:00 2001 From: 06kellyjac Date: Sun, 16 May 2021 10:42:06 +0100 Subject: [PATCH 251/263] minio: set version variables with ldflags Set version variables with ldflags rather than sed in a postPatch phase Also means that CGO_ENABLED and -tags=kqueue can be set in the same place Add changelog --- pkgs/servers/minio/default.nix | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/pkgs/servers/minio/default.nix b/pkgs/servers/minio/default.nix index 47a790bd197..2534322befd 100644 --- a/pkgs/servers/minio/default.nix +++ b/pkgs/servers/minio/default.nix @@ -30,25 +30,18 @@ buildGoModule rec { subPackages = [ "." ]; - postPatch = '' - sed -i "s/Version.*/Version = \"${versionToTimestamp version}\"/g" cmd/build-constants.go - sed -i "s/ReleaseTag.*/ReleaseTag = \"RELEASE.${version}\"/g" cmd/build-constants.go - sed -i "s/CommitID.*/CommitID = \"${src.rev}\"/g" cmd/build-constants.go - ''; - - postConfigure = '' - export CGO_ENABLED=0 - ''; - - buildFlagsArray = [ - "-tags=kqueue" - ]; + preBuild = let t = "github.com/minio/minio/cmd"; in + '' + export CGO_ENABLED=0 + buildFlagsArray+=("-tags" "kqueue" "-ldflags" "-s -w -X ${t}.Version=${versionToTimestamp version} -X ${t}.ReleaseTag=RELEASE.${version} -X ${t}.CommitID=${src.rev}") + ''; passthru.tests.minio = nixosTests.minio; meta = with lib; { homepage = "https://www.minio.io/"; description = "An S3-compatible object storage server"; + changelog = "https://github.com/minio/minio/releases/tag/RELEASE.${version}"; maintainers = with maintainers; [ eelco bachp ]; platforms = platforms.unix; license = licenses.agpl3Plus; From 3fbdcefe1d133f9a1d8a870bbd79eacb6ca6dc05 Mon Sep 17 00:00:00 2001 From: 06kellyjac Date: Sun, 16 May 2021 10:58:07 +0100 Subject: [PATCH 252/263] minio: 2021-05-11T23-27-41Z -> 2021-05-16T05-32-34Z --- pkgs/servers/minio/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/servers/minio/default.nix b/pkgs/servers/minio/default.nix index 2534322befd..d244abf2e68 100644 --- a/pkgs/servers/minio/default.nix +++ b/pkgs/servers/minio/default.nix @@ -15,16 +15,16 @@ let in buildGoModule rec { pname = "minio"; - version = "2021-05-11T23-27-41Z"; + version = "2021-05-16T05-32-34Z"; src = fetchFromGitHub { owner = "minio"; repo = "minio"; rev = "RELEASE.${version}"; - sha256 = "0yljq4lm9maz73ha9m38ljv977999p57rfkzybgzbjjrijgszm2b"; + sha256 = "sha256-+zanqJMYNg/1c20cMm+bqVsW8VquucxEK5NiFAqOmS0="; }; - vendorSha256 = "1dm8nbg86zvxakc7h4dafqb035sc5x6viz8p409l22l695qrp6bi"; + vendorSha256 = "sha256-5aDD68nugFyWsySLEj7LXAdtFXFKWnqfz+5zF5wC2qw="; doCheck = false; From 7a1fbc38a4b538450ac0d42aec8a3e513b4d723e Mon Sep 17 00:00:00 2001 From: Louis Tim Larsen Date: Sat, 15 May 2021 10:52:05 +0200 Subject: [PATCH 253/263] hdhomerun-config-gui: 20200907 -> 20210224 --- pkgs/applications/video/hdhomerun-config-gui/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/applications/video/hdhomerun-config-gui/default.nix b/pkgs/applications/video/hdhomerun-config-gui/default.nix index b44da238d1e..62726dff411 100644 --- a/pkgs/applications/video/hdhomerun-config-gui/default.nix +++ b/pkgs/applications/video/hdhomerun-config-gui/default.nix @@ -1,12 +1,12 @@ -{ lib, stdenv, fetchurl, libhdhomerun, gcc, gnumake, pkg-config, gtk2 }: +{ lib, stdenv, fetchurl, libhdhomerun, pkg-config, gtk2 }: stdenv.mkDerivation rec { pname = "hdhomerun-config-gui"; - version = "20200907"; + version = "20210224"; src = fetchurl { url = "https://download.silicondust.com/hdhomerun/hdhomerun_config_gui_${version}.tgz"; - sha256 = "17zf0hzw68b0xdkh1maqhl96jb7171mbhd29y64as29nps9x4fmz"; + sha256 = "sha256-vzrSk742Ca2I8Uk0uGo44SxpEoVY1QBn62Ahwz8E7p8="; }; nativeBuildInputs = [ pkg-config ]; From 4ef47f32d7a16b62682460e4330ac2863ef05712 Mon Sep 17 00:00:00 2001 From: Vincenzo Mantova Date: Sun, 16 May 2021 11:41:49 +0100 Subject: [PATCH 254/263] eukleides: use $CC instead of hardcoded gcc --- pkgs/applications/science/math/eukleides/default.nix | 5 ++++- pkgs/applications/science/math/eukleides/use-CC.patch | 11 +++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 pkgs/applications/science/math/eukleides/use-CC.patch diff --git a/pkgs/applications/science/math/eukleides/default.nix b/pkgs/applications/science/math/eukleides/default.nix index fe498fdbd8a..b5a9fc3fa86 100644 --- a/pkgs/applications/science/math/eukleides/default.nix +++ b/pkgs/applications/science/math/eukleides/default.nix @@ -9,6 +9,9 @@ lib.fix (eukleides: stdenv.mkDerivation rec { sha256 = "0s8cyh75hdj89v6kpm3z24i48yzpkr8qf0cwxbs9ijxj1i38ki0q"; }; + # use $CC instead of hardcoded gcc + patches = [ ./use-CC.patch ]; + nativeBuildInputs = [ bison flex texinfo makeWrapper ]; buildInputs = [ readline texLive ]; @@ -59,7 +62,7 @@ lib.fix (eukleides: stdenv.mkDerivation rec { circles and conics. ''; - platforms = lib.platforms.linux; + platforms = lib.platforms.unix; maintainers = [ lib.maintainers.peti ]; }; }) diff --git a/pkgs/applications/science/math/eukleides/use-CC.patch b/pkgs/applications/science/math/eukleides/use-CC.patch new file mode 100644 index 00000000000..08bd71ec9dc --- /dev/null +++ b/pkgs/applications/science/math/eukleides/use-CC.patch @@ -0,0 +1,11 @@ +--- a/build/Makefile ++++ b/build/Makefile +@@ -11,7 +11,7 @@ LEX = flex + LFLAGS = -8 + YACC = bison + YFLAGS = -d +-CC = gcc ++CC ?= gcc + IFLAGS = -I$(COMMON_DIR) -I$(MAIN_DIR) -I$(BUILD_DIR) + ifneq ($(strip $(LOCALES)),) + MOFLAGS = -DMO_DIR=\"$(MO_DIR)\" From a5092257c4420c8ee026392f6e41764307163b8f Mon Sep 17 00:00:00 2001 From: superherointj <5861043+superherointj@users.noreply.github.com> Date: Sun, 16 May 2021 08:24:36 -0300 Subject: [PATCH 255/263] top-level: refactor for editorconfig-checker all-packages --- pkgs/top-level/all-packages.nix | 294 ++++++++++++++++---------------- 1 file changed, 146 insertions(+), 148 deletions(-) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index ada07a74304..23da13099c3 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -457,60 +457,60 @@ in # `fetchurl' downloads a file from the network. fetchurl = if stdenv.buildPlatform != stdenv.hostPlatform - then buildPackages.fetchurl # No need to do special overrides twice, - else makeOverridable (import ../build-support/fetchurl) { - inherit lib stdenvNoCC buildPackages; - inherit cacert; - curl = buildPackages.curlMinimal.override (old: rec { - # break dependency cycles - fetchurl = stdenv.fetchurlBoot; - zlib = buildPackages.zlib.override { fetchurl = stdenv.fetchurlBoot; }; - pkg-config = buildPackages.pkg-config.override (old: { - pkg-config = old.pkg-config.override { - fetchurl = stdenv.fetchurlBoot; - }; - }); - perl = buildPackages.perl.override { fetchurl = stdenv.fetchurlBoot; }; - openssl = buildPackages.openssl.override { + then buildPackages.fetchurl # No need to do special overrides twice, + else makeOverridable (import ../build-support/fetchurl) { + inherit lib stdenvNoCC buildPackages; + inherit cacert; + curl = buildPackages.curlMinimal.override (old: rec { + # break dependency cycles fetchurl = stdenv.fetchurlBoot; - buildPackages = { - coreutils = buildPackages.coreutils.override { + zlib = buildPackages.zlib.override { fetchurl = stdenv.fetchurlBoot; }; + pkg-config = buildPackages.pkg-config.override (old: { + pkg-config = old.pkg-config.override { fetchurl = stdenv.fetchurlBoot; + }; + }); + perl = buildPackages.perl.override { fetchurl = stdenv.fetchurlBoot; }; + openssl = buildPackages.openssl.override { + fetchurl = stdenv.fetchurlBoot; + buildPackages = { + coreutils = buildPackages.coreutils.override { + fetchurl = stdenv.fetchurlBoot; + inherit perl; + xz = buildPackages.xz.override { fetchurl = stdenv.fetchurlBoot; }; + gmp = null; + aclSupport = false; + attrSupport = false; + }; inherit perl; - xz = buildPackages.xz.override { fetchurl = stdenv.fetchurlBoot; }; - gmp = null; - aclSupport = false; - attrSupport = false; }; inherit perl; }; - inherit perl; - }; - libssh2 = buildPackages.libssh2.override { - fetchurl = stdenv.fetchurlBoot; - inherit zlib openssl; - }; - # On darwin, libkrb5 needs bootstrap_cmds which would require - # converting many packages to fetchurl_boot to avoid evaluation cycles. - # So turn gssSupport off there, and on Windows. - # On other platforms, keep the previous value. - gssSupport = - if stdenv.isDarwin || stdenv.hostPlatform.isWindows - then false - else old.gssSupport or true; # `? true` is the default - libkrb5 = buildPackages.libkrb5.override { - fetchurl = stdenv.fetchurlBoot; - inherit pkg-config perl openssl; - keyutils = buildPackages.keyutils.override { fetchurl = stdenv.fetchurlBoot; }; - }; - nghttp2 = buildPackages.nghttp2.override { - fetchurl = stdenv.fetchurlBoot; - inherit zlib pkg-config openssl; - c-ares = buildPackages.c-ares.override { fetchurl = stdenv.fetchurlBoot; }; - libev = buildPackages.libev.override { fetchurl = stdenv.fetchurlBoot; }; - }; - }); - }; + libssh2 = buildPackages.libssh2.override { + fetchurl = stdenv.fetchurlBoot; + inherit zlib openssl; + }; + # On darwin, libkrb5 needs bootstrap_cmds which would require + # converting many packages to fetchurl_boot to avoid evaluation cycles. + # So turn gssSupport off there, and on Windows. + # On other platforms, keep the previous value. + gssSupport = + if stdenv.isDarwin || stdenv.hostPlatform.isWindows + then false + else old.gssSupport or true; # `? true` is the default + libkrb5 = buildPackages.libkrb5.override { + fetchurl = stdenv.fetchurlBoot; + inherit pkg-config perl openssl; + keyutils = buildPackages.keyutils.override { fetchurl = stdenv.fetchurlBoot; }; + }; + nghttp2 = buildPackages.nghttp2.override { + fetchurl = stdenv.fetchurlBoot; + inherit zlib pkg-config openssl; + c-ares = buildPackages.c-ares.override { fetchurl = stdenv.fetchurlBoot; }; + libev = buildPackages.libev.override { fetchurl = stdenv.fetchurlBoot; }; + }; + }); + }; fetchRepoProject = callPackage ../build-support/fetchrepoproject { }; @@ -1470,7 +1470,7 @@ in grc = python3Packages.callPackage ../tools/misc/grc { }; green-pdfviewer = callPackage ../applications/misc/green-pdfviewer { - SDL = SDL_sixel; + SDL = SDL_sixel; }; gremlin-console = callPackage ../applications/misc/gremlin-console { @@ -4233,7 +4233,7 @@ in wallutils = callPackage ../tools/graphics/wallutils { }; wrangler = callPackage ../development/tools/wrangler { - inherit (darwin.apple_sdk.frameworks) CoreFoundation CoreServices Security; + inherit (darwin.apple_sdk.frameworks) CoreFoundation CoreServices Security; }; wsl-open = callPackage ../tools/misc/wsl-open { }; @@ -5145,10 +5145,9 @@ in gnu-pw-mgr = callPackage ../tools/security/gnu-pw-mgr { }; - gnused = if !stdenv.hostPlatform.isWindows then - callPackage ../tools/text/gnused { } # broken on Windows - else - gnused_422; + gnused = if !stdenv.hostPlatform.isWindows + then callPackage ../tools/text/gnused { } # broken on Windows + else gnused_422; # This is an easy work-around for [:space:] problems. gnused_422 = callPackage ../tools/text/gnused/422.nix { }; @@ -10451,8 +10450,8 @@ in crossLibcStdenv = overrideCC stdenv (if stdenv.hostPlatform.useLLVM or false - then buildPackages.llvmPackages_8.lldClangNoLibc - else buildPackages.gccCrossStageStatic); + then buildPackages.llvmPackages_8.lldClangNoLibc + else buildPackages.gccCrossStageStatic); # The GCC used to build libc for the target platform. Normal gccs will be # built with, and use, that cross-compiled libc. @@ -11274,15 +11273,15 @@ in mint = callPackage ../development/compilers/mint { }; mitscheme = callPackage ../development/compilers/mit-scheme { - texLive = texlive.combine { inherit (texlive) scheme-small; }; - texinfo = texinfo5; - xlibsWrapper = null; + texLive = texlive.combine { inherit (texlive) scheme-small; }; + texinfo = texinfo5; + xlibsWrapper = null; }; mitschemeX11 = mitscheme.override { - texLive = texlive.combine { inherit (texlive) scheme-small; }; - texinfo = texinfo5; - enableX11 = true; + texLive = texlive.combine { inherit (texlive) scheme-small; }; + texinfo = texinfo5; + enableX11 = true; }; miranda = callPackage ../development/compilers/miranda {}; @@ -12916,7 +12915,7 @@ in # }; # distccWrapper = makeOverridable ({ extraConfig ? "" }: - wrapCC (distcc.links extraConfig)) {}; + wrapCC (distcc.links extraConfig)) {}; distccStdenv = lowPrio (overrideCC stdenv buildPackages.distccWrapper); distccMasquerade = if stdenv.isDarwin @@ -16062,8 +16061,8 @@ in libiconv = if lib.elem stdenv.hostPlatform.libc ["glibc" "musl" "wasilibc"] then glibcIconv (if stdenv.hostPlatform != stdenv.buildPlatform - then libcCross - else stdenv.cc.libc) + then libcCross + else stdenv.cc.libc) else if stdenv.hostPlatform.isDarwin then darwin.libiconv else libiconvReal; @@ -17520,13 +17519,13 @@ in s2geometry = callPackage ../development/libraries/s2geometry { }; - /* This package references ghc844, which we no longer have. Unfortunately, I - have been unable to mark it as "broken" in a way that the ofBorg bot - recognizes. Since I don't want to merge code into master that generates - evaluation errors, I have no other idea but to comment it out entirely. + /* This package references ghc844, which we no longer have. Unfortunately, I + have been unable to mark it as "broken" in a way that the ofBorg bot + recognizes. Since I don't want to merge code into master that generates + evaluation errors, I have no other idea but to comment it out entirely. sad = callPackage ../applications/science/logic/sad { }; - */ + */ safefile = callPackage ../development/libraries/safefile {}; @@ -20253,11 +20252,11 @@ in ]; }; - /* Linux kernel modules are inherently tied to a specific kernel. So - rather than provide specific instances of those packages for a - specific kernel, we have a function that builds those packages - for a specific kernel. This function can then be called for - whatever kernel you're using. */ + /* Linux kernel modules are inherently tied to a specific kernel. So + rather than provide specific instances of those packages for a + specific kernel, we have a function that builds those packages + for a specific kernel. This function can then be called for + whatever kernel you're using. */ linuxPackagesFor = kernel_: lib.makeExtensible (self: with self; { callPackage = newScope self; @@ -20397,9 +20396,8 @@ in mxu11x0 = callPackage ../os-specific/linux/mxu11x0 { }; - /* compiles but has to be integrated into the kernel somehow - Let's have it uncommented and finish it.. - */ + # compiles but has to be integrated into the kernel somehow + # Let's have it uncommented and finish it.. ndiswrapper = callPackage ../os-specific/linux/ndiswrapper { }; netatop = callPackage ../os-specific/linux/netatop { }; @@ -20458,13 +20456,12 @@ in zenpower = callPackage ../os-specific/linux/zenpower { }; inherit (callPackages ../os-specific/linux/zfs { - configFile = "kernel"; - inherit kernel; - }) zfsStable zfsUnstable; + configFile = "kernel"; + inherit kernel; + }) zfsStable zfsUnstable; + zfs = zfsStable; - zfs = zfsStable; - - can-isotp = callPackage ../os-specific/linux/can-isotp { }; + can-isotp = callPackage ../os-specific/linux/can-isotp { }; }); # The current default kernel / kernel modules. @@ -20709,8 +20706,9 @@ in inherit (darwin.apple_sdk.frameworks) AppKit Security; }; - nettools = if stdenv.isLinux then callPackage ../os-specific/linux/net-tools { } - else unixtools.nettools; + nettools = if stdenv.isLinux + then callPackage ../os-specific/linux/net-tools { } + else unixtools.nettools; nettools_mptcp = callPackage ../os-specific/linux/net-tools/mptcp.nix { }; @@ -20909,8 +20907,9 @@ in prayer = callPackage ../servers/prayer { }; - procps = if stdenv.isLinux then callPackage ../os-specific/linux/procps-ng { } - else unixtools.procps; + procps = if stdenv.isLinux + then callPackage ../os-specific/linux/procps-ng { } + else unixtools.procps; procdump = callPackage ../os-specific/linux/procdump { }; @@ -22060,7 +22059,6 @@ in ucs-fonts = callPackage ../data/fonts/ucs-fonts { inherit (buildPackages.xorg) fonttosfnt mkfontscale; }; - ultimate-oldschool-pc-font-pack = callPackage ../data/fonts/ultimate-oldschool-pc-font-pack { }; ultralist = callPackage ../applications/misc/ultralist { }; @@ -22068,7 +22066,7 @@ in undefined-medium = callPackage ../data/fonts/undefined-medium { }; uni-vga = callPackage ../data/fonts/uni-vga - { inherit (buildPackages.xorg) fonttosfnt mkfontscale; }; + { inherit (buildPackages.xorg) fonttosfnt mkfontscale; }; unicode-character-database = callPackage ../data/misc/unicode-character-database { }; @@ -22077,7 +22075,7 @@ in unihan-database = callPackage ../data/misc/unihan-database { }; unifont = callPackage ../data/fonts/unifont - { inherit (buildPackages.xorg) fonttosfnt mkfontscale; }; + { inherit (buildPackages.xorg) fonttosfnt mkfontscale; }; unifont_upper = callPackage ../data/fonts/unifont_upper { }; @@ -23108,7 +23106,7 @@ in flwrap = callPackage ../applications/radio/flwrap { }; fluidsynth = callPackage ../applications/audio/fluidsynth { - inherit (darwin.apple_sdk.frameworks) AudioUnit CoreAudio CoreMIDI CoreServices; + inherit (darwin.apple_sdk.frameworks) AudioUnit CoreAudio CoreMIDI CoreServices; }; fluidsynth_1 = fluidsynth.override { version = "1"; }; @@ -25105,9 +25103,8 @@ in plank = callPackage ../applications/misc/plank { }; - playonlinux = callPackage ../applications/misc/playonlinux { - stdenv = stdenv_32bit; - }; + playonlinux = callPackage ../applications/misc/playonlinux + { stdenv = stdenv_32bit; }; pleroma-bot = python3Packages.callPackage ../development/python-modules/pleroma-bot { }; @@ -27510,10 +27507,10 @@ in zgrviewer = callPackage ../applications/graphics/zgrviewer { }; zgv = callPackage ../applications/graphics/zgv { - # Enable the below line for terminal display. Note - # that it requires sixel graphics compatible terminals like mlterm - # or xterm -ti 340 - SDL = SDL_sixel; + # Enable the below line for terminal display. Note + # that it requires sixel graphics compatible terminals like mlterm + # or xterm -ti 340 + SDL = SDL_sixel; }; zim = callPackage ../applications/office/zim { }; @@ -29444,8 +29441,8 @@ in elan = callPackage ../applications/science/logic/elan {}; mathlibtools = with python3Packages; toPythonApplication mathlibtools; - leo2 = callPackage ../applications/science/logic/leo2 { - ocaml = ocaml-ng.ocamlPackages_4_01_0.ocaml;}; + leo2 = callPackage ../applications/science/logic/leo2 + { ocaml = ocaml-ng.ocamlPackages_4_01_0.ocaml; }; leo3-bin = callPackage ../applications/science/logic/leo3/binary.nix {}; @@ -30241,57 +30238,58 @@ in nixops-dns = callPackage ../tools/package-management/nixops/nixops-dns.nix { }; - /* Evaluate a NixOS configuration using this evaluation of Nixpkgs. + /* + Evaluate a NixOS configuration using this evaluation of Nixpkgs. - With this function you can write, for example, a package that - depends on a custom virtual machine image. + With this function you can write, for example, a package that + depends on a custom virtual machine image. - Parameter: A module, path or list of those that represent the + Parameter: A module, path or list of those that represent the configuration of the NixOS system to be constructed. - Result: An attribute set containing packages produced by this - evaluation of NixOS, such as toplevel, kernel and - initialRamdisk. - The result can be extended in the modules by defining - extra attributes in system.build. - Alternatively, you may use the result's config and - options attributes to query any option. + Result: An attribute set containing packages produced by this + evaluation of NixOS, such as toplevel, kernel and + initialRamdisk. + The result can be extended in the modules by defining + extra attributes in system.build. + Alternatively, you may use the result's config and + options attributes to query any option. - Example: + Example: - let - myOS = pkgs.nixos ({ lib, pkgs, config, ... }: { + let + myOS = pkgs.nixos ({ lib, pkgs, config, ... }: { - config.services.nginx = { - enable = true; - # ... - }; + config.services.nginx = { + enable = true; + # ... + }; - # Use config.system.build to exports relevant parts of a - # configuration. The runner attribute should not be - # considered a fully general replacement for systemd - # functionality. - config.system.build.run-nginx = config.systemd.services.nginx.runner; - }); - in - myOS.run-nginx + # Use config.system.build to exports relevant parts of a + # configuration. The runner attribute should not be + # considered a fully general replacement for systemd + # functionality. + config.system.build.run-nginx = config.systemd.services.nginx.runner; + }); + in + myOS.run-nginx - Unlike in plain NixOS, the nixpkgs.config and - nixpkgs.system options will be ignored by default. Instead, - nixpkgs.pkgs will have the default value of pkgs as it was - constructed right after invoking the nixpkgs function (e.g. the - value of import { overlays = [./my-overlay.nix]; } - but not the value of (import {} // { extra = ...; }). + Unlike in plain NixOS, the nixpkgs.config and + nixpkgs.system options will be ignored by default. Instead, + nixpkgs.pkgs will have the default value of pkgs as it was + constructed right after invoking the nixpkgs function (e.g. the + value of import { overlays = [./my-overlay.nix]; } + but not the value of (import {} // { extra = ...; }). - If you do want to use the config.nixpkgs options, you are - probably better off by calling nixos/lib/eval-config.nix - directly, even though it is possible to set config.nixpkgs.pkgs. + If you do want to use the config.nixpkgs options, you are + probably better off by calling nixos/lib/eval-config.nix + directly, even though it is possible to set config.nixpkgs.pkgs. - For more information about writing NixOS modules, see - https://nixos.org/nixos/manual/index.html#sec-writing-modules + For more information about writing NixOS modules, see + https://nixos.org/nixos/manual/index.html#sec-writing-modules - Note that you will need to have called Nixpkgs with the system - parameter set to the right value for your deployment target. + Note that you will need to have called Nixpkgs with the system + parameter set to the right value for your deployment target. */ nixos = configuration: @@ -30359,11 +30357,11 @@ in test: let loadedTest = if builtins.typeOf test == "path" - then import test - else test; + then import test + else test; calledTest = if pkgs.lib.isFunction loadedTest - then callPackage loadedTest {} - else loadedTest; + then callPackage loadedTest {} + else loadedTest; in nixosTesting.makeTest calledTest; @@ -31023,10 +31021,10 @@ in }; xsw = callPackage ../applications/misc/xsw { - # Enable the next line to use this in terminal. - # Note that it requires sixel capable terminals such as mlterm - # or xterm -ti 340 - SDL = SDL_sixel; + # Enable the next line to use this in terminal. + # Note that it requires sixel capable terminals such as mlterm + # or xterm -ti 340 + SDL = SDL_sixel; }; xteddy = callPackage ../applications/misc/xteddy { }; From eb8890f3bb59ecfb50e52250ec8ba2adb46d4e5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phan=20Kochen?= Date: Sun, 16 May 2021 13:56:30 +0200 Subject: [PATCH 256/263] jpeg-archive: fix darwin build --- pkgs/applications/graphics/jpeg-archive/default.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkgs/applications/graphics/jpeg-archive/default.nix b/pkgs/applications/graphics/jpeg-archive/default.nix index cac930dae14..b974e271a67 100644 --- a/pkgs/applications/graphics/jpeg-archive/default.nix +++ b/pkgs/applications/graphics/jpeg-archive/default.nix @@ -22,9 +22,10 @@ stdenv.mkDerivation { ''; makeFlags = [ + "CC=${stdenv.cc.targetPrefix}cc" "PREFIX=$(out)" "MOZJPEG_PREFIX=${mozjpeg}" - "LIBJPEG=${mozjpeg}/lib/libjpeg.so" + "LIBJPEG=${mozjpeg}/lib/libjpeg${stdenv.hostPlatform.extensions.sharedLibrary}" ]; postInstall = '' From 601ceec28d443255f76c48499ec2c446d135a712 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9ophane=20Hufschmitt?= Date: Sun, 16 May 2021 16:17:42 +0200 Subject: [PATCH 257/263] =?UTF-8?q?nixos-rebuild:=20Don=E2=80=99t=20reset?= =?UTF-8?q?=20the=20experimental=20features?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Make sure that the Nix `experimental-features` set by a user aren’t overwritten when running `nixos-rebuild --flake` by using `--extra-experimental-features` rather than `--experimental-features`. Fix https://github.com/NixOS/nix/issues/4784 --- pkgs/os-specific/linux/nixos-rebuild/nixos-rebuild.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/os-specific/linux/nixos-rebuild/nixos-rebuild.sh b/pkgs/os-specific/linux/nixos-rebuild/nixos-rebuild.sh index 01d0fa823b9..afc0b8a3222 100644 --- a/pkgs/os-specific/linux/nixos-rebuild/nixos-rebuild.sh +++ b/pkgs/os-specific/linux/nixos-rebuild/nixos-rebuild.sh @@ -105,7 +105,7 @@ while [ "$#" -gt 0 ]; do ;; --flake) flake="$1" - flakeFlags=(--experimental-features 'nix-command flakes') + flakeFlags=(--extra-experimental-features 'nix-command flakes') shift 1 ;; --recreate-lock-file|--no-update-lock-file|--no-write-lock-file|--no-registries|--commit-lock-file) From 2b7ed5deef3bee1a112d294204be1b3d21283693 Mon Sep 17 00:00:00 2001 From: midchildan Date: Mon, 17 May 2021 00:42:57 +0900 Subject: [PATCH 258/263] trafficserver: remove joaquinito2051 as maintainer This reverts commit da69e884b8d19835958a04b53cf8148ba8866e66. --- maintainers/maintainer-list.nix | 6 ------ pkgs/servers/http/trafficserver/default.nix | 2 +- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/maintainers/maintainer-list.nix b/maintainers/maintainer-list.nix index 2da788a56af..dd9baebc019 100644 --- a/maintainers/maintainer-list.nix +++ b/maintainers/maintainer-list.nix @@ -4765,12 +4765,6 @@ githubId = 1102396; name = "Jussi Maki"; }; - joaquinito2051 = { - email = "joaquinito2051@gmail.com"; - github = "heroku-miraheze"; - githubId = 61781343; - name = "Joaquín Rufo Gutierrez"; - }; jobojeha = { email = "jobojeha@jeppener.de"; github = "jobojeha"; diff --git a/pkgs/servers/http/trafficserver/default.nix b/pkgs/servers/http/trafficserver/default.nix index 05eb9a17c8e..4a7f9854d18 100644 --- a/pkgs/servers/http/trafficserver/default.nix +++ b/pkgs/servers/http/trafficserver/default.nix @@ -201,7 +201,7 @@ stdenv.mkDerivation rec { large intranets by maximizing existing and available bandwidth. ''; license = licenses.asl20; - maintainers = with maintainers; [ midchildan joaquinito2051 ]; + maintainers = with maintainers; [ midchildan ]; platforms = platforms.unix; }; } From bc9098d60d47b797d1943b98b16ac29437a37823 Mon Sep 17 00:00:00 2001 From: Bran <71175207+branwright1@users.noreply.github.com> Date: Sun, 16 May 2021 20:15:44 +0200 Subject: [PATCH 259/263] river: remove branwright1 as maintainer (#123266) --- maintainers/maintainer-list.nix | 6 ------ pkgs/applications/window-managers/river/default.nix | 2 +- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/maintainers/maintainer-list.nix b/maintainers/maintainer-list.nix index dd9baebc019..da00db17871 100644 --- a/maintainers/maintainer-list.nix +++ b/maintainers/maintainer-list.nix @@ -1394,12 +1394,6 @@ githubId = 302429; name = "Marton Boros"; }; - branwright1 = { - email = "branwright@protonmail.com"; - github = "branwright1"; - githubId = 71175207; - name = "Brandon Wright"; - }; bramd = { email = "bram@bramd.nl"; github = "bramd"; diff --git a/pkgs/applications/window-managers/river/default.nix b/pkgs/applications/window-managers/river/default.nix index e82f290169c..a7331aa39af 100644 --- a/pkgs/applications/window-managers/river/default.nix +++ b/pkgs/applications/window-managers/river/default.nix @@ -43,6 +43,6 @@ stdenv.mkDerivation rec { description = "A dynamic tiling wayland compositor"; license = licenses.gpl3Plus; platforms = platforms.linux; - maintainers = with maintainers; [ branwright1 ]; + maintainers = with maintainers; [ ]; }; } From da04ea775ea4823320b0e0349b20ad69b8743f6f Mon Sep 17 00:00:00 2001 From: figsoda Date: Sun, 16 May 2021 13:42:37 -0400 Subject: [PATCH 260/263] vimPlugins.lsp_signature-nvim: init at 2021-05-07 --- pkgs/misc/vim-plugins/generated.nix | 12 ++++++++++++ pkgs/misc/vim-plugins/vim-plugin-names | 1 + 2 files changed, 13 insertions(+) diff --git a/pkgs/misc/vim-plugins/generated.nix b/pkgs/misc/vim-plugins/generated.nix index 4ab0700e8a5..8d80f3e9b18 100644 --- a/pkgs/misc/vim-plugins/generated.nix +++ b/pkgs/misc/vim-plugins/generated.nix @@ -2458,6 +2458,18 @@ let meta.homepage = "https://github.com/nvim-lua/lsp_extensions.nvim/"; }; + lsp_signature-nvim = buildVimPluginFrom2Nix { + pname = "lsp_signature-nvim"; + version = "2021-05-07"; + src = fetchFromGitHub { + owner = "ray-x"; + repo = "lsp_signature.nvim"; + rev = "de68e0754019f7ff5822f3180b067d89f014943b"; + sha256 = "009lih2s5x9nccx2i2xqb377jkclpxbw25vmznngdq47qr89ws1r"; + }; + meta.homepage = "https://github.com/ray-x/lsp_signature.nvim/"; + }; + lspkind-nvim = buildVimPluginFrom2Nix { pname = "lspkind-nvim"; version = "2021-02-06"; diff --git a/pkgs/misc/vim-plugins/vim-plugin-names b/pkgs/misc/vim-plugins/vim-plugin-names index ff4b066be24..ec322def0c0 100644 --- a/pkgs/misc/vim-plugins/vim-plugin-names +++ b/pkgs/misc/vim-plugins/vim-plugin-names @@ -522,6 +522,7 @@ raghur/vim-ghost Raimondi/delimitMate rakr/vim-one ray-x/aurora +ray-x/lsp_signature.nvim rbgrouleff/bclose.vim rbong/vim-flog rhysd/committia.vim From 805825cc524058526e3a5b9d1583ba317319fe2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eduardo=20S=C3=A1nchez=20Mu=C3=B1oz?= Date: Sun, 16 May 2021 19:45:51 +0200 Subject: [PATCH 261/263] pythonPackages.pyqt4: 4.12 -> 4.12.3 --- pkgs/development/python-modules/pyqt/4.x.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/pyqt/4.x.nix b/pkgs/development/python-modules/pyqt/4.x.nix index 27616d69d3e..2652b5eb00b 100644 --- a/pkgs/development/python-modules/pyqt/4.x.nix +++ b/pkgs/development/python-modules/pyqt/4.x.nix @@ -2,12 +2,12 @@ buildPythonPackage rec { pname = "PyQt-x11-gpl"; - version = "4.12"; + version = "4.12.3"; format = "other"; src = fetchurl { url = "mirror://sourceforge/pyqt/PyQt4_gpl_x11-${version}.tar.gz"; - sha256 = "1nw8r88a5g2d550yvklawlvns8gd5slw53yy688kxnsa65aln79w"; + sha256 = "0wnlasg62rm5d39nq1yw4namcx2ivxgzl93r5f2vb9s0yaz5l3x0"; }; postPatch = '' From de9e2ce42d7834cdc361cc8139ffb9b76643768d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Sun, 16 May 2021 20:36:16 +0200 Subject: [PATCH 262/263] yubikey-manager-qt: 1.1.5 -> 1.2.2 (#123118) --- .../tools/misc/yubikey-manager-qt/default.nix | 52 +++++++++++-------- pkgs/top-level/all-packages.nix | 4 +- 2 files changed, 31 insertions(+), 25 deletions(-) diff --git a/pkgs/tools/misc/yubikey-manager-qt/default.nix b/pkgs/tools/misc/yubikey-manager-qt/default.nix index 02982f9cc4a..00e3ec1fbdc 100644 --- a/pkgs/tools/misc/yubikey-manager-qt/default.nix +++ b/pkgs/tools/misc/yubikey-manager-qt/default.nix @@ -1,53 +1,61 @@ { lib -, stdenv +, mkDerivation , fetchurl -, wrapQtAppsHook , pcsclite , pyotherside -, pythonPackages , python3 , qmake , qtbase , qtgraphicaleffects -, qtquickcontrols , qtquickcontrols2 , yubikey-manager , yubikey-personalization }: -stdenv.mkDerivation rec { +mkDerivation rec { pname = "yubikey-manager-qt"; - version = "1.1.5"; + version = "1.2.2"; src = fetchurl { url = "https://developers.yubico.com/${pname}/Releases/${pname}-${version}.tar.gz"; - sha256 = "1yimlaqvhq34gw6wkqgil0qq8x9zbfzh4psqihjr2d9jaa2wygwy"; + sha256 = "1jqibv7na9h2r8nxgzp40j9qpyiwx97c65krivkcqjwdjk5lrahl"; }; - nativeBuildInputs = [ wrapQtAppsHook python3.pkgs.wrapPython qmake ]; + nativeBuildInputs = [ + python3.pkgs.wrapPython + qmake + ]; postPatch = '' substituteInPlace ykman-gui/deployment.pri --replace '/usr/bin' "$out/bin" ''; - buildInputs = [ pythonPackages.python qtbase qtgraphicaleffects qtquickcontrols qtquickcontrols2 pyotherside ]; + buildInputs = [ + pyotherside + python3 + qtbase + qtgraphicaleffects + qtquickcontrols2 + ]; - pythonPath = [ yubikey-manager ]; + pythonPath = [ + (yubikey-manager.override { python3Packages = python3.pkgs; }) + ]; - dontWrapQtApps = true; postInstall = '' - buildPythonPath "$pythonPath" - - wrapQtApp $out/bin/ykman-gui \ - --prefix LD_LIBRARY_PATH : "${lib.getLib pcsclite}/lib:${yubikey-personalization}/lib" \ - --prefix PYTHONPATH : "$program_PYTHONPATH" - - mkdir -p $out/share/applications - cp resources/ykman-gui.desktop $out/share/applications/ykman-gui.desktop - mkdir -p $out/share/ykman-gui/icons - cp resources/icons/*.{icns,ico,png,xpm} $out/share/ykman-gui/icons + install -Dt $out/share/applications resources/ykman-gui.desktop + install -Dt $out/share/ykman-gui/icons resources/icons/*.{icns,ico,png,xpm} substituteInPlace $out/share/applications/ykman-gui.desktop \ - --replace 'Exec=ykman-gui' "Exec=$out/bin/ykman-gui" \ + --replace 'Exec=ykman-gui' "Exec=$out/bin/ykman-gui" + ''; + + qtWrapperArgs = [ + "--prefix" "LD_LIBRARY_PATH" ":" (lib.makeLibraryPath [ pcsclite yubikey-personalization ]) + ]; + + preFixup = '' + buildPythonPath "$pythonPath" + qtWrapperArgs+=(--prefix PYTHONPATH : "$program_PYTHONPATH") ''; meta = with lib; { diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 1544ad8c68d..6dea4096416 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -18289,9 +18289,7 @@ in yubikey-manager = callPackage ../tools/misc/yubikey-manager { }; - yubikey-manager-qt = libsForQt5.callPackage ../tools/misc/yubikey-manager-qt { - pythonPackages = python3Packages; - }; + yubikey-manager-qt = libsForQt5.callPackage ../tools/misc/yubikey-manager-qt { }; yubikey-personalization = callPackage ../tools/misc/yubikey-personalization { }; From 74b74b05550f258e9055b824eff49b15637dd917 Mon Sep 17 00:00:00 2001 From: fortune Date: Mon, 17 May 2021 03:29:15 +0800 Subject: [PATCH 263/263] river: add fortuneteller2k as maintainer (#123271) --- pkgs/applications/window-managers/river/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/applications/window-managers/river/default.nix b/pkgs/applications/window-managers/river/default.nix index a7331aa39af..b8b53027219 100644 --- a/pkgs/applications/window-managers/river/default.nix +++ b/pkgs/applications/window-managers/river/default.nix @@ -43,6 +43,6 @@ stdenv.mkDerivation rec { description = "A dynamic tiling wayland compositor"; license = licenses.gpl3Plus; platforms = platforms.linux; - maintainers = with maintainers; [ ]; + maintainers = with maintainers; [ fortuneteller2k ]; }; }