about summary refs log tree commit diff
path: root/pkgs/development/compilers
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/compilers')
-rw-r--r--pkgs/development/compilers/edk2/default.nix83
-rw-r--r--pkgs/development/compilers/fasm/bin.nix4
-rw-r--r--pkgs/development/compilers/flux/default.nix21
-rw-r--r--pkgs/development/compilers/gcc/9/default.nix4
-rw-r--r--pkgs/development/compilers/graalvm/enterprise-edition.nix133
-rw-r--r--pkgs/development/compilers/julia/1.0.nix4
-rw-r--r--pkgs/development/compilers/julia/1.1.nix4
-rw-r--r--pkgs/development/compilers/rust/default.nix1
-rw-r--r--pkgs/development/compilers/rust/rustfmt.nix33
-rw-r--r--pkgs/development/compilers/swift/default.nix13
10 files changed, 236 insertions, 64 deletions
diff --git a/pkgs/development/compilers/edk2/default.nix b/pkgs/development/compilers/edk2/default.nix
index 809fc6a4cf1a..2a90902df1e7 100644
--- a/pkgs/development/compilers/edk2/default.nix
+++ b/pkgs/development/compilers/edk2/default.nix
@@ -1,7 +1,7 @@
-{ stdenv, fetchFromGitHub, fetchpatch, libuuid, python2, iasl }:
+{ stdenv, fetchgit, fetchpatch, libuuid, python3, iasl, bc }:
 
 let
-  pythonEnv = python2.withPackages(ps: [ps.tkinter]);
+  pythonEnv = python3.withPackages (ps: [ps.tkinter]);
 
 targetArch = if stdenv.isi686 then
   "IA32"
@@ -13,80 +13,67 @@ else
   throw "Unsupported architecture";
 
 edk2 = stdenv.mkDerivation {
-  name = "edk2-2017-12-05";
-
-  src = fetchFromGitHub {
-    owner = "tianocore";
-    repo = "edk2";
-    rev = "f71a70e7a4c93a6143d7bad8ab0220a947679697";
-    sha256 = "0k48xfwxcgcim1bhkggc19hilvsxsf5axvvcpmld0ng1fcfg0cr6";
+  pname = "edk2";
+  version = "201905";
+
+  # submodules
+  src = fetchgit {
+    url = "https://github.com/tianocore/edk2";
+    rev = "edk2-stable${edk2.version}";
+    sha256 = "0fk40h4nj4qg8shg0yd1zj4iyspslms5fx95ysi04akv90k5sqkn";
   };
 
-  patches = [
-    (fetchpatch {
-      name = "short-circuit-the-transfer-of-an-empty-S3_CONTEXT.patch";
-      url = "https://github.com/tianocore/edk2/commit/9e2a8e928995c3b1bb664b73fd59785055c6b5f6.diff";
-      sha256 = "0x24npijhgpjpsn3n74wayf8qcbaj97vi4z2iyf4almavqq8qaz4";
-    })
-  ];
-
   buildInputs = [ libuuid pythonEnv ];
 
-  makeFlags = "-C BaseTools";
+  makeFlags = [ "-C BaseTools" ];
 
   hardeningDisable = [ "format" "fortify" ];
 
   installPhase = ''
     mkdir -vp $out
     mv -v BaseTools $out
-    mv -v EdkCompatibilityPkg $out
     mv -v edksetup.sh $out
   '';
 
   enableParallelBuilding = true;
 
-  meta = {
+  meta = with stdenv.lib; {
     description = "Intel EFI development kit";
     homepage = https://sourceforge.net/projects/edk2/;
-    license = stdenv.lib.licenses.bsd2;
-    branch = "UDK2017";
-    platforms = ["x86_64-linux" "i686-linux" "aarch64-linux"];
+    license = licenses.bsd2;
+    platforms = [ "x86_64-linux" "i686-linux" "aarch64-linux" ];
   };
 
   passthru = {
-    setup = projectDscPath: attrs: {
-      buildInputs = [ pythonEnv ] ++
-        stdenv.lib.optionals (attrs ? buildInputs) attrs.buildInputs;
+    mkDerivation = projectDscPath: attrs: stdenv.mkDerivation ({
+      inherit (edk2) src;
 
-      configurePhase = ''
-        mkdir -v Conf
+      buildInputs = [ bc pythonEnv ] ++ attrs.buildInputs or [];
 
-        cp ${edk2}/BaseTools/Conf/target.template Conf/target.txt
-        sed -i Conf/target.txt \
-          -e 's|Nt32Pkg/Nt32Pkg.dsc|${projectDscPath}|' \
-          -e 's|MYTOOLS|GCC49|' \
-          -e 's|IA32|${targetArch}|' \
-          -e 's|DEBUG|RELEASE|'\
-
-        cp ${edk2}/BaseTools/Conf/tools_def.template Conf/tools_def.txt
-        sed -i Conf/tools_def.txt \
-          -e 's|DEFINE GCC48_IA32_PREFIX       = /usr/bin/|DEFINE GCC48_IA32_PREFIX       = ""|' \
-          -e 's|DEFINE GCC48_X64_PREFIX        = /usr/bin/|DEFINE GCC48_X64_PREFIX        = ""|' \
-          -e 's|DEFINE UNIX_IASL_BIN           = /usr/bin/iasl|DEFINE UNIX_IASL_BIN           = ${iasl}/bin/iasl|'
+      prePatch = ''
+        rm -rf BaseTools
+        ln -sv ${edk2}/BaseTools BaseTools
+      '';
 
+      configurePhase = ''
+        runHook preConfigure
         export WORKSPACE="$PWD"
-        export EFI_SOURCE="$PWD/EdkCompatibilityPkg"
-        ln -sv ${edk2}/BaseTools BaseTools
-        ln -sv ${edk2}/EdkCompatibilityPkg EdkCompatibilityPkg
         . ${edk2}/edksetup.sh BaseTools
+        runHook postConfigure
       '';
 
-      buildPhase = "
-        build
-      ";
+      buildPhase = ''
+        runHook preBuild
+        build -a ${targetArch} -b RELEASE -t GCC5 -p ${projectDscPath} -n $NIX_BUILD_CORES $buildFlags
+        runHook postBuild
+      '';
 
-      installPhase = "mv -v Build/*/* $out";
-    } // (removeAttrs attrs [ "buildInputs" ] );
+      installPhase = ''
+        runHook preInstall
+        mv -v Build/*/* $out
+        runHook postInstall
+      '';
+    } // removeAttrs attrs [ "buildInputs" ]);
   };
 };
 
diff --git a/pkgs/development/compilers/fasm/bin.nix b/pkgs/development/compilers/fasm/bin.nix
index 98cc2804f600..44d784133f5f 100644
--- a/pkgs/development/compilers/fasm/bin.nix
+++ b/pkgs/development/compilers/fasm/bin.nix
@@ -3,11 +3,11 @@
 stdenvNoCC.mkDerivation rec {
   name = "fasm-bin-${version}";
 
-  version = "1.73.15";
+  version = "1.73.16";
 
   src = fetchurl {
     url = "https://flatassembler.net/fasm-${version}.tgz";
-    sha256 = "0yc30y4hkr226629347gcrzi153f10hcp5q7bm3q6ir3gx35xa39";
+    sha256 = "1jaqm7w458ny37fsw3fln17kw31rcsk8kyadci45qcbw6jspmn7k";
   };
 
   installPhase = ''
diff --git a/pkgs/development/compilers/flux/default.nix b/pkgs/development/compilers/flux/default.nix
new file mode 100644
index 000000000000..c599c9f8baf5
--- /dev/null
+++ b/pkgs/development/compilers/flux/default.nix
@@ -0,0 +1,21 @@
+{ stdenv, lib, fetchFromGitHub, autoreconfHook, pkgconfig }:
+
+stdenv.mkDerivation rec {
+  pname = "flux";
+  version = "2013-09-20";
+
+  src = fetchFromGitHub {
+    owner = "deniskropp";
+    repo = pname;
+    rev = "e45758aa9384b9740ff021ea952399fd113eb0e9";
+    sha256 = "11f3ypg0sdq5kj69zgz6kih1yrzgm48r16spyvzwvlswng147410";
+  };
+
+  nativeBuildInputs = [ autoreconfHook pkgconfig ];
+
+  meta = with lib; {
+    description = "An interface description language used by DirectFB";
+    homepage = "https://github.com/deniskropp/flux";
+    license = licenses.mit;
+  };
+}
diff --git a/pkgs/development/compilers/gcc/9/default.nix b/pkgs/development/compilers/gcc/9/default.nix
index 0d75de7557be..506cfee7f498 100644
--- a/pkgs/development/compilers/gcc/9/default.nix
+++ b/pkgs/development/compilers/gcc/9/default.nix
@@ -37,7 +37,7 @@ assert langGo -> langCC;
 with stdenv.lib;
 with builtins;
 
-let version = "9.1.0";
+let version = "9.2.0";
 
     inherit (stdenv) buildPlatform hostPlatform targetPlatform;
 
@@ -131,7 +131,7 @@ stdenv.mkDerivation ({
 
   src = fetchurl {
     url = "mirror://gcc/releases/gcc-${version}/gcc-${version}.tar.xz";
-    sha256 = "1817nc2bqdc251k0lpc51cimna7v68xjrnvqzvc50q3ax4s6i9kr";
+    sha256 = "01mj3yk7z49i49168hg2cg7qs4bsccrrnv7pjmbdlf8j2a7z0vpa";
   };
 
   inherit patches;
diff --git a/pkgs/development/compilers/graalvm/enterprise-edition.nix b/pkgs/development/compilers/graalvm/enterprise-edition.nix
new file mode 100644
index 000000000000..73023a7668e8
--- /dev/null
+++ b/pkgs/development/compilers/graalvm/enterprise-edition.nix
@@ -0,0 +1,133 @@
+{ stdenv, requireFile, perl, unzip, glibc, zlib, gdk-pixbuf, xorg, glib, fontconfig, freetype, cairo, pango, gtk3, gtk2, ffmpeg, libGL, atk, alsaLib, libav_0_8, setJavaClassPath }:
+
+let
+  graalvm8-ee = stdenv.mkDerivation rec {
+    pname = "graalvm8-ee";
+    version = "19.1.1";
+    srcs = [
+      (requireFile {
+         name   = "graalvm-ee-linux-amd64-${version}.tar.gz";
+         sha256 = "1ayg4chiw08jbrivmsylh6275sn0ygzc0iaic28fk7hhw5dc6r2f";
+         url    = "https://www.oracle.com/technetwork/graalvm/downloads/index.html";
+      })
+      (requireFile {
+         name   = "native-image-installable-svm-svmee-linux-amd64-${version}.jar";
+         sha256 = "1mvc4id193gl482fnjcgh4dz29ifqwigqq68ib0i1p3ks1nnj717";
+         url    = "https://www.oracle.com/technetwork/graalvm/downloads/index.html";
+      })
+      (requireFile {
+         name   = "python-installable-svm-svmee-linux-amd64-${version}.jar";
+         sha256 = "0q7sggqk5myad053dsfw2i1n8v4wspahg1ac7zr3y3srqvdb0xfp";
+         url    = "https://www.oracle.com/technetwork/graalvm/downloads/index.html";
+      })
+      (requireFile {
+         name   = "ruby-installable-svm-svmee-linux-amd64-${version}.jar";
+         sha256 = "1xax1bg155d74jhv7h0qb7vbc95jy4wm4bvbpvr76ivzn7qaml6j";
+         url    = "https://www.oracle.com/technetwork/graalvm/downloads/index.html";
+      })
+    ];
+    nativeBuildInputs = [ unzip perl ];
+    unpackPhase = ''
+      unpack_jar() {
+        jar=$1
+        unzip $jar -d $out
+        perl -ne 'use File::Path qw(make_path);
+                  use File::Basename qw(dirname);
+                  if (/^(.+) = (.+)$/) {
+                    make_path dirname("$ENV{out}/$1");
+                    system "ln -s $2 $ENV{out}/$1";
+                  }' $out/META-INF/symlinks
+        perl -ne 'if (/^(.+) = ([r-])([w-])([x-])([r-])([w-])([x-])([r-])([w-])([x-])$/) {
+                    my $mode = ($2 eq 'r' ? 0400 : 0) + ($3 eq 'w' ? 0200 : 0) + ($4  eq 'x' ? 0100 : 0) +
+                               ($5 eq 'r' ? 0040 : 0) + ($6 eq 'w' ? 0020 : 0) + ($7  eq 'x' ? 0010 : 0) +
+                               ($8 eq 'r' ? 0004 : 0) + ($9 eq 'w' ? 0002 : 0) + ($10 eq 'x' ? 0001 : 0);
+                    chmod $mode, "$ENV{out}/$1";
+                  }' $out/META-INF/permissions
+        rm -rf $out/META-INF
+      }
+
+      mkdir -p $out
+      arr=($srcs)
+      tar xf ''${arr[0]} -C $out --strip-components=1
+      unpack_jar ''${arr[1]}
+      unpack_jar ''${arr[2]}
+      unpack_jar ''${arr[3]}
+    '';
+
+    installPhase = ''
+      # BUG workaround http://mail.openjdk.java.net/pipermail/graal-dev/2017-December/005141.html
+      substituteInPlace $out/jre/lib/security/java.security \
+        --replace file:/dev/random    file:/dev/./urandom \
+        --replace NativePRNGBlocking  SHA1PRNG
+
+      # provide libraries needed for static compilation
+      for f in ${glibc}/lib/* ${glibc.static}/lib/* ${zlib.static}/lib/*; do
+        ln -s $f $out/jre/lib/svm/clibraries/linux-amd64/$(basename $f)
+      done
+    '';
+
+    dontStrip = true;
+
+    preFixup = ''
+      # Set JAVA_HOME automatically.
+      mkdir -p $out/nix-support
+      cat <<EOF > $out/nix-support/setup-hook
+      if [ -z "\$JAVA_HOME" ]; then export JAVA_HOME=$out; fi
+      EOF
+    '';
+
+    postFixup = ''
+      rpath="$out/jre/lib/amd64/jli:$out/jre/lib/amd64/server:$out/jre/lib/amd64:${
+        stdenv.lib.strings.makeLibraryPath [ glibc xorg.libXxf86vm xorg.libX11 xorg.libXext xorg.libXtst xorg.libXi xorg.libXrender
+                                             glib zlib alsaLib fontconfig freetype pango gtk3 gtk2 cairo gdk-pixbuf atk ffmpeg libGL ]}"
+
+      for f in $(find $out -type f -perm -0100); do
+        patchelf --interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" "$f" || true
+        patchelf --set-rpath   "$rpath"                                    "$f" || true
+      done
+
+      for f in $(find $out -type f -perm -0100); do
+        if ldd "$f" | fgrep 'not found'; then echo "in file $f"; fi
+      done
+    '';
+
+    propagatedBuildInputs = [ setJavaClassPath zlib ]; # $out/bin/native-image needs zlib to build native executables
+    
+    doInstallCheck = true;
+    installCheckPhase = ''
+      echo ${stdenv.lib.escapeShellArg ''
+               public class HelloWorld {
+                 public static void main(String[] args) {
+                   System.out.println("Hello World");
+                 }
+               }
+             ''} > HelloWorld.java
+      $out/bin/javac HelloWorld.java
+
+      # run on JVM with Graal Compiler
+      $out/bin/java -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI -XX:+UseJVMCICompiler HelloWorld
+      $out/bin/java -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI -XX:+UseJVMCICompiler HelloWorld | fgrep 'Hello World'
+
+      # Ahead-Of-Time compilation
+      $out/bin/native-image --no-server HelloWorld
+      ./helloworld
+      ./helloworld | fgrep 'Hello World'
+
+      # Ahead-Of-Time compilation with --static
+      $out/bin/native-image --no-server --static HelloWorld
+      ./helloworld
+      ./helloworld | fgrep 'Hello World'
+    '';
+
+    passthru.home = graalvm8-ee;
+
+    meta = with stdenv.lib; {
+      homepage = https://www.graalvm.org/;
+      description = "High-Performance Polyglot VM";
+      license = licenses.unfree;
+      maintainers = with maintainers; [ volth hlolli ];
+      platforms = [ "x86_64-linux" ];
+    };
+  };
+in
+  graalvm8-ee
diff --git a/pkgs/development/compilers/julia/1.0.nix b/pkgs/development/compilers/julia/1.0.nix
index a679eda33066..3cd9daee1416 100644
--- a/pkgs/development/compilers/julia/1.0.nix
+++ b/pkgs/development/compilers/julia/1.0.nix
@@ -1,8 +1,8 @@
 import ./shared.nix {
   majorVersion = "1";
   minorVersion = "0";
-  maintenanceVersion = "3";
-  src_sha256 = "0666chsc19wx02k5m1yilf6wbc9bw27ay8p1d00jkh8m0jkrpf7l";
+  maintenanceVersion = "4";
+  src_sha256 = "1dfx68wbrrzpbh74rla7i2g3r5z6wa1pxq3ahyfm5m27vfyjbkhg";
 
   libuvVersion = "ed3700c849289ed01fe04273a7bf865340b2bd7e";
   libuvSha256 = "137w666zsjw1p0ma3lf94d75hr1q45sgkfmbizkyji2qm57cnxjs";
diff --git a/pkgs/development/compilers/julia/1.1.nix b/pkgs/development/compilers/julia/1.1.nix
index a868f949d27c..5be34b4c4b4c 100644
--- a/pkgs/development/compilers/julia/1.1.nix
+++ b/pkgs/development/compilers/julia/1.1.nix
@@ -1,8 +1,8 @@
 import ./shared.nix {
   majorVersion = "1";
   minorVersion = "1";
-  maintenanceVersion = "0";
-  src_sha256 = "08fyck4qcdv9nnrdqh1wb7lb8pkkikh67xx5lc872sjl9w3p0sak";
+  maintenanceVersion = "1";
+  src_sha256 = "1yqjd0n42xf9hzxpvc9vysyjj98p42by216jkdqakdy7dkjcmnhq";
 
   libuvVersion = "2348256acf5759a544e5ca7935f638d2bc091d60";
   libuvSha256 = "1363f4vqayfcv5zqg07qmzjff56yhad74k16c22ian45lram8mv8";
diff --git a/pkgs/development/compilers/rust/default.nix b/pkgs/development/compilers/rust/default.nix
index fb04239dbd4b..660f3cca7c68 100644
--- a/pkgs/development/compilers/rust/default.nix
+++ b/pkgs/development/compilers/rust/default.nix
@@ -59,6 +59,7 @@
         pkgsBuildHost = pkgsBuildBuild // { targetPackages.stdenv = llvmPackages_5.stdenv; };
         pkgsBuildTarget = pkgsBuildTarget // { targetPackages.stdenv = llvmPackages_5.stdenv; };
       });
+      rustfmt = self.callPackage ./rustfmt.nix { inherit Security; };
       cargo = self.callPackage ./cargo.nix {
         # Use boot package set to break cycle
         rustPlatform = bootRustPlatform;
diff --git a/pkgs/development/compilers/rust/rustfmt.nix b/pkgs/development/compilers/rust/rustfmt.nix
new file mode 100644
index 000000000000..537bdaf445cd
--- /dev/null
+++ b/pkgs/development/compilers/rust/rustfmt.nix
@@ -0,0 +1,33 @@
+{ stdenv, rustPlatform, Security }:
+
+rustPlatform.buildRustPackage rec {
+  name = "rustfmt-${version}";
+  inherit (rustPlatform.rust.rustc) version src;
+
+  # the rust source tarball already has all the dependencies vendored, no need to fetch them again
+  cargoVendorDir = "vendor";
+  preBuild = "pushd src/tools/rustfmt";
+  preInstall = "popd";
+
+  # changes hash of vendor directory otherwise
+  dontUpdateAutotoolsGnuConfigScripts = true;
+
+  buildInputs = stdenv.lib.optional stdenv.isDarwin Security;
+
+  # As of 1.0.0 and rustc 1.30 rustfmt requires a nightly compiler
+  RUSTC_BOOTSTRAP = 1;
+
+  # we run tests in debug mode so tests look for a debug build of
+  # rustfmt. Anyway this adds nearly no compilation time.
+  preCheck = ''
+    cargo build
+  '';
+
+  meta = with stdenv.lib; {
+    description = "A tool for formatting Rust code according to style guidelines";
+    homepage = https://github.com/rust-lang-nursery/rustfmt;
+    license = with licenses; [ mit asl20 ];
+    maintainers = with maintainers; [ globin basvandijk ];
+    platforms = platforms.all;
+  };
+}
diff --git a/pkgs/development/compilers/swift/default.nix b/pkgs/development/compilers/swift/default.nix
index 94d0a4327d9d..f21b2ae3cb80 100644
--- a/pkgs/development/compilers/swift/default.nix
+++ b/pkgs/development/compilers/swift/default.nix
@@ -33,7 +33,7 @@
 }:
 
 let
-  v_base = "5.0.1";
+  v_base = "5.0.2";
   version = "${v_base}-RELEASE";
   version_friendly = "${v_base}";
 
@@ -51,7 +51,7 @@ let
     # For more inforation, see: https://github.com/apple/swift/pull/3594#issuecomment-234169759
     clang = fetch {
       repo = "swift-clang";
-      sha256 = "1ap26425zhn2sdw3m9snyrqhi4phv2fgblyv9wp8xppjlnjkax9k";
+      sha256 = "046p7f4044ls8hhgklsz32md5jvxkaaim1d75n0fmnwap6di3n1q";
     };
     llvm = fetch {
       repo = "swift-llvm";
@@ -83,16 +83,16 @@ let
     };
     foundation = fetch {
       repo = "swift-corelibs-foundation";
-      sha256 = "11w0iapccrk13hjbrwylq8g71znrncnc3mrm345gvnjfgz08ffaq";
+      sha256 = "1wys4xh7f6c7yjf210x41n2krmyi2qj1wpxbv0p48d230va1azj1";
     };
     libdispatch = fetch {
       repo = "swift-corelibs-libdispatch";
-      sha256 = "1mgzsq3nfzbkssfkswzvvjgsbv2fx36i1r83d4nzw3di8spxmg32";
+      sha256 = "0chnb0d4xjyn9wnc8bgimd5ji5igfyq891flgnqpfwr4y26496c1";
       fetchSubmodules = true;
     };
     swift = fetch {
       repo = "swift";
-      sha256 = "02bv47pd0k0xy4k7q6c3flwxwkm2palnzvpr4w3nmvqk0flrbsq6";
+      sha256 = "0fsq1y8dz4ssn90akvzj36cqyblalb09bjzy4ikqn67mb5x99wpb";
     };
   };
 
@@ -248,9 +248,6 @@ stdenv.mkDerivation rec {
     PREFIX=''${out/#\/}
     substituteInPlace swift-corelibs-xctest/build_script.py \
       --replace usr "$PREFIX"
-    substituteInPlace swiftpm/Utilities/bootstrap \
-      --replace \"usr\" \"$PREFIX\" \
-      --replace usr/lib "$PREFIX/lib"
   '';
 
   buildPhase = builder;