diff options
98 files changed, 2553 insertions, 168 deletions
diff --git a/maintainers/maintainer-list.nix b/maintainers/maintainer-list.nix index 6cb9d07fe93..5f4912daa68 100644 --- a/maintainers/maintainer-list.nix +++ b/maintainers/maintainer-list.nix @@ -2077,6 +2077,12 @@ githubId = 195032; name = "Eric Evenchick"; }; + evenbrenden = { + email = "evenbrenden@gmail.com"; + github = "evenbrenden"; + githubId = 2512008; + name = "Even Brenden"; + }; exfalso = { email = "0slemi0@gmail.com"; github = "exfalso"; @@ -3495,6 +3501,11 @@ githubId = 1362179; name = "Kyle Lacy"; }; + laikq = { + email = "gwen@quasebarth.de"; + github = "laikq"; + name = "Gwendolyn Quasebarth"; + }; lasandell = { email = "lasandell@gmail.com"; github = "lasandell"; diff --git a/nixos/tests/ferm.nix b/nixos/tests/ferm.nix index b8e8663e3ad..14c1cd44f5c 100644 --- a/nixos/tests/ferm.nix +++ b/nixos/tests/ferm.nix @@ -22,6 +22,7 @@ import ./make-test.nix ({ pkgs, ...} : { { networking = { dhcpcd.enable = false; + useNetworkd = true; interfaces.eth1.ipv6.addresses = mkOverride 0 [ { address = "fd00::1"; prefixLength = 64; } ]; interfaces.eth1.ipv4.addresses = mkOverride 0 [ { address = "192.168.1.1"; prefixLength = 24; } ]; }; diff --git a/pkgs/applications/audio/sndpeek/default.nix b/pkgs/applications/audio/sndpeek/default.nix new file mode 100644 index 00000000000..ecdafdaeadd --- /dev/null +++ b/pkgs/applications/audio/sndpeek/default.nix @@ -0,0 +1,56 @@ +{ stdenv, fetchurl, libsndfile, freeglut, alsaLib, mesa, libGLU, libX11, libXmu +, libXext, libXi }: + +stdenv.mkDerivation rec { + pname = "sndpeek"; + version = "1.4"; + + src = fetchurl { + url = "https://soundlab.cs.princeton.edu/software/sndpeek/files/sndpeek-${version}.tgz"; + sha256 = "2d86cf74854fa00dcdc05a35dd92bc4cf6115e87102b17023be5cba9ead8eedf"; + }; + sourceRoot = "sndpeek-${version}/src/sndpeek"; + + # this patch adds -lpthread to the list of libraries, without it a + # symbol-not-found-error is thrown + patches = [ ./pthread.patch ]; + + buildInputs = [ + freeglut + alsaLib + mesa + libGLU + libsndfile + libX11 + libXmu + libXext + libXi + ]; + buildFlags = "linux-alsa"; + + installPhase = '' + mkdir -p $out/bin + mv sndpeek $out/bin + ''; + + meta = with stdenv.lib; { + description = "Real-time 3D animated audio display/playback"; + longDescription = '' + sndpeek is just what it sounds (and looks) like: + * real-time 3D animated display/playback + * can use mic-input or wav/aiff/snd/raw/mat file (with playback) + * time-domain waveform + * FFT magnitude spectrum + * 3D waterfall plot + * lissajous! (interchannel correlation) + * rotatable and scalable display + * freeze frame! (for didactic purposes) + * real-time spectral feature extraction (centroid, rms, flux, rolloff) + * available on MacOS X, Linux, and Windows under GPL + * part of the sndtools distribution. + ''; + homepage = https://soundlab.cs.princeton.edu/software/sndpeek/; + license = licenses.gpl2; + maintainers = [ maintainers.laikq ]; + }; +} diff --git a/pkgs/applications/audio/sndpeek/pthread.patch b/pkgs/applications/audio/sndpeek/pthread.patch new file mode 100644 index 00000000000..b2f1d37da6b --- /dev/null +++ b/pkgs/applications/audio/sndpeek/pthread.patch @@ -0,0 +1,13 @@ +diff --git a/makefile.alsa b/makefile.alsa +index 34fb848..cdaeaec 100644 +--- a/makefile.alsa ++++ b/makefile.alsa +@@ -4,7 +4,7 @@ CPP=g++ + INCLUDES=-I../marsyas/ + MARSYAS_DIR=../marsyas/ + CFLAGS=-D__LINUX_ALSA__ -D__LITTLE_ENDIAN__ $(INCLUDES) -O3 -c +-LIBS=-L/usr/X11R6/lib -lglut -lGL -lGLU -lasound -lXmu -lX11 -lXext -lXi -lm -lsndfile ++LIBS=-L/usr/X11R6/lib -lglut -lGL -lGLU -lasound -lXmu -lX11 -lXext -lXi -lm -lsndfile -lpthread + + OBJS=chuck_fft.o RtAudio.o Thread.o sndpeek.o Stk.o \ + Centroid.o DownSampler.o Flux.o LPC.o MFCC.o RMS.o Rolloff.o \ diff --git a/pkgs/applications/audio/spotifyd/default.nix b/pkgs/applications/audio/spotifyd/default.nix index 7734a7f3067..443107ad9e4 100644 --- a/pkgs/applications/audio/spotifyd/default.nix +++ b/pkgs/applications/audio/spotifyd/default.nix @@ -6,16 +6,16 @@ rustPlatform.buildRustPackage rec { pname = "spotifyd"; - version = "0.2.14"; + version = "0.2.16"; src = fetchFromGitHub { owner = "Spotifyd"; repo = "spotifyd"; rev = "v${version}"; - sha256 = "1hbcyc5rdrvdnvvsgaykqamq4i0yq8wqq5qjp6zjf4jlaxxif4nz"; + sha256 = "097hg18h7gya2w0wl5jkav79nb3qzcc4ycsryq7nhxa0h1agvinc"; }; - cargoSha256 = "15gd8shg0mn4vsma2hckj6w8gkwr58iniyfw1vjrh4clw4x7ibb4"; + cargoSha256 = "0ar4bfwn3qxa6wsz2hd7nv1wr824h74jy3xqba2qsy0rsfwy1bmm"; cargoBuildFlags = [ "--no-default-features" diff --git a/pkgs/applications/misc/hugo/default.nix b/pkgs/applications/misc/hugo/default.nix index 720445be9be..840f4c32e52 100644 --- a/pkgs/applications/misc/hugo/default.nix +++ b/pkgs/applications/misc/hugo/default.nix @@ -2,18 +2,18 @@ buildGoModule rec { pname = "hugo"; - version = "0.58.0"; + version = "0.58.3"; goPackagePath = "github.com/gohugoio/hugo"; src = fetchFromGitHub { owner = "gohugoio"; - repo = "hugo"; + repo = pname; rev = "v${version}"; - sha256 = "0971li0777c1s67w72wl1y0b58ky93dw05hbk3s4kqys0acanc2d"; + sha256 = "00dhb6xilkwr9yhncpyc6alzqw77ch3vd85dc7lzsmhw1c80n0lc"; }; - modSha256 = "14ylbh2hx14swcqvawprbx5gynkwyb0nlp5acr4fjy1zl0ifc790"; + modSha256 = "0d6zc7hxb246zsvwsjz4ds6gdd2m95x6l3djh3mmciwfg9cd7prx"; buildFlags = "-tags extended"; diff --git a/pkgs/applications/misc/jotta-cli/default.nix b/pkgs/applications/misc/jotta-cli/default.nix new file mode 100644 index 00000000000..a5196811a6a --- /dev/null +++ b/pkgs/applications/misc/jotta-cli/default.nix @@ -0,0 +1,35 @@ +{ stdenv, fetchzip }: + +let + arch = "amd64"; +in +stdenv.mkDerivation rec { + pname = "jotta-cli"; + version = "0.6.18626"; + src = + fetchzip { + url = "https://repo.jotta.us/archives/linux/${arch}/jotta-cli-${version}_linux_${arch}.tar.gz"; + sha256 = "0v9bw0f2mcvmzp7v8gs6q4p1q54rflqnbjv5sw7h1kyfwznmflzj"; + stripRoot = false; + }; + + installPhase = '' + install -D usr/bin/jotta-cli usr/bin/jottad -t $out/bin/ + mkdir -p $out/share/bash-completion/completions + ''; + + postFixup = '' + patchelf --set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) $out/bin/jotta-cli + patchelf --set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) $out/bin/jottad + $out/bin/jotta-cli completion > $out/share/bash-completion/completions/jotta-cli.bash + ''; + + meta = with stdenv.lib; { + description = "Jottacloud CLI"; + homepage = https://www.jottacloud.com/; + downloadPage = https://repo.jotta.us/archives/linux/; + maintainers = with maintainers; [ evenbrenden ]; + license = licenses.unfree; + platforms = [ "x86_64-linux" ]; + }; +} diff --git a/pkgs/applications/misc/urlscan/default.nix b/pkgs/applications/misc/urlscan/default.nix index 87800cf90d6..791075e4dd9 100644 --- a/pkgs/applications/misc/urlscan/default.nix +++ b/pkgs/applications/misc/urlscan/default.nix @@ -2,13 +2,13 @@ python3Packages.buildPythonApplication rec { pname = "urlscan"; - version = "0.9.3"; + version = "0.9.4"; src = fetchFromGitHub { owner = "firecat53"; repo = pname; rev = version; - sha256 = "0z24k8sk2zfp2pwysyp844vmhr5vbkj74frwy4i0v5pj60i9jl0v"; + sha256 = "11wkwjqsq848ks6m2jqsb8h0xnz75fb60bm0c4jkxys9wzy4chg5"; }; propagatedBuildInputs = [ python3Packages.urwid ]; diff --git a/pkgs/applications/misc/worker/default.nix b/pkgs/applications/misc/worker/default.nix index e5b89ff43b5..6ff09a5b4b0 100644 --- a/pkgs/applications/misc/worker/default.nix +++ b/pkgs/applications/misc/worker/default.nix @@ -2,11 +2,11 @@ stdenv.mkDerivation rec { pname = "worker"; - version = "4.0.1"; + version = "4.1.0"; src = fetchurl { url = "http://www.boomerangsworld.de/cms/worker/downloads/${pname}-${version}.tar.gz"; - sha256 = "1mwkyak68bsxgff399xmr7bb3hxl0r976b90zi7jrzznwlvxx7vh"; + sha256 = "19v4g34sk4fkagk0s60rbixyrrgg22qy1xwffm8b5ffq36r7yfch"; }; buildInputs = [ libX11 ]; diff --git a/pkgs/applications/misc/xmrig/default.nix b/pkgs/applications/misc/xmrig/default.nix index 8a46336c9de..425c4a85888 100644 --- a/pkgs/applications/misc/xmrig/default.nix +++ b/pkgs/applications/misc/xmrig/default.nix @@ -4,13 +4,13 @@ stdenv.mkDerivation rec { pname = "xmrig"; - version = "3.0.0"; + version = "3.1.3"; src = fetchFromGitHub { owner = "xmrig"; repo = "xmrig"; rev = "v${version}"; - sha256 = "1m0rsjb7y1j77mzg5cqb3fdvzgvjkrwgmkjn9nv1xl2757z8hcl4"; + sha256 = "05z3hpz42609zsrqwd9sbxkgzm4f28ajhvgk69jvcfw7azg5jcfq"; }; nativeBuildInputs = [ cmake ]; diff --git a/pkgs/applications/misc/xmrig/proxy.nix b/pkgs/applications/misc/xmrig/proxy.nix index 7d9ebca0086..5871d1a557b 100644 --- a/pkgs/applications/misc/xmrig/proxy.nix +++ b/pkgs/applications/misc/xmrig/proxy.nix @@ -4,13 +4,13 @@ stdenv.mkDerivation rec { pname = "xmrig-proxy"; - version = "3.0.0"; + version = "3.1.1"; src = fetchFromGitHub { owner = "xmrig"; repo = "xmrig-proxy"; rev = "v${version}"; - sha256 = "19rv5zmxwr3kmb2m3fas91aq1493cnkhvs88zcflnijr1ra218ks"; + sha256 = "1qiwarf0bqc17w3r88ysxxpm71gm861zx1fnzp0xi4q3rbh3nfmd"; }; nativeBuildInputs = [ cmake ]; diff --git a/pkgs/applications/networking/esniper/default.nix b/pkgs/applications/networking/esniper/default.nix index 2535d0dc31d..9de87ee178d 100644 --- a/pkgs/applications/networking/esniper/default.nix +++ b/pkgs/applications/networking/esniper/default.nix @@ -1,12 +1,12 @@ { stdenv, fetchgit, openssl, curl, coreutils, gawk, bash, which }: stdenv.mkDerivation { - name = "esniper-2.35.0-15-g91d2665"; + name = "esniper-2.35.0-18-g4a59da0"; src = fetchgit { url = "https://git.code.sf.net/p/esniper/git"; - rev = "91d2665539beaeac21fb4c0cc2fd39c44e771ed7"; - sha256 = "0dixcsvbcj9jbfjfv50nwvw7w90c4s6gnkrpilaan984i6y45rw0"; + rev = "4a59da032aa4536b9e5ea95633247650412511db"; + sha256 = "0d3vazh5q7wymqahggbb2apl9hgrm037y4s3j91d24hjgk2pzzyd"; }; buildInputs = [ openssl curl ]; diff --git a/pkgs/applications/networking/sniffers/wireshark/default.nix b/pkgs/applications/networking/sniffers/wireshark/default.nix index aa965a0c868..ef1e07ca976 100644 --- a/pkgs/applications/networking/sniffers/wireshark/default.nix +++ b/pkgs/applications/networking/sniffers/wireshark/default.nix @@ -10,7 +10,7 @@ assert withQt -> qt5 != null; with stdenv.lib; let - version = "3.0.3"; + version = "3.0.5"; variant = if withQt then "qt" else "cli"; in stdenv.mkDerivation { @@ -20,7 +20,7 @@ in stdenv.mkDerivation { src = fetchurl { url = "https://www.wireshark.org/download/src/all-versions/wireshark-${version}.tar.xz"; - sha256 = "0711jilp9sbgi46d105m3galw8n4wk5yncawi08031qxg2f754mg"; + sha256 = "087qv7nd7zlbckvcs37fkkg7v0mw0hjd5yfbghqym764fpjgqlf5"; }; cmakeFlags = [ diff --git a/pkgs/applications/office/watson/default.nix b/pkgs/applications/office/watson/default.nix index 16df0b294c1..7d79d79072a 100644 --- a/pkgs/applications/office/watson/default.nix +++ b/pkgs/applications/office/watson/default.nix @@ -4,12 +4,12 @@ with pythonPackages; buildPythonApplication rec { pname = "watson"; - version = "1.7.0"; + version = "1.8.0"; src = fetchPypi { inherit version; pname = "td-watson"; - sha256 = "249313996751f32f38817d424cbf8d74956461df1439f0ee3a962fcc3c77225d"; + sha256 = "1ip66jhbcqifdw1avbhngwym0vv7fsqxgbph11da5wlqwfwp060n"; }; checkPhase = '' diff --git a/pkgs/applications/radio/rtl_433/default.nix b/pkgs/applications/radio/rtl_433/default.nix index 3d519255ab4..148ad35a1f0 100644 --- a/pkgs/applications/radio/rtl_433/default.nix +++ b/pkgs/applications/radio/rtl_433/default.nix @@ -4,14 +4,14 @@ stdenv.mkDerivation { - version = "18.12"; + version = "19.08"; pname = "rtl_433"; src = fetchFromGitHub { owner = "merbanan"; repo = "rtl_433"; - rev = "18.12"; - sha256 = "0y73g9ffpsgnmfk8lbihyl9d1fd9v91wsn8k8xhsdmgmn4ra1jk5"; + rev = "19.08"; + sha256 = "0cm82gm5c86qfl4dw37h8wyk77947k6fv2n1pn3xvk3wz2ygsdi6"; }; nativeBuildInputs = [ autoreconfHook pkgconfig ]; diff --git a/pkgs/applications/video/streamlink/default.nix b/pkgs/applications/video/streamlink/default.nix index e33610ac416..b5ffdb018ff 100644 --- a/pkgs/applications/video/streamlink/default.nix +++ b/pkgs/applications/video/streamlink/default.nix @@ -1,14 +1,14 @@ { stdenv, pythonPackages, fetchFromGitHub, rtmpdump, ffmpeg }: pythonPackages.buildPythonApplication rec { - version = "1.1.1"; + version = "1.2.0"; pname = "streamlink"; src = fetchFromGitHub { owner = "streamlink"; repo = "streamlink"; rev = version; - sha256 = "1vyf0pifdqygg98azdkfhy5fdckb0w2ca7c46mkrj452gkvmcq33"; + sha256 = "0l8b9ipfmd6dic07ajqqml26jdydz0k046hvx32mqp64jl5jpznh"; }; checkInputs = with pythonPackages; [ pytest mock requests-mock freezegun ]; diff --git a/pkgs/data/fonts/work-sans/default.nix b/pkgs/data/fonts/work-sans/default.nix new file mode 100644 index 00000000000..16a0e9ac021 --- /dev/null +++ b/pkgs/data/fonts/work-sans/default.nix @@ -0,0 +1,29 @@ +{ lib, fetchFromGitHub }: + +let + version = "1.6"; +in fetchFromGitHub { + name = "work-sans-${version}"; + + owner = "weiweihuanghuang"; + repo = "Work-Sans"; + rev = "v${version}"; + + postFetch = '' + tar xf $downloadedFile --strip=1 + install -m444 -Dt $out/share/fonts/opentype/ fonts/desktop/*.otf + install -m444 -Dt $out/share/fonts/truetype/ fonts/webfonts/ttf/*.ttf + install -m444 -Dt $out/share/fonts/woff/ fonts/webfonts/woff/*.woff + install -m444 -Dt $out/share/fonts/woff2/ fonts/webfonts/woff2/*.woff2 + ''; + + sha256 = "01kjidk6zv80rqxapcdwhd9wxzrjfc6lj4gkf6dwa4sskw5x3b8a"; + + meta = with lib; { + description = "A grotesque sans"; + homepage = "https://weiweihuanghuang.github.io/Work-Sans/"; + license = licenses.ofl; + maintainers = [ maintainers.marsam ]; + platforms = platforms.all; + }; +} diff --git a/pkgs/development/compilers/llvm/9/bintools.nix b/pkgs/development/compilers/llvm/9/bintools.nix new file mode 100644 index 00000000000..72a2a733193 --- /dev/null +++ b/pkgs/development/compilers/llvm/9/bintools.nix @@ -0,0 +1,19 @@ +{ runCommand, stdenv, llvm, lld, version }: + +let + prefix = + if stdenv.hostPlatform != stdenv.targetPlatform + then "${stdenv.targetPlatform.config}-" + else ""; +in runCommand "llvm-binutils-${version}" { preferLocalBuild = true; } '' + mkdir -p $out/bin + for prog in ${lld}/bin/*; do + ln -s $prog $out/bin/${prefix}$(basename $prog) + done + for prog in ${llvm}/bin/*; do + ln -s $prog $out/bin/${prefix}$(echo $(basename $prog) | sed -e "s|llvm-||") + ln -sf $prog $out/bin/${prefix}$(basename $prog) + done + rm -f $out/bin/${prefix}cat + ln -s ${lld}/bin/lld $out/bin/${prefix}ld +'' diff --git a/pkgs/development/compilers/llvm/9/clang/compiler-rt-baremetal.patch b/pkgs/development/compilers/llvm/9/clang/compiler-rt-baremetal.patch new file mode 100644 index 00000000000..a4a0f21b0fc --- /dev/null +++ b/pkgs/development/compilers/llvm/9/clang/compiler-rt-baremetal.patch @@ -0,0 +1,53 @@ +Index: lib/Driver/ToolChains/BareMetal.cpp +=================================================================== +--- a/lib/Driver/ToolChains/BareMetal.cpp ++++ b/lib/Driver/ToolChains/BareMetal.cpp +@@ -157,7 +157,7 @@ + void BareMetal::AddLinkRuntimeLib(const ArgList &Args, + ArgStringList &CmdArgs) const { + CmdArgs.push_back(Args.MakeArgString("-lclang_rt.builtins-" + +- getTriple().getArchName() + ".a")); ++ getTriple().getArchName())); + } + + void baremetal::Linker::ConstructJob(Compilation &C, const JobAction &JA, +Index: test/Driver/baremetal.cpp +=================================================================== +--- a/test/Driver/baremetal.cpp ++++ b/test/Driver/baremetal.cpp +@@ -13,7 +13,7 @@ + // CHECK-V6M-C-NEXT: "{{[^"]*}}ld{{(\.(lld|bfd|gold))?}}{{(\.exe)?}}" "{{.*}}.o" "-Bstatic" + // CHECK-V6M-C-SAME: "-L[[RESOURCE_DIR:[^"]+]]{{[/\\]+}}lib{{[/\\]+}}baremetal" + // CHECK-V6M-C-SAME: "-T" "semihosted.lds" "-Lsome{{[/\\]+}}directory{{[/\\]+}}user{{[/\\]+}}asked{{[/\\]+}}for" +-// CHECK-V6M-C-SAME: "-lc" "-lm" "-lclang_rt.builtins-armv6m.a" ++// CHECK-V6M-C-SAME: "-lc" "-lm" "-lclang_rt.builtins-armv6m" + // CHECK-V6M-C-SAME: "-o" "{{.*}}.o" + + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +@@ -35,7 +35,7 @@ + // CHECK-V6M-DEFAULTCXX: "{{[^"]*}}ld{{(\.(lld|bfd|gold))?}}{{(\.exe)?}}" "{{.*}}.o" "-Bstatic" + // CHECK-V6M-DEFAULTCXX-SAME: "-L{{[^"]*}}{{[/\\]+}}lib{{(64)?}}{{[/\\]+}}clang{{[/\\]+}}{{.*}}{{[/\\]+}}lib{{[/\\]+}}baremetal" + // CHECK-V6M-DEFAULTCXX-SAME: "-lc++" "-lc++abi" "-lunwind" +-// CHECK-V6M-DEFAULTCXX-SAME: "-lc" "-lm" "-lclang_rt.builtins-armv6m.a" ++// CHECK-V6M-DEFAULTCXX-SAME: "-lc" "-lm" "-lclang_rt.builtins-armv6m" + // CHECK-V6M-DEFAULTCXX-SAME: "-o" "{{.*}}.o" + + // RUN: %clangxx -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +@@ -48,7 +48,7 @@ + // CHECK-V6M-LIBCXX: "{{[^"]*}}ld{{(\.(lld|bfd|gold))?}}{{(\.exe)?}}" "{{.*}}.o" "-Bstatic" + // CHECK-V6M-LIBCXX-SAME: "-L{{[^"]*}}{{[/\\]+}}lib{{(64)?}}{{[/\\]+}}clang{{[/\\]+}}{{.*}}{{[/\\]+}}lib{{[/\\]+}}baremetal" + // CHECK-V6M-LIBCXX-SAME: "-lc++" "-lc++abi" "-lunwind" +-// CHECK-V6M-LIBCXX-SAME: "-lc" "-lm" "-lclang_rt.builtins-armv6m.a" ++// CHECK-V6M-LIBCXX-SAME: "-lc" "-lm" "-lclang_rt.builtins-armv6m" + // CHECK-V6M-LIBCXX-SAME: "-o" "{{.*}}.o" + + // RUN: %clangxx -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +@@ -61,7 +61,7 @@ + // CHECK-V6M-LIBSTDCXX: "{{[^"]*}}ld{{(\.(lld|bfd|gold))?}}{{(\.exe)?}}" "{{.*}}.o" "-Bstatic" + // CHECK-V6M-LIBSTDCXX-SAME: "-L{{[^"]*}}{{[/\\]+}}lib{{(64)?}}{{[/\\]+}}clang{{[/\\]+}}{{.*}}{{[/\\]+}}lib{{[/\\]+}}baremetal" + // CHECK-V6M-LIBSTDCXX-SAME: "-lstdc++" "-lsupc++" "-lunwind" +-// CHECK-V6M-LIBSTDCXX-SAME: "-lc" "-lm" "-lclang_rt.builtins-armv6m.a" ++// CHECK-V6M-LIBSTDCXX-SAME: "-lc" "-lm" "-lclang_rt.builtins-armv6m" + // CHECK-V6M-LIBSTDCXX-SAME: "-o" "{{.*}}.o" + + // RUN: %clangxx -no-canonical-prefixes %s -### -o %t.o 2>&1 \ diff --git a/pkgs/development/compilers/llvm/9/clang/default.nix b/pkgs/development/compilers/llvm/9/clang/default.nix new file mode 100644 index 00000000000..df6b916e87f --- /dev/null +++ b/pkgs/development/compilers/llvm/9/clang/default.nix @@ -0,0 +1,120 @@ +{ stdenv, fetch, cmake, libxml2, llvm, version, clang-tools-extra_src, python +, fixDarwinDylibNames +, enableManpages ? false +, enablePolly ? false # TODO: get this info from llvm (passthru?) +}: + +let + self = stdenv.mkDerivation ({ + pname = "clang"; + inherit version; + + src = fetch "cfe" "0426ma80i41qsgzm1qdz81mjskck426diygxi2k5vji2gkpixa3v"; + + unpackPhase = '' + unpackFile $src + mv cfe-${version}* clang + sourceRoot=$PWD/clang + unpackFile ${clang-tools-extra_src} + mv clang-tools-extra-* $sourceRoot/tools/extra + ''; + + nativeBuildInputs = [ cmake python ] + ++ stdenv.lib.optional enableManpages python.pkgs.sphinx; + + buildInputs = [ libxml2 llvm ] + ++ stdenv.lib.optional stdenv.isDarwin fixDarwinDylibNames; + + cmakeFlags = [ + "-DCMAKE_CXX_FLAGS=-std=c++11" + "-DCLANGD_BUILD_XPC=OFF" + ] ++ stdenv.lib.optionals enableManpages [ + "-DCLANG_INCLUDE_DOCS=ON" + "-DLLVM_ENABLE_SPHINX=ON" + "-DSPHINX_OUTPUT_MAN=ON" + "-DSPHINX_OUTPUT_HTML=OFF" + "-DSPHINX_WARNINGS_AS_ERRORS=OFF" + ] ++ stdenv.lib.optionals enablePolly [ + "-DWITH_POLLY=ON" + "-DLINK_POLLY_INTO_TOOLS=ON" + ]; + + patches = [ + ./purity.patch + # https://reviews.llvm.org/D51899 + ./compiler-rt-baremetal.patch + ]; + + postPatch = '' + sed -i -e 's/DriverArgs.hasArg(options::OPT_nostdlibinc)/true/' \ + -e 's/Args.hasArg(options::OPT_nostdlibinc)/true/' \ + lib/Driver/ToolChains/*.cpp + + # Patch for standalone doc building + sed -i '1s,^,find_package(Sphinx REQUIRED)\n,' docs/CMakeLists.txt + '' + stdenv.lib.optionalString stdenv.hostPlatform.isMusl '' + sed -i -e 's/lgcc_s/lgcc_eh/' lib/Driver/ToolChains/*.cpp + '' + stdenv.lib.optionalString stdenv.hostPlatform.isDarwin '' + substituteInPlace tools/extra/clangd/CMakeLists.txt \ + --replace "NOT HAVE_CXX_ATOMICS64_WITHOUT_LIB" FALSE + ''; + + outputs = [ "out" "lib" "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 + fi + + ln -sv $out/bin/clang $out/bin/cpp + + # Move libclang to 'lib' output + moveToOutput "lib/libclang.*" "$lib" + substituteInPlace $out/lib/cmake/clang/ClangTargets-release.cmake \ + --replace "\''${_IMPORT_PREFIX}/lib/libclang." "$lib/lib/libclang." + + mkdir -p $python/bin $python/share/clang/ + mv $out/bin/{git-clang-format,scan-view} $python/bin + if [ -e $out/bin/set-xcode-analyzer ]; then + mv $out/bin/set-xcode-analyzer $python/bin + fi + mv $out/share/clang/*.py $python/share/clang + rm $out/bin/c-index-test + ''; + + enableParallelBuilding = true; + + passthru = { + isClang = true; + inherit llvm; + } // stdenv.lib.optionalAttrs (stdenv.targetPlatform.isLinux || (stdenv.cc.isGNU && stdenv.cc.cc ? gcc)) { + gcc = if stdenv.cc.isGNU then stdenv.cc.cc else stdenv.cc.cc.gcc; + }; + + meta = { + description = "A c, c++, objective-c, and objective-c++ frontend for the llvm compiler"; + homepage = http://llvm.org/; + license = stdenv.lib.licenses.ncsa; + platforms = stdenv.lib.platforms.all; + }; + } // stdenv.lib.optionalAttrs enableManpages { + pname = "clang-manpages"; + + buildPhase = '' + make docs-clang-man + ''; + + installPhase = '' + mkdir -p $out/share/man/man1 + # Manually install clang manpage + cp docs/man/*.1 $out/share/man/man1/ + ''; + + outputs = [ "out" ]; + + doCheck = false; + + meta.description = "man page for Clang ${version}"; + }); +in self diff --git a/pkgs/development/compilers/llvm/9/clang/purity.patch b/pkgs/development/compilers/llvm/9/clang/purity.patch new file mode 100644 index 00000000000..a6729a9b004 --- /dev/null +++ b/pkgs/development/compilers/llvm/9/clang/purity.patch @@ -0,0 +1,30 @@ +From 4add81bba40dcec62c4ea4481be8e35ac53e89d8 Mon Sep 17 00:00:00 2001 +From: Will Dietz <w@wdtz.org> +Date: Thu, 18 May 2017 11:56:12 -0500 +Subject: [PATCH] "purity" patch for 5.0 + +--- + lib/Driver/ToolChains/Gnu.cpp | 7 ------- + 1 file changed, 7 deletions(-) + +diff --git a/lib/Driver/ToolChains/Gnu.cpp b/lib/Driver/ToolChains/Gnu.cpp +index fe3c0191bb..c6a482bece 100644 +--- a/lib/Driver/ToolChains/Gnu.cpp ++++ b/lib/Driver/ToolChains/Gnu.cpp +@@ -494,13 +494,6 @@ void tools::gnutools::Linker::ConstructJob(Compilation &C, const JobAction &JA, + if (!IsStatic) { + if (Args.hasArg(options::OPT_rdynamic)) + CmdArgs.push_back("-export-dynamic"); +- +- if (!Args.hasArg(options::OPT_shared) && !IsStaticPIE) { +- const std::string Loader = +- D.DyldPrefix + ToolChain.getDynamicLinker(Args); +- CmdArgs.push_back("-dynamic-linker"); +- CmdArgs.push_back(Args.MakeArgString(Loader)); +- } + } + + CmdArgs.push_back("-o"); +-- +2.11.0 + diff --git a/pkgs/development/compilers/llvm/9/compiler-rt-codesign.patch b/pkgs/development/compilers/llvm/9/compiler-rt-codesign.patch new file mode 100644 index 00000000000..3cc12b94b20 --- /dev/null +++ b/pkgs/development/compilers/llvm/9/compiler-rt-codesign.patch @@ -0,0 +1,33 @@ +From 3dec5f3475a26aeb4678627795c4b67c6b7b4785 Mon Sep 17 00:00:00 2001 +From: Will Dietz <w@wdtz.org> +Date: Tue, 19 Sep 2017 13:13:06 -0500 +Subject: [PATCH] remove codesign use on Apple, disable ios sim testing that + needs it + +--- + cmake/Modules/AddCompilerRT.cmake | 8 ------ + test/asan/CMakeLists.txt | 52 --------------------------------------- + test/tsan/CMakeLists.txt | 47 ----------------------------------- + 3 files changed, 107 deletions(-) + +diff --git a/cmake/Modules/AddCompilerRT.cmake b/cmake/Modules/AddCompilerRT.cmake +index bc5fb9ff7..b64eb4246 100644 +--- a/cmake/Modules/AddCompilerRT.cmake ++++ b/cmake/Modules/AddCompilerRT.cmake +@@ -210,14 +210,6 @@ function(add_compiler_rt_runtime name type) + set_target_properties(${libname} PROPERTIES IMPORT_PREFIX "") + set_target_properties(${libname} PROPERTIES IMPORT_SUFFIX ".lib") + endif() +- if(APPLE) +- # Ad-hoc sign the dylibs +- add_custom_command(TARGET ${libname} +- POST_BUILD +- COMMAND codesign --sign - $<TARGET_FILE:${libname}> +- WORKING_DIRECTORY ${COMPILER_RT_LIBRARY_OUTPUT_DIR} +- ) +- endif() + endif() + install(TARGETS ${libname} + ARCHIVE DESTINATION ${COMPILER_RT_LIBRARY_INSTALL_DIR} +2.14.1 + diff --git a/pkgs/development/compilers/llvm/9/compiler-rt.nix b/pkgs/development/compilers/llvm/9/compiler-rt.nix new file mode 100644 index 00000000000..2dbade74af5 --- /dev/null +++ b/pkgs/development/compilers/llvm/9/compiler-rt.nix @@ -0,0 +1,70 @@ +{ stdenv, version, fetch, cmake, python, llvm, libcxxabi }: +stdenv.mkDerivation rec { + pname = "compiler-rt"; + inherit version; + src = fetch pname "03ni43lbkp63lr3p6sc94dphqmvnz5av5mml0xmk930xvnbcvr2n"; + + nativeBuildInputs = [ cmake python llvm ]; + buildInputs = stdenv.lib.optional stdenv.hostPlatform.isDarwin libcxxabi; + + cmakeFlags = [ + "-DCOMPILER_RT_DEFAULT_TARGET_ONLY=ON" + "-DCMAKE_C_COMPILER_TARGET=${stdenv.hostPlatform.config}" + "-DCMAKE_ASM_COMPILER_TARGET=${stdenv.hostPlatform.config}" + ] ++ stdenv.lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ + "-DCMAKE_C_FLAGS=-nodefaultlibs" + "-DCMAKE_CXX_COMPILER_WORKS=ON" + "-DCOMPILER_RT_BUILD_SANITIZERS=OFF" + "-DCOMPILER_RT_BUILD_XRAY=OFF" + "-DCOMPILER_RT_BUILD_LIBFUZZER=OFF" + "-DCOMPILER_RT_BUILD_PROFILE=OFF" + "-DCOMPILER_RT_BAREMETAL_BUILD=ON" + #https://stackoverflow.com/questions/53633705/cmake-the-c-compiler-is-not-able-to-compile-a-simple-test-program + "-DCMAKE_TRY_COMPILE_TARGET_TYPE=STATIC_LIBRARY" + "-DCMAKE_SIZEOF_VOID_P=${toString (stdenv.hostPlatform.parsed.cpu.bits / 8)}" + ] ++ stdenv.lib.optionals stdenv.hostPlatform.isMusl [ + "-DCOMPILER_RT_BUILD_SANITIZERS=OFF" + "-DCOMPILER_RT_BUILD_XRAY=OFF" + "-DCOMPILER_RT_BUILD_LIBFUZZER=OFF" + "-DCOMPILER_RT_BUILD_PROFILE=OFF" + ] ++ stdenv.lib.optionals (stdenv.hostPlatform.parsed.kernel.name == "none") [ + "-DCOMPILER_RT_BAREMETAL_BUILD=ON" + "-DCOMPILER_RT_OS_DIR=baremetal" + ]; + + outputs = [ "out" "dev" ]; + + patches = [ + ./compiler-rt-codesign.patch # Revert compiler-rt commit that makes codesign mandatory + ]# ++ stdenv.lib.optional stdenv.hostPlatform.isMusl ./sanitizers-nongnu.patch + ++ stdenv.lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) ./crtbegin-and-end.patch; + + # TSAN requires XPC on Darwin, which we have no public/free source files for. We can depend on the Apple frameworks + # to get it, but they're unfree. Since LLVM is rather central to the stdenv, we patch out TSAN support so that Hydra + # can build this. If we didn't do it, basically the entire nixpkgs on Darwin would have an unfree dependency and we'd + # get no binary cache for the entire platform. If you really find yourself wanting the TSAN, make this controllable by + # a flag and turn the flag off during the stdenv build. + postPatch = stdenv.lib.optionalString stdenv.isDarwin '' + substituteInPlace cmake/config-ix.cmake \ + --replace 'set(COMPILER_RT_HAS_TSAN TRUE)' 'set(COMPILER_RT_HAS_TSAN FALSE)' + '' + stdenv.lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) '' + substituteInPlace lib/builtins/int_util.c \ + --replace "#include <stdlib.h>" "" + substituteInPlace lib/builtins/clear_cache.c \ + --replace "#include <assert.h>" "" + substituteInPlace lib/builtins/cpu_model.c \ + --replace "#include <assert.h>" "" + ''; + + # Hack around weird upsream RPATH bug + postInstall = stdenv.lib.optionalString (stdenv.hostPlatform.isDarwin || stdenv.hostPlatform.isWasm) '' + ln -s "$out/lib"/*/* "$out/lib" + '' + stdenv.lib.optionalString (stdenv.hostPlatform.useLLVM or false) '' + 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 + ln -s $out/lib/*/clang_rt.crtend_shared-*.o $out/lib/crtendS.o + ''; + + enableParallelBuilding = true; +} diff --git a/pkgs/development/compilers/llvm/9/crtbegin-and-end.patch b/pkgs/development/compilers/llvm/9/crtbegin-and-end.patch new file mode 100644 index 00000000000..e63be181f95 --- /dev/null +++ b/pkgs/development/compilers/llvm/9/crtbegin-and-end.patch @@ -0,0 +1,595 @@ +Get crtbegin and crtend without compiler GCC! PR is at https://reviews.llvm.org/D28791 + +Index: compiler-rt/CMakeLists.txt +=================================================================== +--- compiler-rt/CMakeLists.txt ++++ compiler-rt/CMakeLists.txt +@@ -29,6 +29,8 @@ + + option(COMPILER_RT_BUILD_BUILTINS "Build builtins" ON) + mark_as_advanced(COMPILER_RT_BUILD_BUILTINS) ++option(COMPILER_RT_BUILD_CRT "Build crtbegin.o/crtend.o" ON) ++mark_as_advanced(COMPILER_RT_BUILD_CRT) + option(COMPILER_RT_BUILD_SANITIZERS "Build sanitizers" ON) + mark_as_advanced(COMPILER_RT_BUILD_SANITIZERS) + option(COMPILER_RT_BUILD_XRAY "Build xray" ON) +Index: compiler-rt/cmake/Modules/AddCompilerRT.cmake +=================================================================== +--- compiler-rt/cmake/Modules/AddCompilerRT.cmake ++++ compiler-rt/cmake/Modules/AddCompilerRT.cmake +@@ -132,7 +132,7 @@ + # Adds static or shared runtime for a list of architectures and operating + # systems and puts it in the proper directory in the build and install trees. + # add_compiler_rt_runtime(<name> +-# {STATIC|SHARED} ++# {OBJECT|STATIC|SHARED} + # ARCHS <architectures> + # OS <os list> + # SOURCES <source files> +@@ -144,8 +144,8 @@ + # PARENT_TARGET <convenience parent target> + # ADDITIONAL_HEADERS <header files>) + function(add_compiler_rt_runtime name type) +- if(NOT type MATCHES "^(STATIC|SHARED)$") +- message(FATAL_ERROR "type argument must be STATIC or SHARED") ++ if(NOT type MATCHES "^(OBJECT|STATIC|SHARED)$") ++ message(FATAL_ERROR "type argument must be OBJECT, STATIC or SHARED") + return() + endif() + cmake_parse_arguments(LIB +@@ -204,7 +204,10 @@ + message(FATAL_ERROR "Architecture ${arch} can't be targeted") + return() + endif() +- if(type STREQUAL "STATIC") ++ if(type STREQUAL "OBJECT") ++ set(libname "${name}-${arch}") ++ set(output_name_${libname} ${libname}${COMPILER_RT_OS_SUFFIX}) ++ elseif(type STREQUAL "STATIC") + set(libname "${name}-${arch}") + set_output_name(output_name_${libname} ${name} ${arch}) + else() +@@ -270,12 +273,34 @@ + set(COMPONENT_OPTION COMPONENT ${libname}) + endif() + +- add_library(${libname} ${type} ${sources_${libname}}) +- set_target_compile_flags(${libname} ${extra_cflags_${libname}}) +- set_target_link_flags(${libname} ${extra_link_flags_${libname}}) +- set_property(TARGET ${libname} APPEND PROPERTY +- COMPILE_DEFINITIONS ${LIB_DEFS}) +- set_target_output_directories(${libname} ${output_dir_${libname}}) ++ if(type STREQUAL "OBJECT") ++ string(TOUPPER ${CMAKE_BUILD_TYPE} config) ++ get_property(cflags SOURCE ${sources_${libname}} PROPERTY COMPILE_FLAGS) ++ separate_arguments(cflags) ++ add_custom_command( ++ OUTPUT ${output_dir_${libname}}/${libname}.o ++ COMMAND ${CMAKE_C_COMPILER} ${sources_${libname}} ${cflags} ${extra_cflags_${libname}} -c -o ${output_dir_${libname}}/${libname}.o ++ DEPENDS ${sources_${libname}} ++ COMMENT "Building C object ${libname}.o") ++ add_custom_target(${libname} DEPENDS ${output_dir_${libname}}/${libname}.o) ++ install(FILES ${output_dir_${libname}}/${libname}.o ++ DESTINATION ${install_dir_${libname}} ++ ${COMPONENT_OPTION}) ++ else() ++ add_library(${libname} ${type} ${sources_${libname}}) ++ set_target_compile_flags(${libname} ${extra_cflags_${libname}}) ++ set_target_link_flags(${libname} ${extra_link_flags_${libname}}) ++ set_property(TARGET ${libname} APPEND PROPERTY ++ COMPILE_DEFINITIONS ${LIB_DEFS}) ++ set_target_output_directories(${libname} ${output_dir_${libname}}) ++ install(TARGETS ${libname} ++ ARCHIVE DESTINATION ${install_dir_${libname}} ++ ${COMPONENT_OPTION} ++ LIBRARY DESTINATION ${install_dir_${libname}} ++ ${COMPONENT_OPTION} ++ RUNTIME DESTINATION ${install_dir_${libname}} ++ ${COMPONENT_OPTION}) ++ endif() + set_target_properties(${libname} PROPERTIES + OUTPUT_NAME ${output_name_${libname}}) + set_target_properties(${libname} PROPERTIES FOLDER "Compiler-RT Runtime") +@@ -299,13 +324,6 @@ + ) + endif() + endif() +- install(TARGETS ${libname} +- ARCHIVE DESTINATION ${install_dir_${libname}} +- ${COMPONENT_OPTION} +- LIBRARY DESTINATION ${install_dir_${libname}} +- ${COMPONENT_OPTION} +- RUNTIME DESTINATION ${install_dir_${libname}} +- ${COMPONENT_OPTION}) + + # We only want to generate per-library install targets if you aren't using + # an IDE because the extra targets get cluttered in IDEs. +Index: compiler-rt/cmake/config-ix.cmake +=================================================================== +--- compiler-rt/cmake/config-ix.cmake ++++ compiler-rt/cmake/config-ix.cmake +@@ -227,6 +227,7 @@ + ${ARM32} ${ARM64} ${MIPS32} ${MIPS64} ${S390X}) + set(ALL_ASAN_SUPPORTED_ARCH ${X86} ${X86_64} ${ARM32} ${ARM64} + ${MIPS32} ${MIPS64} ${PPC64} ${S390X}) ++set(ALL_CRT_SUPPORTED_ARCH ${X86} ${X86_64} ${ARM32} ${ARM64}) + set(ALL_DFSAN_SUPPORTED_ARCH ${X86_64} ${MIPS64} ${ARM64}) + set(ALL_FUZZER_SUPPORTED_ARCH ${X86_64} ${ARM64}) + +@@ -474,6 +475,7 @@ + SANITIZER_COMMON_SUPPORTED_ARCH) + + else() ++ filter_available_targets(CRT_SUPPORTED_ARCH ${ALL_CRT_SUPPORTED_ARCH}) + # Architectures supported by compiler-rt libraries. + filter_available_targets(SANITIZER_COMMON_SUPPORTED_ARCH + ${ALL_SANITIZER_COMMON_SUPPORTED_ARCH}) +@@ -563,6 +565,12 @@ + + # TODO: Add builtins support. + ++if (CRT_SUPPORTED_ARCH AND OS_NAME MATCHES "Linux") ++ set(COMPILER_RT_HAS_CRT TRUE) ++else() ++ set(COMPILER_RT_HAS_CRT FALSE) ++endif() ++ + if (COMPILER_RT_HAS_SANITIZER_COMMON AND DFSAN_SUPPORTED_ARCH AND + OS_NAME MATCHES "Linux") + set(COMPILER_RT_HAS_DFSAN TRUE) +Index: compiler-rt/lib/CMakeLists.txt +=================================================================== +--- compiler-rt/lib/CMakeLists.txt ++++ compiler-rt/lib/CMakeLists.txt +@@ -17,6 +17,10 @@ + add_subdirectory(builtins) + endif() + ++if(COMPILER_RT_BUILD_CRT) ++ add_subdirectory(crt) ++endif() ++ + function(compiler_rt_build_runtime runtime) + string(TOUPPER ${runtime} runtime_uppercase) + if(COMPILER_RT_HAS_${runtime_uppercase}) +Index: compiler-rt/lib/crt/CMakeLists.txt +=================================================================== +--- /dev/null ++++ compiler-rt/lib/crt/CMakeLists.txt +@@ -0,0 +1,102 @@ ++add_compiler_rt_component(crt) ++ ++function(check_cxx_section_exists section output) ++ cmake_parse_arguments(ARG "" "" "SOURCE;FLAGS" ${ARGN}) ++ if(NOT ARG_SOURCE) ++ set(ARG_SOURCE "int main() { return 0; }\n") ++ endif() ++ ++ string(RANDOM TARGET_NAME) ++ set(TARGET_NAME "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/cmTC_${TARGET_NAME}.dir") ++ file(MAKE_DIRECTORY ${TARGET_NAME}) ++ ++ file(WRITE "${TARGET_NAME}/CheckSectionExists.c" "${ARG_SOURCE}\n") ++ ++ string(REGEX MATCHALL "<[A-Za-z0-9_]*>" substitutions ++ ${CMAKE_C_COMPILE_OBJECT}) ++ ++ set(try_compile_flags "${ARG_FLAGS}") ++ if(CMAKE_C_COMPILER_ID MATCHES Clang AND CMAKE_C_COMPILER_TARGET) ++ list(APPEND try_compile_flags "-target ${CMAKE_C_COMPILER_TARGET}") ++ endif() ++ ++ string(REPLACE ";" " " extra_flags "${try_compile_flags}") ++ ++ set(test_compile_command "${CMAKE_C_COMPILE_OBJECT}") ++ foreach(substitution ${substitutions}) ++ if(substitution STREQUAL "<CMAKE_C_COMPILER>") ++ string(REPLACE "<CMAKE_C_COMPILER>" ++ "${CMAKE_C_COMPILER}" test_compile_command ${test_compile_command}) ++ elseif(substitution STREQUAL "<OBJECT>") ++ string(REPLACE "<OBJECT>" "${TARGET_NAME}/CheckSectionExists.o" ++ test_compile_command ${test_compile_command}) ++ elseif(substitution STREQUAL "<SOURCE>") ++ string(REPLACE "<SOURCE>" "${TARGET_NAME}/CheckSectionExists.c" ++ test_compile_command ${test_compile_command}) ++ elseif(substitution STREQUAL "<FLAGS>") ++ string(REPLACE "<FLAGS>" "${CMAKE_C_FLAGS} ${extra_flags}" ++ test_compile_command ${test_compile_command}) ++ else() ++ string(REPLACE "${substitution}" "" test_compile_command ++ ${test_compile_command}) ++ endif() ++ endforeach() ++ ++ string(REPLACE " " ";" test_compile_command "${test_compile_command}") ++ ++ execute_process( ++ COMMAND ${test_compile_command} ++ RESULT_VARIABLE TEST_RESULT ++ OUTPUT_VARIABLE TEST_OUTPUT ++ ERROR_VARIABLE TEST_ERROR ++ ) ++ ++ execute_process( ++ COMMAND ${CMAKE_OBJDUMP} -h "${TARGET_NAME}/CheckSectionExists.o" ++ RESULT_VARIABLE CHECK_RESULT ++ OUTPUT_VARIABLE CHECK_OUTPUT ++ ERROR_VARIABLE CHECK_ERROR ++ ) ++ string(FIND "${CHECK_OUTPUT}" "${section}" SECTION_FOUND) ++ ++ if(NOT SECTION_FOUND EQUAL -1) ++ set(${output} TRUE PARENT_SCOPE) ++ else() ++ set(${output} FALSE PARENT_SCOPE) ++ endif() ++ ++ file(REMOVE_RECURSE ${TARGET_NAME}) ++endfunction() ++ ++check_cxx_section_exists(".init_array" COMPILER_RT_HAS_INITFINI_ARRAY ++ SOURCE "__attribute__((constructor)) void f() {}\nint main() { return 0; }\n") ++ ++append_list_if(COMPILER_RT_HAS_INITFINI_ARRAY -DCRT_HAS_INITFINI_ARRAY CRT_CFLAGS) ++append_list_if(COMPILER_RT_HAS_FPIC_FLAG -fPIC CRT_CFLAGS) ++ ++foreach(arch ${CRT_SUPPORTED_ARCH}) ++ add_compiler_rt_runtime(clang_rt.crtbegin ++ OBJECT ++ ARCHS ${arch} ++ SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/crtbegin.c ++ CFLAGS ${CRT_CFLAGS} ++ PARENT_TARGET crt) ++ add_compiler_rt_runtime(clang_rt.crtbegin_shared ++ OBJECT ++ ARCHS ${arch} ++ SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/crtbegin.c ++ CFLAGS ${CRT_CFLAGS} -DCRT_SHARED ++ PARENT_TARGET crt) ++ add_compiler_rt_runtime(clang_rt.crtend ++ OBJECT ++ ARCHS ${arch} ++ SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/crtend.c ++ CFLAGS ${CRT_CFLAGS} ++ PARENT_TARGET crt) ++ add_compiler_rt_runtime(clang_rt.crtend_shared ++ OBJECT ++ ARCHS ${arch} ++ SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/crtend.c ++ CFLAGS ${CRT_CFLAGS} -DCRT_SHARED ++ PARENT_TARGET crt) ++endforeach() +Index: compiler-rt/lib/crt/crtbegin.c +=================================================================== +--- /dev/null ++++ compiler-rt/lib/crt/crtbegin.c +@@ -0,0 +1,108 @@ ++/* ===-- crtbegin.c - Start of constructors and destructors ----------------=== ++ * ++ * The LLVM Compiler Infrastructure ++ * ++ * This file is dual licensed under the MIT and the University of Illinois Open ++ * Source Licenses. See LICENSE.TXT for details. ++ * ++ * ===----------------------------------------------------------------------=== ++ */ ++ ++#include <stddef.h> ++ ++__attribute__((visibility("hidden"))) ++#ifdef CRT_SHARED ++void *__dso_handle = &__dso_handle; ++#else ++void *__dso_handle = (void *)0; ++#endif ++ ++static long __EH_FRAME_LIST__[] ++ __attribute__((section(".eh_frame"), aligned(sizeof(void *)))) = {}; ++ ++extern void __register_frame_info(const void *, void *) __attribute__((weak)); ++extern void *__deregister_frame_info(const void *) __attribute__((weak)); ++ ++#ifndef CRT_HAS_INITFINI_ARRAY ++typedef void (*fp)(void); ++ ++static fp __CTOR_LIST__[] ++ __attribute__((section(".ctors"), aligned(sizeof(fp)), used)) = {(fp)-1}; ++extern fp __CTOR_LIST_END__[]; ++#endif ++ ++#ifdef CRT_SHARED ++extern void __cxa_finalize(void *) __attribute__((weak)); ++#endif ++ ++static void __attribute__((used)) __do_init() { ++ static _Bool __initialized; ++ if (__builtin_expect(__initialized, 0)) ++ return; ++ __initialized = 1; ++ ++ static struct { void *p[8]; } __object; ++ if (__register_frame_info) ++ __register_frame_info(__EH_FRAME_LIST__, &__object); ++ ++#ifndef CRT_HAS_INITFINI_ARRAY ++ const size_t n = __CTOR_LIST_END__ - __CTOR_LIST__ - 1; ++ for (size_t i = n; i >= 1; i--) __CTOR_LIST__[i](); ++#endif ++} ++ ++#ifdef CRT_HAS_INITFINI_ARRAY ++__attribute__((section(".init_array"), ++ used)) static void (*__init)(void) = __do_init; ++#else // CRT_HAS_INITFINI_ARRAY ++#if defined(__i386__) || defined(__x86_64__) ++asm(".pushsection .init,\"ax\",@progbits\n\t" ++ "call " __USER_LABEL_PREFIX__ "__do_init\n\t" ++ ".popsection"); ++#elif defined(__arm__) ++asm(".pushsection .init,\"ax\",%progbits\n\t" ++ "bl " __USER_LABEL_PREFIX__ "__do_init\n\t" ++ ".popsection"); ++#endif // CRT_HAS_INITFINI_ARRAY ++#endif ++ ++#ifndef CRT_HAS_INITFINI_ARRAY ++static fp __DTOR_LIST__[] ++ __attribute__((section(".dtors"), aligned(sizeof(fp)), used)) = {(fp)-1}; ++extern fp __DTOR_LIST_END__[]; ++#endif ++ ++static void __attribute__((used)) __do_fini() { ++ static _Bool __finalized; ++ if (__builtin_expect(__finalized, 0)) ++ return; ++ __finalized = 1; ++ ++#ifdef CRT_SHARED ++ if (__cxa_finalize) ++ __cxa_finalize(__dso_handle); ++#endif ++ ++#ifndef CRT_HAS_INITFINI_ARRAY ++ if (__deregister_frame_info) ++ __deregister_frame_info(__EH_FRAME_LIST__); ++ ++ const size_t n = __DTOR_LIST_END__ - __DTOR_LIST__ - 1; ++ for (size_t i = 1; i < n; i++) __DTOR_LIST__[i](); ++#endif ++} ++ ++#ifdef CRT_HAS_INITFINI_ARRAY ++__attribute__((section(".fini_array"), ++ used)) static void (*__fini)(void) = __do_fini; ++#else // CRT_HAS_INITFINI_ARRAY ++#if defined(__i386__) || defined(__x86_64__) ++asm(".pushsection .fini,\"ax\",@progbits\n\t" ++ "call " __USER_LABEL_PREFIX__ "__do_fini\n\t" ++ ".popsection"); ++#elif defined(__arm__) ++asm(".pushsection .fini,\"ax\",%progbits\n\t" ++ "bl " __USER_LABEL_PREFIX__ "__do_fini\n\t" ++ ".popsection"); ++#endif ++#endif // CRT_HAS_INIT_FINI_ARRAY +Index: compiler-rt/lib/crt/crtend.c +=================================================================== +--- /dev/null ++++ compiler-rt/lib/crt/crtend.c +@@ -0,0 +1,24 @@ ++/* ===-- crtend.c - End of constructors and destructors --------------------=== ++ * ++ * The LLVM Compiler Infrastructure ++ * ++ * This file is dual licensed under the MIT and the University of Illinois Open ++ * Source Licenses. See LICENSE.TXT for details. ++ * ++ * ===----------------------------------------------------------------------=== ++ */ ++ ++#include <stdint.h> ++ ++// Put 4-byte zero which is the length field in FDE at the end as a terminator. ++const int32_t __EH_FRAME_LIST_END__[] ++ __attribute__((section(".eh_frame"), aligned(sizeof(int32_t)), ++ visibility("hidden"), used)) = {0}; ++ ++#ifndef CRT_HAS_INITFINI_ARRAY ++typedef void (*fp)(void); ++fp __CTOR_LIST_END__[] ++ __attribute__((section(".ctors"), visibility("hidden"), used)) = {0}; ++fp __DTOR_LIST_END__[] ++ __attribute__((section(".dtors"), visibility("hidden"), used)) = {0}; ++#endif +Index: compiler-rt/test/CMakeLists.txt +=================================================================== +--- compiler-rt/test/CMakeLists.txt ++++ compiler-rt/test/CMakeLists.txt +@@ -73,6 +73,9 @@ + if(COMPILER_RT_BUILD_XRAY) + compiler_rt_test_runtime(xray) + endif() ++ if(COMPILER_RT_HAS_CRT) ++ add_subdirectory(crt) ++ endif() + # ShadowCallStack does not yet provide a runtime with compiler-rt, the tests + # include their own minimal runtime + add_subdirectory(shadowcallstack) +Index: compiler-rt/test/crt/CMakeLists.txt +=================================================================== +--- /dev/null ++++ compiler-rt/test/crt/CMakeLists.txt +@@ -0,0 +1,31 @@ ++set(CRT_LIT_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}) ++ ++set(CRT_TESTSUITES) ++ ++set(CRT_TEST_DEPS "") ++ ++if(NOT COMPILER_RT_STANDALONE_BUILD AND COMPILER_RT_BUILD_CRT AND ++ COMPILER_RT_HAS_CRT) ++ list(APPEND CRT_TEST_DEPS crt) ++endif() ++ ++set(CRT_TEST_ARCH ${CRT_SUPPORTED_ARCH}) ++if (COMPILER_RT_BUILD_CRT AND COMPILER_RT_HAS_CRT) ++ foreach(arch ${CRT_TEST_ARCH}) ++ set(CRT_TEST_TARGET_ARCH ${arch}) ++ string(TOLOWER "-${arch}-${OS_NAME}" CRT_TEST_CONFIG_SUFFIX) ++ get_test_cc_for_arch(${arch} CRT_TEST_TARGET_CC CRT_TEST_TARGET_CFLAGS) ++ string(TOUPPER ${arch} ARCH_UPPER_CASE) ++ set(CONFIG_NAME ${ARCH_UPPER_CASE}${OS_NAME}Config) ++ ++ configure_lit_site_cfg( ++ ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.in ++ ${CMAKE_CURRENT_BINARY_DIR}/${CONFIG_NAME}/lit.site.cfg) ++ list(APPEND CRT_TESTSUITES ${CMAKE_CURRENT_BINARY_DIR}/${CONFIG_NAME}) ++ endforeach() ++endif() ++ ++add_lit_testsuite(check-crt "Running the CRT tests" ++ ${CRT_TESTSUITES} ++ DEPENDS ${CRT_TEST_DEPS}) ++set_target_properties(check-crt PROPERTIES FOLDER "Compiler-RT Misc") +Index: compiler-rt/test/crt/dso_handle.cpp +=================================================================== +--- /dev/null ++++ compiler-rt/test/crt/dso_handle.cpp +@@ -0,0 +1,33 @@ ++// RUN: %clangxx -g -DCRT_SHARED -c %s -fPIC -o %tshared.o ++// RUN: %clangxx -g -c %s -fPIC -o %t.o ++// RUN: %clangxx -g -shared -o %t.so -nostdlib %crti %shared_crtbegin %tshared.o %libstdcxx -lc -lm -lgcc_s %shared_crtend %crtn ++// RUN: %clangxx -g -o %t -nostdlib %crt1 %crti %crtbegin %t.o %libstdcxx -lc -lm %libgcc %t.so %crtend %crtn ++// RUN: %run %t 2>&1 | FileCheck %s ++ ++#include <stdio.h> ++ ++// CHECK: 1 ++// CHECK-NEXT: ~A() ++ ++#ifdef CRT_SHARED ++bool G; ++void C() { ++ printf("%d\n", G); ++} ++ ++struct A { ++ A() { G = true; } ++ ~A() { ++ printf("~A()\n"); ++ } ++}; ++ ++A a; ++#else ++void C(); ++ ++int main() { ++ C(); ++ return 0; ++} ++#endif +Index: compiler-rt/test/crt/lit.cfg +=================================================================== +--- /dev/null ++++ compiler-rt/test/crt/lit.cfg +@@ -0,0 +1,80 @@ ++# -*- Python -*- ++ ++import os ++import subprocess ++ ++# Setup config name. ++config.name = 'CRT' + config.name_suffix ++ ++# Setup source root. ++config.test_source_root = os.path.dirname(__file__) ++ ++ ++def get_library_path(file): ++ cmd = subprocess.Popen([config.clang.strip(), ++ config.target_cflags.strip(), ++ '-print-file-name=%s' % file], ++ stdout=subprocess.PIPE, ++ env=config.environment) ++ if not cmd.stdout: ++ lit_config.fatal("Couldn't find the library path for '%s'" % file) ++ dir = cmd.stdout.read().strip() ++ if sys.platform in ['win32'] and execute_external: ++ # Don't pass dosish path separator to msys bash.exe. ++ dir = dir.replace('\\', '/') ++ # Ensure the result is an ascii string, across Python2.5+ - Python3. ++ return str(dir.decode('ascii')) ++ ++ ++def get_libgcc_file_name(): ++ cmd = subprocess.Popen([config.clang.strip(), ++ config.target_cflags.strip(), ++ '-print-libgcc-file-name'], ++ stdout=subprocess.PIPE, ++ env=config.environment) ++ if not cmd.stdout: ++ lit_config.fatal("Couldn't find the library path for '%s'" % file) ++ dir = cmd.stdout.read().strip() ++ if sys.platform in ['win32'] and execute_external: ++ # Don't pass dosish path separator to msys bash.exe. ++ dir = dir.replace('\\', '/') ++ # Ensure the result is an ascii string, across Python2.5+ - Python3. ++ return str(dir.decode('ascii')) ++ ++ ++def build_invocation(compile_flags): ++ return ' ' + ' '.join([config.clang] + compile_flags) + ' ' ++ ++ ++# Setup substitutions. ++config.substitutions.append( ++ ('%clang ', build_invocation([config.target_cflags]))) ++config.substitutions.append( ++ ('%clangxx ', ++ build_invocation(config.cxx_mode_flags + [config.target_cflags]))) ++ ++base_lib = os.path.join( ++ config.compiler_rt_libdir, "clang_rt.%%s-%s.o" % config.target_arch) ++config.substitutions.append(('%crtbegin', base_lib % "crtbegin")) ++config.substitutions.append(('%shared_crtbegin', base_lib % "crtbegin_shared")) ++config.substitutions.append(('%crtend', base_lib % "crtend")) ++config.substitutions.append(('%shared_crtend', base_lib % "crtend_shared")) ++ ++config.substitutions.append( ++ ('%crt1', get_library_path('crt1.o'))) ++config.substitutions.append( ++ ('%crti', get_library_path('crti.o'))) ++config.substitutions.append( ++ ('%crtn', get_library_path('crtn.o'))) ++ ++config.substitutions.append( ++ ('%libgcc', get_libgcc_file_name())) ++ ++config.substitutions.append( ++ ('%libstdcxx', '-l' + config.sanitizer_cxx_lib.lstrip('lib'))) ++ ++# Default test suffixes. ++config.suffixes = ['.c', '.cc', '.cpp'] ++ ++if config.host_os not in ['Linux']: ++ config.unsupported = True +Index: compiler-rt/test/crt/lit.site.cfg.in +=================================================================== +--- /dev/null ++++ compiler-rt/test/crt/lit.site.cfg.in +@@ -0,0 +1,14 @@ ++@LIT_SITE_CFG_IN_HEADER@ ++ ++# Tool-specific config options. ++config.name_suffix = "@CRT_TEST_CONFIG_SUFFIX@" ++config.crt_lit_source_dir = "@CRT_LIT_SOURCE_DIR@" ++config.target_cflags = "@CRT_TEST_TARGET_CFLAGS@" ++config.target_arch = "@CRT_TEST_TARGET_ARCH@" ++config.sanitizer_cxx_lib = "@SANITIZER_TEST_CXX_LIBNAME@" ++ ++# Load common config for all compiler-rt lit tests ++lit_config.load_config(config, "@COMPILER_RT_BINARY_DIR@/test/lit.common.configured") ++ ++# Load tool-specific config that would do the real work. ++lit_config.load_config(config, "@CRT_LIT_SOURCE_DIR@/lit.cfg") diff --git a/pkgs/development/compilers/llvm/9/default.nix b/pkgs/development/compilers/llvm/9/default.nix new file mode 100644 index 00000000000..1590d180c3f --- /dev/null +++ b/pkgs/development/compilers/llvm/9/default.nix @@ -0,0 +1,197 @@ +{ lowPrio, newScope, pkgs, stdenv, cmake, libstdcxxHook +, libxml2, python, isl, fetchurl, overrideCC, wrapCCWith, wrapBintoolsWith +, buildLlvmTools # tools, but from the previous stage, for cross +, targetLlvmLibraries # libraries, but from the next stage, for cross +}: + +let + release_version = "9.0.0"; + version = release_version; # differentiating these is important for rc's + + fetch = name: sha256: fetchurl { + url = "https://releases.llvm.org/${release_version}/${name}-${version}.src.tar.xz"; + inherit sha256; + }; + + clang-tools-extra_src = fetch "clang-tools-extra" "045cldmcfd8s33wyjlviifgpnw52yqicd6v4ysvdg4i96p78c77a"; + + tools = stdenv.lib.makeExtensible (tools: let + callPackage = newScope (tools // { inherit stdenv cmake libxml2 python isl release_version version fetch; }); + mkExtraBuildCommands = cc: '' + rsrc="$out/resource-root" + mkdir "$rsrc" + ln -s "${cc}/lib/clang/${release_version}/include" "$rsrc" + ln -s "${targetLlvmLibraries.compiler-rt.out}/lib" "$rsrc/lib" + echo "-resource-dir=$rsrc" >> $out/nix-support/cc-cflags + '' + stdenv.lib.optionalString (stdenv.targetPlatform.isLinux && tools.clang-unwrapped ? gcc && !(stdenv.targetPlatform.useLLVM or false)) '' + echo "--gcc-toolchain=${tools.clang-unwrapped.gcc}" >> $out/nix-support/cc-cflags + ''; + in { + + llvm = callPackage ./llvm.nix { }; + llvm-polly = callPackage ./llvm.nix { enablePolly = true; }; + + clang-unwrapped = callPackage ./clang { + inherit clang-tools-extra_src; + }; + clang-polly-unwrapped = callPackage ./clang { + inherit clang-tools-extra_src; + llvm = tools.llvm-polly; + enablePolly = true; + }; + + llvm-manpages = lowPrio (tools.llvm.override { + enableManpages = true; + python = pkgs.python; # don't use python-boot + }); + + clang-manpages = lowPrio (tools.clang-unwrapped.override { + enableManpages = true; + python = pkgs.python; # don't use python-boot + }); + + libclang = tools.clang-unwrapped.lib; + + clang = if stdenv.cc.isGNU then tools.libstdcxxClang else tools.libcxxClang; + + libstdcxxClang = wrapCCWith rec { + cc = tools.clang-unwrapped; + extraPackages = [ + libstdcxxHook + targetLlvmLibraries.compiler-rt + ]; + extraBuildCommands = mkExtraBuildCommands cc; + }; + + libcxxClang = wrapCCWith rec { + cc = tools.clang-unwrapped; + libcxx = targetLlvmLibraries.libcxx; + extraPackages = [ + targetLlvmLibraries.libcxx + targetLlvmLibraries.libcxxabi + targetLlvmLibraries.compiler-rt + ]; + extraBuildCommands = mkExtraBuildCommands cc; + }; + + lld = callPackage ./lld.nix {}; + + lldb = callPackage ./lldb.nix {}; + + # Below, is the LLVM bootstrapping logic. It handles building a + # fully LLVM toolchain from scratch. No GCC toolchain should be + # pulled in. As a consequence, it is very quick to build different + # targets provided by LLVM and we can also build for what GCC + # doesn’t support like LLVM. Probably we should move to some other + # file. + + bintools = callPackage ./bintools.nix {}; + + lldClang = wrapCCWith rec { + cc = tools.clang-unwrapped; + libcxx = targetLlvmLibraries.libcxx; + bintools = wrapBintoolsWith { + inherit (tools) bintools; + }; + extraPackages = [ + targetLlvmLibraries.libcxx + targetLlvmLibraries.libcxxabi + targetLlvmLibraries.compiler-rt + ] ++ stdenv.lib.optionals (!stdenv.targetPlatform.isWasm) [ + targetLlvmLibraries.libunwind + ]; + extraBuildCommands = '' + echo "-target ${stdenv.targetPlatform.config}" >> $out/nix-support/cc-cflags + echo "-rtlib=compiler-rt -Wno-unused-command-line-argument" >> $out/nix-support/cc-cflags + echo "-B${targetLlvmLibraries.compiler-rt}/lib" >> $out/nix-support/cc-cflags + '' + stdenv.lib.optionalString (!stdenv.targetPlatform.isWasm) '' + echo "--unwindlib=libunwind" >> $out/nix-support/cc-cflags + '' + stdenv.lib.optionalString stdenv.targetPlatform.isWasm '' + echo "-fno-exceptions" >> $out/nix-support/cc-cflags + '' + mkExtraBuildCommands cc; + }; + + lldClangNoLibcxx = wrapCCWith rec { + cc = tools.clang-unwrapped; + libcxx = null; + bintools = wrapBintoolsWith { + inherit (tools) bintools; + }; + extraPackages = [ + targetLlvmLibraries.compiler-rt + ]; + extraBuildCommands = '' + echo "-target ${stdenv.targetPlatform.config}" >> $out/nix-support/cc-cflags + echo "-rtlib=compiler-rt" >> $out/nix-support/cc-cflags + echo "-B${targetLlvmLibraries.compiler-rt}/lib" >> $out/nix-support/cc-cflags + echo "-nostdlib++" >> $out/nix-support/cc-cflags + '' + mkExtraBuildCommands cc; + }; + + lldClangNoLibc = wrapCCWith rec { + cc = tools.clang-unwrapped; + libcxx = null; + bintools = wrapBintoolsWith { + inherit (tools) bintools; + libc = null; + }; + extraPackages = [ + targetLlvmLibraries.compiler-rt + ]; + extraBuildCommands = '' + echo "-target ${stdenv.targetPlatform.config}" >> $out/nix-support/cc-cflags + echo "-rtlib=compiler-rt" >> $out/nix-support/cc-cflags + echo "-B${targetLlvmLibraries.compiler-rt}/lib" >> $out/nix-support/cc-cflags + '' + mkExtraBuildCommands cc; + }; + + lldClangNoCompilerRt = wrapCCWith { + cc = tools.clang-unwrapped; + libcxx = null; + bintools = wrapBintoolsWith { + inherit (tools) bintools; + libc = null; + }; + extraPackages = [ ]; + extraBuildCommands = '' + echo "-nostartfiles" >> $out/nix-support/cc-cflags + echo "-target ${stdenv.targetPlatform.config}" >> $out/nix-support/cc-cflags + ''; + }; + + }); + + libraries = stdenv.lib.makeExtensible (libraries: let + callPackage = newScope (libraries // buildLlvmTools // { inherit stdenv cmake libxml2 python isl release_version version fetch; }); + in { + + compiler-rt = callPackage ./compiler-rt.nix ({} // + (stdenv.lib.optionalAttrs (stdenv.hostPlatform.useLLVM or false) { + stdenv = overrideCC stdenv buildLlvmTools.lldClangNoCompilerRt; + })); + + stdenv = overrideCC stdenv buildLlvmTools.clang; + + libcxxStdenv = overrideCC stdenv buildLlvmTools.libcxxClang; + + libcxx = callPackage ./libc++ ({} // + (stdenv.lib.optionalAttrs (stdenv.hostPlatform.useLLVM or false) { + stdenv = overrideCC stdenv buildLlvmTools.lldClangNoLibcxx; + })); + + libcxxabi = callPackage ./libc++abi.nix ({} // + (stdenv.lib.optionalAttrs (stdenv.hostPlatform.useLLVM or false) { + stdenv = overrideCC stdenv buildLlvmTools.lldClangNoLibcxx; + libunwind = libraries.libunwind; + })); + + openmp = callPackage ./openmp.nix {}; + + libunwind = callPackage ./libunwind.nix ({} // + (stdenv.lib.optionalAttrs (stdenv.hostPlatform.useLLVM or false) { + stdenv = overrideCC stdenv buildLlvmTools.lldClangNoLibcxx; + })); + + }); + +in { inherit tools libraries; } // libraries // tools diff --git a/pkgs/development/compilers/llvm/9/fix-test-on-non-x86-like-others.patch b/pkgs/development/compilers/llvm/9/fix-test-on-non-x86-like-others.patch new file mode 100644 index 00000000000..e6c2f040684 --- /dev/null +++ b/pkgs/development/compilers/llvm/9/fix-test-on-non-x86-like-others.patch @@ -0,0 +1,23 @@ +Index: test/tools/gold/X86/linkonce_odr_unnamed_addr.ll +=================================================================== +diff --git a/test/tools/gold/X86/linkonce_odr_unnamed_addr.ll b/llvm/trunk/test/tools/gold/X86/linkonce_odr_unnamed_addr.ll +--- a/test/tools/gold/X86/linkonce_odr_unnamed_addr.ll (revision 372333) ++++ b/test/tools/gold/X86/linkonce_odr_unnamed_addr.ll (working copy) +@@ -3,7 +3,7 @@ + + ; RUN: opt -module-summary %s -o %t.o + ; RUN: opt -module-summary %p/Inputs/linkonce_odr_unnamed_addr.ll -o %t2.o +-; RUN: %gold -plugin %llvmshlibdir/LLVMgold%shlibext \ ++; RUN: %gold -m elf_x86_64 -plugin %llvmshlibdir/LLVMgold%shlibext \ + ; RUN: --plugin-opt=save-temps \ + ; RUN: %t.o %t2.o -o %t3.o + ; RUN: llvm-dis %t.o.1.promote.bc -o - | FileCheck %s +@@ -11,7 +11,7 @@ + ; Now test when one module is a native object. In that case we must be + ; conservative and not auto hide. + ; RUN: llc %p/Inputs/linkonce_odr_unnamed_addr.ll -o %t2native.o -filetype=obj +-; RUN: %gold -plugin %llvmshlibdir/LLVMgold%shlibext \ ++; RUN: %gold -m elf_x86_64 -plugin %llvmshlibdir/LLVMgold%shlibext \ + ; RUN: --plugin-opt=save-temps \ + ; RUN: %t.o %t2native.o -o %t3.o + ; RUN: llvm-dis %t.o.1.promote.bc -o - | FileCheck %s --check-prefix=NOSUMMARY diff --git a/pkgs/development/compilers/llvm/9/libc++/default.nix b/pkgs/development/compilers/llvm/9/libc++/default.nix new file mode 100644 index 00000000000..daf8ed5a9ae --- /dev/null +++ b/pkgs/development/compilers/llvm/9/libc++/default.nix @@ -0,0 +1,55 @@ +{ lib, stdenv, fetch, cmake, python, libcxxabi, fixDarwinDylibNames, version +, enableShared ? true }: + +stdenv.mkDerivation { + pname = "libc++"; + inherit version; + + src = fetch "libcxx" "136j3v7il9aq8wyp48klx6sifnl5asj4lf5c8yx08cjx5fbn4h9w"; + + postUnpack = '' + unpackFile ${libcxxabi.src} + export LIBCXXABI_INCLUDE_DIR="$PWD/$(ls -d libcxxabi-${version}*)/include" + ''; + + patches = stdenv.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 + cmakeFlagsArray=($cmakeFlagsArray -DLIBCXX_CXX_ABI_INCLUDE_PATHS="$LIBCXXABI_INCLUDE_DIR") + '' + lib.optionalString stdenv.hostPlatform.isMusl '' + patchShebangs utils/cat_files.py + ''; + nativeBuildInputs = [ cmake ] + ++ stdenv.lib.optional (stdenv.hostPlatform.isMusl || stdenv.hostPlatform.isWasi) python; + + buildInputs = [ libcxxabi ] ++ lib.optional stdenv.isDarwin fixDarwinDylibNames; + + cmakeFlags = [ + "-DLIBCXX_LIBCXXABI_LIB_PATH=${libcxxabi}/lib" + "-DLIBCXX_LIBCPPABI_VERSION=2" + "-DLIBCXX_CXX_ABI=libcxxabi" + ] ++ stdenv.lib.optional (stdenv.hostPlatform.isMusl || stdenv.hostPlatform.isWasi) "-DLIBCXX_HAS_MUSL_LIBC=1" + ++ stdenv.lib.optional (stdenv.hostPlatform.useLLVM or false) "-DLIBCXX_USE_COMPILER_RT=ON" + ++ stdenv.lib.optional stdenv.hostPlatform.isWasm [ + "-DLIBCXX_ENABLE_THREADS=OFF" + "-DLIBCXX_ENABLE_FILESYSTEM=OFF" + "-DLIBCXX_ENABLE_EXCEPTIONS=OFF" + ] ++ stdenv.lib.optional (!enableShared) "-DLIBCXX_ENABLE_SHARED=OFF"; + + enableParallelBuilding = true; + + linkCxxAbi = stdenv.isLinux; + + setupHooks = [ + ../../../../../build-support/setup-hooks/role.bash + ./setup-hook.sh + ]; + + meta = { + homepage = http://libcxx.llvm.org/; + description = "A new implementation of the C++ standard library, targeting C++11"; + license = with stdenv.lib.licenses; [ ncsa mit ]; + platforms = stdenv.lib.platforms.all; + }; +} diff --git a/pkgs/development/compilers/llvm/9/libc++/setup-hook.sh b/pkgs/development/compilers/llvm/9/libc++/setup-hook.sh new file mode 100644 index 00000000000..6611259165a --- /dev/null +++ b/pkgs/development/compilers/llvm/9/libc++/setup-hook.sh @@ -0,0 +1,6 @@ +# See pkgs/build-support/setup-hooks/role.bash +getHostRole + +linkCxxAbi="@linkCxxAbi@" +export NIX_${role_pre}CXXSTDLIB_COMPILE+=" -isystem @out@/include/c++/v1" +export NIX_${role_pre}CXXSTDLIB_LINK=" -stdlib=libc++${linkCxxAbi:+" -lc++abi"}" diff --git a/pkgs/development/compilers/llvm/9/libc++abi.nix b/pkgs/development/compilers/llvm/9/libc++abi.nix new file mode 100644 index 00000000000..7afff991e75 --- /dev/null +++ b/pkgs/development/compilers/llvm/9/libc++abi.nix @@ -0,0 +1,67 @@ +{ stdenv, cmake, fetch, libcxx, libunwind, llvm, version +, enableShared ? true }: + +stdenv.mkDerivation { + pname = "libc++abi"; + inherit version; + + src = fetch "libcxxabi" "1s9haplqv8ashlsdx2psxiqxh50gqk2jp2vz5yn0djb56mw42l37"; + + nativeBuildInputs = [ cmake ]; + buildInputs = stdenv.lib.optional (!stdenv.isDarwin && !stdenv.isFreeBSD && !stdenv.hostPlatform.isWasm) libunwind; + + cmakeFlags = stdenv.lib.optionals (stdenv.hostPlatform.useLLVM or false) [ + "-DLLVM_ENABLE_LIBCXX=ON" + "-DLIBCXXABI_USE_LLVM_UNWINDER=ON" + ] ++ stdenv.lib.optionals stdenv.hostPlatform.isWasm [ + "-DLIBCXXABI_ENABLE_THREADS=OFF" + "-DLIBCXXABI_ENABLE_EXCEPTIONS=OFF" + ] ++ stdenv.lib.optionals (!enableShared) [ + "-DLIBCXXABI_ENABLE_SHARED=OFF" + ]; + + patches = [ ./libcxxabi-no-threads.patch ]; + + postUnpack = '' + unpackFile ${libcxx.src} + unpackFile ${llvm.src} + cmakeFlags+=" -DLLVM_PATH=$PWD/$(ls -d llvm-*) -DLIBCXXABI_LIBCXX_PATH=$PWD/$(ls -d libcxx-*)" + '' + stdenv.lib.optionalString stdenv.isDarwin '' + export TRIPLE=x86_64-apple-darwin + '' + stdenv.lib.optionalString stdenv.hostPlatform.isMusl '' + patch -p1 -d $(ls -d libcxx-*) -i ${../libcxx-0001-musl-hacks.patch} + '' + stdenv.lib.optionalString stdenv.hostPlatform.isWasm '' + patch -p1 -d $(ls -d llvm-*) -i ${./libcxxabi-wasm.patch} + ''; + + installPhase = if stdenv.isDarwin + then '' + for file in lib/*.dylib; do + # this should be done in CMake, but having trouble figuring out + # the magic combination of necessary CMake variables + # if you fancy a try, take a look at + # http://www.cmake.org/Wiki/CMake_RPATH_handling + install_name_tool -id $out/$file $file + done + make install + install -d 755 $out/include + install -m 644 ../include/*.h $out/include + '' + else '' + install -d -m 755 $out/include $out/lib + install -m 644 lib/libc++abi.a $out/lib + install -m 644 ../include/cxxabi.h $out/include + '' + stdenv.lib.optionalString enableShared '' + install -m 644 lib/libc++abi.so.1.0 $out/lib + ln -s libc++abi.so.1.0 $out/lib/libc++abi.so + ln -s libc++abi.so.1.0 $out/lib/libc++abi.so.1 + ''; + + meta = { + homepage = http://libcxxabi.llvm.org/; + description = "A new implementation of low level support for a standard C++ library"; + license = with stdenv.lib.licenses; [ ncsa mit ]; + maintainers = with stdenv.lib.maintainers; [ vlstill ]; + platforms = stdenv.lib.platforms.all; + }; +} diff --git a/pkgs/development/compilers/llvm/9/libcxxabi-no-threads.patch b/pkgs/development/compilers/llvm/9/libcxxabi-no-threads.patch new file mode 100644 index 00000000000..787f3e16500 --- /dev/null +++ b/pkgs/development/compilers/llvm/9/libcxxabi-no-threads.patch @@ -0,0 +1,12 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 4138acf..41b4763 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -362,6 +362,7 @@ if (NOT LIBCXXABI_ENABLE_THREADS) + " is also set to ON.") + endif() + add_definitions(-D_LIBCXXABI_HAS_NO_THREADS) ++ add_definitions(-D_LIBCPP_HAS_NO_THREADS) + endif() + + if (LIBCXXABI_HAS_EXTERNAL_THREAD_API) diff --git a/pkgs/development/compilers/llvm/9/libcxxabi-wasm.patch b/pkgs/development/compilers/llvm/9/libcxxabi-wasm.patch new file mode 100644 index 00000000000..4ebfe46aa81 --- /dev/null +++ b/pkgs/development/compilers/llvm/9/libcxxabi-wasm.patch @@ -0,0 +1,16 @@ +diff --git a/cmake/modules/HandleLLVMOptions.cmake b/cmake/modules/HandleLLVMOptions.cmake +index 15497d405e0..33f7f18193a 100644 +--- a/cmake/modules/HandleLLVMOptions.cmake ++++ b/cmake/modules/HandleLLVMOptions.cmake +@@ -127,7 +127,10 @@ else(WIN32) + set(LLVM_HAVE_LINK_VERSION_SCRIPT 1) + endif() + else(FUCHSIA OR UNIX) +- MESSAGE(SEND_ERROR "Unable to determine platform") ++ if(${CMAKE_SYSTEM_NAME} MATCHES "Wasi") ++ else() ++ MESSAGE(SEND_ERROR "Unable to determine platform") ++ endif() + endif(FUCHSIA OR UNIX) + endif(WIN32) + diff --git a/pkgs/development/compilers/llvm/9/libunwind.nix b/pkgs/development/compilers/llvm/9/libunwind.nix new file mode 100644 index 00000000000..5eba9e03c78 --- /dev/null +++ b/pkgs/development/compilers/llvm/9/libunwind.nix @@ -0,0 +1,14 @@ +{ stdenv, version, fetch, cmake, fetchpatch, enableShared ? true }: + +stdenv.mkDerivation rec { + pname = "libunwind"; + inherit version; + + src = fetch pname "1chd1nz4bscrs6qa7p8sqgk5df86ll0frv0f451vhks2w44qsslp"; + + nativeBuildInputs = [ cmake ]; + + enableParallelBuilding = true; + + cmakeFlags = stdenv.lib.optional (!enableShared) "-DLIBUNWIND_ENABLE_SHARED=OFF"; +} diff --git a/pkgs/development/compilers/llvm/9/lld.nix b/pkgs/development/compilers/llvm/9/lld.nix new file mode 100644 index 00000000000..c5baef4357e --- /dev/null +++ b/pkgs/development/compilers/llvm/9/lld.nix @@ -0,0 +1,33 @@ +{ stdenv +, fetch +, cmake +, libxml2 +, llvm +, version +}: + +stdenv.mkDerivation rec { + pname = "lld"; + inherit version; + + src = fetch pname "14cgd34gr826qpxzhrkbz6qgm8ymds0hrsiznwzp42ax4f5p9iii"; + + nativeBuildInputs = [ cmake ]; + buildInputs = [ llvm libxml2 ]; + + outputs = [ "out" "dev" ]; + + enableParallelBuilding = true; + + postInstall = '' + moveToOutput include "$dev" + moveToOutput lib "$dev" + ''; + + meta = { + description = "The LLVM Linker"; + homepage = http://lld.llvm.org/; + license = stdenv.lib.licenses.ncsa; + platforms = stdenv.lib.platforms.all; + }; +} diff --git a/pkgs/development/compilers/llvm/9/lldb-procfs.patch b/pkgs/development/compilers/llvm/9/lldb-procfs.patch new file mode 100644 index 00000000000..b075dbaeee0 --- /dev/null +++ b/pkgs/development/compilers/llvm/9/lldb-procfs.patch @@ -0,0 +1,31 @@ +--- a/source/Plugins/Process/Linux/Procfs.h ++++ b/source/Plugins/Process/Linux/Procfs.h +@@ -11,21 +11,12 @@ + // sys/procfs.h on Android/Linux for all supported architectures. + + #include <sys/ptrace.h> ++#include <asm/ptrace.h> + +-#ifdef __ANDROID__ +-#if defined(__arm64__) || defined(__aarch64__) +-typedef unsigned long elf_greg_t; +-typedef elf_greg_t +- elf_gregset_t[(sizeof(struct user_pt_regs) / sizeof(elf_greg_t))]; +-typedef struct user_fpsimd_state elf_fpregset_t; +-#ifndef NT_FPREGSET +-#define NT_FPREGSET NT_PRFPREG +-#endif // NT_FPREGSET +-#elif defined(__mips__) +-#ifndef NT_FPREGSET +-#define NT_FPREGSET NT_PRFPREG +-#endif // NT_FPREGSET +-#endif +-#else // __ANDROID__ ++#if !defined(__GLIBC__) && defined(__powerpc__) ++#define pt_regs musl_pt_regs ++#include <sys/procfs.h> ++#undef pt_regs ++#else + #include <sys/procfs.h> +-#endif // __ANDROID__ ++#endif diff --git a/pkgs/development/compilers/llvm/9/lldb.nix b/pkgs/development/compilers/llvm/9/lldb.nix new file mode 100644 index 00000000000..ee281384c40 --- /dev/null +++ b/pkgs/development/compilers/llvm/9/lldb.nix @@ -0,0 +1,72 @@ +{ stdenv +, fetch +, cmake +, zlib +, ncurses +, swig +, which +, libedit +, libxml2 +, llvm +, clang-unwrapped +, python +, version +, darwin +, lit +}: + +stdenv.mkDerivation rec { + pname = "lldb"; + inherit version; + + src = fetch pname "1507dl0xw03nppxpz2xsq4s30jdbkplx4w14za54ngqm3xm2yk0y"; + + patches = [ ./lldb-procfs.patch ]; + + nativeBuildInputs = [ cmake python which swig lit ]; + buildInputs = [ + ncurses + zlib + libedit + libxml2 + llvm + ] + ++ stdenv.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_CODESIGN_IDENTITY=" # codesigning makes nondeterministic + "-DClang_DIR=${clang-unwrapped}/lib/cmake" + "-DLLVM_EXTERNAL_LIT=${lit}/bin/lit" + ]; + + enableParallelBuilding = true; + + postInstall = '' + # man page + mkdir -p $out/share/man/man1 + install ../docs/lldb.1 -t $out/share/man/man1/ + + # 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 + ''; + + meta = with stdenv.lib; { + description = "A next-generation high-performance debugger"; + homepage = http://llvm.org/; + license = licenses.ncsa; + platforms = platforms.all; + }; +} diff --git a/pkgs/development/compilers/llvm/9/llvm-outputs.patch b/pkgs/development/compilers/llvm/9/llvm-outputs.patch new file mode 100644 index 00000000000..40096fa3497 --- /dev/null +++ b/pkgs/development/compilers/llvm/9/llvm-outputs.patch @@ -0,0 +1,26 @@ +diff --git a/tools/llvm-config/llvm-config.cpp b/tools/llvm-config/llvm-config.cpp +index 94d426b..37f7794 100644 +--- a/tools/llvm-config/llvm-config.cpp ++++ b/tools/llvm-config/llvm-config.cpp +@@ -333,6 +333,21 @@ int main(int argc, char **argv) { + ActiveIncludeOption = "-I" + ActiveIncludeDir; + } + ++ /// Nix-specific multiple-output handling: override ActiveLibDir if --link-shared ++ if (!IsInDevelopmentTree) { ++ bool WantShared = true; ++ for (int i = 1; i < argc; ++i) { ++ StringRef Arg = argv[i]; ++ if (Arg == "--link-shared") ++ WantShared = true; ++ else if (Arg == "--link-static") ++ WantShared = false; // the last one wins ++ } ++ ++ if (WantShared) ++ ActiveLibDir = std::string("@lib@") + "/lib" + LLVM_LIBDIR_SUFFIX; ++ } ++ + /// We only use `shared library` mode in cases where the static library form + /// of the components provided are not available; note however that this is + /// skipped if we're run from within the build dir. However, once installed, diff --git a/pkgs/development/compilers/llvm/9/llvm.nix b/pkgs/development/compilers/llvm/9/llvm.nix new file mode 100644 index 00000000000..9bc7e1fc20b --- /dev/null +++ b/pkgs/development/compilers/llvm/9/llvm.nix @@ -0,0 +1,182 @@ +{ stdenv +, fetch +, cmake +, python +, libffi +, libbfd +, libpfm +, libxml2 +, ncurses +, version +, release_version +, zlib +, buildPackages +, debugVersion ? false +, enableManpages ? false +, enableSharedLibraries ? true +, enablePFM ? !(stdenv.isDarwin + || stdenv.isAarch64 # broken for Ampere eMAG 8180 (c2.large.arm on Packet) #56245 +) +, enablePolly ? false +}: + +let + inherit (stdenv.lib) optional optionals optionalString; + + # Used when creating a version-suffixed symlink of libLLVM.dylib + shortVersion = with stdenv.lib; + concatStringsSep "." (take 1 (splitString "." release_version)); + +in stdenv.mkDerivation (rec { + pname = "llvm"; + inherit version; + + src = fetch pname "117ymdz1by2nkfq1c2p9m4050dp848kbjbiv6nsfj8hzy9f5d86n"; + polly_src = fetch "polly" "0cyl2gsibf1dhqvkyw1qb0f8q58ib6cihzyh4f9kj9g77ll95ym4"; + + 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"; + + nativeBuildInputs = [ cmake python ] + ++ optionals enableManpages [ python.pkgs.sphinx python.pkgs.recommonmark ]; + + buildInputs = [ libxml2 libffi ] + ++ optional enablePFM libpfm; # exegesis + + propagatedBuildInputs = [ ncurses zlib ]; + + 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})' "" + '' + # 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 + '' + '' + # FileSystem permissions tests fail with various special bits + substituteInPlace unittests/Support/CMakeLists.txt \ + --replace "Path.cpp" "" + rm unittests/Support/Path.cpp + '' + optionalString stdenv.hostPlatform.isMusl '' + patch -p1 -i ${../TLI-musl.patch} + substituteInPlace unittests/Support/CMakeLists.txt \ + --replace "add_subdirectory(DynamicLibrary)" "" + rm unittests/Support/DynamicLibrary/DynamicLibraryTest.cpp + # valgrind unhappy with musl or glibc, but fails w/musl only + rm test/CodeGen/AArch64/wineh4.mir + '' + '' + patchShebangs test/BugPoint/compile-custom.ll.py + + # Fix test so that no extra locale files are needed + substituteInPlace test/tools/llvm-ar/mri-utf8.test \ + --replace en_US.UTF-8 C.UTF-8 + + # Fix x86 gold test on non-x86 platforms + # (similar fix made to others in this directory previously, FWIW) + patch -p1 -i ${./fix-test-on-non-x86-like-others.patch} + ''; + + # hacky fix: created binaries need to be run before installation + preBuild = '' + mkdir -p $out/ + ln -sv $PWD/lib $out + ''; + + cmakeFlags = with stdenv; [ + "-DCMAKE_BUILD_TYPE=${if debugVersion then "Debug" else "Release"}" + "-DLLVM_INSTALL_UTILS=ON" # Needed by rustc + "-DLLVM_BUILD_TESTS=ON" + "-DLLVM_ENABLE_FFI=ON" + "-DLLVM_ENABLE_RTTI=ON" + "-DLLVM_HOST_TRIPLE=${stdenv.hostPlatform.config}" + "-DLLVM_DEFAULT_TARGET_TRIPLE=${stdenv.hostPlatform.config}" + "-DLLVM_ENABLE_DUMP=ON" + ] ++ optionals enableSharedLibraries [ + "-DLLVM_LINK_LLVM_DYLIB=ON" + ] ++ optionals enableManpages [ + "-DLLVM_BUILD_DOCS=ON" + "-DLLVM_ENABLE_SPHINX=ON" + "-DSPHINX_OUTPUT_MAN=ON" + "-DSPHINX_OUTPUT_HTML=OFF" + "-DSPHINX_WARNINGS_AS_ERRORS=OFF" + ] ++ optionals (!isDarwin) [ + "-DLLVM_BINUTILS_INCDIR=${libbfd.dev}/include" + ] ++ optionals (isDarwin) [ + "-DLLVM_ENABLE_LIBCXX=ON" + "-DCAN_TARGET_i386=false" + ] ++ optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ + "-DCMAKE_CROSSCOMPILING=True" + "-DLLVM_TABLEGEN=${buildPackages.llvm_7}/bin/llvm-tblgen" + ]; + + postBuild = '' + rm -fR $out + ''; + + preCheck = '' + export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PWD/lib + ''; + + 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-" + '' + + 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 + ''; + + doCheck = stdenv.isLinux && (!stdenv.isx86_32); + + checkTarget = "check-all"; + + enableParallelBuilding = true; + + meta = { + description = "Collection of modular and reusable compiler and toolchain technologies"; + homepage = http://llvm.org/; + license = stdenv.lib.licenses.ncsa; + maintainers = with stdenv.lib.maintainers; [ lovek323 raskin dtzWill ]; + platforms = stdenv.lib.platforms.all; + }; +} // stdenv.lib.optionalAttrs enableManpages { + pname = "llvm-manpages"; + + buildPhase = '' + make docs-llvm-man + ''; + + propagatedBuildInputs = []; + + installPhase = '' + make -C docs install + ''; + + postPatch = null; + postInstall = null; + + outputs = [ "out" ]; + + doCheck = false; + + meta.description = "man pages for LLVM ${version}"; +}) diff --git a/pkgs/development/compilers/llvm/9/openmp.nix b/pkgs/development/compilers/llvm/9/openmp.nix new file mode 100644 index 00000000000..a511aed2eb8 --- /dev/null +++ b/pkgs/development/compilers/llvm/9/openmp.nix @@ -0,0 +1,26 @@ +{ stdenv +, fetch +, cmake +, llvm +, perl +, version +}: + +stdenv.mkDerivation rec { + pname = "openmp"; + inherit version; + + src = fetch pname "0nrv9np134b7c483jnq786spy3hbpj11d7g21g67cqq66c8ynycr"; + + nativeBuildInputs = [ cmake perl ]; + buildInputs = [ llvm ]; + + enableParallelBuilding = true; + + meta = { + description = "Components required to build an executable OpenMP program"; + homepage = http://openmp.llvm.org/; + license = stdenv.lib.licenses.mit; + platforms = stdenv.lib.platforms.all; + }; +} diff --git a/pkgs/development/compilers/llvm/9/sanitizers-nongnu.patch b/pkgs/development/compilers/llvm/9/sanitizers-nongnu.patch new file mode 100644 index 00000000000..1f2ac97818e --- /dev/null +++ b/pkgs/development/compilers/llvm/9/sanitizers-nongnu.patch @@ -0,0 +1,412 @@ +From f7a253f8f85d0f49df6b73996737a3e84ac64236 Mon Sep 17 00:00:00 2001 +From: Will Dietz <w@wdtz.org> +Date: Mon, 24 Sep 2018 11:17:25 -0500 +Subject: [PATCH] Ported to 7.0, taken from gentoo-musl project. + +------ +Ported to compiler-rt-sanitizers-5.0.0. Taken from + +https://gist.githubusercontent.com/pwaller/2337f3290f12634cad3e3730cff0a6c1/raw/83c87a8585e2f9662494db5662e5361beb093c26/nongnu.patch +Signed-off-by: Jory A. Pratt <anarchy@gentoo.org> + +Taken from gentoo-musl project, with a few additional minor fixes. +--- + lib/asan/asan_linux.cc | 4 +- + lib/interception/interception_linux.cc | 2 +- + lib/interception/interception_linux.h | 2 +- + lib/msan/msan_linux.cc | 2 +- + lib/sanitizer_common/sanitizer_allocator.cc | 2 +- + .../sanitizer_common_interceptors_ioctl.inc | 4 +- + .../sanitizer_common_syscalls.inc | 2 +- + lib/sanitizer_common/sanitizer_linux.cc | 8 +++- + .../sanitizer_linux_libcdep.cc | 10 ++--- + lib/sanitizer_common/sanitizer_platform.h | 6 +++ + .../sanitizer_platform_interceptors.h | 4 +- + .../sanitizer_platform_limits_posix.cc | 37 +++++++++++-------- + lib/tsan/rtl/tsan_platform_linux.cc | 2 +- + 13 files changed, 51 insertions(+), 34 deletions(-) + +diff --git a/lib/asan/asan_linux.cc b/lib/asan/asan_linux.cc +index 625f32d40..73cf77aca 100644 +--- a/lib/asan/asan_linux.cc ++++ b/lib/asan/asan_linux.cc +@@ -46,7 +46,7 @@ + #include <link.h> + #endif + +-#if SANITIZER_ANDROID || SANITIZER_FREEBSD || SANITIZER_SOLARIS ++#if SANITIZER_ANDROID || SANITIZER_FREEBSD || SANITIZER_SOLARIS || SANITIZER_NONGNU + #include <ucontext.h> + extern "C" void* _DYNAMIC; + #elif SANITIZER_NETBSD +@@ -139,7 +139,7 @@ void AsanApplyToGlobals(globals_op_fptr op, const void *needle) { + UNIMPLEMENTED(); + } + +-#if SANITIZER_ANDROID ++#if SANITIZER_ANDROID || SANITIZER_NONGNU + // FIXME: should we do anything for Android? + void AsanCheckDynamicRTPrereqs() {} + void AsanCheckIncompatibleRT() {} +diff --git a/lib/interception/interception_linux.cc b/lib/interception/interception_linux.cc +index 26bfcd8f6..529b234f7 100644 +--- a/lib/interception/interception_linux.cc ++++ b/lib/interception/interception_linux.cc +@@ -43,7 +43,7 @@ bool GetRealFunctionAddress(const char *func_name, uptr *func_addr, + } + + // Android and Solaris do not have dlvsym +-#if !SANITIZER_ANDROID && !SANITIZER_SOLARIS && !SANITIZER_OPENBSD ++#if !SANITIZER_ANDROID && !SANITIZER_SOLARIS && !SANITIZER_OPENBSD && !SANITIZER_NONGNU + void *GetFuncAddrVer(const char *func_name, const char *ver) { + return dlvsym(RTLD_NEXT, func_name, ver); + } +diff --git a/lib/interception/interception_linux.h b/lib/interception/interception_linux.h +index 942c25609..24a4d5080 100644 +--- a/lib/interception/interception_linux.h ++++ b/lib/interception/interception_linux.h +@@ -36,7 +36,7 @@ void *GetFuncAddrVer(const char *func_name, const char *ver); + (::__interception::uptr) & WRAP(func)) + + // Android, Solaris and OpenBSD do not have dlvsym +-#if !SANITIZER_ANDROID && !SANITIZER_SOLARIS && !SANITIZER_OPENBSD ++#if !SANITIZER_ANDROID && !SANITIZER_SOLARIS && !SANITIZER_OPENBSD && !SANITIZER_NONGNU + #define INTERCEPT_FUNCTION_VER_LINUX_OR_FREEBSD(func, symver) \ + (::__interception::real_##func = (func##_f)( \ + unsigned long)::__interception::GetFuncAddrVer(#func, symver)) +diff --git a/lib/msan/msan_linux.cc b/lib/msan/msan_linux.cc +index 385a650c4..6e30a8ce9 100644 +--- a/lib/msan/msan_linux.cc ++++ b/lib/msan/msan_linux.cc +@@ -13,7 +13,7 @@ + //===----------------------------------------------------------------------===// + + #include "sanitizer_common/sanitizer_platform.h" +-#if SANITIZER_FREEBSD || SANITIZER_LINUX || SANITIZER_NETBSD ++#if SANITIZER_FREEBSD || (SANITIZER_LINUX && !SANITIZER_NONGNU) || SANITIZER_NETBSD + + #include "msan.h" + #include "msan_report.h" +diff --git a/lib/sanitizer_common/sanitizer_allocator.cc b/lib/sanitizer_common/sanitizer_allocator.cc +index 6bfd5e5ee..048f6154f 100644 +--- a/lib/sanitizer_common/sanitizer_allocator.cc ++++ b/lib/sanitizer_common/sanitizer_allocator.cc +@@ -27,7 +27,7 @@ const char *SecondaryAllocatorName = "LargeMmapAllocator"; + + // ThreadSanitizer for Go uses libc malloc/free. + #if SANITIZER_GO || defined(SANITIZER_USE_MALLOC) +-# if SANITIZER_LINUX && !SANITIZER_ANDROID ++# if SANITIZER_LINUX && !SANITIZER_ANDROID && !SANITIZER_NONGNU + extern "C" void *__libc_malloc(uptr size); + # if !SANITIZER_GO + extern "C" void *__libc_memalign(uptr alignment, uptr size); +diff --git a/lib/sanitizer_common/sanitizer_common_interceptors_ioctl.inc b/lib/sanitizer_common/sanitizer_common_interceptors_ioctl.inc +index 2d633c173..b6eb23116 100644 +--- a/lib/sanitizer_common/sanitizer_common_interceptors_ioctl.inc ++++ b/lib/sanitizer_common/sanitizer_common_interceptors_ioctl.inc +@@ -104,7 +104,7 @@ static void ioctl_table_fill() { + _(SIOCGETVIFCNT, WRITE, struct_sioc_vif_req_sz); + #endif + +-#if SANITIZER_LINUX ++#if SANITIZER_LINUX && !SANITIZER_NONGNU + // Conflicting request ids. + // _(CDROMAUDIOBUFSIZ, NONE, 0); + // _(SNDCTL_TMR_CONTINUE, NONE, 0); +@@ -365,7 +365,7 @@ static void ioctl_table_fill() { + _(VT_WAITACTIVE, NONE, 0); + #endif + +-#if SANITIZER_LINUX && !SANITIZER_ANDROID ++#if SANITIZER_LINUX && !SANITIZER_ANDROID && !SANITIZER_NONGNU + // _(SIOCDEVPLIP, WRITE, struct_ifreq_sz); // the same as EQL_ENSLAVE + _(CYGETDEFTHRESH, WRITE, sizeof(int)); + _(CYGETDEFTIMEOUT, WRITE, sizeof(int)); +diff --git a/lib/sanitizer_common/sanitizer_common_syscalls.inc b/lib/sanitizer_common/sanitizer_common_syscalls.inc +index 469c8eb7e..24f87867d 100644 +--- a/lib/sanitizer_common/sanitizer_common_syscalls.inc ++++ b/lib/sanitizer_common/sanitizer_common_syscalls.inc +@@ -2038,7 +2038,7 @@ POST_SYSCALL(setrlimit)(long res, long resource, void *rlim) { + } + } + +-#if !SANITIZER_ANDROID ++#if !SANITIZER_ANDROID && !SANITIZER_NONGNU + PRE_SYSCALL(prlimit64)(long pid, long resource, const void *new_rlim, + void *old_rlim) { + if (new_rlim) PRE_READ(new_rlim, struct_rlimit64_sz); +diff --git a/lib/sanitizer_common/sanitizer_linux.cc b/lib/sanitizer_common/sanitizer_linux.cc +index 96d6c1eff..9e2b7fb9d 100644 +--- a/lib/sanitizer_common/sanitizer_linux.cc ++++ b/lib/sanitizer_common/sanitizer_linux.cc +@@ -541,13 +541,13 @@ const char *GetEnv(const char *name) { + #endif + } + +-#if !SANITIZER_FREEBSD && !SANITIZER_NETBSD && !SANITIZER_OPENBSD ++#if !SANITIZER_FREEBSD && !SANITIZER_NETBSD && !SANITIZER_OPENBSD && !SANITIZER_NONGNU + extern "C" { + SANITIZER_WEAK_ATTRIBUTE extern void *__libc_stack_end; + } + #endif + +-#if !SANITIZER_GO && !SANITIZER_FREEBSD && !SANITIZER_NETBSD && \ ++#if (!SANITIZER_GO || SANITIZER_NONGNU) && !SANITIZER_FREEBSD && !SANITIZER_NETBSD && \ + !SANITIZER_OPENBSD + static void ReadNullSepFileToArray(const char *path, char ***arr, + int arr_size) { +@@ -590,6 +590,10 @@ static void GetArgsAndEnv(char ***argv, char ***envp) { + #elif SANITIZER_NETBSD + *argv = __ps_strings->ps_argvstr; + *envp = __ps_strings->ps_envstr; ++#elif SANITIZER_NONGNU ++ static const int kMaxArgv = 2000, kMaxEnvp = 2000; ++ ReadNullSepFileToArray("/proc/self/cmdline", argv, kMaxArgv); ++ ReadNullSepFileToArray("/proc/self/environ", envp, kMaxEnvp); + #else // SANITIZER_FREEBSD + #if !SANITIZER_GO + if (&__libc_stack_end) { +diff --git a/lib/sanitizer_common/sanitizer_linux_libcdep.cc b/lib/sanitizer_common/sanitizer_linux_libcdep.cc +index 4962ff832..438f94dbe 100644 +--- a/lib/sanitizer_common/sanitizer_linux_libcdep.cc ++++ b/lib/sanitizer_common/sanitizer_linux_libcdep.cc +@@ -179,7 +179,7 @@ __attribute__((unused)) static bool GetLibcVersion(int *major, int *minor, + } + + #if !SANITIZER_FREEBSD && !SANITIZER_ANDROID && !SANITIZER_GO && \ +- !SANITIZER_NETBSD && !SANITIZER_OPENBSD && !SANITIZER_SOLARIS ++ !SANITIZER_NETBSD && !SANITIZER_OPENBSD && !SANITIZER_SOLARIS && !SANITIZER_NONGNU + static uptr g_tls_size; + + #ifdef __i386__ +@@ -261,7 +261,7 @@ void InitTlsSize() { } + #if (defined(__x86_64__) || defined(__i386__) || defined(__mips__) || \ + defined(__aarch64__) || defined(__powerpc64__) || defined(__s390__) || \ + defined(__arm__)) && \ +- SANITIZER_LINUX && !SANITIZER_ANDROID ++ SANITIZER_LINUX && !SANITIZER_ANDROID && !SANITIZER_NONGNU + // sizeof(struct pthread) from glibc. + static atomic_uintptr_t thread_descriptor_size; + +@@ -426,7 +426,7 @@ int GetSizeFromHdr(struct dl_phdr_info *info, size_t size, void *data) { + + #if !SANITIZER_GO + static void GetTls(uptr *addr, uptr *size) { +-#if SANITIZER_LINUX && !SANITIZER_ANDROID ++#if SANITIZER_LINUX && !SANITIZER_ANDROID && !SANITIZER_NONGNU + # if defined(__x86_64__) || defined(__i386__) || defined(__s390__) + *addr = ThreadSelf(); + *size = GetTlsSize(); +@@ -470,7 +470,7 @@ static void GetTls(uptr *addr, uptr *size) { + #elif SANITIZER_OPENBSD + *addr = 0; + *size = 0; +-#elif SANITIZER_ANDROID ++#elif SANITIZER_ANDROID || SANITIZER_NONGNU + *addr = 0; + *size = 0; + #elif SANITIZER_SOLARIS +@@ -486,7 +486,7 @@ static void GetTls(uptr *addr, uptr *size) { + #if !SANITIZER_GO + uptr GetTlsSize() { + #if SANITIZER_FREEBSD || SANITIZER_ANDROID || SANITIZER_NETBSD || \ +- SANITIZER_OPENBSD || SANITIZER_SOLARIS ++ SANITIZER_OPENBSD || SANITIZER_SOLARIS || SANITIZER_NONGNU + uptr addr, size; + GetTls(&addr, &size); + return size; +diff --git a/lib/sanitizer_common/sanitizer_platform.h b/lib/sanitizer_common/sanitizer_platform.h +index d81e25580..e10680ac8 100644 +--- a/lib/sanitizer_common/sanitizer_platform.h ++++ b/lib/sanitizer_common/sanitizer_platform.h +@@ -208,6 +208,12 @@ + # define SANITIZER_SOLARIS32 0 + #endif + ++#if defined(__linux__) && !defined(__GLIBC__) ++# define SANITIZER_NONGNU 1 ++#else ++# define SANITIZER_NONGNU 0 ++#endif ++ + #if defined(__myriad2__) + # define SANITIZER_MYRIAD2 1 + #else +diff --git a/lib/sanitizer_common/sanitizer_platform_interceptors.h b/lib/sanitizer_common/sanitizer_platform_interceptors.h +index f95539a73..6c53b3415 100644 +--- a/lib/sanitizer_common/sanitizer_platform_interceptors.h ++++ b/lib/sanitizer_common/sanitizer_platform_interceptors.h +@@ -39,7 +39,7 @@ + # include "sanitizer_platform_limits_solaris.h" + #endif + +-#if SANITIZER_LINUX && !SANITIZER_ANDROID ++#if SANITIZER_LINUX && !SANITIZER_ANDROID && !SANITIZER_NONGNU + # define SI_LINUX_NOT_ANDROID 1 + #else + # define SI_LINUX_NOT_ANDROID 0 +@@ -322,7 +322,7 @@ + #define SANITIZER_INTERCEPT_ETHER_R (SI_FREEBSD || SI_LINUX_NOT_ANDROID) + #define SANITIZER_INTERCEPT_SHMCTL \ + (SI_NETBSD || SI_OPENBSD || SI_SOLARIS || \ +- ((SI_FREEBSD || SI_LINUX_NOT_ANDROID) && \ ++ ((SI_FREEBSD || SI_LINUX_NOT_ANDROID || SANITIZER_NONGNU) && \ + SANITIZER_WORDSIZE == 64)) // NOLINT + #define SANITIZER_INTERCEPT_RANDOM_R SI_LINUX_NOT_ANDROID + #define SANITIZER_INTERCEPT_PTHREAD_ATTR_GET SI_POSIX +diff --git a/lib/sanitizer_common/sanitizer_platform_limits_posix.cc b/lib/sanitizer_common/sanitizer_platform_limits_posix.cc +index 54da635d7..2f6ff69c3 100644 +--- a/lib/sanitizer_common/sanitizer_platform_limits_posix.cc ++++ b/lib/sanitizer_common/sanitizer_platform_limits_posix.cc +@@ -14,6 +14,9 @@ + + #include "sanitizer_platform.h" + ++// Workaround musl <--> linux conflicting definition of 'struct sysinfo' ++#define _LINUX_SYSINFO_H ++ + #if SANITIZER_LINUX || SANITIZER_FREEBSD || SANITIZER_MAC + // Tests in this file assume that off_t-dependent data structures match the + // libc ABI. For example, struct dirent here is what readdir() function (as +@@ -138,12 +141,14 @@ typedef struct user_fpregs elf_fpregset_t; + + #if SANITIZER_LINUX && !SANITIZER_ANDROID + #include <glob.h> +-#include <obstack.h> ++# if !SANITIZER_NONGNU ++# include <obstack.h> ++# endif + #include <mqueue.h> +-#include <net/if_ppp.h> +-#include <netax25/ax25.h> +-#include <netipx/ipx.h> +-#include <netrom/netrom.h> ++#include <linux/if_ppp.h> ++#include <linux/ax25.h> ++#include <linux/ipx.h> ++#include <linux/netrom.h> + #if HAVE_RPC_XDR_H + # include <rpc/xdr.h> + #elif HAVE_TIRPC_RPC_XDR_H +@@ -251,7 +256,7 @@ namespace __sanitizer { + unsigned struct_itimerspec_sz = sizeof(struct itimerspec); + #endif // SANITIZER_LINUX || SANITIZER_FREEBSD + +-#if SANITIZER_LINUX && !SANITIZER_ANDROID ++#if SANITIZER_LINUX && !SANITIZER_ANDROID && !SANITIZER_NONGNU + // Use pre-computed size of struct ustat to avoid <sys/ustat.h> which + // has been removed from glibc 2.28. + #if defined(__aarch64__) || defined(__s390x__) || defined (__mips64) \ +@@ -322,7 +327,7 @@ unsigned struct_ElfW_Phdr_sz = sizeof(ElfW(Phdr)); + unsigned struct_ElfW_Phdr_sz = sizeof(Elf_Phdr); + #endif + +-#if (SANITIZER_LINUX || SANITIZER_FREEBSD) && !SANITIZER_ANDROID ++#if (SANITIZER_LINUX || SANITIZER_FREEBSD) && !SANITIZER_ANDROID && !SANITIZER_NONGNU + int glob_nomatch = GLOB_NOMATCH; + int glob_altdirfunc = GLOB_ALTDIRFUNC; + #endif +@@ -416,7 +421,7 @@ unsigned struct_ElfW_Phdr_sz = sizeof(Elf_Phdr); + unsigned struct_termios_sz = sizeof(struct termios); + unsigned struct_winsize_sz = sizeof(struct winsize); + +-#if SANITIZER_LINUX ++#if SANITIZER_LINUX && !SANITIZER_NONGNU + unsigned struct_arpreq_sz = sizeof(struct arpreq); + unsigned struct_cdrom_msf_sz = sizeof(struct cdrom_msf); + unsigned struct_cdrom_multisession_sz = sizeof(struct cdrom_multisession); +@@ -466,7 +471,7 @@ unsigned struct_ElfW_Phdr_sz = sizeof(Elf_Phdr); + unsigned struct_vt_mode_sz = sizeof(struct vt_mode); + #endif // SANITIZER_LINUX || SANITIZER_FREEBSD + +-#if SANITIZER_LINUX && !SANITIZER_ANDROID ++#if SANITIZER_LINUX && !SANITIZER_ANDROID && !SANITIZER_NONGNU + unsigned struct_ax25_parms_struct_sz = sizeof(struct ax25_parms_struct); + unsigned struct_cyclades_monitor_sz = sizeof(struct cyclades_monitor); + #if EV_VERSION > (0x010000) +@@ -834,7 +839,7 @@ unsigned struct_ElfW_Phdr_sz = sizeof(Elf_Phdr); + unsigned IOCTL_VT_WAITACTIVE = VT_WAITACTIVE; + #endif // SANITIZER_LINUX || SANITIZER_FREEBSD + +-#if SANITIZER_LINUX && !SANITIZER_ANDROID ++#if SANITIZER_LINUX && !SANITIZER_ANDROID && !SANITIZER_NONGNU + unsigned IOCTL_CYGETDEFTHRESH = CYGETDEFTHRESH; + unsigned IOCTL_CYGETDEFTIMEOUT = CYGETDEFTIMEOUT; + unsigned IOCTL_CYGETMON = CYGETMON; +@@ -989,7 +994,7 @@ CHECK_SIZE_AND_OFFSET(dl_phdr_info, dlpi_phdr); + CHECK_SIZE_AND_OFFSET(dl_phdr_info, dlpi_phnum); + #endif // SANITIZER_LINUX || SANITIZER_FREEBSD + +-#if (SANITIZER_LINUX || SANITIZER_FREEBSD) && !SANITIZER_ANDROID ++#if (SANITIZER_LINUX || SANITIZER_FREEBSD) && !SANITIZER_ANDROID && !SANITIZER_NONGNU + CHECK_TYPE_SIZE(glob_t); + CHECK_SIZE_AND_OFFSET(glob_t, gl_pathc); + CHECK_SIZE_AND_OFFSET(glob_t, gl_pathv); +@@ -1023,6 +1028,7 @@ CHECK_TYPE_SIZE(iovec); + CHECK_SIZE_AND_OFFSET(iovec, iov_base); + CHECK_SIZE_AND_OFFSET(iovec, iov_len); + ++#if !SANITIZER_NONGNU + CHECK_TYPE_SIZE(msghdr); + CHECK_SIZE_AND_OFFSET(msghdr, msg_name); + CHECK_SIZE_AND_OFFSET(msghdr, msg_namelen); +@@ -1036,6 +1042,7 @@ CHECK_TYPE_SIZE(cmsghdr); + CHECK_SIZE_AND_OFFSET(cmsghdr, cmsg_len); + CHECK_SIZE_AND_OFFSET(cmsghdr, cmsg_level); + CHECK_SIZE_AND_OFFSET(cmsghdr, cmsg_type); ++#endif + + #ifndef __GLIBC_PREREQ + #define __GLIBC_PREREQ(x, y) 0 +@@ -1145,7 +1152,7 @@ CHECK_SIZE_AND_OFFSET(mntent, mnt_passno); + + CHECK_TYPE_SIZE(ether_addr); + +-#if (SANITIZER_LINUX || SANITIZER_FREEBSD) && !SANITIZER_ANDROID ++#if (SANITIZER_LINUX || SANITIZER_FREEBSD) && !SANITIZER_ANDROID && !SANITIZER_NONGNU + CHECK_TYPE_SIZE(ipc_perm); + # if SANITIZER_FREEBSD + CHECK_SIZE_AND_OFFSET(ipc_perm, key); +@@ -1206,7 +1213,7 @@ CHECK_SIZE_AND_OFFSET(ifaddrs, ifa_dstaddr); + CHECK_SIZE_AND_OFFSET(ifaddrs, ifa_data); + #endif + +-#if SANITIZER_LINUX ++#if SANITIZER_LINUX && !SANITIZER_NONGNU + COMPILER_CHECK(sizeof(__sanitizer_mallinfo) == sizeof(struct mallinfo)); + #endif + +@@ -1256,7 +1263,7 @@ COMPILER_CHECK(__sanitizer_XDR_DECODE == XDR_DECODE); + COMPILER_CHECK(__sanitizer_XDR_FREE == XDR_FREE); + #endif + +-#if SANITIZER_LINUX && !SANITIZER_ANDROID ++#if SANITIZER_LINUX && !SANITIZER_ANDROID && !SANITIZER_NONGNU + COMPILER_CHECK(sizeof(__sanitizer_FILE) <= sizeof(FILE)); + CHECK_SIZE_AND_OFFSET(FILE, _flags); + CHECK_SIZE_AND_OFFSET(FILE, _IO_read_ptr); +@@ -1275,7 +1282,7 @@ CHECK_SIZE_AND_OFFSET(FILE, _chain); + CHECK_SIZE_AND_OFFSET(FILE, _fileno); + #endif + +-#if SANITIZER_LINUX && !SANITIZER_ANDROID ++#if SANITIZER_LINUX && !SANITIZER_ANDROID && !SANITIZER_NONGNU + COMPILER_CHECK(sizeof(__sanitizer__obstack_chunk) <= sizeof(_obstack_chunk)); + CHECK_SIZE_AND_OFFSET(_obstack_chunk, limit); + CHECK_SIZE_AND_OFFSET(_obstack_chunk, prev); +diff --git a/lib/tsan/rtl/tsan_platform_linux.cc b/lib/tsan/rtl/tsan_platform_linux.cc +index de989b780..51a97b554 100644 +--- a/lib/tsan/rtl/tsan_platform_linux.cc ++++ b/lib/tsan/rtl/tsan_platform_linux.cc +@@ -294,7 +294,7 @@ void InitializePlatform() { + // This is required to properly "close" the fds, because we do not see internal + // closes within glibc. The code is a pure hack. + int ExtractResolvFDs(void *state, int *fds, int nfd) { +-#if SANITIZER_LINUX && !SANITIZER_ANDROID ++#if SANITIZER_LINUX && !SANITIZER_ANDROID && !SANITIZER_NONGNU + int cnt = 0; + struct __res_state *statp = (struct __res_state*)state; + for (int i = 0; i < MAXNS && cnt < nfd; i++) { +-- +2.19.0 + diff --git a/pkgs/development/compilers/nim/default.nix b/pkgs/development/compilers/nim/default.nix index 4228c368e56..129b8ca4dd8 100644 --- a/pkgs/development/compilers/nim/default.nix +++ b/pkgs/development/compilers/nim/default.nix @@ -1,15 +1,15 @@ # based on https://github.com/nim-lang/Nim/blob/v0.18.0/.travis.yml -{ stdenv, lib, fetchurl, makeWrapper, nodejs-slim-11_x, openssl, pcre, readline, +{ stdenv, lib, fetchurl, makeWrapper, nodejs-slim, openssl, pcre, readline, boehmgc, sfml, tzdata, coreutils, sqlite }: stdenv.mkDerivation rec { pname = "nim"; - version = "0.20.2"; + version = "1.0.0"; src = fetchurl { url = "https://nim-lang.org/download/${pname}-${version}.tar.xz"; - sha256 = "0pibil10x0c181kw705phlwk8bn8dy5ghqd9h9fm6i9afrz5ryp1"; + sha256 = "1pg0lxahis8zfk6rdzdj281bahl8wglpjgngkc4vg1pc9p61fj03"; }; doCheck = !stdenv.isDarwin; @@ -30,7 +30,7 @@ stdenv.mkDerivation rec { # as part of building it, so it cannot be read-only checkInputs = [ - nodejs-slim-11_x tzdata coreutils + nodejs-slim tzdata coreutils ]; nativeBuildInputs = [ @@ -64,9 +64,6 @@ stdenv.mkDerivation rec { substituteInPlace ./tests/osproc/tworkingdir.nim --replace "/usr/bin" "${coreutils}/bin" substituteInPlace ./tests/stdlib/ttimes.nim --replace "/usr/share/zoneinfo" "${tzdata}/share/zoneinfo" - # reported upstream: https://github.com/nim-lang/Nim/issues/11435 - ${disableTest} ./tests/misc/tstrace.nim - # runs out of memory on a machine with 8GB RAM ${disableTest} ./tests/system/t7894.nim @@ -80,11 +77,20 @@ stdenv.mkDerivation rec { ${disableCompile} ./lib/nimhcr.nim ${disableTest} ./tests/dll/nimhcr_unit.nim ${disableTest} ./tests/dll/nimhcr_integration.nim + + # reported upstream: https://github.com/nim-lang/Nim/issues/12262 + ${disableTest} ./tests/range/tcompiletime_range_checks.nim + + # requires "immintrin.h" which is available only on x86 + ${disableTest} ./tests/misc/tsizeof3.nim ''; checkPhase = '' runHook preCheck + # Fortify hardening breaks tests + # https://github.com/nim-lang/Nim/issues/11435#issuecomment-534545696 + NIX_HARDENING_ENABLE=''${NIX_HARDENING_ENABLE/fortify/} \ ./koch tests --nim:bin/nim all runHook postCheck @@ -97,7 +103,10 @@ stdenv.mkDerivation rec { ./koch install $out mv $out/nim/bin/* $out/bin/ && rmdir $out/nim/bin mv $out/nim/* $out/ && rmdir $out/nim + + # Fortify hardening appends -O2 to gcc flags which is unwanted for unoptimized nim builds. wrapProgram $out/bin/nim \ + --run 'NIX_HARDENING_ENABLE=''${NIX_HARDENING_ENABLE/fortify/}' \ --suffix PATH : ${lib.makeBinPath [ stdenv.cc ]} runHook postInstall @@ -107,7 +116,7 @@ stdenv.mkDerivation rec { description = "Statically typed, imperative programming language"; homepage = "https://nim-lang.org/"; license = licenses.mit; - maintainers = with maintainers; [ ehmry peterhoeg ]; + maintainers = with maintainers; [ ehmry ]; platforms = with platforms; linux ++ darwin; # arbitrary }; } diff --git a/pkgs/development/libraries/boehm-gc/default.nix b/pkgs/development/libraries/boehm-gc/default.nix index cf76d9e7d24..bc8b7a8c760 100644 --- a/pkgs/development/libraries/boehm-gc/default.nix +++ b/pkgs/development/libraries/boehm-gc/default.nix @@ -15,20 +15,18 @@ stdenv.mkDerivation rec { }; outputs = [ "out" "dev" "doc" ]; - separateDebugInfo = stdenv.isLinux; + separateDebugInfo = stdenv.isLinux && stdenv.hostPlatform.libc != "musl"; preConfigure = stdenv.lib.optionalString (stdenv.hostPlatform.libc == "musl") '' export NIX_CFLAGS_COMPILE+=" -D_GNU_SOURCE -DUSE_MMAP -DHAVE_DL_ITERATE_PHDR" ''; - patches = - # https://github.com/ivmai/bdwgc/pull/208 + patches = # https://github.com/ivmai/bdwgc/pull/208 lib.optional stdenv.hostPlatform.isRiscV ./riscv.patch; configureFlags = [ "--enable-cplusplus" "--with-libatomic-ops=none" ] - ++ lib.optional enableLargeConfig "--enable-large-config" - ++ lib.optional (stdenv.hostPlatform.libc == "musl") "--disable-static"; + ++ lib.optional enableLargeConfig "--enable-large-config"; doCheck = true; # not cross; diff --git a/pkgs/development/libraries/bullet/default.nix b/pkgs/development/libraries/bullet/default.nix index f6041802a9c..1b6c56f13af 100644 --- a/pkgs/development/libraries/bullet/default.nix +++ b/pkgs/development/libraries/bullet/default.nix @@ -40,7 +40,8 @@ stdenv.mkDerivation rec { enableParallelBuilding = true; - NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.cc.isClang "-Wno-error=argument-outside-range"; + NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.cc.isClang + "-Wno-error=argument-outside-range -Wno-error=c++11-narrowing"; meta = with stdenv.lib; { description = "A professional free 3D Game Multiphysics Library"; diff --git a/pkgs/development/libraries/dbus/default.nix b/pkgs/development/libraries/dbus/default.nix index 616ad869d57..804f0e7fc85 100644 --- a/pkgs/development/libraries/dbus/default.nix +++ b/pkgs/development/libraries/dbus/default.nix @@ -60,6 +60,7 @@ stdenv.mkDerivation rec { configureFlags = [ "--enable-user-session" "--libexecdir=${placeholder ''out''}/libexec" + "--datadir=/etc" "--localstatedir=/var" "--runstatedir=/run" "--sysconfdir=/etc" diff --git a/pkgs/development/libraries/libsodium/default.nix b/pkgs/development/libraries/libsodium/default.nix index 8c88abd2c44..a2b6ba6224e 100644 --- a/pkgs/development/libraries/libsodium/default.nix +++ b/pkgs/development/libraries/libsodium/default.nix @@ -9,7 +9,7 @@ stdenv.mkDerivation rec { }; outputs = [ "out" "dev" ]; - separateDebugInfo = stdenv.isLinux; + separateDebugInfo = stdenv.isLinux && stdenv.hostPlatform.libc != "musl"; enableParallelBuilding = true; diff --git a/pkgs/development/libraries/serialdv/default.nix b/pkgs/development/libraries/serialdv/default.nix index 11f9d301347..b57d90eb21c 100644 --- a/pkgs/development/libraries/serialdv/default.nix +++ b/pkgs/development/libraries/serialdv/default.nix @@ -2,13 +2,13 @@ stdenv.mkDerivation rec { pname = "serialdv"; - version ="1.1.1"; + version ="1.1.2"; src = fetchFromGitHub { owner = "f4exb"; repo = "serialdv"; rev = "v${version}"; - sha256 = "0swalyp8cbs7if6gxbcl7wf83ml8ch3k7ww4hws89rzpjvf070fr"; + sha256 = "0d2lnvfzf31i3f2klm46s87gby3yz3hc46cap0yqifzml0ff1qbm"; }; nativeBuildInputs = [ cmake ]; diff --git a/pkgs/development/libraries/tdlib/default.nix b/pkgs/development/libraries/tdlib/default.nix index 716f3d313b4..96ae5c1ec9a 100644 --- a/pkgs/development/libraries/tdlib/default.nix +++ b/pkgs/development/libraries/tdlib/default.nix @@ -1,14 +1,14 @@ { fetchFromGitHub, gperf, openssl, readline, zlib, cmake, stdenv }: stdenv.mkDerivation rec { - version = "1.4.0"; + version = "1.5.0"; pname = "tdlib"; src = fetchFromGitHub { owner = "tdlib"; repo = "td"; rev = "v${version}"; - sha256 = "1ijyn14rjb87rqm39hg7md8ab33yiy8cgzw3p0m37scn58gabpp7"; + sha256 = "1rqxdvzlryqln5jzj35cwz1fjwy4s8xq97p0wdnpzbfjpcalvrm5"; }; buildInputs = [ gperf openssl readline zlib ]; diff --git a/pkgs/development/libraries/tpm2-tss/default.nix b/pkgs/development/libraries/tpm2-tss/default.nix index cb105235678..0bff95f02a7 100644 --- a/pkgs/development/libraries/tpm2-tss/default.nix +++ b/pkgs/development/libraries/tpm2-tss/default.nix @@ -4,11 +4,11 @@ stdenv.mkDerivation rec { pname = "tpm2-tss"; - version = "2.2.3"; + version = "2.3.1"; src = fetchurl { url = "https://github.com/tpm2-software/${pname}/releases/download/${version}/${pname}-${version}.tar.gz"; - sha256 = "1hwrka0g817a4d1177vv0z13gp66bxzxhflfxswjhcdk93kaws8k"; + sha256 = "1ryy6da3s91ks3m66y3xp6yh3v096kny0f9br74mxf2635n5g5kh"; }; nativeBuildInputs = [ diff --git a/pkgs/development/ocaml-modules/lacaml/default.nix b/pkgs/development/ocaml-modules/lacaml/default.nix index 4556fb1eb41..4b35ce25fde 100644 --- a/pkgs/development/ocaml-modules/lacaml/default.nix +++ b/pkgs/development/ocaml-modules/lacaml/default.nix @@ -13,8 +13,8 @@ stdenv.mkDerivation rec { sha256 = "1aflg07cc9ak9mg1cr0qr368c9s141glwlarl5nhalf6hhq7ibcb"; }; - buildInputs = - [ ocaml findlib dune base stdio liblapack blas ] ++ + buildInputs = [ ocaml findlib dune base stdio ]; + propagatedBuildInputs = [ liblapack blas ] ++ stdenv.lib.optionals stdenv.isDarwin [ darwin.apple_sdk.frameworks.Accelerate ]; diff --git a/pkgs/development/ocaml-modules/zarith/default.nix b/pkgs/development/ocaml-modules/zarith/default.nix index cb90c200547..c97078c62ed 100644 --- a/pkgs/development/ocaml-modules/zarith/default.nix +++ b/pkgs/development/ocaml-modules/zarith/default.nix @@ -6,9 +6,9 @@ let source = if stdenv.lib.versionAtLeast ocaml.version "4.02" then { - version = "1.8"; - url = https://github.com/ocaml/Zarith/archive/release-1.8.tar.gz; - sha256 = "1cn63c97aij19nrw5hc1zh1jpnbsdkzq99zyyk649c4s3xi3iqq7"; + version = "1.9.1"; + url = https://github.com/ocaml/Zarith/archive/release-1.9.1.tar.gz; + sha256 = "0pfa271476dic5pvn6kxz3dfswxs6kqm2cxmhdx5xq2ayca05gj9"; } else { version = "1.3"; url = http://forge.ocamlcore.org/frs/download.php/1471/zarith-1.3.tgz; diff --git a/pkgs/development/python-modules/Wand/default.nix b/pkgs/development/python-modules/Wand/default.nix index b1b71b39572..6ff6a7b9f07 100644 --- a/pkgs/development/python-modules/Wand/default.nix +++ b/pkgs/development/python-modules/Wand/default.nix @@ -6,11 +6,11 @@ buildPythonPackage rec { pname = "Wand"; - version = "0.5.6"; + version = "0.5.7"; src = fetchPypi { inherit pname version; - sha256 = "126gpx6zj7fpx87v1qgicpfdahmmkqqmd2a8abllq0jlckrmjsyh"; + sha256 = "0wvqzppflph3fkgkyv3k11ga28fv1g1bz8sbf227d7pql8c6ia8k"; }; postPatch = '' diff --git a/pkgs/development/python-modules/azure-cli-telemetry/default.nix b/pkgs/development/python-modules/azure-cli-telemetry/default.nix index 73873076bda..22b32e20eee 100644 --- a/pkgs/development/python-modules/azure-cli-telemetry/default.nix +++ b/pkgs/development/python-modules/azure-cli-telemetry/default.nix @@ -10,11 +10,11 @@ buildPythonPackage rec { pname = "azure-cli-telemetry"; - version = "1.0.2"; + version = "1.0.3"; src = fetchPypi { inherit pname version; - sha256 = "14wmxdsrrlnixaj52q37rrvp9wg5b54gf5wn2z1vq68kxpg1s560"; + sha256 = "0sf27pcz653h0cnxsg47nndilhqlw9fl019aqbnji2vn967r9rnl"; }; propagatedBuildInputs = [ diff --git a/pkgs/development/python-modules/azure/default.nix b/pkgs/development/python-modules/azure/default.nix index 87a39255561..0a2e733ea1a 100644 --- a/pkgs/development/python-modules/azure/default.nix +++ b/pkgs/development/python-modules/azure/default.nix @@ -34,5 +34,6 @@ buildPythonPackage rec { homepage = "https://azure.microsoft.com/en-us/develop/python/"; license = licenses.asl20; maintainers = with maintainers; [ olcai ]; + broken = true; # this should propagate over 70 azure packages, many of which are not added yet }; } diff --git a/pkgs/development/python-modules/bidict/default.nix b/pkgs/development/python-modules/bidict/default.nix index 61dc1db1a48..a3fd59eea43 100644 --- a/pkgs/development/python-modules/bidict/default.nix +++ b/pkgs/development/python-modules/bidict/default.nix @@ -11,11 +11,11 @@ buildPythonPackage rec { pname = "bidict"; - version = "0.18.0"; + version = "0.18.2"; src = fetchPypi { inherit pname version; - sha256 = "4d10630fd5d86b7c165387473c5180e7fca7635f12e24b1f426aac259c72c81a"; + sha256 = "0br3ljvd56nqifr1mbwksvl5jjk40pihrrjlyn7hmc40yq6m5bvh"; }; nativeBuildInputs = [ setuptools_scm ]; diff --git a/pkgs/development/python-modules/clikit/default.nix b/pkgs/development/python-modules/clikit/default.nix index 1ac684e6d69..37a41c7fba4 100644 --- a/pkgs/development/python-modules/clikit/default.nix +++ b/pkgs/development/python-modules/clikit/default.nix @@ -4,11 +4,11 @@ buildPythonPackage rec { pname = "clikit"; - version = "0.3.1"; + version = "0.3.2"; src = fetchPypi { inherit pname version; - sha256 = "0f8ba0kbka208faxdlny8byqb2w2cdyspq73zalymq8vr91796lp"; + sha256 = "1pvzq3glf4sjgrm0wyxln3s6vicdc9q8r5sgaiqmxdmd9pylw0xm"; }; propagatedBuildInputs = [ diff --git a/pkgs/development/python-modules/cnvkit/default.nix b/pkgs/development/python-modules/cnvkit/default.nix index 905b274a055..054e302dfe7 100644 --- a/pkgs/development/python-modules/cnvkit/default.nix +++ b/pkgs/development/python-modules/cnvkit/default.nix @@ -39,6 +39,11 @@ buildPythonPackage rec { pomegranate ]; + postPatch = '' + substituteInPlace setup.py \ + --replace "pandas >= 0.20.1, < 0.25.0" "pandas" + ''; + meta = with lib; { homepage = "https://cnvkit.readthedocs.io"; description = "A Python library and command-line software toolkit to infer and visualize copy number from high-throughput DNA sequencing data"; diff --git a/pkgs/development/python-modules/django-cors-headers/default.nix b/pkgs/development/python-modules/django-cors-headers/default.nix index 24146306af7..a91d6bf2870 100644 --- a/pkgs/development/python-modules/django-cors-headers/default.nix +++ b/pkgs/development/python-modules/django-cors-headers/default.nix @@ -6,11 +6,11 @@ buildPythonPackage rec { pname = "django-cors-headers"; - version = "3.0.2"; + version = "3.1.0"; src = fetchPypi { inherit pname version; - sha256 = "0b11nkcviwv5dqnlmv63bgzciczb51wairm8b6wr6sda4p7y5wzb"; + sha256 = "0g1vqhc36ay518vs67kkf6w76ay27dc73w145bpwgp9fky81r6z6"; }; propagatedBuildInputs = [ django ]; diff --git a/pkgs/development/python-modules/holoviews/default.nix b/pkgs/development/python-modules/holoviews/default.nix index bd0cbda48d8..07be912a65a 100644 --- a/pkgs/development/python-modules/holoviews/default.nix +++ b/pkgs/development/python-modules/holoviews/default.nix @@ -15,11 +15,11 @@ buildPythonPackage rec { pname = "holoviews"; - version = "1.12.3"; + version = "1.12.5"; src = fetchPypi { inherit pname version; - sha256 = "df64c0f163fe8b43d28cf5bcdeb8abc45d882aedca525b870f17987edd0c80a2"; + sha256 = "15cay2fnhwqr42s4hiq37b8q87sir5k59p14g96mvg5p0gjnhg3w"; }; propagatedBuildInputs = [ diff --git a/pkgs/development/python-modules/identify/default.nix b/pkgs/development/python-modules/identify/default.nix index 8987ce97c71..3b53038321c 100644 --- a/pkgs/development/python-modules/identify/default.nix +++ b/pkgs/development/python-modules/identify/default.nix @@ -2,11 +2,11 @@ buildPythonPackage rec { pname = "identify"; - version = "1.4.5"; + version = "1.4.7"; src = fetchPypi { inherit pname version; - sha256 = "1z8xjvpkj599h3s76q05y10iysjjky7b0s5g3zicfyxhzm7x59a3"; + sha256 = "0vi9qxgnjgxdk4wj3c5ha3hjmc97j3pw1zh2cg39jprapn4rb4fq"; }; # Tests not included in PyPI tarball diff --git a/pkgs/development/python-modules/joblib/default.nix b/pkgs/development/python-modules/joblib/default.nix index c16c7687c8a..08957304312 100644 --- a/pkgs/development/python-modules/joblib/default.nix +++ b/pkgs/development/python-modules/joblib/default.nix @@ -3,10 +3,11 @@ , fetchPypi , fetchpatch , stdenv -, sphinx , numpydoc , pytest , python-lz4 +, setuptools +, sphinx }: @@ -37,7 +38,7 @@ buildPythonPackage rec { ]; checkInputs = [ sphinx numpydoc pytest ]; - propagatedBuildInputs = [ python-lz4 ]; + propagatedBuildInputs = [ python-lz4 setuptools ]; # test_disk_used is broken: https://github.com/joblib/joblib/issues/57 # test_dispatch_multiprocessing is broken only on Darwin. diff --git a/pkgs/development/python-modules/lark-parser/default.nix b/pkgs/development/python-modules/lark-parser/default.nix index 590ca988023..79bf4636b50 100644 --- a/pkgs/development/python-modules/lark-parser/default.nix +++ b/pkgs/development/python-modules/lark-parser/default.nix @@ -5,13 +5,13 @@ buildPythonPackage rec { pname = "lark-parser"; - version = "0.7.3"; + version = "0.7.5"; src = fetchFromGitHub { owner = "lark-parser"; repo = "lark"; rev = version; - sha256 = "1d8dbn8wwqqvvjyhai813sqkx6366d8jkjq0gkyh51692pflmwrp"; + sha256 = "1k9s62ddv6pghzp1yak2ld6sk92zm4sz1xqp8zkzyh3xqdsmfa0f"; }; # tests of Nearley support require js2py diff --git a/pkgs/development/python-modules/opt-einsum/2.nix b/pkgs/development/python-modules/opt-einsum/2.nix new file mode 100644 index 00000000000..11da1ba1ea5 --- /dev/null +++ b/pkgs/development/python-modules/opt-einsum/2.nix @@ -0,0 +1,30 @@ +{ buildPythonPackage, fetchPypi, lib, numpy, pytest_4 }: + +buildPythonPackage rec { + version = "2.3.2"; + pname = "opt_einsum"; + + src = fetchPypi { + inherit version pname; + sha256 = "0ny3v8x83mzpwmqjdzqhzy2pzwyy4wx01r1h9i29xw3yvas69m6k"; + }; + + checkInputs = [ + pytest_4 + ]; + + checkPhase = '' + pytest + ''; + + propagatedBuildInputs = [ + numpy + ]; + + meta = { + description = "Optimizing NumPy's einsum function with order optimization and GPU support."; + homepage = http://optimized-einsum.readthedocs.io; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ teh ]; + }; +} diff --git a/pkgs/development/python-modules/opt-einsum/default.nix b/pkgs/development/python-modules/opt-einsum/default.nix index c28105d4e49..f4e7d38ecb8 100644 --- a/pkgs/development/python-modules/opt-einsum/default.nix +++ b/pkgs/development/python-modules/opt-einsum/default.nix @@ -1,31 +1,26 @@ -{ buildPythonPackage, fetchPypi, lib, numpy, pytest, pytestpep8, pytestcov }: +{ buildPythonPackage, fetchPypi, lib, numpy, pytest_4 }: + buildPythonPackage rec { - version = "2.3.2"; + version = "3.0.1"; pname = "opt_einsum"; src = fetchPypi { inherit version pname; - sha256 = "0ny3v8x83mzpwmqjdzqhzy2pzwyy4wx01r1h9i29xw3yvas69m6k"; + sha256 = "1agyvq26x0zd6j3wzgczl4apx8v7cb9w1z50azn8c3pq9jphgfla"; }; - checkInputs = [ - pytest - pytestpep8 - pytestcov - ]; + propagatedBuildInputs = [ numpy ]; + + checkInputs = [ pytest_4 ]; checkPhase = '' pytest ''; - propagatedBuildInputs = [ - numpy - ]; - - meta = { + meta = with lib; { description = "Optimizing NumPy's einsum function with order optimization and GPU support."; homepage = http://optimized-einsum.readthedocs.io; - license = lib.licenses.mit; - maintainers = with lib.maintainers; [ teh ]; + license = licenses.mit; + maintainers = with maintainers; [ teh ]; }; } diff --git a/pkgs/development/python-modules/peewee/default.nix b/pkgs/development/python-modules/peewee/default.nix index afb805c0b7e..d2cd79419a4 100644 --- a/pkgs/development/python-modules/peewee/default.nix +++ b/pkgs/development/python-modules/peewee/default.nix @@ -10,14 +10,14 @@ buildPythonPackage rec { pname = "peewee"; - version = "3.10.0"; + version = "3.11.1"; # pypi release does not provide tests src = fetchFromGitHub { owner = "coleifer"; repo = pname; rev = version; - sha256 = "166h7vy3j0v4h2jnyiwpmpqgmn95381a5ra40ghghy0fqd9v49g8"; + sha256 = "0q84r9x99h9a3kqs3i12bgk8rz5my8vpjngg8yaqd2kzsb6gynp8"; }; diff --git a/pkgs/development/python-modules/pex/default.nix b/pkgs/development/python-modules/pex/default.nix index 1e61992b49d..30631e06b5f 100644 --- a/pkgs/development/python-modules/pex/default.nix +++ b/pkgs/development/python-modules/pex/default.nix @@ -6,11 +6,11 @@ buildPythonPackage rec { pname = "pex"; - version = "1.6.8"; + version = "1.6.11"; src = fetchPypi { inherit pname version; - sha256 = "1zibkc074dvk69bkiipfzn2l9glgzs26g16j2ny5lzq320wqszkj"; + sha256 = "034170w0qh20qkfaha2rpnccm31f7snhb4r9cd079v4v2x2swybk"; }; nativeBuildInputs = [ setuptools ]; diff --git a/pkgs/development/python-modules/pomegranate/default.nix b/pkgs/development/python-modules/pomegranate/default.nix index 7054485f302..4493ef51075 100644 --- a/pkgs/development/python-modules/pomegranate/default.nix +++ b/pkgs/development/python-modules/pomegranate/default.nix @@ -2,13 +2,13 @@ buildPythonPackage rec { pname = "pomegranate"; - version = "0.11.0"; + version = "0.11.1"; src = fetchFromGitHub { repo = pname; owner = "jmschrei"; rev = "v${version}"; - sha256 = "0gf7z343ag4g7pfccn1sdap3ihkaxrc9ca75awjhmsa2cyqs66df"; + sha256 = "19kdzqyj86aldsls68a6ymrs8sasv3a8r4wjmfdmcif1xsg6zb4q"; }; propagatedBuildInputs = [ numpy scipy cython networkx joblib pyyaml ]; diff --git a/pkgs/development/python-modules/pytorch/default.nix b/pkgs/development/python-modules/pytorch/default.nix index f14200b3542..17bf6f5cdab 100644 --- a/pkgs/development/python-modules/pytorch/default.nix +++ b/pkgs/development/python-modules/pytorch/default.nix @@ -44,6 +44,7 @@ in buildPythonPackage rec { }) ]; + dontUseCmakeConfigure = true; preConfigure = lib.optionalString cudaSupport '' export CC=${cudatoolkit.cc}/bin/gcc CXX=${cudatoolkit.cc}/bin/g++ '' + lib.optionalString (cudaSupport && cudnn != null) '' diff --git a/pkgs/development/python-modules/qtconsole/default.nix b/pkgs/development/python-modules/qtconsole/default.nix index 055a54612a0..95ee3a864e6 100644 --- a/pkgs/development/python-modules/qtconsole/default.nix +++ b/pkgs/development/python-modules/qtconsole/default.nix @@ -14,11 +14,11 @@ buildPythonPackage rec { pname = "qtconsole"; - version = "4.5.2"; + version = "4.5.5"; src = fetchPypi { inherit pname version; - sha256 = "0z6d2rmzrx2dzbx94xxmsrl6vn6jjpzvb6014y2bqhwr7znbjzkn"; + sha256 = "1nf64wl3ni0q69ihcm5y6zl12mmg7gvkhrb98hbgwv3yb09787mr"; }; checkInputs = [ nose ] ++ lib.optionals isPy27 [mock]; diff --git a/pkgs/development/python-modules/radio_beam/default.nix b/pkgs/development/python-modules/radio_beam/default.nix index 09d815134ef..d21da2c7583 100644 --- a/pkgs/development/python-modules/radio_beam/default.nix +++ b/pkgs/development/python-modules/radio_beam/default.nix @@ -10,11 +10,11 @@ buildPythonPackage rec { pname = "radio_beam"; - version = "0.3.1"; + version = "0.3.2"; src = fetchPypi { inherit pname version; - sha256 = "1wgd9dyz3pcc9ighkclb6qfyshwbg35s57lz6k62jhcxpvp8r5zb"; + sha256 = "0g1nqiikv023ab60gfqrvc13kfjv8m70bpfk264vlliaq6mvxdf2"; }; propagatedBuildInputs = [ astropy ]; diff --git a/pkgs/development/python-modules/rasterio/default.nix b/pkgs/development/python-modules/rasterio/default.nix index 1a4fdff5812..b5dc13f6625 100644 --- a/pkgs/development/python-modules/rasterio/default.nix +++ b/pkgs/development/python-modules/rasterio/default.nix @@ -6,14 +6,14 @@ buildPythonPackage rec { pname = "rasterio"; - version = "1.0.25"; + version = "1.0.28"; # Pypi doesn't ship the tests, so we fetch directly from GitHub src = fetchFromGitHub { owner = "mapbox"; repo = "rasterio"; rev = version; - sha256 = "15m0ajcrxjdzahdkxa3mylk87l31zz48k99bvmmx96hcl31cf347"; + sha256 = "05rn2ijjv64a765gkpwcq3bb933gzp35zj4l9sk0agh19462myjx"; }; checkInputs = [ boto3 pytest pytestcov packaging hypothesis ] ++ lib.optional (!isPy3k) mock; diff --git a/pkgs/development/python-modules/resampy/default.nix b/pkgs/development/python-modules/resampy/default.nix index e9e51756d9f..a83e196005d 100644 --- a/pkgs/development/python-modules/resampy/default.nix +++ b/pkgs/development/python-modules/resampy/default.nix @@ -12,14 +12,14 @@ buildPythonPackage rec { pname = "resampy"; - version = "0.2.1"; + version = "0.2.2"; # No tests in PyPi Archive src = fetchFromGitHub { owner = "bmcfee"; repo = pname; rev = version; - sha256 = "0a2bxj042y62dimm2i4vglbhpwbybam07mcl67cb6pmfsw9fbqhj"; + sha256 = "0qmkxl5sbgh0j73n667vyi7ywzh09iaync91yp1j5rrcmwsn0qfs"; }; checkInputs = [ pytest pytestcov ]; diff --git a/pkgs/development/python-modules/sepaxml/default.nix b/pkgs/development/python-modules/sepaxml/default.nix index 6e6809663a6..1790ae2e8f5 100644 --- a/pkgs/development/python-modules/sepaxml/default.nix +++ b/pkgs/development/python-modules/sepaxml/default.nix @@ -6,7 +6,7 @@ }: buildPythonPackage rec { - version = "2.1.0"; + version = "2.2.0"; pname = "sepaxml"; disabled = isPy27; @@ -14,7 +14,7 @@ buildPythonPackage rec { owner = "raphaelm"; repo = "python-sepaxml"; rev = version; - sha256 = "0lkb0nnyxmwvm6gkwls8w2290b66lwz9bv8p39wwcn7flabviwhj"; + sha256 = "1qmgdcz61hs65m2fddwn9jpyk2sxifdb0f3jz1n0lgy774z0pmas"; }; propagatedBuildInputs = [ diff --git a/pkgs/development/python-modules/shodan/default.nix b/pkgs/development/python-modules/shodan/default.nix index 8723a7b940c..ae9f9e42ecf 100644 --- a/pkgs/development/python-modules/shodan/default.nix +++ b/pkgs/development/python-modules/shodan/default.nix @@ -4,22 +4,24 @@ , click-plugins , colorama , requests +, setuptools , XlsxWriter }: buildPythonPackage rec { pname = "shodan"; - version = "1.14.0"; + version = "1.17.0"; src = fetchPypi { inherit pname version; - sha256 = "0c5x53757p6ihh1f8xqsal2gi9ikcl3464b38qinva51s0kkb58k"; + sha256 = "1sh7a2dsal3kzcl4s9xbpl7hxhm9k55s5hiqdqqnafhvhnh0vmbz"; }; propagatedBuildInputs = [ click-plugins colorama requests + setuptools XlsxWriter ]; diff --git a/pkgs/development/python-modules/srsly/default.nix b/pkgs/development/python-modules/srsly/default.nix index d1685b4d579..17cd3e8c503 100644 --- a/pkgs/development/python-modules/srsly/default.nix +++ b/pkgs/development/python-modules/srsly/default.nix @@ -12,11 +12,11 @@ buildPythonPackage rec { pname = "srsly"; - version = "0.0.7"; + version = "0.1.0"; src = fetchPypi { inherit pname version; - sha256 = "1v9nn17q2lshnvnc8ff6nk53rggz2hgnmx4fj4czfr40125r98pk"; + sha256 = "1l9yjp1w2vrkrynxrlrc0v47i2iq9059k4ni44nz23573xbdrh2w"; }; propagatedBuildInputs = lib.optional (pythonOlder "3.4") pathlib; diff --git a/pkgs/development/python-modules/streamz/default.nix b/pkgs/development/python-modules/streamz/default.nix index 5360b951de2..da77691e354 100644 --- a/pkgs/development/python-modules/streamz/default.nix +++ b/pkgs/development/python-modules/streamz/default.nix @@ -5,23 +5,23 @@ , toolz , zict , six -, pytest +, pytest_4 , networkx , distributed , confluent-kafka , graphviz +, requests }: buildPythonPackage rec { pname = "streamz"; - version = "0.5.1"; + version = "0.5.2"; src = fetchPypi { inherit pname version; - sha256 = "80c9ded1d6e68d3b78339deb6e9baf93a633d84b4a8875221e337ac06890103f"; + sha256 = "127rpdjgkcyjifmkqbhmqfbzlgi32n54rybrdxja610qr906y40c"; }; - checkInputs = [ pytest networkx distributed confluent-kafka graphviz ]; propagatedBuildInputs = [ tornado toolz @@ -29,6 +29,15 @@ buildPythonPackage rec { six ]; + checkInputs = [ + confluent-kafka + distributed + graphviz + networkx + pytest_4 + requests + ]; + # Disable test_tcp_async because fails on sandbox build checkPhase = '' pytest --deselect=streamz/tests/test_sources.py::test_tcp_async \ @@ -37,7 +46,7 @@ buildPythonPackage rec { meta = with lib; { description = "Pipelines to manage continuous streams of data"; - homepage = https://github.com/mrocklin/streamz/; + homepage = "https://github.com/mrocklin/streamz"; license = licenses.bsd3; maintainers = [ maintainers.costrouc ]; }; diff --git a/pkgs/development/python-modules/stripe/default.nix b/pkgs/development/python-modules/stripe/default.nix index 9c252aa9ce2..68ed8dcf99f 100644 --- a/pkgs/development/python-modules/stripe/default.nix +++ b/pkgs/development/python-modules/stripe/default.nix @@ -2,7 +2,7 @@ buildPythonPackage rec { pname = "stripe"; - version = "2.30.0"; + version = "2.35.1"; # Tests require network connectivity and there's no easy way to disable # them. ~ C. @@ -10,7 +10,7 @@ buildPythonPackage rec { src = fetchPypi { inherit pname version; - sha256 = "de6be07c9e8a350d588278186316f66c72af7036aa5e917d1a924fb875249034"; + sha256 = "0rmzba8yig426anf8fxiacyvwchlsws746757sgvw748n8lrarbw"; }; propagatedBuildInputs = [ requests ]; diff --git a/pkgs/development/python-modules/supervisor/default.nix b/pkgs/development/python-modules/supervisor/default.nix index 4771ba7a89d..e7bbb57cedc 100644 --- a/pkgs/development/python-modules/supervisor/default.nix +++ b/pkgs/development/python-modules/supervisor/default.nix @@ -1,27 +1,26 @@ { lib, buildPythonPackage, isPy3k, fetchPypi , mock , meld3 +, setuptools }: + buildPythonPackage rec { pname = "supervisor"; - version = "3.3.5"; + version = "4.0.4"; src = fetchPypi { inherit pname version; - sha256 = "1w3ahridzbc6rxfpbyx8lij6pjlcgf2ymzyg53llkjqxalp6sk8v"; + sha256 = "02pindhq84hb9a7ykyaqw8i2iqb21h69lpmclyqh7fm1446rji4n"; }; checkInputs = [ mock ]; - propagatedBuildInputs = [ meld3 ]; - - # Supervisor requires Python 2.4 or later but does not work on any version of Python 3. You are using version 3.6.5 (default, Mar 28 2018, 10:24:30) - disabled = isPy3k; + propagatedBuildInputs = [ meld3 setuptools ]; - meta = { + meta = with lib; { description = "A system for controlling process state under UNIX"; homepage = http://supervisord.org/; - license = lib.licenses.free; # http://www.repoze.org/LICENSE.txt - maintainers = with lib.maintainers; [ zimbatm ]; + license = licenses.free; # http://www.repoze.org/LICENSE.txt + maintainers = with maintainers; [ zimbatm ]; }; } diff --git a/pkgs/development/python-modules/tilestache/default.nix b/pkgs/development/python-modules/tilestache/default.nix index 2b0fc68ca4c..c76cc6645d9 100644 --- a/pkgs/development/python-modules/tilestache/default.nix +++ b/pkgs/development/python-modules/tilestache/default.nix @@ -12,13 +12,13 @@ buildPythonPackage rec { pname = "tilestache"; - version = "1.51.13"; + version = "1.51.14"; disabled = !isPy27; src = fetchPypi { pname = "TileStache"; inherit version; - sha256 = "11e15dd85501345bcfeb18dce5b1c8fb74ac8d867df2520afe0eefe1edd85f27"; + sha256 = "1qjrabl6qr7i6yj6v647ck92abcyklb0vmb6h6kj7x8v2cj5xbvk"; }; propagatedBuildInputs = [ modestmaps pillow pycairo python-mapnik simplejson werkzeug ]; diff --git a/pkgs/development/python-modules/tld/default.nix b/pkgs/development/python-modules/tld/default.nix index b3d83deeac9..470a4bb40dd 100644 --- a/pkgs/development/python-modules/tld/default.nix +++ b/pkgs/development/python-modules/tld/default.nix @@ -2,11 +2,11 @@ python.pkgs.buildPythonPackage rec { pname = "tld"; - version = "0.9.3"; + version = "0.9.6"; src = fetchPypi { inherit pname version; - sha256 = "0i0prgwrmm157h6fa5bx9wm0m70qq2nhzp743374a94p9s766rpp"; + sha256 = "0figmf80y715zv6viqan2nyzpg9aia5dyl25nskirpm5lh1s99w9"; }; propagatedBuildInputs = with python.pkgs; [ six ]; diff --git a/pkgs/development/python-modules/twine/default.nix b/pkgs/development/python-modules/twine/default.nix index a49e994019e..3fdc11e440e 100644 --- a/pkgs/development/python-modules/twine/default.nix +++ b/pkgs/development/python-modules/twine/default.nix @@ -11,11 +11,11 @@ buildPythonPackage rec { pname = "twine"; - version = "1.13.0"; + version = "1.15.0"; src = fetchPypi { inherit pname version; - sha256 = "d6c29c933ecfc74e9b1d9fa13aa1f87c5d5770e119f5a4ce032092f0ff5b14dc"; + sha256 = "11rpd653zcgzkq3sgwkzs3mpxl3r5rij59745ni84ikv8smjmlm3"; }; propagatedBuildInputs = [ pkginfo requests requests_toolbelt tqdm pyblake2 readme_renderer ]; diff --git a/pkgs/development/python-modules/umap-learn/default.nix b/pkgs/development/python-modules/umap-learn/default.nix index 1fbdbd3782a..a97f69652e8 100644 --- a/pkgs/development/python-modules/umap-learn/default.nix +++ b/pkgs/development/python-modules/umap-learn/default.nix @@ -10,13 +10,13 @@ buildPythonPackage rec { pname = "umap-learn"; - version = "0.3.9"; + version = "0.3.10"; src = fetchFromGitHub { owner = "lmcinnes"; repo = "umap"; rev = version; - sha256 = "1cdc7hs3vwzxvzs34l9a06q8rvks29wj6swyj8zvwr32knxch8a9"; + sha256 = "0nck5va5km7qkbrhn15dsn0p2mms9kc641lcypy7l8haqgm44h8x"; }; checkInputs = [ diff --git a/pkgs/development/python-modules/uncompyle6/default.nix b/pkgs/development/python-modules/uncompyle6/default.nix index f300ed72751..65542cd758b 100644 --- a/pkgs/development/python-modules/uncompyle6/default.nix +++ b/pkgs/development/python-modules/uncompyle6/default.nix @@ -11,11 +11,11 @@ buildPythonPackage rec { pname = "uncompyle6"; - version = "3.3.3"; + version = "3.4.0"; src = fetchPypi { inherit pname version; - sha256 = "9c492a560ff1c8713f0947cfc3ab755c368e26421d13087cd5b6c01b1529ea5b"; + sha256 = "0w4m0jywjb0w1y73nkb05zmjxb4plpfi3w2g1rgrf45afa2aqm8z"; }; checkInputs = [ nose pytest hypothesis six ]; diff --git a/pkgs/development/python-modules/uproot/default.nix b/pkgs/development/python-modules/uproot/default.nix index f85c28b7f57..3d20c31b9be 100644 --- a/pkgs/development/python-modules/uproot/default.nix +++ b/pkgs/development/python-modules/uproot/default.nix @@ -15,11 +15,11 @@ buildPythonPackage rec { pname = "uproot"; - version = "3.8.0"; + version = "3.10.0"; src = fetchPypi { inherit pname version; - sha256 = "06s0lym5md59pj8w89acnwk0i0hh92az187h4gz22mb849h308pw"; + sha256 = "1ir3gxgfidw0lx0d2x1lmmxg9brb5fam3ncfihba2b0bvyq9bqzd"; }; nativeBuildInputs = [ pytestrunner ]; diff --git a/pkgs/development/python-modules/websockify/default.nix b/pkgs/development/python-modules/websockify/default.nix index a9758580a44..484cc33b1f3 100644 --- a/pkgs/development/python-modules/websockify/default.nix +++ b/pkgs/development/python-modules/websockify/default.nix @@ -5,12 +5,12 @@ }: buildPythonPackage rec { - version = "0.8.0"; + version = "0.9.0"; pname = "websockify"; src = fetchPypi { inherit pname version; - sha256 = "547d3d98c5081f2dc2872a2e4a3aef33e0ee5141d5f6209204aab2f4a41548d2"; + sha256 = "1nnalv0jkkj34hw6yb12lp6r6fj1ps9vkkyshjvx65y5xdwmnny3"; }; propagatedBuildInputs = [ numpy ]; diff --git a/pkgs/development/python-modules/zstd/default.nix b/pkgs/development/python-modules/zstd/default.nix index 9c9c932cabf..3f9dac6d42c 100644 --- a/pkgs/development/python-modules/zstd/default.nix +++ b/pkgs/development/python-modules/zstd/default.nix @@ -3,11 +3,11 @@ buildPythonPackage rec { pname = "zstd"; - version = "1.4.1.0"; + version = "1.4.3.2"; src = fetchPypi { inherit pname version; - sha256 = "0laxg0pag1bzmqmg4x81jb32412pn98p9zg2b0li035m779nka95"; + sha256 = "1h4wvzikar4ryhawm7clh29bvhbpy0ix1rlxhg9x195fpq56vsh7"; }; postPatch = '' diff --git a/pkgs/development/tools/analysis/radare2/cutter.nix b/pkgs/development/tools/analysis/radare2/cutter.nix index 84c56a9b569..252e95e5793 100644 --- a/pkgs/development/tools/analysis/radare2/cutter.nix +++ b/pkgs/development/tools/analysis/radare2/cutter.nix @@ -10,13 +10,13 @@ stdenv.mkDerivation rec { pname = "radare2-cutter"; - version = "1.8.3"; + version = "1.9.0"; src = fetchFromGitHub { owner = "radareorg"; repo = "cutter"; rev = "v${version}"; - sha256 = "03f3cdckh51anx9gd1b0ndb2fg7061hqngvygf32ky29mm2m2lyv"; + sha256 = "1ln55ssrasbaam267lwc2vxnm8j0c2x35qsda44xi2p8hqxslf8k"; }; postUnpack = "export sourceRoot=$sourceRoot/src"; diff --git a/pkgs/development/tools/analysis/radare2/default.nix b/pkgs/development/tools/analysis/radare2/default.nix index 41949b0ad42..cc6930fce13 100644 --- a/pkgs/development/tools/analysis/radare2/default.nix +++ b/pkgs/development/tools/analysis/radare2/default.nix @@ -120,12 +120,12 @@ in { cs_sha256 = "0ijwxxk71nr9z91yxw20zfj4bbsbrgvixps5c7cpj163xlzlwba6"; }; r2-for-cutter = generic { - version_commit = "22775"; - gittap = "3.6.0"; - gittip = "ff3bb6e3b2e6a519b4c975d05758c171a5186389"; - rev = "ff3bb6e3b2e6a519b4c975d05758c171a5186389"; - version = "2019-06-24"; - sha256 = "0vp94qzznqv87vvjbyyj6swkm6gl7byqvb1jv23i8i42zi5n7qmd"; + version_commit = "22888"; + gittap = "3.8.0"; + gittip = "b4860e4eecad2053202965926f16296864b2f1e5"; + rev = "b4860e4eecad2053202965926f16296864b2f1e5"; + version = "2019-09-03"; + sha256 = "0rx6az2vpqy12lvzpxx9pappqj84d88daj8bis3zsffqgmhsafcd"; cs_ver = "4.0.1"; cs_sha256 = "0ijwxxk71nr9z91yxw20zfj4bbsbrgvixps5c7cpj163xlzlwba6"; }; diff --git a/pkgs/misc/screensavers/xlockmore/default.nix b/pkgs/misc/screensavers/xlockmore/default.nix index c08b16a0a1d..c63a930cd05 100644 --- a/pkgs/misc/screensavers/xlockmore/default.nix +++ b/pkgs/misc/screensavers/xlockmore/default.nix @@ -2,11 +2,11 @@ , libXdmcp, libXt }: stdenv.mkDerivation rec { - name = "xlockmore-5.57"; + name = "xlockmore-5.58"; src = fetchurl { url = "http://sillycycle.com/xlock/${name}.tar.xz"; - sha256 = "18r8rh8fzdn9miicbpc3qbdd4mm2g1jpsbcvj29sr66pxydzkb7r"; + sha256 = "1va11sbv5lbkxkp0i0msz5md3n2n82nzppk27rzdrw7y79vq37zw"; curlOpts = "--user-agent 'Mozilla/5.0'"; }; diff --git a/pkgs/os-specific/linux/busybox/default.nix b/pkgs/os-specific/linux/busybox/default.nix index f041d2b5042..087209a9d29 100644 --- a/pkgs/os-specific/linux/busybox/default.nix +++ b/pkgs/os-specific/linux/busybox/default.nix @@ -88,10 +88,6 @@ stdenv.mkDerivation rec { runHook postConfigure ''; - postConfigure = lib.optionalString useMusl '' - makeFlagsArray+=("CC=${stdenv.cc.targetPrefix}cc -isystem ${musl.dev}/include -B${musl}/lib -L${musl}/lib") - ''; - depsBuildBuild = [ buildPackages.stdenv.cc ]; buildInputs = lib.optionals (enableStatic && !useMusl && stdenv.cc.libc ? static) [ stdenv.cc.libc stdenv.cc.libc.static ]; diff --git a/pkgs/os-specific/linux/busybox/sandbox-shell.nix b/pkgs/os-specific/linux/busybox/sandbox-shell.nix index c2d82ebc487..036ea0a0f48 100644 --- a/pkgs/os-specific/linux/busybox/sandbox-shell.nix +++ b/pkgs/os-specific/linux/busybox/sandbox-shell.nix @@ -2,8 +2,6 @@ # Minimal shell for use as basic /bin/sh in sandbox builds busybox.override { - # musl roadmap has RISC-V support projected for 1.1.20 - useMusl = !stdenv.hostPlatform.isRiscV && stdenv.hostPlatform.libc != "bionic"; enableStatic = true; enableMinimal = true; extraConfig = '' diff --git a/pkgs/test/default.nix b/pkgs/test/default.nix index 793229f8bbb..eb0711b8885 100644 --- a/pkgs/test/default.nix +++ b/pkgs/test/default.nix @@ -20,6 +20,10 @@ with pkgs; cc-wrapper-libcxx-6 = callPackage ./cc-wrapper { stdenv = llvmPackages_6.libcxxStdenv; }; cc-wrapper-clang-7 = callPackage ./cc-wrapper { stdenv = llvmPackages_7.stdenv; }; cc-wrapper-libcxx-7 = callPackage ./cc-wrapper { stdenv = llvmPackages_7.libcxxStdenv; }; + cc-wrapper-clang-8 = callPackage ./cc-wrapper { stdenv = llvmPackages_8.stdenv; }; + cc-wrapper-libcxx-8 = callPackage ./cc-wrapper { stdenv = llvmPackages_8.libcxxStdenv; }; + cc-wrapper-clang-9 = callPackage ./cc-wrapper { stdenv = llvmPackages_9.stdenv; }; + cc-wrapper-libcxx-9 = callPackage ./cc-wrapper { stdenv = llvmPackages_9.libcxxStdenv; }; stdenv-inputs = callPackage ./stdenv-inputs { }; cc-multilib-gcc = callPackage ./cc-wrapper/multilib.nix { stdenv = gccMultiStdenv; }; diff --git a/pkgs/tools/X11/xidlehook/default.nix b/pkgs/tools/X11/xidlehook/default.nix index b1770af2406..89aff817f50 100644 --- a/pkgs/tools/X11/xidlehook/default.nix +++ b/pkgs/tools/X11/xidlehook/default.nix @@ -3,7 +3,7 @@ rustPlatform.buildRustPackage rec { pname = "xidlehook"; - version = "0.7.0"; + version = "0.7.1"; doCheck = false; @@ -12,7 +12,7 @@ rustPlatform.buildRustPackage rec { repo = "xidlehook"; rev = version; - sha256 = "0dl4rnh4l3rhga5pfxmkc9syn6vx05zxdf8xcv0gw9h60y1smp6v"; + sha256 = "04bb81iwxznkr1zq1q8dql9qklzm9qy7837a71b02ywp3fc6v5b2"; }; cargoBuildFlags = lib.optionals (!stdenv.isLinux) ["--no-default-features" "--features" "pulse"]; diff --git a/pkgs/tools/compression/brotli/default.nix b/pkgs/tools/compression/brotli/default.nix index 33b6f12cd46..229c6c8b8e4 100644 --- a/pkgs/tools/compression/brotli/default.nix +++ b/pkgs/tools/compression/brotli/default.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchFromGitHub, cmake }: +{ stdenv, fetchFromGitHub, cmake, fetchpatch, staticOnly ? false }: # ?TODO: there's also python lib in there @@ -15,7 +15,13 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ cmake ]; - cmakeFlags = []; + patches = stdenv.lib.optional staticOnly (fetchpatch { + url = "https://github.com/google/brotli/pull/655/commits/7289e5a378ba13801996a84d89d8fe95c3fc4c11.patch"; + sha256 = "1bghbdvj24jrvb0sqfdif9vwg7wx6pn8dvl6flkrcjkhpj0gi0jg"; + }); + + cmakeFlags = [] + ++ stdenv.lib.optional staticOnly "-DBUILD_SHARED_LIBS=OFF"; outputs = [ "out" "dev" "lib" ]; diff --git a/pkgs/tools/graphics/vips/default.nix b/pkgs/tools/graphics/vips/default.nix index ad352c04ad9..3efbd6e0765 100644 --- a/pkgs/tools/graphics/vips/default.nix +++ b/pkgs/tools/graphics/vips/default.nix @@ -10,13 +10,13 @@ stdenv.mkDerivation rec { pname = "vips"; - version = "8.8.1"; + version = "8.8.3"; src = fetchFromGitHub { owner = "libvips"; repo = "libvips"; rev = "v${version}"; - sha256 = "1wnfn92rvafx1g9vvhbvxssifzydx9y95kszg6i4c1p5sv5nhfd2"; + sha256 = "0wlwcgcp7d3vhjdbi3xlpvnj4jl4321vac9v1sr1mis4aivwzsrn"; # Remove unicode file names which leads to different checksums on HFS+ # vs. other filesystems because of unicode normalisation. extraPostFetch = '' diff --git a/pkgs/tools/misc/xprite-editor/default.nix b/pkgs/tools/misc/xprite-editor/default.nix new file mode 100644 index 00000000000..e2615bef6ce --- /dev/null +++ b/pkgs/tools/misc/xprite-editor/default.nix @@ -0,0 +1,43 @@ +{ stdenv +, fetchFromGitHub +, rustPlatform +, gtk3 +, AppKit +, pkg-config +, python3 +}: + +rustPlatform.buildRustPackage rec { + pname = "xprite-editor-unstable"; + version = "2019-09-22"; + + src = fetchFromGitHub { + owner = "rickyhan"; + repo = "xprite-editor"; + rev = "7f899dff982642927024540e4bafd74e4ea5e52a"; + sha256 = "1k6k8y8gg1vdmyjz27q689q9rliw0rrnzwlpjcd4vlc6swaq9ahx"; + fetchSubmodules = true; + # Rename unicode file name which leads to different checksums on HFS+ + # vs. other filesystems because of unicode normalization. + postFetch = '' + mv $out/config/palettes/Sweet\ Guaran*.hex $out/config/palettes/Sweet\ Guarana.hex + ''; + }; + + buildInputs = stdenv.lib.optionals stdenv.isLinux [ gtk3 ] + ++ stdenv.lib.optionals stdenv.isDarwin [ AppKit ]; + + nativeBuildInputs = stdenv.lib.optionals stdenv.isLinux [ pkg-config python3 ]; + + cargoSha256 = "0cd58888l7pjmghin31ha780yhs2pz67b10jysyasdw0a88m0dwy"; + + cargoBuildFlags = [ "--bin" "xprite-native" ]; + + meta = with stdenv.lib; { + homepage = "https://github.com/rickyhan/xprite-editor"; + description = "Pixel art editor"; + license = licenses.gpl3; + maintainers = [ maintainers.marsam ]; + platforms = platforms.linux ++ platforms.darwin; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 0a27f73a16c..6e394eb8b4e 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -1765,6 +1765,8 @@ in jellyfin = callPackage ../servers/jellyfin { }; + jotta-cli = callPackage ../applications/misc/jotta-cli { }; + kapacitor = callPackage ../servers/monitoring/kapacitor { }; kisslicer = callPackage ../tools/misc/kisslicer { }; @@ -7144,6 +7146,10 @@ in xorriso = callPackage ../tools/cd-dvd/xorriso { }; + xprite-editor = callPackage ../tools/misc/xprite-editor { + inherit (darwin.apple_sdk.frameworks) AppKit; + }; + xpf = callPackage ../tools/text/xml/xpf { libxml2 = libxml2Python; }; @@ -7441,6 +7447,7 @@ in llvm-polly = llvmPackages_latest.llvm-polly; clang-polly = llvmPackages_latest.clang.override { cc = llvmPackages_latest.clang-polly-unwrapped; }; + clang_9 = llvmPackages_9.clang; clang_8 = llvmPackages_8.clang; clang_7 = llvmPackages_7.clang; clang_6 = llvmPackages_6.clang; @@ -8122,6 +8129,7 @@ in lld_6 = llvmPackages_6.lld; lld_7 = llvmPackages_7.lld; lld_8 = llvmPackages_8.lld; + lld_9 = llvmPackages_9.lld; lldb = llvmPackages.lldb; lldb_4 = llvmPackages_4.lldb; @@ -8129,10 +8137,12 @@ in lldb_6 = llvmPackages_6.lldb; lldb_7 = llvmPackages_7.lldb; lldb_8 = llvmPackages_8.lldb; + lldb_9 = llvmPackages_9.lldb; llvm = llvmPackages.llvm; llvm-manpages = llvmPackages.llvm-manpages; + llvm_9 = llvmPackages_9.llvm; llvm_8 = llvmPackages_8.llvm; llvm_7 = llvmPackages_7.llvm; llvm_6 = llvmPackages_6.llvm; @@ -8199,7 +8209,15 @@ in stdenv = gcc6Stdenv; # with gcc-7: undefined reference to `__divmoddi4' }); - llvmPackages_latest = llvmPackages_8; + llvmPackages_9 = callPackage ../development/compilers/llvm/9 ({ + inherit (stdenvAdapters) overrideCC; + buildLlvmTools = buildPackages.llvmPackages_9.tools; + targetLlvmLibraries = targetPackages.llvmPackages_9.libraries; + } // stdenv.lib.optionalAttrs (buildPackages.stdenv.cc.isGNU && stdenv.hostPlatform.isi686) { + stdenv = gcc6Stdenv; # with gcc-7: undefined reference to `__divmoddi4' + }); + + llvmPackages_latest = llvmPackages_9; lorri = throw "lorri is not stable yet. Please go to https://github.com/target/lorri and follow the installation instructions there, for the time being."; @@ -15457,7 +15475,12 @@ in bridge-utils = callPackage ../os-specific/linux/bridge-utils { }; busybox = callPackage ../os-specific/linux/busybox { }; - busybox-sandbox-shell = callPackage ../os-specific/linux/busybox/sandbox-shell.nix { }; + busybox-sandbox-shell = callPackage ../os-specific/linux/busybox/sandbox-shell.nix { + # musl roadmap has RISC-V support projected for 1.1.20 + busybox = if !stdenv.hostPlatform.isRiscV && stdenv.hostPlatform.libc != "bionic" + then pkgsStatic.busybox + else busybox; + }; cachefilesd = callPackage ../os-specific/linux/cachefilesd { }; @@ -17269,6 +17292,8 @@ in wireless-regdb = callPackage ../data/misc/wireless-regdb { }; + work-sans = callPackage ../data/fonts/work-sans { }; + wqy_microhei = callPackage ../data/fonts/wqy-microhei { }; wqy_zenhei = callPackage ../data/fonts/wqy-zenhei { }; @@ -19750,6 +19775,8 @@ in sidplayfp = callPackage ../applications/audio/sidplayfp { }; + sndpeek = callPackage ../applications/audio/sndpeek { }; + sxhkd = callPackage ../applications/window-managers/sxhkd { }; mpop = callPackage ../applications/networking/mpop { diff --git a/pkgs/top-level/php-packages.nix b/pkgs/top-level/php-packages.nix index fc6d7674338..ff5be8399b2 100644 --- a/pkgs/top-level/php-packages.nix +++ b/pkgs/top-level/php-packages.nix @@ -365,12 +365,12 @@ let }; phpcs = mkDerivation rec { - version = "3.4.2"; + version = "3.5.0"; pname = "phpcs"; src = pkgs.fetchurl { url = "https://github.com/squizlabs/PHP_CodeSniffer/releases/download/${version}/phpcs.phar"; - sha256 = "0hk9w5kn72z9xhswfmxilb2wk96vy07z4a1pwrpspjlr23aajrk9"; + sha256 = "078anf2r6a3p8v575m65vryazipgfchs07yb92m9xh41lk5wlndf"; }; phases = [ "installPhase" ]; diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index d08bb33f34e..a610ef51d8c 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -3165,7 +3165,10 @@ in { pyro-ppl = callPackage ../development/python-modules/pyro-ppl {}; - opt-einsum = callPackage ../development/python-modules/opt-einsum {}; + opt-einsum = if isPy27 then + callPackage ../development/python-modules/opt-einsum/2.nix {} + else + callPackage ../development/python-modules/opt-einsum {}; pytorchWithCuda = self.pytorch.override { cudaSupport = true; diff --git a/pkgs/top-level/static.nix b/pkgs/top-level/static.nix index f3c524378ea..cc773207c37 100644 --- a/pkgs/top-level/static.nix +++ b/pkgs/top-level/static.nix @@ -69,6 +69,10 @@ in { haskellStaticAdapter; }; + nghttp2 = super.nghttp2.override { + enableApp = false; + }; + ncurses = super.ncurses.override { enableStatic = true; }; @@ -78,14 +82,14 @@ in { } // optionalAttrs super.stdenv.hostPlatform.isDarwin { pythonSupport = false; }); - zlib = super.zlib.override { + zlib = (super.zlib.override { static = true; shared = false; # Don’t use new stdenv zlib because # it doesn’t like the --disable-shared flag stdenv = super.stdenv; - }; + }).static; xz = super.xz.override { enableStatic = true; }; @@ -115,7 +119,9 @@ in { static = true; }; openblas = super.openblas.override { enableStatic = true; }; - openssl = super.openssl.override { + nix = super.nix.override { withAWS = false; }; + # openssl 1.1 doesn't compile + openssl = super.openssl_1_0_2.override { static = true; # Don’t use new stdenv for openssl because it doesn’t like the @@ -125,6 +131,10 @@ in { boost = super.boost.override { enableStatic = true; enableShared = false; + + # Don’t use new stdenv for boost because it doesn’t like the + # --disable-shared flag + stdenv = super.stdenv; }; gmp = super.gmp.override { withStatic = true; @@ -159,6 +169,15 @@ in { }; }; + curl = super.curl.override { + # a very sad story: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=439039 + gssSupport = false; + }; + + brotli = super.brotli.override { + staticOnly = true; + }; + llvmPackages_8 = super.llvmPackages_8 // { libraries = super.llvmPackages_8.libraries // rec { libcxxabi = super.llvmPackages_8.libraries.libcxxabi.override { |