Skip to content

Commit b4f7814

Browse files
committed
Mac build was not uploaded.
Linux builder desktop file was wrong name (inherited from offline dev)
1 parent 8929ffc commit b4f7814

File tree

4 files changed

+110
-2
lines changed

4 files changed

+110
-2
lines changed

_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "2.14.104.1"
1+
__version__ = "2.14.105"

builder/Linux/make.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ commonparts(){
7474
mkdir -p bin &&
7575
mkdir -p share/applications &&
7676
mkdir -p share/icons/hicolor/256x256/apps &&
77-
echo "$desktop" > share/applications/OoDC.desktop &&
77+
echo "$desktop" > share/applications/$basename.desktop &&
7878
cp ../../../../OoJSC256x256.png share/icons/hicolor/256x256/apps/$basename-icon.png ||
7979
q "commonparts : failed to make output tree"
8080
}

builder/MacOS/MacOS-README.txt

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
The Mac version of this is currently quite crude compared to its Linux brother.
2+
3+
This will build an app tarball, with an executable that will work where python
4+
is unavailable.
5+
6+
Then, build.
7+
8+
./make.sh dist
9+
10+
If rebuilding for any reason, delete the build directory.
11+
12+
./make.sh clean
13+
14+
Detailed info:
15+
16+
The script needs to be in the build tree at ./MacOS/make.sh
17+
18+
It expects to be executed in that directory.
19+
20+
Any arg2 will be used as the base name for the tarball. Take care!
21+
22+
Any arg3 will be used as a destination directory for the tarballs.
23+
24+
It will:
25+
Create a "build" directory.
26+
Create a python3 venv in it.
27+
Activate the venv.
28+
Use pip inside the venv to install python dependencies and pyinstaller.
29+
Compile an executable of the project.
30+
Create a tar archive with that in it.

builder/MacOS/make.sh

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
#!/bin/bash
2+
3+
q(){ echo "Error at: $*" >&2 ; exit 5 ; } # exit function
4+
5+
alttarbase="$2"
6+
alttardir="$3"
7+
8+
cleaner(){
9+
step="Remove build directory"
10+
echo "$step" ; rm -Rf build || q "$step"
11+
}
12+
13+
basedir="$(dirname $(realpath $0))"
14+
[ -d "$basedir" ] || q "Insane basedir '$basedir'"
15+
cd "$basedir" || q "Can't cd to $basedir"
16+
17+
builddirname=build
18+
builddir="$basedir/$builddirname" # this can be deleted to retry a build
19+
basename=OoliteDebugConsole2 # gets used a lot
20+
inscript=DebugConsole.py # the name of the script we'll be 'compiling'
21+
venv="$builddir/pyinstaller"
22+
relpath="../../../"
23+
24+
prep(){
25+
mkdir -p "$builddir" || q "Can't create $builddir."
26+
cd "$builddir" || q "Can't cd to builddir $builddir"
27+
step="setting up venv and building tools"
28+
python3 -m venv "$venv" &&
29+
source "$venv"/bin/activate &&
30+
pip install click &&
31+
pip install twisted &&
32+
pip install pyinstaller || q "$step"
33+
}
34+
35+
36+
setupvars(){
37+
#cd to base directory and set up base variables
38+
cd "$basedir"
39+
cd ../.. && ver=$(echo "
40+
from _version import __version__
41+
print(__version__)
42+
" | python3 ) && cd - || q "error ascertaining version"
43+
[ "x$ver" = "x" ] && q "version not found. version file empty or absent"
44+
[ "x$alttarbase" != "x" ] && tarbase="$alttarbase" || tarbase="${basename}-$ver-macos_$(arch)"
45+
[ "x$alttardir" != "x" ] && tardir="$alttardir" || tardir="$basedir"
46+
mkdir -p "$tardir" || q "could not create dir '$tardir' to house tarballs"
47+
}
48+
49+
onefile(){
50+
step="making executable"
51+
echo "$step"
52+
pyinstaller --name "$basename" --onefile "${relpath}$inscript" \
53+
--add-binary "${relpath}oojsc.xbm:." --add-binary "${relpath}OoJSC.ico:." \
54+
--add-binary "${relpath}OoJSC256x256.png:." &&
55+
tarname="$tarbase-onefile.tgz"
56+
tar -C "$builddir/dist" --numeric-owner --dereference \
57+
-cpzf "$tardir/$tarname" . || q "$failed $step"
58+
mv dist/$basename $basedir &&
59+
echo "
60+
Finished $step.
61+
62+
To test the executable run:
63+
64+
./$basename
65+
66+
A tarball is at '$tardir/$tarname'.
67+
68+
" || q "$step"
69+
}
70+
71+
#Arg 1 chooses action. clean or dist.
72+
case "$1" in
73+
clean) cleaner ;; # remove entire build directory
74+
dist) cleaner && setupvars && prep && onefile ;;
75+
*) q "Setup: Invalid arg 1: [clean|dist]" ;;
76+
esac
77+
78+
#end

0 commit comments

Comments
 (0)