more systematic makedist_cygwin;
authorwenzelm
Thu, 10 Jan 2013 17:53:15 +0100
changeset 50806 c19dba2d7ffe
parent 50805 69439c9defec
child 50807 c065f3d14197
more systematic makedist_cygwin;
Admin/Windows/Cygwin/init.bat
Admin/lib/Tools/makedist_cygwin
--- a/Admin/Windows/Cygwin/init.bat	Thu Jan 10 15:45:27 2013 +0100
+++ b/Admin/Windows/Cygwin/init.bat	Thu Jan 10 17:53:15 2013 +0100
@@ -3,6 +3,8 @@
 cd "%~dp0"
 cd "..\.."
 
-echo Initializing ...
-"contrib\cygwin-1.7.9\bin\ash" /bin/rebaseall
-"contrib\cygwin-1.7.9\bin\bash" -c "PATH=/bin; chmod -wx $(find heaps -type f); mkpasswd -l >/etc/passwd; mkgroup -l >/etc/group"
+set CYGWIN=nodosfilewarning
+
+echo Initializing Cygwin ...
+"cygwin\bin\ash" /bin/rebaseall -p
+"cygwin\bin\bash" -c "PATH=/bin; bash -c 'source /etc/postinstall/base-files-mketc.sh.done'; mkpasswd -l >/etc/passwd; mkgroup -l >/etc/group"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Admin/lib/Tools/makedist_cygwin	Thu Jan 10 17:53:15 2013 +0100
@@ -0,0 +1,69 @@
+#!/usr/bin/env bash
+#
+# DESCRIPTION: produce pre-canned Cygwin distribution for Isabelle
+
+## diagnostics
+
+PRG=$(basename "$0")
+
+function usage()
+{
+  echo
+  echo "Usage: isabelle $PRG"
+  echo
+  echo "  Produce pre-canned Cygwin distribution for Isabelle."
+  echo
+  exit 1
+}
+
+function fail()
+{
+  echo "$1" >&2
+  exit 2
+}
+
+
+## arguments
+
+[ "$#" -ne 0 ] && usage
+
+
+## main
+
+TARGET="$PWD/cygwin"
+
+
+# download
+
+[ ! -e "$TARGET" ] || fail "Target already exists: \"$TARGET\""
+mkdir -p "$TARGET/isabelle" || fail "Failed to create target directory: \"$TARGET\""
+
+perl -MLWP::Simple -e "getprint 'http://cygwin.com/setup.exe';" > "$TARGET/isabelle/cygwin.exe"
+chmod +x "$TARGET/isabelle/cygwin.exe"
+
+"$TARGET/isabelle/cygwin.exe" -h </dev/null >/dev/null || exit 2
+
+
+# install
+
+"$TARGET/isabelle/cygwin.exe" \
+  --local-package-dir "$(cygpath -w "$TMP/cygwin")" \
+  --root "$(cygpath -w "$TARGET")" \
+  --packages libgmp3,perl,python,rlwrap \
+  --no-shortcuts --no-startmenu --no-desktop --quiet-mode
+
+[ "$?" = 0 -a -e "$TARGET/etc" ] || exit 2
+
+
+# patches
+
+for NAME in hosts protocols services networks
+do
+  rm "$TARGET/etc/$NAME"
+done
+
+ln -s cygperl5_14.dll "$TARGET/bin/cygperl5_14_2.dll"
+
+rm "$TARGET/Cygwin.bat"
+
+cp "$ISABELLE_HOME/Admin/Windows/Cygwin/init.bat" "$TARGET/isabelle/."