Index: Makefile =================================================================== RCS file: /home/ncvs/ports/math/isabelle/Makefile,v retrieving revision 1.3 diff -u -r1.3 Makefile --- Makefile 10 Aug 2006 12:04:59 -0000 1.3 +++ Makefile 6 Mar 2007 00:40:00 -0000 @@ -2,7 +2,7 @@ # Date created: 08 August 2005 # Whom: Timothy Bourke # -# $FreeBSD: ports/math/isabelle/Makefile,v 1.3 2006/08/10 12:04:59 rafan Exp $ +# $FreeBSD$ # PORTNAME= isabelle @@ -22,7 +22,6 @@ COMMENT= A generic proof assistant OPTIONS= SMLNJ "Use SML/NJ (devel) instead of the faster Poly/ML" Off -NO_PACKAGE= Requires non-standard kernel setting. .include @@ -30,11 +29,13 @@ ML_SYSTEM= smlnj-110 ML_HOME= ${LOCALBASE}/smlnj/bin ML_OPTIONS= @SMLdebug=/dev/null +ML_PLATFORM= x86-bsd .else -ML_SYSTEM= polyml-4.2.0 -ML_HOME= ${LOCALBASE}/lib/polyml/ -ML_OPTIONS= -H 80 +ML_SYSTEM= polyml-5.0 +ML_HOME= ${LOCALBASE}/bin +ML_OPTIONS= -H 500 ML_DBASE= "" +ML_PLATFORM= "" .endif USE_PERL5= yes @@ -43,12 +44,12 @@ DOCFILES= Contents *.pdf *.eps *.ps *.dvi -PLIST_SUB= HEAPSUBDIR=${ML_SYSTEM}_x86-bsd - .if defined(WITH_SMLNJ) +PLIST_SUB= HEAPSUBDIR=${ML_SYSTEM}_${ML_PLATFORM} BUILD_DEPENDS+= sml:${PORTSDIR}/lang/sml-nj-devel RUN_DEPENDS+= sml:${PORTSDIR}/lang/sml-nj-devel .else +PLIST_SUB= HEAPSUBDIR=${ML_SYSTEM} BUILD_DEPENDS+= poly:${PORTSDIR}/lang/polyml RUN_DEPENDS+= poly:${PORTSDIR}/lang/polyml .endif @@ -57,8 +58,12 @@ post-extract: @${CP} ${FILESDIR}/Makefile ${WRKSRC} - @${CP} ${FILESDIR}/polyml-4.1.4-patch.ML ${WRKSRC}/src/Pure/ML-Systems/ - @${CP} ${FILESDIR}/polyml-4.2.0.ML ${WRKSRC}/src/Pure/ML-Systems/ + @${CP} ${FILESDIR}/run-polyml-5.0 ${WRKSRC}/lib/scripts/ + @${CHMOD} ugo+x ${WRKSRC}/lib/scripts/run-polyml-5.0 + @${CP} ${FILESDIR}/polyml-5.0.ML ${WRKSRC}/src/Pure/ML-Systems/ +.if !defined(WITH_SMLNJ) + @${CP} ${FILESDIR}/proofgeneral-settings.el ${WRKSRC}/etc/ +.endif post-patch: @${MV} ${WRKSRC}/etc/settings ${WRKSRC}/etc/settings.presed @@ -66,19 +71,12 @@ s|%%ML_HOME%%|${ML_HOME}|; \ s|%%ML_OPTIONS%%|\"${ML_OPTIONS}\"|; \ s|%%ML_DBASE%%|${ML_DBASE}|; \ + s|%%ML_PLATFORM%%|${ML_PLATFORM}|; \ s|%%PREFIX%%|${PREFIX}|" \ ${WRKSRC}/etc/settings.presed > ${WRKSRC}/etc/settings @${RM} ${WRKSRC}/etc/settings.presed @${TOUCH} ${WRKSRC}/contrib/.keep -pre-build: -.if !defined(WITH_SMLNJ) - @if ${TEST} `ulimit -Hd` -lt 917504; then \ - ${CAT} ${FILESDIR}/badmaxdsiz; \ - exit 1; \ - fi -.endif - post-install: ${WRKSRC}/bin/isatool ${INSTALL} -d ${PREFIX}/share/isabelle -p ${PREFIX}/bin .if !defined(NOPORTDOCS) Index: pkg-install =================================================================== RCS file: pkg-install diff -N pkg-install --- pkg-install 1 Sep 2005 10:03:58 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,23 +0,0 @@ -#!/bin/sh - -if [ "$2" = "POST-INSTALL" ]; then - if test `ulimit -Hd` -lt 917504; then - cat <&2 + exit 2 +} + +function check_file() +{ + if [ ! -f "$1" ]; then + echo "Unable to locate $1" >&2 + echo "Please check your ML system settings!" >&2 + exit 2 + fi +} + + +## compiler executables and libraries + +POLY="$ML_HOME/poly" +check_file "$POLY" + +if [ "$(basename "$ML_HOME")" = bin ]; then + POLYLIB="$(cd "$ML_HOME"; cd "$(pwd -P)"; cd ../lib; pwd)" +else + POLYLIB="$ML_HOME" +fi + +export LD_LIBRARY_PATH="$POLYLIB:$LD_LIBRARY_PATH" +export DYLD_LIBRARY_PATH="$POLYLIB:$DYLD_LIBRARY_PATH" + + +## prepare databases + +if [ -z "$INFILE" ]; then + EXIT="fun exit 0 = (OS.Process.exit OS.Process.success): unit | exit _ = OS.Process.exit OS.Process.failure;" +else + check_file "$INFILE" + POLY="$INFILE" + EXIT="" +fi + +ROOT_FUNCTION="fn () => (Signal.signal (2, Signal.SIG_HANDLE (fn _ => Process.interruptConsoleProcesses ())); PolyML.rootFunction ())" + +if [ -z "$OUTFILE" ]; then + COMMIT='fun commit () = (TextIO.output (TextIO.stdErr, "Error - Database is not opened for writing.\n"); false);' +else + if [ -z "$COMPRESS" ]; then + COMMIT="fun commit () = (TextIO.output (TextIO.stdOut, \"Exporting $OUTFILE\n\"); PolyML.export (\"$OUTFILE\", $ROOT_FUNCTION); true);" + else + COMMIT="fun commit () = (PolyML.shareCommonData PolyML.rootFunction; TextIO.output (TextIO.stdOut, \"Exporting $OUTFILE\n\"); PolyML.export (\"$OUTFILE\", $ROOT_FUNCTION); true);" + fi + [ -f "$OUTFILE" ] && { chmod +w "$OUTFILE" || fail_out; } + rm -f "${OUTFILE}.o" || fail_out +fi + + +## run it! + +MLTEXT="PolyML.Compiler.printInAlphabeticalOrder := false; $EXIT $COMMIT $MLTEXT" +MLEXIT="commit();" + +if [ -z "$TERMINATE" ]; then + FEEDER_OPTS="" +else + FEEDER_OPTS="-q" +fi + +"$ISABELLE_HOME/lib/scripts/feeder" -p -h "$MLTEXT" -t "$MLEXIT" $FEEDER_OPTS | \ + { read FPID; "$POLY" $ML_OPTIONS; RC="$?"; kill -HUP "$FPID"; exit "$RC"; } +RC="$?" + +if [ -n "$OUTFILE" ]; then + if [ -e "${OUTFILE}.o" ]; then + cc -o "$OUTFILE" "${OUTFILE}.o" -L"$POLYLIB" -lpolymain -lpolyml -lstdc++ || fail_out + rm -f "${OUTFILE}.o" + [ -e "${OUTFILE}.exe" ] && mv "${OUTFILE}.exe" "$OUTFILE" + fi + [ -f "$OUTFILE" -a -n "$NOWRITE" ] && chmod -w "$OUTFILE" +fi + +exit "$RC"