summary refs log tree commit diff
path: root/pkgs/applications/science
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/applications/science')
-rw-r--r--pkgs/applications/science/electronics/tkgate/1.x.nix2
-rw-r--r--pkgs/applications/science/logic/coq/8.5.nix68
-rw-r--r--pkgs/applications/science/logic/coq/default.nix4
-rw-r--r--pkgs/applications/science/math/R/default.nix4
-rw-r--r--pkgs/applications/science/programming/kframework/default.nix102
5 files changed, 175 insertions, 5 deletions
diff --git a/pkgs/applications/science/electronics/tkgate/1.x.nix b/pkgs/applications/science/electronics/tkgate/1.x.nix
index 30e882a7f38..e9849d0460c 100644
--- a/pkgs/applications/science/electronics/tkgate/1.x.nix
+++ b/pkgs/applications/science/electronics/tkgate/1.x.nix
@@ -16,7 +16,7 @@ stdenv.mkDerivation rec {
 
   patchPhase = ''
     sed -i config.h \
-      -e 's|.*#define.*TKGATE_TCLTK_VERSIONS.*|#define TKGATE_TCLTK_VERSIONS "8.5"|' \
+      -e 's|.*#define.*TKGATE_TCLTK_VERSIONS.*|#define TKGATE_TCLTK_VERSIONS "${tcl.release}"|' \
       -e 's|.*#define.*TKGATE_INCDIRS.*|#define TKGATE_INCDIRS "${tcl}/include ${tk}/include ${libiconvInc} ${libX11}/include"|' \
       -e 's|.*#define.*TKGATE_LIBDIRS.*|#define TKGATE_LIBDIRS "${tcl}/lib ${tk}/lib ${libiconvLib} ${libX11}/lib"|' \
       \
diff --git a/pkgs/applications/science/logic/coq/8.5.nix b/pkgs/applications/science/logic/coq/8.5.nix
new file mode 100644
index 00000000000..87b476249f4
--- /dev/null
+++ b/pkgs/applications/science/logic/coq/8.5.nix
@@ -0,0 +1,68 @@
+# - coqide compilation can be disabled by setting lablgtk to null;
+
+{stdenv, fetchurl, writeText, pkgconfig, ocaml, findlib, camlp5, ncurses, lablgtk ? null}:
+
+let
+  version = "8.5b2";
+  coq-version = "8.5";
+  buildIde = lablgtk != null;
+  ideFlags = if buildIde then "-lablgtkdir ${lablgtk}/lib/ocaml/*/site-lib/lablgtk2 -coqide opt" else "";
+in
+
+stdenv.mkDerivation {
+  name = "coq-${version}";
+
+  inherit coq-version;
+  inherit ocaml camlp5;
+
+  src = fetchurl {
+    url = https://coq.inria.fr/distrib/V8.5beta2/files/coq-8.5beta2.tar.gz;
+    sha256 = "1z34ch56lld86srgsjdwdq3girz0k0wqmvyxsa7jwvvxn3qmmq2v";
+  };
+
+  buildInputs = [ pkgconfig ocaml findlib camlp5 ncurses lablgtk ];
+
+  postPatch = ''
+    UNAME=$(type -tp uname)
+    RM=$(type -tp rm)
+    substituteInPlace configure --replace "/bin/uname" "$UNAME"
+    substituteInPlace tools/beautify-archive --replace "/bin/rm" "$RM"
+    substituteInPlace Makefile.build --replace "ifeq (\$(ARCH),Darwin)" "ifeq (\$(ARCH),Darwinx)"
+  '';
+
+  setupHook = writeText "setupHook.sh" ''
+    addCoqPath () {
+      if test -d "''$1/lib/coq/${coq-version}/user-contrib"; then
+        export COQPATH="''${COQPATH}''${COQPATH:+:}''$1/lib/coq/${coq-version}/user-contrib/"
+      fi
+    }
+
+    envHooks=(''${envHooks[@]} addCoqPath)
+  '';
+
+  preConfigure = ''
+    configureFlagsArray=(
+      -opt
+      ${ideFlags}
+    )
+  '';
+
+  prefixKey = "-prefix ";
+
+  buildFlags = "revision coq coqide";
+
+  meta = with stdenv.lib; {
+    description = "Coq proof assistant";
+    longDescription = ''
+      Coq is a formal proof management system.  It provides a formal language
+      to write mathematical definitions, executable algorithms and theorems
+      together with an environment for semi-interactive development of
+      machine-checked proofs.
+    '';
+    homepage = "http://coq.inria.fr";
+    license = licenses.lgpl21;
+    branch = coq-version;
+    maintainers = with maintainers; [ roconnor thoughtpolice vbgl ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/pkgs/applications/science/logic/coq/default.nix b/pkgs/applications/science/logic/coq/default.nix
index 391dba244ef..5a8fa9ff4dc 100644
--- a/pkgs/applications/science/logic/coq/default.nix
+++ b/pkgs/applications/science/logic/coq/default.nix
@@ -3,7 +3,7 @@
 {stdenv, fetchurl, pkgconfig, writeText, ocaml, findlib, camlp5, ncurses, lablgtk ? null}:
 
 let
-  version = "8.4pl5";
+  version = "8.4pl6";
   coq-version = "8.4";
   buildIde = lablgtk != null;
   ideFlags = if buildIde then "-lablgtkdir ${lablgtk}/lib/ocaml/*/site-lib/lablgtk2 -coqide opt" else "";
@@ -17,7 +17,7 @@ stdenv.mkDerivation {
 
   src = fetchurl {
     url = "http://coq.inria.fr/distrib/V${version}/files/coq-${version}.tar.gz";
-    sha256 = "0iajsabyrgypk1ncm0kqcxqv02k24xa1bayaxacjgmsqiavmm09m";
+    sha256 = "1mpbj4yf36kpjg2v2sln12i8dzqn8rag6fd07hslj2lpm4qs4h55";
   };
 
   buildInputs = [ pkgconfig ocaml findlib camlp5 ncurses lablgtk ];
diff --git a/pkgs/applications/science/math/R/default.nix b/pkgs/applications/science/math/R/default.nix
index 0bd6f5a35c3..d0adb338207 100644
--- a/pkgs/applications/science/math/R/default.nix
+++ b/pkgs/applications/science/math/R/default.nix
@@ -6,11 +6,11 @@
 }:
 
 stdenv.mkDerivation rec {
-  name = "R-3.1.3";
+  name = "R-3.2.0";
 
   src = fetchurl {
     url = "http://cran.r-project.org/src/base/R-3/${name}.tar.gz";
-    sha256 = "04kk6wd55bi0f0qsp98ckjxh95q2990vkgq4j83kiajvjciq7s87";
+    sha256 = "0dagyqgvi8i3nw158qi2zpwm04s4ffzvnmk5niaksvxs30zrbbpm";
   };
 
   buildInputs = [ blas bzip2 gfortran liblapack libX11 libXmu libXt
diff --git a/pkgs/applications/science/programming/kframework/default.nix b/pkgs/applications/science/programming/kframework/default.nix
new file mode 100644
index 00000000000..e8a4f2b3156
--- /dev/null
+++ b/pkgs/applications/science/programming/kframework/default.nix
@@ -0,0 +1,102 @@
+{ stdenv, fetchFromGitHub, maven, openjdk8, releaseTools }:
+
+# TODO:
+# - Investigate builds on platforms other than 64-bit linux
+# - Separate package for Maven cache? This would speed up builds and
+#   theoretically could still be pure
+# - Find a way to prevent Maven from downloading artifacts irrelevant
+#   to the platform for which we are building
+
+releaseTools.mvnBuild rec {
+  name = "kframework-20150415";
+
+  mvn8 = maven.override {
+    jdk = openjdk8; # K uses Java 8. The official docs reference the
+                    # Oracle VM, but it's been working with OpenJDK
+  };
+
+  src = fetchFromGitHub {
+    owner = "kframework";
+    repo = "k";
+    rev = "85a41bc024"; # nightly build for April 15th, 2015
+    sha256 = "01ndfdnqxp2w86pg3ax39sxayb2pfm39lj1h3818zzn86gqwa1vc";
+  };
+
+  buildInputs = [ mvn8 openjdk8 ];
+
+  preSetupPhase = ''
+    # z3 needs this to pass tests
+    export LD_LIBRARY_PATH=$(cat $NIX_CC/nix-support/orig-cc)/lib
+    # not sure if this does anything, since it might only speed up incremental builds
+    export MAVEN_OPTS="-XX:+TieredCompilation"
+  '';
+
+  mvnAssembly = ''
+    mvn package -Dcheckstyle.skip -Dmaven.test.skip=true -Dmaven.repo.local=$M2_REPO
+  '';
+
+  mvnRelease = ''
+    true # do nothing, since mvn package is sufficient
+  '';
+
+  # this is a custom version of k-distribution/src/main/scripts/lib/k
+  kscript = ''
+    #!/usr/bin/env bash
+    export JAVA=${openjdk8}/bin/java
+
+    export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:"$out/lib"
+
+    export K_OPTS="-Xms64m -Xmx1024m -Xss32m -XX:+TieredCompilation"
+    export MISC_ARGS="-Djava.awt.headless=true"
+    export ARGS="$MISC_ARGS $K_OPTS"
+    $JAVA $ARGS -cp "$out/share/kframework/lib/java/*" org.kframework.main.Main "$@"
+  '';
+
+  finalPhase = ''
+    # set some environment variables
+    export K_ROOT=$PWD/k-distribution/target/release/k/
+    export K_SHARE=$out/share/kframework/
+    # make requisite directories
+    mkdir -p $out/lib $K_SHARE/lib/native
+    # copy over bin
+    cp -R $K_ROOT/bin                             $K_SHARE/
+    # symlink $out/bin to $out/share/kframework/bin
+    ln -s $K_SHARE/bin                            $out/bin
+    # copy everything relevant to $out/share/kframework
+    # we may want to consider adding the documentation etc.
+    cp -R $K_ROOT/include                         $K_SHARE/
+    cp -R $K_ROOT/lib/java                        $K_SHARE/lib/
+    cp -R $K_ROOT/lib/native/linux                $K_SHARE/lib/native/
+    cp -R $K_ROOT/lib/native/linux64              $K_SHARE/lib/native/
+    # remove Windows batch scripts
+    rm $K_SHARE/bin/*.bat # */
+    # TODO: fix these scripts so they work
+    rm $K_SHARE/bin/kserver $K_SHARE/bin/stop-kserver
+    # make our k wrapper script and substitute $out for its value
+    echo -n "$kscript" | sed "s:\$out:$out:g" > $K_SHARE/lib/k
+    chmod +x $K_SHARE/lib/k
+    # symlink requisite binaries
+    ln -s $K_SHARE/lib/k                           $out/lib/k
+    ln -s $K_SHARE/lib/native/linux/sdf2table      $out/bin/sdf2table
+    ln -s $K_SHARE/lib/native/linux64/z3           $out/bin/z3
+    ln -s $K_SHARE/lib/native/linux64/libz3.so     $out/lib/libz3.so
+    ln -s $K_SHARE/lib/native/linux64/libz3java.so $out/lib/libz3java.so
+    # patch Z3 so it uses the right interpreter/libs
+    patchelf \
+      --interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
+      --set-rpath $(cat $NIX_CC/nix-support/orig-cc)/lib \
+      --force-rpath \
+      $K_SHARE/lib/native/linux64/z3
+  '';
+
+  meta = {
+    description = "A rewrite-based executable semantic framework in which programming languages, type systems and formal analysis tools can be defined";
+    homepage = http://www.kframework.org;
+    license = stdenv.lib.licenses.bsd3;     # technically it is the UIUC/NCSA license
+                                            # but LLVM uses that license as well and
+                                            # it is marked as BSD3
+    maintainers = [ stdenv.lib.maintainers.taktoa ];
+    platforms = stdenv.lib.platforms.linux; # I haven't done testing on other OSes, but
+                                            # since it's Java it should run anywhere
+  };
+}