This reverts commit de0211090334c2d562ee8560a298d5f5f76b40b3. The package doesn't compile: https://github.com/NixOS/nixpkgs/pull/7419#issuecomment-135972366.
···11-{ stdenv, fetchFromGitHub, maven, openjdk8, releaseTools }:
22-33-# TODO:
44-# - Investigate builds on platforms other than 64-bit linux
55-# - Separate package for Maven cache? This would speed up builds and
66-# theoretically could still be pure
77-# - Find a way to prevent Maven from downloading artifacts irrelevant
88-# to the platform for which we are building
99-1010-releaseTools.mvnBuild rec {
1111- name = "kframework-20150415";
1212-1313- mvn8 = maven.override {
1414- jdk = openjdk8; # K uses Java 8. The official docs reference the
1515- # Oracle VM, but it's been working with OpenJDK
1616- };
1717-1818- src = fetchFromGitHub {
1919- owner = "kframework";
2020- repo = "k";
2121- rev = "85a41bc024"; # nightly build for April 15th, 2015
2222- sha256 = "01ndfdnqxp2w86pg3ax39sxayb2pfm39lj1h3818zzn86gqwa1vc";
2323- };
2424-2525- buildInputs = [ mvn8 openjdk8 ];
2626-2727- preSetupPhase = ''
2828- # z3 needs this to pass tests
2929- export LD_LIBRARY_PATH=$(cat $NIX_CC/nix-support/orig-cc)/lib
3030- # not sure if this does anything, since it might only speed up incremental builds
3131- export MAVEN_OPTS="-XX:+TieredCompilation"
3232- '';
3333-3434- mvnAssembly = ''
3535- mvn package -Dcheckstyle.skip -Dmaven.test.skip=true -Dmaven.repo.local=$M2_REPO
3636- '';
3737-3838- mvnRelease = ''
3939- true # do nothing, since mvn package is sufficient
4040- '';
4141-4242- # this is a custom version of k-distribution/src/main/scripts/lib/k
4343- kscript = ''
4444- #!/usr/bin/env bash
4545- export JAVA=${openjdk8}/bin/java
4646-4747- export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:"$out/lib"
4848-4949- export K_OPTS="-Xms64m -Xmx1024m -Xss32m -XX:+TieredCompilation"
5050- export MISC_ARGS="-Djava.awt.headless=true"
5151- export ARGS="$MISC_ARGS $K_OPTS"
5252- $JAVA $ARGS -cp "$out/share/kframework/lib/java/*" org.kframework.main.Main "$@"
5353- '';
5454-5555- finalPhase = ''
5656- # set some environment variables
5757- export K_ROOT=$PWD/k-distribution/target/release/k/
5858- export K_SHARE=$out/share/kframework/
5959- # make requisite directories
6060- mkdir -p $out/lib $K_SHARE/lib/native
6161- # copy over bin
6262- cp -R $K_ROOT/bin $K_SHARE/
6363- # symlink $out/bin to $out/share/kframework/bin
6464- ln -s $K_SHARE/bin $out/bin
6565- # copy everything relevant to $out/share/kframework
6666- # we may want to consider adding the documentation etc.
6767- cp -R $K_ROOT/include $K_SHARE/
6868- cp -R $K_ROOT/lib/java $K_SHARE/lib/
6969- cp -R $K_ROOT/lib/native/linux $K_SHARE/lib/native/
7070- cp -R $K_ROOT/lib/native/linux64 $K_SHARE/lib/native/
7171- # remove Windows batch scripts
7272- rm $K_SHARE/bin/*.bat # */
7373- # TODO: fix these scripts so they work
7474- rm $K_SHARE/bin/kserver $K_SHARE/bin/stop-kserver
7575- # make our k wrapper script and substitute $out for its value
7676- echo -n "$kscript" | sed "s:\$out:$out:g" > $K_SHARE/lib/k
7777- chmod +x $K_SHARE/lib/k
7878- # symlink requisite binaries
7979- ln -s $K_SHARE/lib/k $out/lib/k
8080- ln -s $K_SHARE/lib/native/linux/sdf2table $out/bin/sdf2table
8181- ln -s $K_SHARE/lib/native/linux64/z3 $out/bin/z3
8282- ln -s $K_SHARE/lib/native/linux64/libz3.so $out/lib/libz3.so
8383- ln -s $K_SHARE/lib/native/linux64/libz3java.so $out/lib/libz3java.so
8484- # patch Z3 so it uses the right interpreter/libs
8585- patchelf \
8686- --interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
8787- --set-rpath $(cat $NIX_CC/nix-support/orig-cc)/lib \
8888- --force-rpath \
8989- $K_SHARE/lib/native/linux64/z3
9090- '';
9191-9292- meta = {
9393- description = "A rewrite-based executable semantic framework in which programming languages, type systems and formal analysis tools can be defined";
9494- homepage = http://www.kframework.org;
9595- license = stdenv.lib.licenses.bsd3; # technically it is the UIUC/NCSA license
9696- # but LLVM uses that license as well and
9797- # it is marked as BSD3
9898- maintainers = [ stdenv.lib.maintainers.taktoa ];
9999- platforms = stdenv.lib.platforms.linux; # I haven't done testing on other OSes, but
100100- # since it's Java it should run anywhere
101101- };
102102-}