-
Notifications
You must be signed in to change notification settings - Fork 8
/
prepare_bundle_linux_x86.sh
executable file
·51 lines (40 loc) · 1.75 KB
/
prepare_bundle_linux_x86.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
#!/usr/bin/env bash
################################################################################
# PROJECT: Squeak Bundle Generation
# FILE: prepare_bundle_linux.sh
# CONTENT: Generate bundle for Ubuntu/Linux (x86 and x86_64).
#
# AUTHORS: Fabio Niephaus, Hasso Plattner Institute, Potsdam, Germany
# Marcel Taeumel, Hasso Plattner Institute, Potsdam, Germany
################################################################################
begin_group "Creating Linux bundle for ${SMALLTALK_VERSION}..."
BUNDLE_NAME_LIN_X86="${IMAGE_NAME}-${VERSION_VM_LINUX_X86}-${BUNDLE_NAME_LIN_X86_SUFFIX}"
export_variable "BUNDLE_NAME_LIN_X86" "${BUNDLE_NAME_LIN_X86}"
BUNDLE_PATH="${BUILD_PATH}/${BUNDLE_NAME_LIN_X86}"
VM_BASE_PATH="${TMP_PATH}/${VM_LIN_X86}"
if should_use_rc_vm; then
# There is an extra indirection in the OSVM builds on GitHub
# E.g., vm-linux/sqcogspur32linuxht/...
pushd ${VM_BASE_PATH}
VM_BASE_PATH="${VM_BASE_PATH}/$(find * -type d | head -n 1)"
popd
fi
VM_PATH="${BUNDLE_PATH}/bin"
SHARED_PATH="${BUNDLE_PATH}/shared"
echo "...creating directories..."
mkdir -p "${BUNDLE_PATH}" "${VM_PATH}" "${SHARED_PATH}"
echo "...copying Linux VM (x86-based)..."
# Note that in 'bin' is only a symlink to the actual binary in 'lib/squeak'
cp -R "${VM_BASE_PATH}/lib/squeak/"*/* "${VM_PATH}"
copy_resources "${SHARED_PATH}"
echo "...merging template..."
cp "${LIN_TEMPLATE_PATH}/squeak.sh" "${BUNDLE_PATH}/"
echo "...setting permissions..."
chmod +x "${VM_PATH}/squeak" "${BUNDLE_PATH}/squeak.sh"
echo "...applying various templates (squeak.sh)..."
# squeak.sh launcher
sed -i".bak" "s/%VM_NAME%/squeak/g" "${BUNDLE_PATH}/squeak.sh"
rm -f "${BUNDLE_PATH}/squeak.sh.bak"
compress_into_product_Linux "${BUNDLE_NAME_LIN_X86}"
reset_build_dir
end_group