Repository navigation
Expand file tree
/
Copy pathbuildOSX.sh
More file actions
executable file
·56 lines (46 loc) · 2.59 KB
/
Copy pathbuildOSX.sh
File metadata and controls
executable file
·56 lines (46 loc) · 2.59 KB
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
#!/bin/bash
# Build the TheNoteTaker macOS application (build/NoteTaker-Installer.dmg).
# Run from the repository root: the icons are read from ressources/.
set -x
set -e
# In GitHub Actions, load the checked out sources; locally, load from GitHub
if [ -n "$GITHUB_WORKSPACE" ]
then
REPOSITORY="gitlocal://$GITHUB_WORKSPACE/src"
else
REPOSITORY="github://pharo-contributions/TheNoteTaker:master/src"
fi
wget -O - get.pharo.org/64/140+vm | bash
./pharo Pharo.image save NoteTaker
# Pharo comes with a Microdown version; unload it so that the baseline loads the one it needs
./pharo NoteTaker.image --no-default-preferences st scripts/preLoading.st --save --quit
./pharo NoteTaker.image --no-default-preferences eval --save "Metacello new
baseline: 'TheNoteTaker';
repository: '$REPOSITORY';
onUpgradeUseLoaded;
onConflictUseLoaded;
load: #( 'default' 'App' )"
# NTPackagedApplication finds the icons in ressources/ of the repository Metacello registered in Iceberg
./pharo NoteTaker.image --no-default-preferences eval "NTPackagedApplication generateOSXPackage"
# Since 2026-11-28, the VM headers (include/latest12.zip) keep sq.h and assert.h in pharovm/common and
# sqPlatformSpecific.h in pharovm/osx, which the generated CMakeLists.txt does not search yet
if ! grep -q 'build/include/pharovm/common' build/CMakeLists.txt
then
perl -0pi -e 's#(\t\$\{CMAKE_CURRENT_BINARY_DIR\}/build/include/pharovm\n)#$1\t\$\{CMAKE_CURRENT_BINARY_DIR\}/build/include/pharovm/common\n\t\$\{CMAKE_CURRENT_BINARY_DIR\}/build/include/pharovm/osx\n#' build/CMakeLists.txt
grep -q 'build/include/pharovm/common' build/CMakeLists.txt
fi
# Since 2026-11-28, the VM core (latest12.zip) is named @rpath/libPharoVMCore.dylib: the launcher needs the
# run path @executable_path/Plugins (where build.sh copies the VM), as the Pharo executable of the VM has
if ! grep -q 'executable_path/Plugins' build/CMakeLists.txt
then
perl -pi -e 's#^(target_link_libraries\((\S+) PharoVMCore\)\n)#$1set_target_properties($2 PROPERTIES BUILD_RPATH "\@executable_path/Plugins")\n#' build/CMakeLists.txt
grep -q 'executable_path/Plugins' build/CMakeLists.txt
fi
# The VM plugins include symbolic links (libz.dylib -> libz.1.dylib...). The bundle is signed with them, but the
# DMG holds plain files instead, so its signature is invalid ("a sealed resource is missing or invalid").
# Copy the plugins with the links resolved, before build.sh signs the bundle.
perl -pi -e 's#^cp -Rf (build/vm/Pharo\.app/Contents/MacOS/Plugins/)#cp -RLf $1#' build/build.sh
grep -q '^cp -RLf build/vm/Pharo.app/Contents/MacOS/Plugins/' build/build.sh
cd build
chmod +x build.sh
./build.sh