Admin/lib/Tools/makedist_bundle
author blanchet
Fri, 13 Sep 2013 02:55:04 +0200
changeset 53592 5a7bf8c859f6
parent 53581 c0ad478abf50
child 53883 f1c5f857df3d
permissions -rwxr-xr-x
made non-co case more robust as well (cf. b6e2993fd0d3)
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
33907
473f859e1c29 re-package Isabelle distribution with add-on components;
wenzelm
parents:
diff changeset
     1
#!/usr/bin/env bash
473f859e1c29 re-package Isabelle distribution with add-on components;
wenzelm
parents:
diff changeset
     2
#
50790
0088e0805b10 updated makebundles as Admin isabelle tool;
wenzelm
parents: 48190
diff changeset
     3
# DESCRIPTION: re-package Isabelle distribution with add-on components
33907
473f859e1c29 re-package Isabelle distribution with add-on components;
wenzelm
parents:
diff changeset
     4
473f859e1c29 re-package Isabelle distribution with add-on components;
wenzelm
parents:
diff changeset
     5
## diagnostics
473f859e1c29 re-package Isabelle distribution with add-on components;
wenzelm
parents:
diff changeset
     6
473f859e1c29 re-package Isabelle distribution with add-on components;
wenzelm
parents:
diff changeset
     7
PRG=$(basename "$0")
473f859e1c29 re-package Isabelle distribution with add-on components;
wenzelm
parents:
diff changeset
     8
473f859e1c29 re-package Isabelle distribution with add-on components;
wenzelm
parents:
diff changeset
     9
function usage()
473f859e1c29 re-package Isabelle distribution with add-on components;
wenzelm
parents:
diff changeset
    10
{
473f859e1c29 re-package Isabelle distribution with add-on components;
wenzelm
parents:
diff changeset
    11
  echo
51064
9c425ed4a52c separate makedist_bundle for each platform family, which is more useful for manual use;
wenzelm
parents: 50961
diff changeset
    12
  echo "Usage: isabelle $PRG ARCHIVE PLATFORM_FAMILY"
33907
473f859e1c29 re-package Isabelle distribution with add-on components;
wenzelm
parents:
diff changeset
    13
  echo
37315
af2adf0ae97d one all-inclusive bundle for each platform;
wenzelm
parents: 33907
diff changeset
    14
  echo "  Re-package Isabelle source distribution with add-on components"
51064
9c425ed4a52c separate makedist_bundle for each platform family, which is more useful for manual use;
wenzelm
parents: 50961
diff changeset
    15
  echo "  and post-hoc patches for platform family linux, macos, windows."
50790
0088e0805b10 updated makebundles as Admin isabelle tool;
wenzelm
parents: 48190
diff changeset
    16
  echo
0088e0805b10 updated makebundles as Admin isabelle tool;
wenzelm
parents: 48190
diff changeset
    17
  echo "  Add-on components are that of the running Isabelle version!"
33907
473f859e1c29 re-package Isabelle distribution with add-on components;
wenzelm
parents:
diff changeset
    18
  echo
473f859e1c29 re-package Isabelle distribution with add-on components;
wenzelm
parents:
diff changeset
    19
  exit 1
473f859e1c29 re-package Isabelle distribution with add-on components;
wenzelm
parents:
diff changeset
    20
}
473f859e1c29 re-package Isabelle distribution with add-on components;
wenzelm
parents:
diff changeset
    21
473f859e1c29 re-package Isabelle distribution with add-on components;
wenzelm
parents:
diff changeset
    22
function fail()
473f859e1c29 re-package Isabelle distribution with add-on components;
wenzelm
parents:
diff changeset
    23
{
473f859e1c29 re-package Isabelle distribution with add-on components;
wenzelm
parents:
diff changeset
    24
  echo "$1" >&2
473f859e1c29 re-package Isabelle distribution with add-on components;
wenzelm
parents:
diff changeset
    25
  exit 2
473f859e1c29 re-package Isabelle distribution with add-on components;
wenzelm
parents:
diff changeset
    26
}
473f859e1c29 re-package Isabelle distribution with add-on components;
wenzelm
parents:
diff changeset
    27
473f859e1c29 re-package Isabelle distribution with add-on components;
wenzelm
parents:
diff changeset
    28
50790
0088e0805b10 updated makebundles as Admin isabelle tool;
wenzelm
parents: 48190
diff changeset
    29
## arguments
0088e0805b10 updated makebundles as Admin isabelle tool;
wenzelm
parents: 48190
diff changeset
    30
51064
9c425ed4a52c separate makedist_bundle for each platform family, which is more useful for manual use;
wenzelm
parents: 50961
diff changeset
    31
[ "$#" -ne 2 ] && usage
50790
0088e0805b10 updated makebundles as Admin isabelle tool;
wenzelm
parents: 48190
diff changeset
    32
0088e0805b10 updated makebundles as Admin isabelle tool;
wenzelm
parents: 48190
diff changeset
    33
ARCHIVE="$1"; shift
51064
9c425ed4a52c separate makedist_bundle for each platform family, which is more useful for manual use;
wenzelm
parents: 50961
diff changeset
    34
PLATFORM_FAMILY="$1"; shift
50790
0088e0805b10 updated makebundles as Admin isabelle tool;
wenzelm
parents: 48190
diff changeset
    35
0088e0805b10 updated makebundles as Admin isabelle tool;
wenzelm
parents: 48190
diff changeset
    36
[ -f "$ARCHIVE" ] || fail "Bad source archive: $ARCHIVE"
0088e0805b10 updated makebundles as Admin isabelle tool;
wenzelm
parents: 48190
diff changeset
    37
0088e0805b10 updated makebundles as Admin isabelle tool;
wenzelm
parents: 48190
diff changeset
    38
ARCHIVE_DIR="$(cd $(dirname "$ARCHIVE"); echo "$PWD")"
0088e0805b10 updated makebundles as Admin isabelle tool;
wenzelm
parents: 48190
diff changeset
    39
ISABELLE_NAME="$(basename "$ARCHIVE" .tar.gz)"
0088e0805b10 updated makebundles as Admin isabelle tool;
wenzelm
parents: 48190
diff changeset
    40
0088e0805b10 updated makebundles as Admin isabelle tool;
wenzelm
parents: 48190
diff changeset
    41
0088e0805b10 updated makebundles as Admin isabelle tool;
wenzelm
parents: 48190
diff changeset
    42
## main
0088e0805b10 updated makebundles as Admin isabelle tool;
wenzelm
parents: 48190
diff changeset
    43
50863
8f6046b7f850 some attempts to avoid "._" files on Mac OS X;
wenzelm
parents: 50831
diff changeset
    44
export COPYFILE_DISABLE=true
8f6046b7f850 some attempts to avoid "._" files on Mac OS X;
wenzelm
parents: 50831
diff changeset
    45
50794
a62d048e6213 renamed tool;
wenzelm
parents: 50790
diff changeset
    46
TMP="/var/tmp/isabelle-makedist$$"
37315
af2adf0ae97d one all-inclusive bundle for each platform;
wenzelm
parents: 33907
diff changeset
    47
mkdir "$TMP" || fail "Cannot create directory $TMP"
af2adf0ae97d one all-inclusive bundle for each platform;
wenzelm
parents: 33907
diff changeset
    48
50790
0088e0805b10 updated makebundles as Admin isabelle tool;
wenzelm
parents: 48190
diff changeset
    49
ISABELLE_TARGET="$TMP/$ISABELLE_NAME"
33907
473f859e1c29 re-package Isabelle distribution with add-on components;
wenzelm
parents:
diff changeset
    50
53418
d47a7cebe6b2 standardize jdk name;
wenzelm
parents: 52678
diff changeset
    51
tar -C "$TMP" -x -z -f "$ARCHIVE" || exit 2
33907
473f859e1c29 re-package Isabelle distribution with add-on components;
wenzelm
parents:
diff changeset
    52
37315
af2adf0ae97d one all-inclusive bundle for each platform;
wenzelm
parents: 33907
diff changeset
    53
53581
c0ad478abf50 generate distribution classpath for cold-start application wrappers;
wenzelm
parents: 53489
diff changeset
    54
# distribution classpath (based on educated guesses)
c0ad478abf50 generate distribution classpath for cold-start application wrappers;
wenzelm
parents: 53489
diff changeset
    55
c0ad478abf50 generate distribution classpath for cold-start application wrappers;
wenzelm
parents: 53489
diff changeset
    56
splitarray ":" "$ISABELLE_CLASSPATH"; CLASSPATH_ENTRIES=("${SPLITARRAY[@]}")
c0ad478abf50 generate distribution classpath for cold-start application wrappers;
wenzelm
parents: 53489
diff changeset
    57
declare -a DISTRIBITION_CLASSPATH=()
c0ad478abf50 generate distribution classpath for cold-start application wrappers;
wenzelm
parents: 53489
diff changeset
    58
c0ad478abf50 generate distribution classpath for cold-start application wrappers;
wenzelm
parents: 53489
diff changeset
    59
for ENTRY in "${CLASSPATH_ENTRIES[@]}"
c0ad478abf50 generate distribution classpath for cold-start application wrappers;
wenzelm
parents: 53489
diff changeset
    60
do
c0ad478abf50 generate distribution classpath for cold-start application wrappers;
wenzelm
parents: 53489
diff changeset
    61
  ENTRY=$(echo "$ENTRY" | perl -n -e "
c0ad478abf50 generate distribution classpath for cold-start application wrappers;
wenzelm
parents: 53489
diff changeset
    62
    if (m,$ISABELLE_HOME/(.*)\$,) { print qq{\$1}; }
c0ad478abf50 generate distribution classpath for cold-start application wrappers;
wenzelm
parents: 53489
diff changeset
    63
    elsif (m,$USER_HOME/.isabelle/contrib/(.*)\$,) { print qq{contrib/\$1}; }
c0ad478abf50 generate distribution classpath for cold-start application wrappers;
wenzelm
parents: 53489
diff changeset
    64
    else { print; };
c0ad478abf50 generate distribution classpath for cold-start application wrappers;
wenzelm
parents: 53489
diff changeset
    65
    print qq{\n};")
c0ad478abf50 generate distribution classpath for cold-start application wrappers;
wenzelm
parents: 53489
diff changeset
    66
  DISTRIBITION_CLASSPATH["${#DISTRIBITION_CLASSPATH[@]}"]="$ENTRY"
c0ad478abf50 generate distribution classpath for cold-start application wrappers;
wenzelm
parents: 53489
diff changeset
    67
done
c0ad478abf50 generate distribution classpath for cold-start application wrappers;
wenzelm
parents: 53489
diff changeset
    68
c0ad478abf50 generate distribution classpath for cold-start application wrappers;
wenzelm
parents: 53489
diff changeset
    69
DISTRIBITION_CLASSPATH["${#DISTRIBITION_CLASSPATH[@]}"]="src/Tools/jEdit/dist/jedit.jar"
c0ad478abf50 generate distribution classpath for cold-start application wrappers;
wenzelm
parents: 53489
diff changeset
    70
c0ad478abf50 generate distribution classpath for cold-start application wrappers;
wenzelm
parents: 53489
diff changeset
    71
echo "classpath"
c0ad478abf50 generate distribution classpath for cold-start application wrappers;
wenzelm
parents: 53489
diff changeset
    72
for ENTRY in "${DISTRIBITION_CLASSPATH[@]}"
c0ad478abf50 generate distribution classpath for cold-start application wrappers;
wenzelm
parents: 53489
diff changeset
    73
do
c0ad478abf50 generate distribution classpath for cold-start application wrappers;
wenzelm
parents: 53489
diff changeset
    74
  echo "  $ENTRY"
c0ad478abf50 generate distribution classpath for cold-start application wrappers;
wenzelm
parents: 53489
diff changeset
    75
done
c0ad478abf50 generate distribution classpath for cold-start application wrappers;
wenzelm
parents: 53489
diff changeset
    76
c0ad478abf50 generate distribution classpath for cold-start application wrappers;
wenzelm
parents: 53489
diff changeset
    77
50790
0088e0805b10 updated makebundles as Admin isabelle tool;
wenzelm
parents: 48190
diff changeset
    78
# bundled components
33907
473f859e1c29 re-package Isabelle distribution with add-on components;
wenzelm
parents:
diff changeset
    79
53485
a837df2ceee5 override potential changes in $ISABELLE_HOME_USER/etc/settings;
wenzelm
parents: 53484
diff changeset
    80
init_component "$JEDIT_HOME"
a837df2ceee5 override potential changes in $ISABELLE_HOME_USER/etc/settings;
wenzelm
parents: 53484
diff changeset
    81
50790
0088e0805b10 updated makebundles as Admin isabelle tool;
wenzelm
parents: 48190
diff changeset
    82
mkdir -p "$ARCHIVE_DIR/contrib"
0088e0805b10 updated makebundles as Admin isabelle tool;
wenzelm
parents: 48190
diff changeset
    83
0088e0805b10 updated makebundles as Admin isabelle tool;
wenzelm
parents: 48190
diff changeset
    84
echo "#bundled components" >> "$ISABELLE_TARGET/etc/components"
33907
473f859e1c29 re-package Isabelle distribution with add-on components;
wenzelm
parents:
diff changeset
    85
50812
eb38dfcf834a manage cygwin as bundled quasi-component;
wenzelm
parents: 50810
diff changeset
    86
for CATALOG in main "$PLATFORM_FAMILY" bundled "bundled-$PLATFORM_FAMILY"
50790
0088e0805b10 updated makebundles as Admin isabelle tool;
wenzelm
parents: 48190
diff changeset
    87
do
0088e0805b10 updated makebundles as Admin isabelle tool;
wenzelm
parents: 48190
diff changeset
    88
  CATALOG_FILE="$ISABELLE_HOME/Admin/components/$CATALOG"
0088e0805b10 updated makebundles as Admin isabelle tool;
wenzelm
parents: 48190
diff changeset
    89
  if [ -f "$CATALOG_FILE" ]
0088e0805b10 updated makebundles as Admin isabelle tool;
wenzelm
parents: 48190
diff changeset
    90
  then
0088e0805b10 updated makebundles as Admin isabelle tool;
wenzelm
parents: 48190
diff changeset
    91
    echo "catalog ${CATALOG}"
0088e0805b10 updated makebundles as Admin isabelle tool;
wenzelm
parents: 48190
diff changeset
    92
    {
0088e0805b10 updated makebundles as Admin isabelle tool;
wenzelm
parents: 48190
diff changeset
    93
      while { unset REPLY; read -r; test "$?" = 0 -o -n "$REPLY"; }
0088e0805b10 updated makebundles as Admin isabelle tool;
wenzelm
parents: 48190
diff changeset
    94
      do
0088e0805b10 updated makebundles as Admin isabelle tool;
wenzelm
parents: 48190
diff changeset
    95
        case "$REPLY" in
0088e0805b10 updated makebundles as Admin isabelle tool;
wenzelm
parents: 48190
diff changeset
    96
          \#* | "") ;;
0088e0805b10 updated makebundles as Admin isabelle tool;
wenzelm
parents: 48190
diff changeset
    97
          *)
0088e0805b10 updated makebundles as Admin isabelle tool;
wenzelm
parents: 48190
diff changeset
    98
            COMPONENT="$REPLY"
50891
d1a0335b4231 do not register quasi-components, notably cygwin;
wenzelm
parents: 50863
diff changeset
    99
            COMPONENT_DIR="$ISABELLE_TARGET/contrib/$COMPONENT"
50790
0088e0805b10 updated makebundles as Admin isabelle tool;
wenzelm
parents: 48190
diff changeset
   100
            case "$COMPONENT" in
0088e0805b10 updated makebundles as Admin isabelle tool;
wenzelm
parents: 48190
diff changeset
   101
              jedit_build*) ;;
0088e0805b10 updated makebundles as Admin isabelle tool;
wenzelm
parents: 48190
diff changeset
   102
              *)
0088e0805b10 updated makebundles as Admin isabelle tool;
wenzelm
parents: 48190
diff changeset
   103
                echo "  component $COMPONENT"
0088e0805b10 updated makebundles as Admin isabelle tool;
wenzelm
parents: 48190
diff changeset
   104
                CONTRIB="$ARCHIVE_DIR/contrib/${COMPONENT}.tar.gz"
0088e0805b10 updated makebundles as Admin isabelle tool;
wenzelm
parents: 48190
diff changeset
   105
                if [ ! -f "$CONTRIB" ]; then
0088e0805b10 updated makebundles as Admin isabelle tool;
wenzelm
parents: 48190
diff changeset
   106
                  REMOTE="$ISABELLE_COMPONENT_REPOSITORY/${COMPONENT}.tar.gz"
0088e0805b10 updated makebundles as Admin isabelle tool;
wenzelm
parents: 48190
diff changeset
   107
                  echo "  download $REMOTE"
0088e0805b10 updated makebundles as Admin isabelle tool;
wenzelm
parents: 48190
diff changeset
   108
                  perl -MLWP::Simple -e "getprint '$REMOTE';" > "$CONTRIB"
0088e0805b10 updated makebundles as Admin isabelle tool;
wenzelm
parents: 48190
diff changeset
   109
                  perl -e "exit((stat('${CONTRIB}'))[7] == 0 ? 0 : 1);" && exit 2
0088e0805b10 updated makebundles as Admin isabelle tool;
wenzelm
parents: 48190
diff changeset
   110
                fi
0088e0805b10 updated makebundles as Admin isabelle tool;
wenzelm
parents: 48190
diff changeset
   111
53418
d47a7cebe6b2 standardize jdk name;
wenzelm
parents: 52678
diff changeset
   112
                tar -C "$ISABELLE_TARGET/contrib" -x -z -f "$CONTRIB" || exit 2
50891
d1a0335b4231 do not register quasi-components, notably cygwin;
wenzelm
parents: 50863
diff changeset
   113
                if [ -f "$COMPONENT_DIR/etc/settings" -o -f "$COMPONENT_DIR/etc/components" ]
d1a0335b4231 do not register quasi-components, notably cygwin;
wenzelm
parents: 50863
diff changeset
   114
                then
53418
d47a7cebe6b2 standardize jdk name;
wenzelm
parents: 52678
diff changeset
   115
                  case "$COMPONENT" in
d47a7cebe6b2 standardize jdk name;
wenzelm
parents: 52678
diff changeset
   116
                    jdk-*)
d47a7cebe6b2 standardize jdk name;
wenzelm
parents: 52678
diff changeset
   117
                      mv "$ISABELLE_TARGET/contrib/$COMPONENT" "$ISABELLE_TARGET/contrib/jdk"
d47a7cebe6b2 standardize jdk name;
wenzelm
parents: 52678
diff changeset
   118
                      echo "contrib/jdk" >> "$ISABELLE_TARGET/etc/components"
d47a7cebe6b2 standardize jdk name;
wenzelm
parents: 52678
diff changeset
   119
                      ;;
d47a7cebe6b2 standardize jdk name;
wenzelm
parents: 52678
diff changeset
   120
                    *)
d47a7cebe6b2 standardize jdk name;
wenzelm
parents: 52678
diff changeset
   121
                      echo "contrib/$COMPONENT" >> "$ISABELLE_TARGET/etc/components"
d47a7cebe6b2 standardize jdk name;
wenzelm
parents: 52678
diff changeset
   122
                      ;;
d47a7cebe6b2 standardize jdk name;
wenzelm
parents: 52678
diff changeset
   123
                  esac
50891
d1a0335b4231 do not register quasi-components, notably cygwin;
wenzelm
parents: 50863
diff changeset
   124
                fi
50790
0088e0805b10 updated makebundles as Admin isabelle tool;
wenzelm
parents: 48190
diff changeset
   125
                ;;
0088e0805b10 updated makebundles as Admin isabelle tool;
wenzelm
parents: 48190
diff changeset
   126
            esac
0088e0805b10 updated makebundles as Admin isabelle tool;
wenzelm
parents: 48190
diff changeset
   127
            ;;
0088e0805b10 updated makebundles as Admin isabelle tool;
wenzelm
parents: 48190
diff changeset
   128
        esac
0088e0805b10 updated makebundles as Admin isabelle tool;
wenzelm
parents: 48190
diff changeset
   129
      done
0088e0805b10 updated makebundles as Admin isabelle tool;
wenzelm
parents: 48190
diff changeset
   130
    } < "$CATALOG_FILE"
33907
473f859e1c29 re-package Isabelle distribution with add-on components;
wenzelm
parents:
diff changeset
   131
  fi
473f859e1c29 re-package Isabelle distribution with add-on components;
wenzelm
parents:
diff changeset
   132
done
473f859e1c29 re-package Isabelle distribution with add-on components;
wenzelm
parents:
diff changeset
   133
47742
316c67657fd3 move polyml within Cygwin /usr/local to simplify its rebasing;
wenzelm
parents: 47723
diff changeset
   134
52501
e4f668f258a1 postinstall: recover Cygwin permissions;
wenzelm
parents: 51064
diff changeset
   135
# purge other platforms
e4f668f258a1 postinstall: recover Cygwin permissions;
wenzelm
parents: 51064
diff changeset
   136
e4f668f258a1 postinstall: recover Cygwin permissions;
wenzelm
parents: 51064
diff changeset
   137
function purge_contrib
e4f668f258a1 postinstall: recover Cygwin permissions;
wenzelm
parents: 51064
diff changeset
   138
{
e4f668f258a1 postinstall: recover Cygwin permissions;
wenzelm
parents: 51064
diff changeset
   139
  (
e4f668f258a1 postinstall: recover Cygwin permissions;
wenzelm
parents: 51064
diff changeset
   140
    cd "$ISABELLE_TARGET"
e4f668f258a1 postinstall: recover Cygwin permissions;
wenzelm
parents: 51064
diff changeset
   141
    for DIR in $(eval find contrib "$@" | sort)
e4f668f258a1 postinstall: recover Cygwin permissions;
wenzelm
parents: 51064
diff changeset
   142
    do
e4f668f258a1 postinstall: recover Cygwin permissions;
wenzelm
parents: 51064
diff changeset
   143
      echo "removing $DIR"
e4f668f258a1 postinstall: recover Cygwin permissions;
wenzelm
parents: 51064
diff changeset
   144
      rm -rf "$DIR"
e4f668f258a1 postinstall: recover Cygwin permissions;
wenzelm
parents: 51064
diff changeset
   145
    done
e4f668f258a1 postinstall: recover Cygwin permissions;
wenzelm
parents: 51064
diff changeset
   146
  )
e4f668f258a1 postinstall: recover Cygwin permissions;
wenzelm
parents: 51064
diff changeset
   147
}
e4f668f258a1 postinstall: recover Cygwin permissions;
wenzelm
parents: 51064
diff changeset
   148
e4f668f258a1 postinstall: recover Cygwin permissions;
wenzelm
parents: 51064
diff changeset
   149
53483
74a4685a96c8 generate application based on $JEDIT_JAVA_OPTIONS $JEDIT_SYSTEM_OPTIONS at build time (see also src/Tools/jEdit/lib/Tools/jedit);
wenzelm
parents: 53473
diff changeset
   150
# platform-specific setup (inside archive)
47833
12cb7b5d4b77 more windows-friendly presentation of main text files;
wenzelm
parents: 47760
diff changeset
   151
50790
0088e0805b10 updated makebundles as Admin isabelle tool;
wenzelm
parents: 48190
diff changeset
   152
case "$PLATFORM_FAMILY" in
0088e0805b10 updated makebundles as Admin isabelle tool;
wenzelm
parents: 48190
diff changeset
   153
  linux)
52501
e4f668f258a1 postinstall: recover Cygwin permissions;
wenzelm
parents: 51064
diff changeset
   154
    purge_contrib '-name "x86*-darwin" -o -name "x86*-cygwin" -o -name "x86*-windows"'
53581
c0ad478abf50 generate distribution classpath for cold-start application wrappers;
wenzelm
parents: 53489
diff changeset
   155
c0ad478abf50 generate distribution classpath for cold-start application wrappers;
wenzelm
parents: 53489
diff changeset
   156
    LINUX_CLASSPATH=""
c0ad478abf50 generate distribution classpath for cold-start application wrappers;
wenzelm
parents: 53489
diff changeset
   157
    for ENTRY in "${DISTRIBITION_CLASSPATH[@]}"
c0ad478abf50 generate distribution classpath for cold-start application wrappers;
wenzelm
parents: 53489
diff changeset
   158
    do
c0ad478abf50 generate distribution classpath for cold-start application wrappers;
wenzelm
parents: 53489
diff changeset
   159
      if [ -z "$LINUX_CLASSPATH" ]; then
c0ad478abf50 generate distribution classpath for cold-start application wrappers;
wenzelm
parents: 53489
diff changeset
   160
        LINUX_CLASSPATH="\\\$ISABELLE_HOME/$ENTRY"
c0ad478abf50 generate distribution classpath for cold-start application wrappers;
wenzelm
parents: 53489
diff changeset
   161
      else
c0ad478abf50 generate distribution classpath for cold-start application wrappers;
wenzelm
parents: 53489
diff changeset
   162
        LINUX_CLASSPATH="$LINUX_CLASSPATH:\\\$ISABELLE_HOME/$ENTRY"
c0ad478abf50 generate distribution classpath for cold-start application wrappers;
wenzelm
parents: 53489
diff changeset
   163
      fi
c0ad478abf50 generate distribution classpath for cold-start application wrappers;
wenzelm
parents: 53489
diff changeset
   164
    done
53483
74a4685a96c8 generate application based on $JEDIT_JAVA_OPTIONS $JEDIT_SYSTEM_OPTIONS at build time (see also src/Tools/jEdit/lib/Tools/jedit);
wenzelm
parents: 53473
diff changeset
   165
    cat "$ISABELLE_HOME/Admin/Linux/Isabelle" | \
53581
c0ad478abf50 generate distribution classpath for cold-start application wrappers;
wenzelm
parents: 53489
diff changeset
   166
      perl -p > "$ISABELLE_TARGET/$ISABELLE_NAME" \
c0ad478abf50 generate distribution classpath for cold-start application wrappers;
wenzelm
parents: 53489
diff changeset
   167
        -e "s,{JAVA_ARGS},$JEDIT_JAVA_OPTIONS $JEDIT_SYSTEM_OPTIONS,g; s,{CLASSPATH},$LINUX_CLASSPATH,;"
53463
7863f4b3b73b generate application wrapper for Linux;
wenzelm
parents: 53421
diff changeset
   168
    chmod +x "$ISABELLE_TARGET/$ISABELLE_NAME"
44951
3aa3aeb4980f specific bundle for x86_64-linux, which is especially important for JRE due to its extra library dependencies;
wenzelm
parents: 44807
diff changeset
   169
    ;;
50790
0088e0805b10 updated makebundles as Admin isabelle tool;
wenzelm
parents: 48190
diff changeset
   170
  macos)
52501
e4f668f258a1 postinstall: recover Cygwin permissions;
wenzelm
parents: 51064
diff changeset
   171
    purge_contrib '-name "x86*-linux" -o -name "x86*-cygwin" -o -name "x86*-windows"'
52677
2b446d507296 fully-automated packaging (requires Mac OS X);
wenzelm
parents: 52674
diff changeset
   172
    mv "$ISABELLE_TARGET/contrib/macos_app" "$TMP/."
50798
0ddc85dae1d5 purge other platforms uniformly;
wenzelm
parents: 50794
diff changeset
   173
44807
44db3e309060 platform-specific look and feel;
wenzelm
parents: 41650
diff changeset
   174
    perl -pi -e "s,lookAndFeel=.*,lookAndFeel=com.apple.laf.AquaLookAndFeel,g;" \
44964
23dbab7f8cf4 tweak keyboard shortcuts for Mac OS X;
wenzelm
parents: 44951
diff changeset
   175
      -e "s,delete-line.shortcut=.*,delete-line.shortcut=C+d,g;" \
23dbab7f8cf4 tweak keyboard shortcuts for Mac OS X;
wenzelm
parents: 44951
diff changeset
   176
      -e "s,delete.shortcut2=.*,delete.shortcut2=A+d,g;" \
53463
7863f4b3b73b generate application wrapper for Linux;
wenzelm
parents: 53421
diff changeset
   177
      "$ISABELLE_TARGET/src/Tools/jEdit/dist/properties/jEdit.props"
44807
44db3e309060 platform-specific look and feel;
wenzelm
parents: 41650
diff changeset
   178
    ;;
50790
0088e0805b10 updated makebundles as Admin isabelle tool;
wenzelm
parents: 48190
diff changeset
   179
  windows)
52501
e4f668f258a1 postinstall: recover Cygwin permissions;
wenzelm
parents: 51064
diff changeset
   180
    purge_contrib '-name "x86*-linux" -o -name "x86*-darwin"'
52677
2b446d507296 fully-automated packaging (requires Mac OS X);
wenzelm
parents: 52674
diff changeset
   181
    mv "$ISABELLE_TARGET/contrib/windows_app" "$TMP/."
50790
0088e0805b10 updated makebundles as Admin isabelle tool;
wenzelm
parents: 48190
diff changeset
   182
44807
44db3e309060 platform-specific look and feel;
wenzelm
parents: 41650
diff changeset
   183
    perl -pi -e "s,lookAndFeel=.*,lookAndFeel=com.sun.java.swing.plaf.windows.WindowsLookAndFeel,g;" \
53463
7863f4b3b73b generate application wrapper for Linux;
wenzelm
parents: 53421
diff changeset
   184
      "$ISABELLE_TARGET/src/Tools/jEdit/dist/properties/jEdit.props"
50790
0088e0805b10 updated makebundles as Admin isabelle tool;
wenzelm
parents: 48190
diff changeset
   185
53484
1100982a071c generate application ini based on $ISABELLE_JAVA_SYSTEM_OPTIONS $JEDIT_JAVA_OPTIONS $JEDIT_SYSTEM_OPTIONS at build time (see also lib/Tools/java and src/Tools/jEdit/lib/Tools/jedit);
wenzelm
parents: 53483
diff changeset
   186
    (
1100982a071c generate application ini based on $ISABELLE_JAVA_SYSTEM_OPTIONS $JEDIT_JAVA_OPTIONS $JEDIT_SYSTEM_OPTIONS at build time (see also lib/Tools/java and src/Tools/jEdit/lib/Tools/jedit);
wenzelm
parents: 53483
diff changeset
   187
      cat "$ISABELLE_HOME/Admin/Windows/WinRun4J/Isabelle.ini"
53581
c0ad478abf50 generate distribution classpath for cold-start application wrappers;
wenzelm
parents: 53489
diff changeset
   188
53484
1100982a071c generate application ini based on $ISABELLE_JAVA_SYSTEM_OPTIONS $JEDIT_JAVA_OPTIONS $JEDIT_SYSTEM_OPTIONS at build time (see also lib/Tools/java and src/Tools/jEdit/lib/Tools/jedit);
wenzelm
parents: 53483
diff changeset
   189
      declare -a JAVA_ARGS=()
1100982a071c generate application ini based on $ISABELLE_JAVA_SYSTEM_OPTIONS $JEDIT_JAVA_OPTIONS $JEDIT_SYSTEM_OPTIONS at build time (see also lib/Tools/java and src/Tools/jEdit/lib/Tools/jedit);
wenzelm
parents: 53483
diff changeset
   190
      eval "JAVA_ARGS=($ISABELLE_JAVA_SYSTEM_OPTIONS $JEDIT_JAVA_OPTIONS $JEDIT_SYSTEM_OPTIONS)"
1100982a071c generate application ini based on $ISABELLE_JAVA_SYSTEM_OPTIONS $JEDIT_JAVA_OPTIONS $JEDIT_SYSTEM_OPTIONS at build time (see also lib/Tools/java and src/Tools/jEdit/lib/Tools/jedit);
wenzelm
parents: 53483
diff changeset
   191
      A=2
1100982a071c generate application ini based on $ISABELLE_JAVA_SYSTEM_OPTIONS $JEDIT_JAVA_OPTIONS $JEDIT_SYSTEM_OPTIONS at build time (see also lib/Tools/java and src/Tools/jEdit/lib/Tools/jedit);
wenzelm
parents: 53483
diff changeset
   192
      for ARG in "${JAVA_ARGS[@]}"
1100982a071c generate application ini based on $ISABELLE_JAVA_SYSTEM_OPTIONS $JEDIT_JAVA_OPTIONS $JEDIT_SYSTEM_OPTIONS at build time (see also lib/Tools/java and src/Tools/jEdit/lib/Tools/jedit);
wenzelm
parents: 53483
diff changeset
   193
      do
1100982a071c generate application ini based on $ISABELLE_JAVA_SYSTEM_OPTIONS $JEDIT_JAVA_OPTIONS $JEDIT_SYSTEM_OPTIONS at build time (see also lib/Tools/java and src/Tools/jEdit/lib/Tools/jedit);
wenzelm
parents: 53483
diff changeset
   194
        echo -e "vmarg.$A=$ARG\r"
1100982a071c generate application ini based on $ISABELLE_JAVA_SYSTEM_OPTIONS $JEDIT_JAVA_OPTIONS $JEDIT_SYSTEM_OPTIONS at build time (see also lib/Tools/java and src/Tools/jEdit/lib/Tools/jedit);
wenzelm
parents: 53483
diff changeset
   195
        A=$[ $A + 1 ]
1100982a071c generate application ini based on $ISABELLE_JAVA_SYSTEM_OPTIONS $JEDIT_JAVA_OPTIONS $JEDIT_SYSTEM_OPTIONS at build time (see also lib/Tools/java and src/Tools/jEdit/lib/Tools/jedit);
wenzelm
parents: 53483
diff changeset
   196
      done
53581
c0ad478abf50 generate distribution classpath for cold-start application wrappers;
wenzelm
parents: 53489
diff changeset
   197
c0ad478abf50 generate distribution classpath for cold-start application wrappers;
wenzelm
parents: 53489
diff changeset
   198
      A=1
c0ad478abf50 generate distribution classpath for cold-start application wrappers;
wenzelm
parents: 53489
diff changeset
   199
      for ENTRY in "${DISTRIBITION_CLASSPATH[@]}"
c0ad478abf50 generate distribution classpath for cold-start application wrappers;
wenzelm
parents: 53489
diff changeset
   200
      do
c0ad478abf50 generate distribution classpath for cold-start application wrappers;
wenzelm
parents: 53489
diff changeset
   201
        ENTRY=$(echo "$ENTRY" | perl -p -e 's,/,\\\\,g;')
c0ad478abf50 generate distribution classpath for cold-start application wrappers;
wenzelm
parents: 53489
diff changeset
   202
        echo -e "classpath.$A=$ENTRY\r"
c0ad478abf50 generate distribution classpath for cold-start application wrappers;
wenzelm
parents: 53489
diff changeset
   203
        A=$[ $A + 1 ]
c0ad478abf50 generate distribution classpath for cold-start application wrappers;
wenzelm
parents: 53489
diff changeset
   204
      done
53484
1100982a071c generate application ini based on $ISABELLE_JAVA_SYSTEM_OPTIONS $JEDIT_JAVA_OPTIONS $JEDIT_SYSTEM_OPTIONS at build time (see also lib/Tools/java and src/Tools/jEdit/lib/Tools/jedit);
wenzelm
parents: 53483
diff changeset
   205
    ) > "$ISABELLE_TARGET/${ISABELLE_NAME}.ini"
1100982a071c generate application ini based on $ISABELLE_JAVA_SYSTEM_OPTIONS $JEDIT_JAVA_OPTIONS $JEDIT_SYSTEM_OPTIONS at build time (see also lib/Tools/java and src/Tools/jEdit/lib/Tools/jedit);
wenzelm
parents: 53483
diff changeset
   206
52670
57a00f274130 build Windows application on the spot, using Unix tools;
wenzelm
parents: 52668
diff changeset
   207
    cp "$TMP/windows_app/Isabelle.exe" "$ISABELLE_TARGET/${ISABELLE_NAME}.exe"
53473
28ba604926f1 more official lib/logo/isabelle.bmp;
wenzelm
parents: 53472
diff changeset
   208
    cp "$ISABELLE_HOME/Admin/Windows/Cygwin/Cygwin-Setup.bat" \
50961
d64bc889f7d6 copy Cygwin-Latex-Setup.bat;
wenzelm
parents: 50899
diff changeset
   209
      "$ISABELLE_HOME/Admin/Windows/Cygwin/Cygwin-Latex-Setup.bat" \
50810
76967aa4fe84 outermost directory structure for Windows/Cygwin;
wenzelm
parents: 50798
diff changeset
   210
      "$ISABELLE_HOME/Admin/Windows/Cygwin/Cygwin-Terminal.bat" "$ISABELLE_TARGET"
50790
0088e0805b10 updated makebundles as Admin isabelle tool;
wenzelm
parents: 48190
diff changeset
   211
52501
e4f668f258a1 postinstall: recover Cygwin permissions;
wenzelm
parents: 51064
diff changeset
   212
    (
e4f668f258a1 postinstall: recover Cygwin permissions;
wenzelm
parents: 51064
diff changeset
   213
      cd "$ISABELLE_TARGET"
e4f668f258a1 postinstall: recover Cygwin permissions;
wenzelm
parents: 51064
diff changeset
   214
52670
57a00f274130 build Windows application on the spot, using Unix tools;
wenzelm
parents: 52668
diff changeset
   215
      for NAME in postinstall rebaseall
52501
e4f668f258a1 postinstall: recover Cygwin permissions;
wenzelm
parents: 51064
diff changeset
   216
      do
e4f668f258a1 postinstall: recover Cygwin permissions;
wenzelm
parents: 51064
diff changeset
   217
        cp -a "$ISABELLE_HOME/Admin/Windows/Cygwin/isabelle/$NAME" \
e4f668f258a1 postinstall: recover Cygwin permissions;
wenzelm
parents: 51064
diff changeset
   218
          "contrib/cygwin/isabelle/."
e4f668f258a1 postinstall: recover Cygwin permissions;
wenzelm
parents: 51064
diff changeset
   219
      done
e4f668f258a1 postinstall: recover Cygwin permissions;
wenzelm
parents: 51064
diff changeset
   220
52561
722d65595e8e allow whitespace in file names;
wenzelm
parents: 52542
diff changeset
   221
      find . -type f -not -name '*.exe' -not -name '*.dll' -perm +100 \
722d65595e8e allow whitespace in file names;
wenzelm
parents: 52542
diff changeset
   222
        -print0 > "contrib/cygwin/isabelle/executables"
52501
e4f668f258a1 postinstall: recover Cygwin permissions;
wenzelm
parents: 51064
diff changeset
   223
52668
a467a6b4376c produce 7z archive for windows and preserve symlinks separately;
wenzelm
parents: 52561
diff changeset
   224
      find . -type l -exec echo "{}" ";" -exec readlink "{}" ";" \
a467a6b4376c produce 7z archive for windows and preserve symlinks separately;
wenzelm
parents: 52561
diff changeset
   225
        > "contrib/cygwin/isabelle/symlinks"
53421
8e729ecd5b0c provide file indicator;
wenzelm
parents: 53418
diff changeset
   226
8e729ecd5b0c provide file indicator;
wenzelm
parents: 53418
diff changeset
   227
      touch "contrib/cygwin/isabelle/uninitialized"
52501
e4f668f258a1 postinstall: recover Cygwin permissions;
wenzelm
parents: 51064
diff changeset
   228
    )
50892
9a7d81d66d09 include /isabelle/rebaseall in autorebaseall, which is run after installation of further packages;
wenzelm
parents: 50891
diff changeset
   229
9a7d81d66d09 include /isabelle/rebaseall in autorebaseall, which is run after installation of further packages;
wenzelm
parents: 50891
diff changeset
   230
    perl -pi -e "s,/bin/rebaseall.*,/isabelle/rebaseall,g;" \
9a7d81d66d09 include /isabelle/rebaseall in autorebaseall, which is run after installation of further packages;
wenzelm
parents: 50891
diff changeset
   231
      "$ISABELLE_TARGET/contrib/cygwin/etc/postinstall/autorebase.bat.done"
9a7d81d66d09 include /isabelle/rebaseall in autorebaseall, which is run after installation of further packages;
wenzelm
parents: 50891
diff changeset
   232
41627
0040e0ea02e7 delete compiled .elc files to improve portability on Linux, notably for GNU Emacs 23.1.x instead of 23.2.x;
wenzelm
parents: 41611
diff changeset
   233
    ;;
0040e0ea02e7 delete compiled .elc files to improve portability on Linux, notably for GNU Emacs 23.1.x instead of 23.2.x;
wenzelm
parents: 41611
diff changeset
   234
  *)
0040e0ea02e7 delete compiled .elc files to improve portability on Linux, notably for GNU Emacs 23.1.x instead of 23.2.x;
wenzelm
parents: 41611
diff changeset
   235
    ;;
0040e0ea02e7 delete compiled .elc files to improve portability on Linux, notably for GNU Emacs 23.1.x instead of 23.2.x;
wenzelm
parents: 41611
diff changeset
   236
esac
41611
f23ce44fbaec Cygwin: back to ProofGeneral-3.7.1.1 with XEmacs, since PG 4.x with GNU Emacs 23 is painfully slow;
wenzelm
parents: 41555
diff changeset
   237
50798
0ddc85dae1d5 purge other platforms uniformly;
wenzelm
parents: 50794
diff changeset
   238
0ddc85dae1d5 purge other platforms uniformly;
wenzelm
parents: 50794
diff changeset
   239
# archive
0ddc85dae1d5 purge other platforms uniformly;
wenzelm
parents: 50794
diff changeset
   240
0ddc85dae1d5 purge other platforms uniformly;
wenzelm
parents: 50794
diff changeset
   241
BUNDLE_ARCHIVE="${ARCHIVE_DIR}/${ISABELLE_NAME}_${PLATFORM_FAMILY}.tar.gz"
37315
af2adf0ae97d one all-inclusive bundle for each platform;
wenzelm
parents: 33907
diff changeset
   242
50790
0088e0805b10 updated makebundles as Admin isabelle tool;
wenzelm
parents: 48190
diff changeset
   243
echo "packaging $(basename "$BUNDLE_ARCHIVE")"
50899
506ff6abfde0 grand-unified Admin/Release/build script (excluding .app and .exe);
wenzelm
parents: 50892
diff changeset
   244
tar -C "$TMP" -c -z -f "$BUNDLE_ARCHIVE" "$ISABELLE_NAME" || exit 2
33907
473f859e1c29 re-package Isabelle distribution with add-on components;
wenzelm
parents:
diff changeset
   245
52670
57a00f274130 build Windows application on the spot, using Unix tools;
wenzelm
parents: 52668
diff changeset
   246
53483
74a4685a96c8 generate application based on $JEDIT_JAVA_OPTIONS $JEDIT_SYSTEM_OPTIONS at build time (see also src/Tools/jEdit/lib/Tools/jedit);
wenzelm
parents: 53473
diff changeset
   247
# platform-specific setup (outside archive)
52670
57a00f274130 build Windows application on the spot, using Unix tools;
wenzelm
parents: 52668
diff changeset
   248
52677
2b446d507296 fully-automated packaging (requires Mac OS X);
wenzelm
parents: 52674
diff changeset
   249
if [ "$ISABELLE_PLATFORM_FAMILY" = linux -a "$PLATFORM_FAMILY" != macos -o "$ISABELLE_PLATFORM_FAMILY" = macos ]
52668
a467a6b4376c produce 7z archive for windows and preserve symlinks separately;
wenzelm
parents: 52561
diff changeset
   250
then
52677
2b446d507296 fully-automated packaging (requires Mac OS X);
wenzelm
parents: 52674
diff changeset
   251
  case "$PLATFORM_FAMILY" in
2b446d507296 fully-automated packaging (requires Mac OS X);
wenzelm
parents: 52674
diff changeset
   252
    macos)
52670
57a00f274130 build Windows application on the spot, using Unix tools;
wenzelm
parents: 52668
diff changeset
   253
      echo "application for $PLATFORM_FAMILY"
57a00f274130 build Windows application on the spot, using Unix tools;
wenzelm
parents: 52668
diff changeset
   254
      (
52677
2b446d507296 fully-automated packaging (requires Mac OS X);
wenzelm
parents: 52674
diff changeset
   255
        cd "$TMP"
2b446d507296 fully-automated packaging (requires Mac OS X);
wenzelm
parents: 52674
diff changeset
   256
2b446d507296 fully-automated packaging (requires Mac OS X);
wenzelm
parents: 52674
diff changeset
   257
        APP_TEMPLATE="$ISABELLE_HOME/Admin/MacOS/App3"
2b446d507296 fully-automated packaging (requires Mac OS X);
wenzelm
parents: 52674
diff changeset
   258
        APP="${ISABELLE_NAME}.app"
2b446d507296 fully-automated packaging (requires Mac OS X);
wenzelm
parents: 52674
diff changeset
   259
2b446d507296 fully-automated packaging (requires Mac OS X);
wenzelm
parents: 52674
diff changeset
   260
        for NAME in Java MacOS PlugIns Resources
2b446d507296 fully-automated packaging (requires Mac OS X);
wenzelm
parents: 52674
diff changeset
   261
        do
2b446d507296 fully-automated packaging (requires Mac OS X);
wenzelm
parents: 52674
diff changeset
   262
          mkdir -p "$APP/Contents/$NAME"
2b446d507296 fully-automated packaging (requires Mac OS X);
wenzelm
parents: 52674
diff changeset
   263
        done
2b446d507296 fully-automated packaging (requires Mac OS X);
wenzelm
parents: 52674
diff changeset
   264
53488
009d3bcf6907 generate application Info.plist based on $ISABELLE_JAVA_SYSTEM_OPTIONS $JEDIT_JAVA_OPTIONS $JEDIT_SYSTEM_OPTIONS at build time (see also lib/Tools/java and src/Tools/jEdit/lib/Tools/jedit);
wenzelm
parents: 53485
diff changeset
   265
        (
009d3bcf6907 generate application Info.plist based on $ISABELLE_JAVA_SYSTEM_OPTIONS $JEDIT_JAVA_OPTIONS $JEDIT_SYSTEM_OPTIONS at build time (see also lib/Tools/java and src/Tools/jEdit/lib/Tools/jedit);
wenzelm
parents: 53485
diff changeset
   266
          cat "$APP_TEMPLATE/Info.plist-part1"
009d3bcf6907 generate application Info.plist based on $ISABELLE_JAVA_SYSTEM_OPTIONS $JEDIT_JAVA_OPTIONS $JEDIT_SYSTEM_OPTIONS at build time (see also lib/Tools/java and src/Tools/jEdit/lib/Tools/jedit);
wenzelm
parents: 53485
diff changeset
   267
009d3bcf6907 generate application Info.plist based on $ISABELLE_JAVA_SYSTEM_OPTIONS $JEDIT_JAVA_OPTIONS $JEDIT_SYSTEM_OPTIONS at build time (see also lib/Tools/java and src/Tools/jEdit/lib/Tools/jedit);
wenzelm
parents: 53485
diff changeset
   268
          declare -a OPTIONS=()
009d3bcf6907 generate application Info.plist based on $ISABELLE_JAVA_SYSTEM_OPTIONS $JEDIT_JAVA_OPTIONS $JEDIT_SYSTEM_OPTIONS at build time (see also lib/Tools/java and src/Tools/jEdit/lib/Tools/jedit);
wenzelm
parents: 53485
diff changeset
   269
          eval "OPTIONS=($ISABELLE_JAVA_SYSTEM_OPTIONS $JEDIT_JAVA_OPTIONS $JEDIT_SYSTEM_OPTIONS)"
009d3bcf6907 generate application Info.plist based on $ISABELLE_JAVA_SYSTEM_OPTIONS $JEDIT_JAVA_OPTIONS $JEDIT_SYSTEM_OPTIONS at build time (see also lib/Tools/java and src/Tools/jEdit/lib/Tools/jedit);
wenzelm
parents: 53485
diff changeset
   270
          for OPT in "${OPTIONS[@]}"
009d3bcf6907 generate application Info.plist based on $ISABELLE_JAVA_SYSTEM_OPTIONS $JEDIT_JAVA_OPTIONS $JEDIT_SYSTEM_OPTIONS at build time (see also lib/Tools/java and src/Tools/jEdit/lib/Tools/jedit);
wenzelm
parents: 53485
diff changeset
   271
          do
009d3bcf6907 generate application Info.plist based on $ISABELLE_JAVA_SYSTEM_OPTIONS $JEDIT_JAVA_OPTIONS $JEDIT_SYSTEM_OPTIONS at build time (see also lib/Tools/java and src/Tools/jEdit/lib/Tools/jedit);
wenzelm
parents: 53485
diff changeset
   272
            echo "<string>$OPT</string>"
009d3bcf6907 generate application Info.plist based on $ISABELLE_JAVA_SYSTEM_OPTIONS $JEDIT_JAVA_OPTIONS $JEDIT_SYSTEM_OPTIONS at build time (see also lib/Tools/java and src/Tools/jEdit/lib/Tools/jedit);
wenzelm
parents: 53485
diff changeset
   273
          done
53489
97222a86aec0 proper apple.awt.application.name for Java 7;
wenzelm
parents: 53488
diff changeset
   274
          echo "<string>-Dapple.awt.application.name={ISABELLE_NAME}</string>"
53488
009d3bcf6907 generate application Info.plist based on $ISABELLE_JAVA_SYSTEM_OPTIONS $JEDIT_JAVA_OPTIONS $JEDIT_SYSTEM_OPTIONS at build time (see also lib/Tools/java and src/Tools/jEdit/lib/Tools/jedit);
wenzelm
parents: 53485
diff changeset
   275
009d3bcf6907 generate application Info.plist based on $ISABELLE_JAVA_SYSTEM_OPTIONS $JEDIT_JAVA_OPTIONS $JEDIT_SYSTEM_OPTIONS at build time (see also lib/Tools/java and src/Tools/jEdit/lib/Tools/jedit);
wenzelm
parents: 53485
diff changeset
   276
          cat "$APP_TEMPLATE/Info.plist-part2"
009d3bcf6907 generate application Info.plist based on $ISABELLE_JAVA_SYSTEM_OPTIONS $JEDIT_JAVA_OPTIONS $JEDIT_SYSTEM_OPTIONS at build time (see also lib/Tools/java and src/Tools/jEdit/lib/Tools/jedit);
wenzelm
parents: 53485
diff changeset
   277
        ) | perl -p -e "s,{ISABELLE_NAME},${ISABELLE_NAME},g;" > "$APP/Contents/Info.plist"
52677
2b446d507296 fully-automated packaging (requires Mac OS X);
wenzelm
parents: 52674
diff changeset
   278
53581
c0ad478abf50 generate distribution classpath for cold-start application wrappers;
wenzelm
parents: 53489
diff changeset
   279
        for ENTRY in "${DISTRIBITION_CLASSPATH[@]}"
52677
2b446d507296 fully-automated packaging (requires Mac OS X);
wenzelm
parents: 52674
diff changeset
   280
        do
53581
c0ad478abf50 generate distribution classpath for cold-start application wrappers;
wenzelm
parents: 53489
diff changeset
   281
          ln -sf "../Resources/${ISABELLE_NAME}/$ENTRY" "$APP/Contents/Java"
52677
2b446d507296 fully-automated packaging (requires Mac OS X);
wenzelm
parents: 52674
diff changeset
   282
        done
2b446d507296 fully-automated packaging (requires Mac OS X);
wenzelm
parents: 52674
diff changeset
   283
2b446d507296 fully-automated packaging (requires Mac OS X);
wenzelm
parents: 52674
diff changeset
   284
        cp -R "$APP_TEMPLATE/Resources/." "$APP/Contents/Resources/."
2b446d507296 fully-automated packaging (requires Mac OS X);
wenzelm
parents: 52674
diff changeset
   285
        cp "$APP_TEMPLATE/../isabelle.icns" "$APP/Contents/Resources/."
2b446d507296 fully-automated packaging (requires Mac OS X);
wenzelm
parents: 52674
diff changeset
   286
53418
d47a7cebe6b2 standardize jdk name;
wenzelm
parents: 52678
diff changeset
   287
        ln -sf "../Resources/${ISABELLE_NAME}/contrib/jdk/x86_64-darwin" \
52677
2b446d507296 fully-automated packaging (requires Mac OS X);
wenzelm
parents: 52674
diff changeset
   288
          "$APP/Contents/PlugIns/jdk"
2b446d507296 fully-automated packaging (requires Mac OS X);
wenzelm
parents: 52674
diff changeset
   289
2b446d507296 fully-automated packaging (requires Mac OS X);
wenzelm
parents: 52674
diff changeset
   290
        cp macos_app/JavaAppLauncher "$APP/Contents/MacOS/." && \
2b446d507296 fully-automated packaging (requires Mac OS X);
wenzelm
parents: 52674
diff changeset
   291
          chmod +x "$APP/Contents/MacOS/JavaAppLauncher"
2b446d507296 fully-automated packaging (requires Mac OS X);
wenzelm
parents: 52674
diff changeset
   292
2b446d507296 fully-automated packaging (requires Mac OS X);
wenzelm
parents: 52674
diff changeset
   293
        mv "$ISABELLE_NAME" "$APP/Contents/Resources/."
2b446d507296 fully-automated packaging (requires Mac OS X);
wenzelm
parents: 52674
diff changeset
   294
        ln -sf "Contents/Resources/$ISABELLE_NAME" "$APP/Isabelle"
2b446d507296 fully-automated packaging (requires Mac OS X);
wenzelm
parents: 52674
diff changeset
   295
52678
9bc073ea478a overwrite target;
wenzelm
parents: 52677
diff changeset
   296
        rm -f "${ARCHIVE_DIR}/${ISABELLE_NAME}.dmg"
52677
2b446d507296 fully-automated packaging (requires Mac OS X);
wenzelm
parents: 52674
diff changeset
   297
        hdiutil create -srcfolder "$APP" "${ARCHIVE_DIR}/${ISABELLE_NAME}.dmg"
2b446d507296 fully-automated packaging (requires Mac OS X);
wenzelm
parents: 52674
diff changeset
   298
      )
2b446d507296 fully-automated packaging (requires Mac OS X);
wenzelm
parents: 52674
diff changeset
   299
      ;;
2b446d507296 fully-automated packaging (requires Mac OS X);
wenzelm
parents: 52674
diff changeset
   300
    windows)
2b446d507296 fully-automated packaging (requires Mac OS X);
wenzelm
parents: 52674
diff changeset
   301
      (
2b446d507296 fully-automated packaging (requires Mac OS X);
wenzelm
parents: 52674
diff changeset
   302
        cd "$TMP"
2b446d507296 fully-automated packaging (requires Mac OS X);
wenzelm
parents: 52674
diff changeset
   303
        rm -f "${ARCHIVE_DIR}/${ISABELLE_NAME}.7z"
2b446d507296 fully-automated packaging (requires Mac OS X);
wenzelm
parents: 52674
diff changeset
   304
        7z -y -bd a "$TMP/${ISABELLE_NAME}.7z" "$ISABELLE_NAME" || exit 2
2b446d507296 fully-automated packaging (requires Mac OS X);
wenzelm
parents: 52674
diff changeset
   305
2b446d507296 fully-automated packaging (requires Mac OS X);
wenzelm
parents: 52674
diff changeset
   306
        echo "application for $PLATFORM_FAMILY"
2b446d507296 fully-automated packaging (requires Mac OS X);
wenzelm
parents: 52674
diff changeset
   307
        (
2b446d507296 fully-automated packaging (requires Mac OS X);
wenzelm
parents: 52674
diff changeset
   308
          cat "windows_app/7zsd_All.sfx"
2b446d507296 fully-automated packaging (requires Mac OS X);
wenzelm
parents: 52674
diff changeset
   309
          cat "$ISABELLE_HOME/Admin/Windows/Installer/sfx.txt" | \
2b446d507296 fully-automated packaging (requires Mac OS X);
wenzelm
parents: 52674
diff changeset
   310
            perl -p -e "s,{ISABELLE_NAME},${ISABELLE_NAME},g;"
2b446d507296 fully-automated packaging (requires Mac OS X);
wenzelm
parents: 52674
diff changeset
   311
          cat "$TMP/${ISABELLE_NAME}.7z"
2b446d507296 fully-automated packaging (requires Mac OS X);
wenzelm
parents: 52674
diff changeset
   312
        ) > "${ARCHIVE_DIR}/${ISABELLE_NAME}.exe"
2b446d507296 fully-automated packaging (requires Mac OS X);
wenzelm
parents: 52674
diff changeset
   313
        chmod +x "${ARCHIVE_DIR}/${ISABELLE_NAME}.exe"
2b446d507296 fully-automated packaging (requires Mac OS X);
wenzelm
parents: 52674
diff changeset
   314
      )
2b446d507296 fully-automated packaging (requires Mac OS X);
wenzelm
parents: 52674
diff changeset
   315
      ;;
2b446d507296 fully-automated packaging (requires Mac OS X);
wenzelm
parents: 52674
diff changeset
   316
    *)
2b446d507296 fully-automated packaging (requires Mac OS X);
wenzelm
parents: 52674
diff changeset
   317
      ;;
2b446d507296 fully-automated packaging (requires Mac OS X);
wenzelm
parents: 52674
diff changeset
   318
  esac
2b446d507296 fully-automated packaging (requires Mac OS X);
wenzelm
parents: 52674
diff changeset
   319
else
2b446d507296 fully-automated packaging (requires Mac OS X);
wenzelm
parents: 52674
diff changeset
   320
  echo "### Cannot build application for $PLATFORM_FAMILY on $ISABELLE_PLATFORM_FAMILY"
52668
a467a6b4376c produce 7z archive for windows and preserve symlinks separately;
wenzelm
parents: 52561
diff changeset
   321
fi
33907
473f859e1c29 re-package Isabelle distribution with add-on components;
wenzelm
parents:
diff changeset
   322
52677
2b446d507296 fully-automated packaging (requires Mac OS X);
wenzelm
parents: 52674
diff changeset
   323
33907
473f859e1c29 re-package Isabelle distribution with add-on components;
wenzelm
parents:
diff changeset
   324
# clean up
473f859e1c29 re-package Isabelle distribution with add-on components;
wenzelm
parents:
diff changeset
   325
rm -rf "$TMP"