From: James Fournie Date: Wed, 4 May 2011 19:37:31 +0000 (-0700) Subject: Add make targets for an OS X staff client. The Makefile can be run on Linux but has X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=b66995a0e136bc768d635ed26ef6c176caff2e12;p=working%2FEvergreen.git Add make targets for an OS X staff client. The Makefile can be run on Linux but has the added benefit of creating a DMG file if run on OS X. OS X uses a different icon file format so the windows ico was converted. Note that building the osx-client requires curl (wget is not installed by default on macs) Update capability is not yet complete --- diff --git a/Open-ILS/xul/staff_client/Info.plist b/Open-ILS/xul/staff_client/Info.plist new file mode 100644 index 0000000000..b9aaf721e7 --- /dev/null +++ b/Open-ILS/xul/staff_client/Info.plist @@ -0,0 +1,24 @@ + + + + + CFBundleExecutable + xulrunner + CFBundleGetInfoString + Evergreen Staff Client BUILD_ID + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + Evergreen Staff Client + CFBundleIconFile + evergreen-icon-mac.icns + CFBundlePackageType + APPL + CFBundleShortVersionString + BUILD_ID + CFBundleVersion + BUILD_ID.BUILD_ID + NSAppleScriptEnabled + + + diff --git a/Open-ILS/xul/staff_client/Makefile.am b/Open-ILS/xul/staff_client/Makefile.am index f51e4dc16d..6bf7b71f81 100644 --- a/Open-ILS/xul/staff_client/Makefile.am +++ b/Open-ILS/xul/staff_client/Makefile.am @@ -14,6 +14,11 @@ XULRUNNER_WINFILE=xulrunner-$(XULRUNNER_VERSION).en-US.win32.zip XULRUNNER_LINUXFILE=xulrunner-$(XULRUNNER_VERSION).en-US.linux-i686.tar.bz2 XULRUNNER_URL=http://releases.mozilla.org/pub/mozilla.org/xulrunner/releases/$(XULRUNNER_VERSION)/runtimes/ +# mac stuff +XULRUNNER_OSXFILE=xulrunner-$(XULRUNNER_VERSION).en-US.mac-i386.sdk.tar.bz2 +XULRUNNER_SDK=http://releases.mozilla.org/pub/mozilla.org/xulrunner/releases/$(XULRUNNER_VERSION)/sdk/ +OSX_APP_FILE="Evergreen\ ${STAFF_CLIENT_VERSION}.app" + OPENSRF_JSLIBS = "$(OPENSRF_LIBS)/javascript" CHROME_LOCALES = $$(ls -1 chrome/locale) SKIN_CSS = $$(ls -1 server/skin/*css | sed -e "s/.css/_custom.css/") @@ -303,6 +308,34 @@ linux-client: linux-xulrunner @cd client; tar cjf ../evergreen_staff_client.tar.bz2 *; cd .. @echo 'Done' +# For OS X we need to use the SDK since the runtime pkg isn't really useful for our purposes +osx-xulrunner: client_app + @echo 'Preparing OS X xulrunner' + @if [ ! -f ${XULRUNNER_OSXFILE} ]; then curl -O ${XULRUNNER_SDK}${XULRUNNER_OSXFILE}; fi; + @tar xjf ${XULRUNNER_OSXFILE} --exclude='xulrunner-sdk/idl/' --exclude='xulrunner-sdk/include' --exclude='xulrunner-sdk/host' --exclude='xulrunner-sdk/lib' --exclude='xulrunner-sdk/sdk' + @if [ -f client/defaults/preferences/autoupdate.js ]; then echo 'pref("app.update.channel","mac");' >> client/defaults/preferences/autochannel.js; fi; + +# this will work on linux, it builds the .app directory/bundle +osx-client: osx-xulrunner + @echo 'Building Evergreen.app directory structure for OS X within client/' + @mkdir -p "${OSX_APP_FILE}/Contents/Frameworks/XUL.framework/Versions" + @mkdir -p "${OSX_APP_FILE}/Contents/MacOS" + @mv client "${OSX_APP_FILE}/Contents/Resources" + @cp evergreen-icon-mac.icns "${OSX_APP_FILE}/Contents/Resources/evergreen-icon-mac.icns" + @mv xulrunner-sdk/bin "${OSX_APP_FILE}/Contents/Frameworks/XUL.framework/Versions/${XULRUNNER_VERSION}" + @rmdir xulrunner-sdk + @ln -sf "${XULRUNNER_VERSION}" "${OSX_APP_FILE}/Contents/Frameworks/XUL.framework/Versions/Current" + @sed s/BUILD_ID/${STAFF_CLIENT_STAMP_ID}/g Info.plist > "${OSX_APP_FILE}/Contents/Info.plist" + @cp "${OSX_APP_FILE}/Contents/Frameworks/XUL.framework/Versions/Current/xulrunner" "${OSX_APP_FILE}/Contents/MacOS/" + @cd "${OSX_APP_FILE}/Contents/Frameworks/XUL.framework"; ln -sf Versions/Current/libxpcom.dylib; ln -sf Versions/Current/XUL; ln -sf Versions/Current/xulrunner-bin + @mkdir client + @mv "${OSX_APP_FILE}" client + @echo "Compressing and packaging" + @if [ -f /usr/bin/hdiutil ]; then echo "Using hdiutil to create DMG"; cd client; ln -sf "/Applications"; cd - ; fi; + @if [ -f /usr/bin/hdiutil ]; then hdiutil create -ov -volname "Evergreen" -format UDZO -imagekey zlib-level=9 -srcfolder client Evergreen.dmg; fi; + @if [ ! -f /usr/bin/hdiutil ]; then echo "hdiutil does not exist, falling back on zip"; cd client; zip -y -q -9 -r ../Evergreen-Mac.zip *; fi; + @echo 'Done' + # For running the updates script with the correct updates directory, optionally building clients as well updates updates-client win-updates win-updates-client linux-updates linux-updates-client generic-updates generic-updates-client extension-updates: diff --git a/Open-ILS/xul/staff_client/evergreen-icon-mac.icns b/Open-ILS/xul/staff_client/evergreen-icon-mac.icns new file mode 100644 index 0000000000..00508ff78a Binary files /dev/null and b/Open-ILS/xul/staff_client/evergreen-icon-mac.icns differ