forked from jMonkeyEngine/sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild-installers.sh
More file actions
executable file
·129 lines (94 loc) · 3.14 KB
/
build-installers.sh
File metadata and controls
executable file
·129 lines (94 loc) · 3.14 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
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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
#!/bin/bash
#(c) jmonkeyengine.org
# Uses NBPackage to create installers for different platforms.
# Prequisites for running this script:
# - The SDK ZIP build must already exist
# - JDKs must already been downloaded
# Some quirks exist with the different platform installers:
# - Linux DEPs are only created with current architecture
# - Windows installer requires Inno Setup, this seems like an easy thing to break in this chain
set -e # Quit on Error
nbpackage_version="1.0-beta6"
nbpackage_url="https://archive.apache.org/dist/netbeans/netbeans-nbpackage/$nbpackage_version/nbpackage-$nbpackage_version-bin.zip"
inno_setup_url="https://files.jrsoftware.org/is/6/innosetup-6.5.1.exe"
function download_nbpackage {
echo "> Downloading the nbpackage"
if [ -f "downloads/nbpackage.zip" ];
then
echo "< Already existing, SKIPPING."
else
mkdir -p downloads
curl -# -o downloads/nbpackage.zip -L $nbpackage_url
echo "< OK!"
fi
}
function prepare_nbpackage {
echo "> Extracting the nbpackage"
if [ -d "nbpackage" ];
then
echo "< Already existing, SKIPPING."
else
unzip -qq downloads/nbpackage.zip -d nbpackage
echo "< OK!"
fi
}
function build_nbpackage {
echo ">> Building the nbpackage installer for $1-$2"
./nbpackage/nbpackage-$nbpackage_version/bin/nbpackage --input ../dist/jmonkeyplatform.zip --config "$1-$2/$3" --output ../dist/ -v -Ppackage.version="$4"
echo "<< OK!"
}
function build_linux_deb {
echo "> Building the Linux DEB"
build_nbpackage linux x64 jmonkeyengine-x64-deb.properties "$1"
build_nbpackage linux aarch64 jmonkeyengine-aarch64-deb.properties "$1"
echo "< OK!"
}
function build_windows_installer {
echo "> Building the Windows installer"
setup_inno_setup $2
build_nbpackage windows x64 jmonkeyengine-windows-x64.properties "$1"
echo "< OK!"
}
function setup_inno_setup {
echo ">> Setting up Inno Setup"
download_inno_setup
# Needs Wine!!!
if [ -z "$1" ];
then
wine downloads/innosetup.exe /VERYSILENT
else
echo "<< Trying headless mode"
xvfb-run wine downloads/innosetup.exe /VERYSILENT
fi
echo "<< OK!"
}
function download_inno_setup {
echo ">>> Downloading Inno Setup"
if [ -f "downloads/innosetup.exe" ];
then
echo "<<< Already existing, SKIPPING."
else
mkdir -p downloads
curl -# -o downloads/innosetup.exe -L $inno_setup_url
echo "<<< OK!"
fi
}
function build_macos_pgk {
echo "> Building the MacOS pgk"
build_nbpackage macos x64 jmonkeyengine-macos-x64.properties "$1"
build_nbpackage macos aarch64 jmonkeyengine-macos-aarch64.properties "$1"
echo "< OK!"
}
echo "Building installers with version tag $1"
versionString=$1
if [[ $versionString != [[:digit:]]* ]];
then
versionString=${versionString:1}
echo "Stripped version tag to $versionString"
fi
download_nbpackage
prepare_nbpackage
build_linux_deb "$versionString"
build_windows_installer "$versionString" "$2"
# MACOS needs signed packages etc. So disabled
#build_macos_pgk "$versionString"