forked from squeak-smalltalk/squeak-app
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprepare_aio.sh
executable file
·86 lines (76 loc) · 3.81 KB
/
prepare_aio.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
#!/usr/bin/env bash
################################################################################
# PROJECT: Squeak Bundle Generation
# FILE: prepare_aio.sh
# CONTENT: Generate the All-in-One bundle.
#
# AUTHORS: Fabio Niephaus, Hasso Plattner Institute, Potsdam, Germany
# Marcel Taeumel, Hasso Plattner Institute, Potsdam, Germany
################################################################################
travis_fold start aio_bundle "Creating All-in-one bundle for ${TRAVIS_SMALLTALK_VERSION}..."
BUNDLE_NAME_AIO="${IMAGE_NAME}-All-in-One"
APP_NAME="${BUNDLE_NAME_AIO}.app"
APP_DIR="${BUILD_DIR}/${APP_NAME}"
CONTENTS_DIR="${APP_DIR}/Contents"
RESOURCES_DIR="${CONTENTS_DIR}/Resources"
VM_ARM_TARGET="${CONTENTS_DIR}/Linux-ARM"
if [[ "${IMAGE_BITS}" == "64" ]]; then
VM_LIN_TARGET="${CONTENTS_DIR}/Linux-x86_64"
else
VM_LIN_TARGET="${CONTENTS_DIR}/Linux-i686"
fi
VM_MAC_TARGET="${CONTENTS_DIR}/MacOS"
VM_WIN_TARGET="${CONTENTS_DIR}/Win32"
echo "...copying VMs into bundle..."
cp -R "${TMP_DIR}/${VM_MAC}/Squeak.app" "${APP_DIR}"
if is_32bit; then
cp -R "${TMP_DIR}/${VM_ARM6}" "${VM_ARM_TARGET}"
fi
cp -R "${TMP_DIR}/${VM_LIN}" "${VM_LIN_TARGET}"
cp -R "${TMP_DIR}/${VM_WIN}" "${VM_WIN_TARGET}"
copy_resources "${RESOURCES_DIR}"
echo "...merging template..."
cp "${AIO_TEMPLATE_DIR}/squeak.bat" "${BUILD_DIR}/"
cp "${AIO_TEMPLATE_DIR}/squeak.sh" "${BUILD_DIR}/"
cp -R "${AIO_TEMPLATE_DIR}/Squeak.app/Contents/Library" "${CONTENTS_DIR}/"
cp "${AIO_TEMPLATE_DIR}/Squeak.app/Contents/Info.plist" "${CONTENTS_DIR}/"
cp "${ICONS_DIR}/${SMALLTALK_NAME}"*.icns "${RESOURCES_DIR}/"
ENGLISH_DIR="${AIO_TEMPLATE_DIR}/Squeak.app/Contents/Resources/English.lproj"
if ! is_Squeak_50; then
rm -rf "${RESOURCES_DIR}/English.lproj/MainMenu.nib"
cp -R "${ENGLISH_DIR}/MainMenu.nib" "${RESOURCES_DIR}/English.lproj/MainMenu.nib"
cp "${ENGLISH_DIR}/Credits.rtf" "${RESOURCES_DIR}/English.lproj/"
fi
cp "${AIO_TEMPLATE_DIR}/Squeak.app/Contents/Win32/Squeak.ini" "${VM_WIN_TARGET}/"
echo "...setting permissions..."
chmod +x "${VM_LIN_TARGET}/squeak" "${VM_MAC_TARGET}/Squeak" "${VM_WIN_TARGET}/Squeak.exe" \
"${BUILD_DIR}/squeak.sh" "${BUILD_DIR}/squeak.bat"
echo "...applying various templates (squeak.sh, Info.plist, etc)..."
# squeak.bat launcher
sed -i ".bak" "s/%APP_NAME%/${APP_NAME}/g" "${BUILD_DIR}/squeak.bat"
sed -i ".bak" "s/%SqueakImageName%/${IMAGE_NAME}.image/g" "${BUILD_DIR}/squeak.bat"
rm -f "${BUILD_DIR}/squeak.bat.bak"
# squeak.sh launcher
sed -i ".bak" "s/%APP_NAME%/${APP_NAME}/g" "${BUILD_DIR}/squeak.sh"
sed -i ".bak" "s/%SqueakImageName%/${IMAGE_NAME}.image/g" "${BUILD_DIR}/squeak.sh"
sed -i ".bak" "s/%IMAGE_BITS%/${IMAGE_BITS}/g" "${BUILD_DIR}/squeak.sh"
rm -f "${BUILD_DIR}/squeak.sh.bak"
# Info.plist
sed -i ".bak" "s/%SmalltalkName%/${SMALLTALK_NAME}/g" "${CONTENTS_DIR}/Info.plist"
sed -i ".bak" "s/%CFBundleGetInfoString%/${BUNDLE_NAME_AIO}/g" "${CONTENTS_DIR}/Info.plist"
sed -i ".bak" "s/%CFBundleIdentifier%/org.squeak.${SQUEAK_VERSION}.${IMAGE_BITS}.All-in-One/g" "${CONTENTS_DIR}/Info.plist"
sed -i ".bak" "s/%CFBundleName%/${SMALLTALK_NAME}/g" "${CONTENTS_DIR}/Info.plist"
sed -i ".bak" "s/%CFBundleShortVersionString%/${SQUEAK_VERSION_NUMBER}/g" "${CONTENTS_DIR}/Info.plist"
sed -i ".bak" "s/%CFBundleVersion%/${IMAGE_BITS} bit/g" "${CONTENTS_DIR}/Info.plist"
sed -i ".bak" "s/%SqueakImageName%/${IMAGE_NAME}.image/g" "${CONTENTS_DIR}/Info.plist"
rm -f "${CONTENTS_DIR}/Info.plist.bak"
# Squeak.ini (consistent with contents in Info.plist)
sed -i ".bak" "s/%WindowTitle%/${WINDOW_TITLE}/g" "${VM_WIN_TARGET}/Squeak.ini"
rm -f "${VM_WIN_TARGET}/Squeak.ini.bak"
# Remove .map files from $VM_WIN_TARGET
rm -f "${VM_WIN_TARGET}/"*.map
# Signing the macOS application
echo "...signing the bundle..."
codesign -s "${SIGN_IDENTITY}" --force --deep --verbose "${APP_DIR}"
compress "${BUNDLE_NAME_AIO}"
travis_fold end aio_bundle