tools/dmg_pkg_install.sh
author sheepluva
Mon, 05 Aug 2019 00:20:45 +0200
changeset 15300 f382ec6dba11
parent 11592 cf83d9cb5590
permissions -rw-r--r--
In hindsight my emscripten-ifdef (70d416a8f63f) is nonsense. As fpcrtl_glShaderSource() would not be defined and lead to compiling issues. So either it's 3 ifdefs (in pas2cRedo, pas2cSystem and misc.c), in order to toggle between fpcrtl_ and the native function, or alternatively have no ifdef for it at all. I'm going with none at all, which means emscripten will compile with the original (const) function prototype, being wrapped by the fpcrtl_ function, same as non-emscripten builds.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
11592
cf83d9cb5590 - Enable CI builds with travis for hw iOS
antonc27 <antonc27@mail.ru>
parents:
diff changeset
     1
#!/bin/bash
cf83d9cb5590 - Enable CI builds with travis for hw iOS
antonc27 <antonc27@mail.ru>
parents:
diff changeset
     2
cf83d9cb5590 - Enable CI builds with travis for hw iOS
antonc27 <antonc27@mail.ru>
parents:
diff changeset
     3
# Downloads and install a .dmg from a URL
cf83d9cb5590 - Enable CI builds with travis for hw iOS
antonc27 <antonc27@mail.ru>
parents:
diff changeset
     4
#
cf83d9cb5590 - Enable CI builds with travis for hw iOS
antonc27 <antonc27@mail.ru>
parents:
diff changeset
     5
# Usage
cf83d9cb5590 - Enable CI builds with travis for hw iOS
antonc27 <antonc27@mail.ru>
parents:
diff changeset
     6
# $ dmg_pkg_install [url]
cf83d9cb5590 - Enable CI builds with travis for hw iOS
antonc27 <antonc27@mail.ru>
parents:
diff changeset
     7
#
cf83d9cb5590 - Enable CI builds with travis for hw iOS
antonc27 <antonc27@mail.ru>
parents:
diff changeset
     8
# Adopted from https://gist.github.com/afgomez/4172338
cf83d9cb5590 - Enable CI builds with travis for hw iOS
antonc27 <antonc27@mail.ru>
parents:
diff changeset
     9
cf83d9cb5590 - Enable CI builds with travis for hw iOS
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    10
cf83d9cb5590 - Enable CI builds with travis for hw iOS
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    11
if [[ $# -lt 1 ]]; then
cf83d9cb5590 - Enable CI builds with travis for hw iOS
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    12
  echo "Usage: dmg_pkg_install [url]"
cf83d9cb5590 - Enable CI builds with travis for hw iOS
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    13
  exit 1
cf83d9cb5590 - Enable CI builds with travis for hw iOS
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    14
fi
cf83d9cb5590 - Enable CI builds with travis for hw iOS
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    15
cf83d9cb5590 - Enable CI builds with travis for hw iOS
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    16
url=$*
cf83d9cb5590 - Enable CI builds with travis for hw iOS
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    17
cf83d9cb5590 - Enable CI builds with travis for hw iOS
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    18
# Generate a random file name
cf83d9cb5590 - Enable CI builds with travis for hw iOS
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    19
tmp_file=/tmp/`openssl rand -base64 10 | tr -dc '[:alnum:]'`.dmg
cf83d9cb5590 - Enable CI builds with travis for hw iOS
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    20
cf83d9cb5590 - Enable CI builds with travis for hw iOS
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    21
# Download file
cf83d9cb5590 - Enable CI builds with travis for hw iOS
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    22
echo "Downloading $url..."
cf83d9cb5590 - Enable CI builds with travis for hw iOS
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    23
curl -# -L -o $tmp_file $url
cf83d9cb5590 - Enable CI builds with travis for hw iOS
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    24
cf83d9cb5590 - Enable CI builds with travis for hw iOS
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    25
echo "Mounting image..."
cf83d9cb5590 - Enable CI builds with travis for hw iOS
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    26
volume=`hdiutil mount $tmp_file | tail -n1 | perl -nle '/(\/Volumes\/[^ ]+)/; print $1'`
cf83d9cb5590 - Enable CI builds with travis for hw iOS
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    27
cf83d9cb5590 - Enable CI builds with travis for hw iOS
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    28
# Locate .pkg
cf83d9cb5590 - Enable CI builds with travis for hw iOS
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    29
app_pkg=`find $volume/. -name *.pkg -maxdepth 1 -print0`
cf83d9cb5590 - Enable CI builds with travis for hw iOS
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    30
echo "Install pkg..."
cf83d9cb5590 - Enable CI builds with travis for hw iOS
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    31
installer -pkg $app_pkg -target /
cf83d9cb5590 - Enable CI builds with travis for hw iOS
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    32
cf83d9cb5590 - Enable CI builds with travis for hw iOS
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    33
# Unmount volume, delete temporal file
cf83d9cb5590 - Enable CI builds with travis for hw iOS
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    34
echo "Cleaning up..."
cf83d9cb5590 - Enable CI builds with travis for hw iOS
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    35
hdiutil unmount $volume -quiet
cf83d9cb5590 - Enable CI builds with travis for hw iOS
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    36
rm $tmp_file
cf83d9cb5590 - Enable CI builds with travis for hw iOS
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    37
cf83d9cb5590 - Enable CI builds with travis for hw iOS
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    38
echo "Done!"
cf83d9cb5590 - Enable CI builds with travis for hw iOS
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    39
exit 0