coqPackages.mathcomp,ssreflect: 1.5 -> 1.6

See the INSTALL file in the mathcomp package for instructions on
upgrading projects from 1.5 to 1.6.  The 1.6 version works with both Coq
8.4 and 8.5.
This commit is contained in:
John Wiegley 2015-12-20 11:12:23 -08:00
parent 56f6be2583
commit e582c41482
4 changed files with 39 additions and 34 deletions

View File

@ -4,15 +4,15 @@ let src =
if coq.coq-version == "8.4" then if coq.coq-version == "8.4" then
fetchurl { fetchurl {
url = http://ssr.msr-inria.inria.fr/FTP/mathcomp-1.5.tar.gz; url = http://ssr.msr-inria.inria.fr/FTP/mathcomp-1.6.tar.gz;
sha256 = "1297svwi18blrlyd8vsqilar2h5nfixlvlifdkbx47aljq4m5bam"; sha256 = "0adr556032r1jkvphbpfvrrv041qk0yqb7a1xnbam52ji0mdl2w8";
} }
else if coq.coq-version == "8.5" then else if coq.coq-version == "8.5" then
fetchurl { fetchurl {
url = http://ssr.msr-inria.inria.fr/FTP/mathcomp-1.5.coq85beta2.tar.gz; url = http://ssr.msr-inria.inria.fr/FTP/mathcomp-1.6.tar.gz;
sha256 = "03bnq44ym43x8shi7whc02l0g5vy6rx8f1imjw478chlgwcxazqy"; sha256 = "0adr556032r1jkvphbpfvrrv041qk0yqb7a1xnbam52ji0mdl2w8";
} }
else throw "No mathcomp package for Coq version ${coq.coq-version}"; else throw "No mathcomp package for Coq version ${coq.coq-version}";

View File

@ -1,25 +1,33 @@
{ stdenv, fetchurl, coq, ssreflect { stdenv, fetchurl, coq, ssreflect, ncurses, which
, graphviz, ocamlPackages, withDoc ? true , graphviz, ocamlPackages, withDoc ? false
, src , src
}: }:
stdenv.mkDerivation { stdenv.mkDerivation {
name = "coq-mathcomp-1.5-${coq.coq-version}"; name = "coq-mathcomp-1.6-${coq.coq-version}";
inherit src; inherit src;
nativeBuildInputs = stdenv.lib.optionals withDoc nativeBuildInputs = stdenv.lib.optionals withDoc [ graphviz ];
([ graphviz ] ++ (with ocamlPackages; [ ocaml camlp5_transitional ])); buildInputs = [ coq.ocaml coq.camlp5 ncurses which ];
propagatedBuildInputs = [ ssreflect ]; propagatedBuildInputs = [ coq ssreflect ];
enableParallelBuilding = true; enableParallelBuilding = true;
buildFlags = stdenv.lib.optionalString withDoc "doc"; buildFlags = stdenv.lib.optionalString withDoc "doc";
installFlags = "COQLIB=$(out)/lib/coq/${coq.coq-version}/"; preBuild = ''
cd mathcomp
export COQBIN=${coq}/bin/
'';
postInstall = stdenv.lib.optionalString withDoc '' installPhase = ''
make -f Makefile.coq COQLIB=$out/lib/coq/${coq.coq-version}/ install
rm -fr $out/lib/coq/${coq.coq-version}/user-contrib/mathcomp/ssreflect*
rm -fr $out/lib/coq/${coq.coq-version}/user-contrib/ssrmatching.cmi
rm -fr $out/share/coq/${coq.coq-version}/user-contrib/mathcomp/ssreflect*
'' + stdenv.lib.optionalString withDoc ''
make -f Makefile.coq install-doc DOCDIR=$out/share/coq/${coq.coq-version}/ make -f Makefile.coq install-doc DOCDIR=$out/share/coq/${coq.coq-version}/
''; '';

View File

@ -5,8 +5,8 @@ if coq.coq-version == "8.4" then
callPackage ./generic.nix { callPackage ./generic.nix {
src = fetchurl { src = fetchurl {
url = http://ssr.msr-inria.inria.fr/FTP/ssreflect-1.5.tar.gz; url = http://ssr.msr-inria.inria.fr/FTP/mathcomp-1.6.tar.gz;
sha256 = "0hm1ha7sxqfqhc7iwhx6zdz3nki4rj5nfd3ab24hmz8v7mlpinds"; sha256 = "0adr556032r1jkvphbpfvrrv041qk0yqb7a1xnbam52ji0mdl2w8";
}; };
} }
@ -16,12 +16,10 @@ else if coq.coq-version == "8.5" then
callPackage ./generic.nix { callPackage ./generic.nix {
src = fetchurl { src = fetchurl {
url = http://ssr.msr-inria.inria.fr/FTP/ssreflect-1.5.coq85beta2.tar.gz; url = http://ssr.msr-inria.inria.fr/FTP/mathcomp-1.6.tar.gz;
sha256 = "084l9xd5vgb8jml0dkm66g8cil5rsf04w821pjhn2qk9mdbwaagf"; sha256 = "0adr556032r1jkvphbpfvrrv041qk0yqb7a1xnbam52ji0mdl2w8";
}; };
patches = [ ./threads.patch ];
} }
else throw "No ssreflect package for Coq version ${coq.coq-version}" else throw "No ssreflect package for Coq version ${coq.coq-version}"

View File

@ -1,39 +1,38 @@
{ stdenv, fetchurl, coq, ncurses { stdenv, fetchurl, coq, ncurses, which
, graphviz, withDoc ? true , graphviz, withDoc ? false
, src, patches ? [] , src, patches ? []
}: }:
stdenv.mkDerivation { stdenv.mkDerivation {
name = "coq-ssreflect-1.5-${coq.coq-version}"; name = "coq-ssreflect-1.6-${coq.coq-version}";
inherit src; inherit src;
nativeBuildInputs = stdenv.lib.optionals withDoc [ graphviz ]; nativeBuildInputs = stdenv.lib.optionals withDoc [ graphviz ];
buildInputs = [ coq.ocaml coq.camlp5 ncurses ]; buildInputs = [ coq.ocaml coq.camlp5 ncurses which ];
propagatedBuildInputs = [ coq ]; propagatedBuildInputs = [ coq ];
enableParallelBuilding = true; enableParallelBuilding = true;
inherit patches; inherit patches;
postPatch = '' preBuild = ''
# Permit building of the ssrcoq statically-bound executable cd mathcomp/ssreflect
sed -i 's/^#-custom/-custom/' Make export COQBIN=${coq}/bin/
sed -i 's/^#SSRCOQ/SSRCOQ/' Make
''; '';
buildFlags = stdenv.lib.optionalString withDoc "doc"; installPhase = ''
make -f Makefile.coq COQLIB=$out/lib/coq/${coq.coq-version}/ install
installFlags = "COQLIB=$(out)/lib/coq/${coq.coq-version}/"; '';
postInstall = '' postInstall = ''
mkdir -p $out/bin # mkdir -p $out/bin
cp -p bin/ssrcoq $out/bin # cp -p bin/ssrcoq $out/bin
cp -p bin/ssrcoq.byte $out/bin # cp -p bin/ssrcoq.byte $out/bin
'' + stdenv.lib.optionalString withDoc '' '' + stdenv.lib.optionalString withDoc ''
mkdir -p $out/share/doc/coq/${coq.coq-version}/user-contrib/Ssreflect/ mkdir -p $out/share/doc/coq/${coq.coq-version}/user-contrib/mathcomp/ssreflect/
cp -r html $out/share/doc/coq/${coq.coq-version}/user-contrib/Ssreflect/ cp -r html $out/share/doc/coq/${coq.coq-version}/user-contrib/mathcomp/ssreflect/
''; '';
meta = with stdenv.lib; { meta = with stdenv.lib; {