Skip to content

Commit

Permalink
ci: fix macos build recipe
Browse files Browse the repository at this point in the history
  • Loading branch information
paulmueller committed Feb 2, 2021
1 parent d640bdb commit c1d2b39
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 14 deletions.
18 changes: 10 additions & 8 deletions build-recipes/macos_PyJibe.spec
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@ import warnings

from pyjibe._version import version

NAME = "PyJibe"

if not exists("./PyJibeLauncher.py"):
warnings.warn("Cannot find 'PyJibeLauncher.py'! Please run pyinstaller " +
"from the 'build-recipes' directory.")
if not exists("./{}Launcher.py".format(NAME):
warnings.warn("Cannot find {}Launcher.py'! ".format(NAME) +
"Please run pyinstaller from the 'build-recipes' directory.")

block_cipher = None

a = Analysis(['PyJibeLauncher.py'],
a = Analysis(['{}Launcher.py'.format(NAME)],
pathex=['.'],
binaries=[],
datas=[],
Expand All @@ -29,7 +30,7 @@ exe = EXE(pyz,
a.scripts,
[],
exclude_binaries=True,
name='PyJibe.bin',
name=NAME + '.bin',
debug=False,
bootloader_ignore_signals=False,
strip=False,
Expand All @@ -42,12 +43,13 @@ coll = COLLECT(exe,
strip=False,
upx=True,
upx_exclude=[],
name='PyJibe')
name=NAME)
app = BUNDLE(coll,
name='PyJibe.app',
icon='PyJibe.icns',
name=NAME + '.app',
icon=NAME + '.icns',
bundle_identifier=None,
info_plist = {
'NSPrincipalClass': 'NSApplication',
'NSHighResolutionCapable' : 'True',
'CFBundleShortVersionString' : version,
}
Expand Down
12 changes: 6 additions & 6 deletions build-recipes/macos_build_app.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ TMP="./dist/pack.temp.dmg"

# cleanup from previous builds
rm -rf ./build
rm -rf ./dist_app
rm -rf ./dist

pip install -r macos_build_requirements.txt

Expand All @@ -41,7 +41,7 @@ pyinstaller -y --log-level=WARN ${SPEC}
# Test the binary by executing it with --version argument
echo ""
echo "...Testing the app (this should print the version)."
./dist_app/${NAME}.app/Contents/MacOS/${NAME} --version
./dist/${NAME}.app/Contents/MacOS/${NAME}.bin --version
echo ""

# Create PKG (pkgbuild is for deployments in app stores)
Expand All @@ -52,14 +52,14 @@ pkgbuild --install-location /Applications/ --component ${APP} ${PKG}

# Create DMG
# add link to Applications
mkdir ./dist_app/ui-release
cd ./dist_app/ui-release
mkdir ./dist/ui-release
cd ./dist/ui-release
ln -s /Applications
cd -
mv ${APP} ./dist_app/ui-release/
mv ${APP} ./dist/ui-release/

# create temporary DMG
hdiutil create -srcfolder ./dist_app/ui-release/ -volname "${NAMEVERSION}" -fs HFS+ \
hdiutil create -srcfolder ./dist/ui-release/ -volname "${NAMEVERSION}" -fs HFS+ \
-fsargs "-c c=64,a=16,e=16" -format UDRW "${TMP}"

# optional: edit the DMG
Expand Down

0 comments on commit c1d2b39

Please sign in to comment.