# HG changeset patch # User wenzelm # Date 1359372329 -3600 # Node ID 9c425ed4a52cf017d96c3561e7b174fc5fa46cdc # Parent d5fd24f735551b0d34b1df4b114608d3290e9f7d separate makedist_bundle for each platform family, which is more useful for manual use; diff -r d5fd24f73555 -r 9c425ed4a52c Admin/Release/build --- a/Admin/Release/build Sat Jan 26 20:36:26 2013 +0100 +++ b/Admin/Release/build Mon Jan 28 12:25:29 2013 +0100 @@ -100,8 +100,17 @@ DISTBASE="$BASE_DIR/dist-${DISTNAME}" -"$ISABELLE_TOOL" makedist_bundles "$DISTBASE/${DISTNAME}.tar.gz" + +for PLATFORM_FAMILY in linux macos windows +do + +echo +echo "*** $PLATFORM_FAMILY ***" + +"$ISABELLE_TOOL" makedist_bundle "$DISTBASE/${DISTNAME}.tar.gz" "$PLATFORM_FAMILY" [ "$?" = 0 ] || exit "$?" +done + "$THIS/build_library" $JOBS "$DISTBASE/${DISTNAME}_${ISABELLE_PLATFORM_FAMILY}.tar.gz" diff -r d5fd24f73555 -r 9c425ed4a52c Admin/lib/Tools/makedist_bundle --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Admin/lib/Tools/makedist_bundle Mon Jan 28 12:25:29 2013 +0100 @@ -0,0 +1,180 @@ +#!/usr/bin/env bash +# +# DESCRIPTION: re-package Isabelle distribution with add-on components + +## diagnostics + +PRG=$(basename "$0") + +function usage() +{ + echo + echo "Usage: isabelle $PRG ARCHIVE PLATFORM_FAMILY" + echo + echo " Re-package Isabelle source distribution with add-on components" + echo " and post-hoc patches for platform family linux, macos, windows." + echo + echo " Add-on components are that of the running Isabelle version!" + echo + exit 1 +} + +function fail() +{ + echo "$1" >&2 + exit 2 +} + + +## arguments + +[ "$#" -ne 2 ] && usage + +ARCHIVE="$1"; shift +PLATFORM_FAMILY="$1"; shift + +[ -f "$ARCHIVE" ] || fail "Bad source archive: $ARCHIVE" + +ARCHIVE_DIR="$(cd $(dirname "$ARCHIVE"); echo "$PWD")" +ISABELLE_NAME="$(basename "$ARCHIVE" .tar.gz)" + + +## main + +export COPYFILE_DISABLE=true + +TMP="/var/tmp/isabelle-makedist$$" +mkdir "$TMP" || fail "Cannot create directory $TMP" + +ISABELLE_TARGET="$TMP/$ISABELLE_NAME" + +tar -C "$TMP" -x -z -f "$ARCHIVE" + + +# bundled components + +mkdir -p "$ARCHIVE_DIR/contrib" + +echo "#bundled components" >> "$ISABELLE_TARGET/etc/components" + +for CATALOG in main "$PLATFORM_FAMILY" bundled "bundled-$PLATFORM_FAMILY" +do + CATALOG_FILE="$ISABELLE_HOME/Admin/components/$CATALOG" + if [ -f "$CATALOG_FILE" ] + then + echo "catalog ${CATALOG}" + { + while { unset REPLY; read -r; test "$?" = 0 -o -n "$REPLY"; } + do + case "$REPLY" in + \#* | "") ;; + *) + COMPONENT="$REPLY" + COMPONENT_DIR="$ISABELLE_TARGET/contrib/$COMPONENT" + case "$COMPONENT" in + jedit_build*) ;; + *) + echo " component $COMPONENT" + CONTRIB="$ARCHIVE_DIR/contrib/${COMPONENT}.tar.gz" + if [ ! -f "$CONTRIB" ]; then + REMOTE="$ISABELLE_COMPONENT_REPOSITORY/${COMPONENT}.tar.gz" + echo " download $REMOTE" + perl -MLWP::Simple -e "getprint '$REMOTE';" > "$CONTRIB" + perl -e "exit((stat('${CONTRIB}'))[7] == 0 ? 0 : 1);" && exit 2 + fi + + tar -C "$ISABELLE_TARGET/contrib" -x -z -f "$CONTRIB" + if [ -f "$COMPONENT_DIR/etc/settings" -o -f "$COMPONENT_DIR/etc/components" ] + then + echo "contrib/$COMPONENT" >> "$ISABELLE_TARGET/etc/components" + fi + ;; + esac + ;; + esac + done + } < "$CATALOG_FILE" + fi +done + + +# platform-specific patches + +case "$PLATFORM_FAMILY" in + linux) + OTHER_PLATFORMS='-name "x86*-darwin" -o -name "x86*-cygwin" -o -name "x86*-windows"' + ;; + macos) + OTHER_PLATFORMS='-name "x86*-linux" -o -name "x86*-cygwin" -o -name "x86*-windows"' + + perl -pi -e "s,lookAndFeel=.*,lookAndFeel=com.apple.laf.AquaLookAndFeel,g;" \ + -e "s,delete-line.shortcut=.*,delete-line.shortcut=C+d,g;" \ + -e "s,delete.shortcut2=.*,delete.shortcut2=A+d,g;" \ + "$TMP/$ISABELLE_NAME/src/Tools/jEdit/dist/properties/jEdit.props" + ;; + windows) + OTHER_PLATFORMS='-name "x86*-linux" -o -name "x86*-darwin"' + + perl -pi -e "s,lookAndFeel=.*,lookAndFeel=com.sun.java.swing.plaf.windows.WindowsLookAndFeel,g;" \ + "$TMP/$ISABELLE_NAME/src/Tools/jEdit/dist/properties/jEdit.props" + + cp "$ISABELLE_HOME/Admin/Windows/launch4j/Isabelle.exe" "$ISABELLE_TARGET/Isabelle2013.exe" + cp "$ISABELLE_HOME/Admin/Windows/Cygwin/Cygwin-Setup.bat" \ + "$ISABELLE_HOME/Admin/Windows/Cygwin/Cygwin-Latex-Setup.bat" \ + "$ISABELLE_HOME/Admin/Windows/Cygwin/Cygwin-Terminal.bat" "$ISABELLE_TARGET" + + for NAME in init.bat postinstall rebaseall + do + cp -a "$ISABELLE_HOME/Admin/Windows/Cygwin/isabelle/$NAME" \ + "$ISABELLE_TARGET/contrib/cygwin/isabelle/." + done + + perl -pi -e "s,/bin/rebaseall.*,/isabelle/rebaseall,g;" \ + "$ISABELLE_TARGET/contrib/cygwin/etc/postinstall/autorebase.bat.done" + + for NAME in ANNOUNCE README NEWS COPYRIGHT CONTRIBUTORS contrib/README + do + FILE="$ISABELLE_TARGET/$NAME" + { + echo '' + echo '' + echo '' + echo '' + echo '' + echo "${NAME}" + echo '' + echo '' + echo '
'
+        perl -w -p -e "s/&/&/g; s//>/g; s/'/'/g; s/\"/"/g;" "$FILE"
+        echo '
' + echo '' + } > "${FILE}.html" + done + ;; + *) + ;; +esac + + +# purge other platforms + +( + cd "$ISABELLE_TARGET" + for DIR in $(eval find contrib $OTHER_PLATFORMS | sort) + do + echo "removing $DIR" + rm -rf "$DIR" + done +) + + +# archive + +BUNDLE_ARCHIVE="${ARCHIVE_DIR}/${ISABELLE_NAME}_${PLATFORM_FAMILY}.tar.gz" + +echo "packaging $(basename "$BUNDLE_ARCHIVE")" +tar -C "$TMP" -c -z -f "$BUNDLE_ARCHIVE" "$ISABELLE_NAME" || exit 2 + + +# clean up +rm -rf "$TMP" diff -r d5fd24f73555 -r 9c425ed4a52c Admin/lib/Tools/makedist_bundles --- a/Admin/lib/Tools/makedist_bundles Sat Jan 26 20:36:26 2013 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,188 +0,0 @@ -#!/usr/bin/env bash -# -# DESCRIPTION: re-package Isabelle distribution with add-on components - -## diagnostics - -PRG=$(basename "$0") - -function usage() -{ - echo - echo "Usage: isabelle $PRG ARCHIVE" - echo - echo " Re-package Isabelle source distribution with add-on components" - echo " and post-hoc patches for platform families linux, macos, windows." - echo - echo " Add-on components are that of the running Isabelle version!" - echo - exit 1 -} - -function fail() -{ - echo "$1" >&2 - exit 2 -} - - -## arguments - -[ "$#" -ne 1 ] && usage - -ARCHIVE="$1"; shift - -[ -f "$ARCHIVE" ] || fail "Bad source archive: $ARCHIVE" - -ARCHIVE_DIR="$(cd $(dirname "$ARCHIVE"); echo "$PWD")" -ISABELLE_NAME="$(basename "$ARCHIVE" .tar.gz)" - - -## main - -export COPYFILE_DISABLE=true - -for PLATFORM_FAMILY in linux macos windows -do - -echo -echo "*** $PLATFORM_FAMILY ***" - -TMP="/var/tmp/isabelle-makedist$$" -mkdir "$TMP" || fail "Cannot create directory $TMP" - -ISABELLE_TARGET="$TMP/$ISABELLE_NAME" - -tar -C "$TMP" -x -z -f "$ARCHIVE" - - -# bundled components - -mkdir -p "$ARCHIVE_DIR/contrib" - -echo "#bundled components" >> "$ISABELLE_TARGET/etc/components" - -for CATALOG in main "$PLATFORM_FAMILY" bundled "bundled-$PLATFORM_FAMILY" -do - CATALOG_FILE="$ISABELLE_HOME/Admin/components/$CATALOG" - if [ -f "$CATALOG_FILE" ] - then - echo "catalog ${CATALOG}" - { - while { unset REPLY; read -r; test "$?" = 0 -o -n "$REPLY"; } - do - case "$REPLY" in - \#* | "") ;; - *) - COMPONENT="$REPLY" - COMPONENT_DIR="$ISABELLE_TARGET/contrib/$COMPONENT" - case "$COMPONENT" in - jedit_build*) ;; - *) - echo " component $COMPONENT" - CONTRIB="$ARCHIVE_DIR/contrib/${COMPONENT}.tar.gz" - if [ ! -f "$CONTRIB" ]; then - REMOTE="$ISABELLE_COMPONENT_REPOSITORY/${COMPONENT}.tar.gz" - echo " download $REMOTE" - perl -MLWP::Simple -e "getprint '$REMOTE';" > "$CONTRIB" - perl -e "exit((stat('${CONTRIB}'))[7] == 0 ? 0 : 1);" && exit 2 - fi - - tar -C "$ISABELLE_TARGET/contrib" -x -z -f "$CONTRIB" - if [ -f "$COMPONENT_DIR/etc/settings" -o -f "$COMPONENT_DIR/etc/components" ] - then - echo "contrib/$COMPONENT" >> "$ISABELLE_TARGET/etc/components" - fi - ;; - esac - ;; - esac - done - } < "$CATALOG_FILE" - fi -done - - -# platform-specific patches - -case "$PLATFORM_FAMILY" in - linux) - OTHER_PLATFORMS='-name "x86*-darwin" -o -name "x86*-cygwin" -o -name "x86*-windows"' - ;; - macos) - OTHER_PLATFORMS='-name "x86*-linux" -o -name "x86*-cygwin" -o -name "x86*-windows"' - - perl -pi -e "s,lookAndFeel=.*,lookAndFeel=com.apple.laf.AquaLookAndFeel,g;" \ - -e "s,delete-line.shortcut=.*,delete-line.shortcut=C+d,g;" \ - -e "s,delete.shortcut2=.*,delete.shortcut2=A+d,g;" \ - "$TMP/$ISABELLE_NAME/src/Tools/jEdit/dist/properties/jEdit.props" - ;; - windows) - OTHER_PLATFORMS='-name "x86*-linux" -o -name "x86*-darwin"' - - perl -pi -e "s,lookAndFeel=.*,lookAndFeel=com.sun.java.swing.plaf.windows.WindowsLookAndFeel,g;" \ - "$TMP/$ISABELLE_NAME/src/Tools/jEdit/dist/properties/jEdit.props" - - cp "$ISABELLE_HOME/Admin/Windows/launch4j/Isabelle.exe" "$ISABELLE_TARGET/Isabelle2013.exe" - cp "$ISABELLE_HOME/Admin/Windows/Cygwin/Cygwin-Setup.bat" \ - "$ISABELLE_HOME/Admin/Windows/Cygwin/Cygwin-Latex-Setup.bat" \ - "$ISABELLE_HOME/Admin/Windows/Cygwin/Cygwin-Terminal.bat" "$ISABELLE_TARGET" - - for NAME in init.bat postinstall rebaseall - do - cp -a "$ISABELLE_HOME/Admin/Windows/Cygwin/isabelle/$NAME" \ - "$ISABELLE_TARGET/contrib/cygwin/isabelle/." - done - - perl -pi -e "s,/bin/rebaseall.*,/isabelle/rebaseall,g;" \ - "$ISABELLE_TARGET/contrib/cygwin/etc/postinstall/autorebase.bat.done" - - for NAME in ANNOUNCE README NEWS COPYRIGHT CONTRIBUTORS contrib/README - do - FILE="$ISABELLE_TARGET/$NAME" - { - echo '' - echo '' - echo '' - echo '' - echo '' - echo "${NAME}" - echo '' - echo '' - echo '
'
-        perl -w -p -e "s/&/&/g; s//>/g; s/'/'/g; s/\"/"/g;" "$FILE"
-        echo '
' - echo '' - } > "${FILE}.html" - done - ;; - *) - ;; -esac - - -# purge other platforms - -( - cd "$ISABELLE_TARGET" - for DIR in $(eval find contrib $OTHER_PLATFORMS | sort) - do - echo "removing $DIR" - rm -rf "$DIR" - done -) - - -# archive - -BUNDLE_ARCHIVE="${ARCHIVE_DIR}/${ISABELLE_NAME}_${PLATFORM_FAMILY}.tar.gz" - -echo "packaging $(basename "$BUNDLE_ARCHIVE")" -tar -C "$TMP" -c -z -f "$BUNDLE_ARCHIVE" "$ISABELLE_NAME" || exit 2 - - -# clean up -rm -rf "$TMP" - -done -