forked from opentoonz/opentoonz
-
Notifications
You must be signed in to change notification settings - Fork 0
106 lines (95 loc) · 3.52 KB
/
workflow_macos.yml
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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
name: MacOS Build
on: [push, pull_request]
jobs:
macOS:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- name: Remove symlinks
run: |
# remove existing symlinks before installing python@3.10 and 3.11
rm /usr/local/bin/2to3
rm /usr/local/bin/idle3
rm /usr/local/bin/pydoc3
rm /usr/local/bin/python3
rm /usr/local/bin/python3-config
rm /usr/local/bin/2to3-3.11
rm /usr/local/bin/idle3.11
rm /usr/local/bin/pydoc3.11
rm /usr/local/bin/python3.11
rm /usr/local/bin/python3.11-config
- name: Install libraries
run: |
checkPkgAndInstall()
{
while [ $# -ne 0 ]
do
if brew ls --versions $1 ; then
brew upgrade $1
else
brew install $1
fi
shift
done
}
brew update
checkPkgAndInstall pkg-config glew lz4 libjpeg libpng lzo boost libusb libmypaint ccache jpeg-turbo ninja
checkPkgAndInstall opencv
# opencv depends on vtk and vtk depends on qt6
brew unlink qt
checkPkgAndInstall qt@5
- uses: actions/cache@v1
with:
path: /Users/runner/.ccache
key: ${{ runner.os }}-${{ github.sha }}
restore-keys: ${{ runner.os }}-
- name: Build libtiff
run: |
export PATH="/usr/local/opt/ccache/libexec:$PATH"
cd thirdparty/tiff-4.0.3
CFLAGS='-fPIC' CXXFLAGS='-fPIC' ./configure --disable-lzma
make -j $(nproc)
- name: Build
run: |
export PKG_CONFIG_PATH="/usr/local/opt/jpeg-turbo/lib/pkgconfig:$PKG_CONFIG_PATH"
cd toonz
mkdir build
cd build
cmake ../sources -G Ninja -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DQT_PATH='/usr/local/opt/qt@5/lib' -DWITH_TRANSLATION=OFF
ninja -w dupbuild=warn
- name: Introduce Libraries and Stuff
run: |
cd toonz/build/toonz
cp -pr ../../../stuff OpenToonz.app/portablestuff
/usr/local/opt/qt@5/bin/macdeployqt OpenToonz.app -verbose=1 -always-overwrite \
-executable=OpenToonz.app/Contents/MacOS/lzocompress \
-executable=OpenToonz.app/Contents/MacOS/lzodecompress \
-executable=OpenToonz.app/Contents/MacOS/tcleanup \
-executable=OpenToonz.app/Contents/MacOS/tcomposer \
-executable=OpenToonz.app/Contents/MacOS/tconverter \
-executable=OpenToonz.app/Contents/MacOS/tfarmcontroller \
-executable=OpenToonz.app/Contents/MacOS/tfarmserver
- name: Modify Library Paths
run: |
cd toonz/build/toonz/OpenToonz.app/Contents/Frameworks
for TARGETLIB in `ls ./ | grep dylib`
do
echo $TARGETLIB
for FROMPATH in `otool -L "$TARGETLIB" | grep ".dylib" | grep -v "$TARGETLIB" | grep -v "@executable_path/../Frameworks" | sed -e"s/ (.*$//"`
do
echo " $FROMPATH"
LIBNAME=`basename $FROMPATH`
if [[ -e ./$LIBNAME ]]; then
echo "updating library path of $LIBNAME in $TARGETLIB"
install_name_tool -change "$FROMPATH" "@executable_path/../Frameworks/$LIBNAME" $TARGETLIB
fi
done
done
- name: Create Artifact
run: |
cd toonz/build/toonz
/usr/local/opt/qt@5/bin/macdeployqt OpenToonz.app -dmg -verbose=1
- uses: actions/upload-artifact@v1
with:
name: Opentoonz-${{ runner.os }}-${{ github.sha }}
path: toonz/build/toonz/OpenToonz.dmg