-
-
Notifications
You must be signed in to change notification settings - Fork 122
Expand file tree
/
Copy pathappimage.build.sh
More file actions
executable file
·71 lines (58 loc) · 2.21 KB
/
appimage.build.sh
File metadata and controls
executable file
·71 lines (58 loc) · 2.21 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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#!/bin/bash
export BUILD_FOLDER=/tmp/build
export SOURCE_FOLDER="$PWD"
export OSSIA_SDK="/opt/ossia-sdk-${CPU_ARCH}"
if [[ -z "${SCORE_EXTRA_CMAKE_ARGS-}" ]]; then
export SCORE_EXTRA_CMAKE_ARGS=
fi
if [[ -z "${SCORE_CMAKE_CACHE-}" ]]; then
export SCORE_CMAKE_CACHE=
fi
mkdir -p $BUILD_FOLDER
ln -s $BUILD_FOLDER build
(
cd cmake/Deployment/Linux/AppImage/
docker build \
--build-arg CPU_ARCH="${CPU_ARCH}" \
-f Dockerfile.llvm \
-t ossia/score-package-linux \
.
)
docker run \
-v "$SOURCE_FOLDER/cmake/Deployment/Linux/AppImage/Recipe.llvm:/Recipe" \
-e TOOLCHAIN=appimage \
-e TAG="$GITTAGNOV" \
-e OSSIA_SDK="$OSSIA_SDK" \
-e CPU_ARCH="$CPU_ARCH" \
-e SCORE_EXTRA_CMAKE_ARGS="$SCORE_EXTRA_CMAKE_ARGS" \
-e SCORE_CMAKE_CACHE="$SCORE_CMAKE_CACHE" \
--mount type=bind,source="$PWD/$OSSIA_SDK",target=$OSSIA_SDK \
--mount type=bind,source="$SOURCE_FOLDER",target=/score \
--mount type=bind,source="$BUILD_FOLDER",target=/build \
ossia/score-package-linux \
/bin/bash /Recipe
if [[ ! -f "$BUILD_FOLDER/score.AppDir/usr/bin/ossia-score" ]]; then
echo "Build failure, ossia-score main binary missing ! "
exit 1
fi
sudo chown -R $(whoami) "$BUILD_FOLDER"
wget -nv "https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-${CPU_ARCH}.AppImage"
chmod a+x appimagetool-${CPU_ARCH}.AppImage
wget -nv "https://github.com/AppImage/type2-runtime/releases/download/continuous/runtime-${CPU_ARCH}"
chmod a+x runtime-${CPU_ARCH}
cp "$SOURCE_FOLDER/cmake/Deployment/Linux/AppImage/AppRun" build/score.AppDir/
cp "$SOURCE_FOLDER/cmake/Deployment/Linux/AppImage/ossia-score.desktop" build/score.AppDir/
sed -i "s/x86_64/$CPU_ARCH/" build/score.AppDir/ossia-score.desktop
sed -i "s/3.0.0/$GITTAGNOV/" build/score.AppDir/ossia-score.desktop
cp "$SOURCE_FOLDER/src/lib/resources/ossia-score.png" build/score.AppDir/
cp "$SOURCE_FOLDER/src/lib/resources/ossia-score.png" build/score.AppDir/.DirIcon
./appimagetool-${CPU_ARCH}.AppImage -n "/tmp/build/score.AppDir" "Score.AppImage" --runtime-file runtime-${CPU_ARCH}
if [[ ! -f "Score.AppImage" ]]; then
echo "Build failure, Score.AppImage could not be created"
exit 1
fi
chmod a+rwx Score.AppImage
(
cd $BUILD_FOLDER/SDK
zip -r -q -9 $SOURCE_FOLDER/linux-sdk.zip usr
)