diff options
author | Mateusz Kowalczyk <mk440@bath.ac.uk> | 2014-09-30 15:04:30 +0100 |
---|---|---|
committer | Mateusz Kowalczyk <mk440@bath.ac.uk> | 2014-09-30 15:04:30 +0100 |
commit | ce4ae2aa1e49cb550734755dda893fb39bec4a2b (patch) | |
tree | d86d786eca549a4c31035068031a28d5bad665ee /pkgs/applications | |
parent | 02e29e2eb14c3287f9c3276874295fe7f5a276a7 (diff) | |
parent | a65767a0b42e91f711e655820d6b76bd51265847 (diff) | |
download | nixlib-ce4ae2aa1e49cb550734755dda893fb39bec4a2b.tar nixlib-ce4ae2aa1e49cb550734755dda893fb39bec4a2b.tar.gz nixlib-ce4ae2aa1e49cb550734755dda893fb39bec4a2b.tar.bz2 nixlib-ce4ae2aa1e49cb550734755dda893fb39bec4a2b.tar.lz nixlib-ce4ae2aa1e49cb550734755dda893fb39bec4a2b.tar.xz nixlib-ce4ae2aa1e49cb550734755dda893fb39bec4a2b.tar.zst nixlib-ce4ae2aa1e49cb550734755dda893fb39bec4a2b.zip |
Merge pull request #4305 from vbgl/coq-containers
Working with Coq
Diffstat (limited to 'pkgs/applications')
7 files changed, 66 insertions, 96 deletions
diff --git a/pkgs/applications/editors/emacs-modes/proofgeneral/4.3pre.nix b/pkgs/applications/editors/emacs-modes/proofgeneral/4.3pre.nix index 3a492dc0c7f4..32a036805edc 100644 --- a/pkgs/applications/editors/emacs-modes/proofgeneral/4.3pre.nix +++ b/pkgs/applications/editors/emacs-modes/proofgeneral/4.3pre.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchurl, emacs, texinfo, texLive, perl, which, automake }: +{ stdenv, fetchurl, emacs, texinfo, texLive, perl, which, automake, enableDoc ? false }: stdenv.mkDerivation (rec { name = "ProofGeneral-4.3pre131011"; @@ -10,7 +10,7 @@ stdenv.mkDerivation (rec { sourceRoot = name; - buildInputs = [ emacs texinfo texLive perl which ]; + buildInputs = [ emacs texinfo perl which ] ++ stdenv.lib.optional enableDoc texLive; prePatch = '' sed -i "Makefile" \ @@ -25,15 +25,20 @@ stdenv.mkDerivation (rec { sed -i '96d' doc/ProofGeneral.texi ''; + patches = [ ./pg.patch ]; + preBuild = '' make clean; ''; installPhase = + if enableDoc + then # Copy `texinfo.tex' in the right place so that `texi2pdf' works. '' cp -v "${automake}/share/"automake-*/texinfo.tex doc make install install-doc - ''; + '' + else "make install"; meta = { description = "Proof General, an Emacs front-end for proof assistants"; diff --git a/pkgs/applications/editors/emacs-modes/proofgeneral/pg.patch b/pkgs/applications/editors/emacs-modes/proofgeneral/pg.patch new file mode 100644 index 000000000000..c733911118de --- /dev/null +++ b/pkgs/applications/editors/emacs-modes/proofgeneral/pg.patch @@ -0,0 +1,16 @@ +diff -r c7d8bfff4c0a bin/proofgeneral +--- a/bin/proofgeneral Sat Sep 27 02:25:15 2014 +0100 ++++ b/bin/proofgeneral Sat Sep 27 02:28:16 2014 +0100 +@@ -73,11 +73,7 @@ + + # Try to find Proof General directory + if [ -z "$PGHOME" ] || [ ! -d "$PGHOME" ]; then +- # default relative to this script, otherwise PGHOMEDEFAULT +- MYDIR="`readlink --canonicalize "$0" | sed -ne 's,/bin/proofgeneral$,,p'`" +- if [ -d "$MYDIR" ]; then +- PGHOME="$MYDIR" +- elif [ -d "$PGHOMEDEFAULT" ]; then ++ if [ -d "$PGHOMEDEFAULT" ]; then + PGHOME="$PGHOMEDEFAULT" + else + echo "Cannot find the Proof General lisp files: Set PGHOME or use --pghome." diff --git a/pkgs/applications/science/logic/coq/8.3.nix b/pkgs/applications/science/logic/coq/8.3.nix index f23622de8a03..8664b822cca7 100644 --- a/pkgs/applications/science/logic/coq/8.3.nix +++ b/pkgs/applications/science/logic/coq/8.3.nix @@ -54,7 +54,7 @@ stdenv.mkDerivation { cp ide/*.cmi ide/ide.*a $out/lib/coq/ide/ '' else ""; - meta = { + meta = with stdenv.lib; { description = "Coq proof assistant"; longDescription = '' Coq is a formal proof management system. It provides a formal language @@ -63,7 +63,7 @@ stdenv.mkDerivation { machine-checked proofs. ''; homepage = "http://coq.inria.fr"; - license = "LGPL"; - maintainers = [ stdenv.lib.maintainers.roconnor ]; + license = licenses.lgpl21; + maintainers = with maintainers; [ roconnor vbgl ]; }; } diff --git a/pkgs/applications/science/logic/coq/HEAD.nix b/pkgs/applications/science/logic/coq/HEAD.nix index c76e563ff5f8..4081465fbd27 100644 --- a/pkgs/applications/science/logic/coq/HEAD.nix +++ b/pkgs/applications/science/logic/coq/HEAD.nix @@ -1,19 +1,20 @@ # - coqide compilation can be disabled by setting lablgtk to null; -{stdenv, fetchgit, pkgconfig, ocaml, findlib, camlp5, ncurses, lablgtk ? null}: +{stdenv, fetchgit, writeText, pkgconfig, ocaml, findlib, camlp5, ncurses, lablgtk ? null}: let version = "8.5pre-01feb42"; + coq-version = "8.5"; buildIde = lablgtk != null; ideFlags = if buildIde then "-lablgtkdir ${lablgtk}/lib/ocaml/*/site-lib/lablgtk2 -coqide opt" else ""; - idePath = if buildIde then '' - CAML_LD_LIBRARY_PATH=${lablgtk}/lib/ocaml/3.12.1/site-lib/stublibs - '' else ""; in stdenv.mkDerivation { name = "coq-${version}"; + inherit coq-version; + inherit ocaml camlp5; + src = fetchgit { url = git://scm.gforge.inria.fr/coq/coq.git; rev = "01feb4206d26b41bfaab9bd45a7b2fc4db569baf"; @@ -32,8 +33,17 @@ stdenv.mkDerivation { 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 = '' - buildFlagsArray=(${idePath}) configureFlagsArray=( -opt ${ideFlags} @@ -44,7 +54,7 @@ stdenv.mkDerivation { buildFlags = "revision coq coqide"; - meta = { + meta = with stdenv.lib; { description = "Coq proof assistant"; longDescription = '' Coq is a formal proof management system. It provides a formal language @@ -53,8 +63,8 @@ stdenv.mkDerivation { machine-checked proofs. ''; homepage = "http://coq.inria.fr"; - license = "LGPL"; - maintainers = with stdenv.lib.maintainers; [ roconnor thoughtpolice ]; - platforms = stdenv.lib.platforms.unix; + license = licenses.lgpl21; + 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 da77a4c5a9aa..f0f62bfb3537 100644 --- a/pkgs/applications/science/logic/coq/default.nix +++ b/pkgs/applications/science/logic/coq/default.nix @@ -1,19 +1,20 @@ # - coqide compilation can be disabled by setting lablgtk to null; -{stdenv, fetchurl, pkgconfig, ocaml, findlib, camlp5, ncurses, lablgtk ? null}: +{stdenv, fetchurl, pkgconfig, writeText, ocaml, findlib, camlp5, ncurses, lablgtk ? null}: -let +let version = "8.4pl4"; + coq-version = "8.4"; buildIde = lablgtk != null; ideFlags = if buildIde then "-lablgtkdir ${lablgtk}/lib/ocaml/*/site-lib/lablgtk2 -coqide opt" else ""; - idePath = if buildIde then '' - CAML_LD_LIBRARY_PATH=${lablgtk}/lib/ocaml/3.12.1/site-lib/stublibs - '' else ""; in stdenv.mkDerivation { name = "coq-${version}"; + inherit coq-version; + inherit ocaml camlp5; + src = fetchurl { url = "http://coq.inria.fr/distrib/V${version}/files/coq-${version}.tar.gz"; sha256 = "00bzf4kfbd0g279jrr8ynzvb9wqcly3wi577bkrxivhrg2msxhq6"; @@ -31,7 +32,6 @@ stdenv.mkDerivation { ''; preConfigure = '' - buildFlagsArray=(${idePath}) configureFlagsArray=( -opt -camldir ${ocaml}/bin @@ -44,7 +44,17 @@ stdenv.mkDerivation { buildFlags = "revision coq coqide"; - meta = { + 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) + ''; + + meta = with stdenv.lib; { description = "Formal proof management system"; longDescription = '' Coq is a formal proof management system. It provides a formal language @@ -53,8 +63,8 @@ stdenv.mkDerivation { machine-checked proofs. ''; homepage = "http://coq.inria.fr"; - license = "LGPL"; - maintainers = with stdenv.lib.maintainers; [ roconnor thoughtpolice ]; - platforms = stdenv.lib.platforms.unix; + license = licenses.lgpl21; + maintainers = with maintainers; [ roconnor thoughtpolice vbgl ]; + platforms = platforms.unix; }; } diff --git a/pkgs/applications/science/logic/ssreflect/default.nix b/pkgs/applications/science/logic/ssreflect/default.nix deleted file mode 100644 index a784e5fe1b6e..000000000000 --- a/pkgs/applications/science/logic/ssreflect/default.nix +++ /dev/null @@ -1,50 +0,0 @@ -# TODO: -# - coq needs to be invoked with the explicit path to the ssreflect theory -# e.g. coqide -R ~/.nix-profile/lib/coq/user-contrib/ '' - -{stdenv, fetchurl, ocaml, camlp5, coq, makeWrapper}: - -let - pname = "ssreflect"; - version = "1.5"; - name = "${pname}-${version}"; - webpage = http://www.msr-inria.inria.fr/Projects/math-components; -in - -stdenv.mkDerivation { - inherit name; - - src = fetchurl { - url = "http://ssr.msr-inria.inria.fr/FTP/${name}.tar.gz"; - sha256 = "0hm1ha7sxqfqhc7iwhx6zdz3nki4rj5nfd3ab24hmz8v7mlpinds"; - }; - - buildInputs = [ ocaml camlp5 coq makeWrapper ]; - - patches = [ ./static.patch ]; - - installPhase = '' - COQLIB=$out/lib/coq/ make -f Makefile.coq install -e - mkdir -p $out/bin - cp bin/* $out/bin - for i in $out/bin/*; do - wrapProgram "$i" \ - --add-flags "-R" \ - --add-flags "$out/lib/coq/user-contrib/Ssreflect" \ - --add-flags "Ssreflect" - done - makeWrapper "${coq}/bin/coqide" "$out/bin/ssrcoqide" --add-flags "-coqtop" --add-flags "$out/bin/ssrcoq" - ''; - - meta = { - description = "Small Scale Reflection extension for Coq"; - longDescription = '' - Small Scale Reflection (ssreflect) is an extension of the Coq Theorem - Prover which enable a formal proof methodology based on the pervasive - use of computation with symbolic representation - ''; - homepage = webpage; - license = "CeCILL B FREE SOFTWARE LICENSE or CeCILL FREE SOFTWARE LICENSE"; - maintainers = [ stdenv.lib.maintainers.roconnor ]; - }; -} diff --git a/pkgs/applications/science/logic/ssreflect/static.patch b/pkgs/applications/science/logic/ssreflect/static.patch deleted file mode 100644 index 2211d8802582..000000000000 --- a/pkgs/applications/science/logic/ssreflect/static.patch +++ /dev/null @@ -1,21 +0,0 @@ ---- ssreflect1.4-coq8.4/Make (revision 3823) -+++ ssreflect1.4-coq8.4/Make (working copy) -@@ -1,10 +1,10 @@ --### Uncomment for static linking --## --#-custom "$(COQBIN)coqmktop -coqlib `$(COQBIN)coqtop -where` -opt -o bin/ssrcoq src/ssrmatching.cmx src/ssreflect.cmx" "src/ssrmatching.cmx src/ssreflect.cmx" bin/ssrcoq --#-custom "$(COQBIN)coqmktop -coqlib `$(COQBIN)coqtop -where` -o bin/ssrcoq.byte src/ssrmatching.cmo src/ssreflect.cmo" "src/ssrmatching.cmo src/ssreflect.cmo" bin/ssrcoq.byte --#-custom "$(SSRCOQ) $(COQFLAGS) -compile $*" "%.v $(SSRCOQ)" "%.vo" --#SSRCOQ = bin/ssrcoq --## -+## Uncomment for static linking -+# -+-custom "$(COQBIN)coqmktop -coqlib `$(COQBIN)coqtop -where` -opt -o bin/ssrcoq src/ssrmatching.cmx src/ssreflect.cmx" "src/ssrmatching.cmx src/ssreflect.cmx" bin/ssrcoq -+-custom "$(COQBIN)coqmktop -coqlib `$(COQBIN)coqtop -where` -o bin/ssrcoq.byte src/ssrmatching.cmo src/ssreflect.cmo" "src/ssrmatching.cmo src/ssreflect.cmo" bin/ssrcoq.byte -+-custom "$(SSRCOQ) $(COQFLAGS) -compile $*" "%.v $(SSRCOQ)" "%.vo" -+SSRCOQ = bin/ssrcoq -+# - - ## What follows should be left untouched by the final user of ssreflect - -R theories Ssreflect - |