Skip to content
GitLab
  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
    • Switch to GitLab Next
  • Sign in / Register
  • A Armagetron Advanced
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 29
    • Issues 29
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
    • Requirements
  • Merge requests 2
    • Merge requests 2
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Container Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Armagetron Advanced
  • Armagetron Advanced
  • Issues
  • #119
Closed
Open
Created Jan 06, 2022 by Christian Mäder@cimnine

macOS DMG Build

I was finally able to build a DMG from the latest trunk, i.e. aa3e0475 🎉

./bootstrap.sh
./configure --disable-debug \
            --disable-dependency-tracking \
            --disable-silent-rules \
            --disable-zthreadtest \
            --disable-sysinstall \
            --disable-uninstall \
            --disable-restoreold \
            --enable-automakedefaults \
            --disable-useradd \
            --disable-initscripts \
            --disable-etc
sh desktop/os-x/build_bundle.sh

There was only one minor problem: build_bundle.sh was rendered as follows.

build_bundle.sh

#!/bin/bash

set -x

DIR=$1
test -z "${DIR}" && DIR="`pwd`"

TITLE="Armagetron Advanced"
BUNDLE="${DIR}/${TITLE}.app"

rm -rf "${BUNDLE}"
mkdir -p "${BUNDLE}" || exit $?

# add plist with @v@ -> value and progtitle replacements
REL_SRCDIR=`echo . | sed -e s,^../../,,` || exit $?
cp "`dirname $0`/Info.plist" "${BUNDLE}/" || exit $?

# add icons
REL_TOP_SRCDIR=`echo ../.. | sed -e s,^../../,a,` || exit $?
cp "${REL_TOP_SRCDIR}/desktop/os-x/armagetronad.icns" "${BUNDLE}/${TITLE}.icns"

# install game into bundle
DESTDIR="${BUNDLE}" make install || exit $?

# bundle libraries
(cd "${BUNDLE}"; dylibbundler -od -b -x ".//usr/local/bin/armagetronad" -d ".//usr/local/libs/" -i /usr/lib/) || exit $?

# for debugging pure app bundle builds
# exit 0

# zip
(cd "${BUNDLE}" && zip -r ../armagetronad-0.4.0_alpha_z5260.macOS.zip .) || exit $?

# pack dmg

# mkdir pack
# cp -a "${BUNDLE}" pack || exit $?
# --sandbox-safe
# --icon "$ICON" 200 190 \
# DMG_SRC=pack
DMG_SRC=${BUNDLE}
DMG="${DIR}/armagetronad-0.4.0_alpha_z5260.dmg"
rm -f "${DMG}"
ICON="${REL_TOP_SRCDIR}/desktop/os-x/armagetronad.icns"
BG="${REL_TOP_SRCDIR}/desktop/os-x/background.png"
create-dmg \
	--volicon "$ICON" \
	--app-drop-link 470 180 --window-pos 200 112 --window-size 650 330 \
	--icon "${TITLE}.app" 220 80 \
	--icon-size 100 \
	--hide-extension "${TITLE}.app" \
	--background ${BG} \
	"${DMG}" "${DMG_SRC}" || exit $?

# alternative, native way, less powerful
# hdiutil create -volname "Armagetron Advanced" -srcfolder "${BUNDLE}" -ov -format UDIF "${DMG}"

rm -rf "${DMG_SRC}"

But since I'm running the script from the project root directory it could not find the icons and pictures for the DMG, i.e. ICON and BG. This is because the path points to ../.., which is outside the project root directory.

I manually patched the REL_TOP_SRCDIR variable to REL_TOP_SRCDIR=. and this worked. I was able to build a working DMG on both, and x64 and amd64 MacBook.

Here are the builds:

  • armagetronad-0.4.0_alpha_z5260_arm64.dmg
  • armagetronad-0.4.0_alpha_z5260_x86.dmg

Did I do something wrong that the build_bundle.sh script was incorrectly populated?

Edited Jan 06, 2022 by Christian Mäder
Assignee
Assign to
Time tracking