From 039ac92480a09266146fc5b0c9ec67a32a2565ad Mon Sep 17 00:00:00 2001 From: saurabhb17 Date: Wed, 26 Feb 2020 16:04:40 +0530 Subject: Added secondary files --- .../mac-osx/dmg-generator/AdiumApplescriptRunner | Bin 0 -> 18612 bytes .../Artwork/Anonymous_aiga_left_arrow.svg | 54 ++++++ .../dmg-generator/Artwork/dmgBackground.png | Bin 0 -> 118847 bytes .../dmg-generator/Artwork/dmgBackground.svg | 196 +++++++++++++++++++++ packaging/mac-osx/dmg-generator/Makefile | 40 +++++ packaging/mac-osx/dmg-generator/RightDS_Store | Bin 0 -> 12292 bytes packaging/mac-osx/dmg-generator/dmg_kicad.scpt | Bin 0 -> 15724 bytes packaging/mac-osx/dmg-generator/make-diskimage.sh | 78 ++++++++ packaging/mac-osx/dmg-generator/mkalias | Bin 0 -> 34552 bytes 9 files changed, 368 insertions(+) create mode 100755 packaging/mac-osx/dmg-generator/AdiumApplescriptRunner create mode 100644 packaging/mac-osx/dmg-generator/Artwork/Anonymous_aiga_left_arrow.svg create mode 100644 packaging/mac-osx/dmg-generator/Artwork/dmgBackground.png create mode 100644 packaging/mac-osx/dmg-generator/Artwork/dmgBackground.svg create mode 100644 packaging/mac-osx/dmg-generator/Makefile create mode 100644 packaging/mac-osx/dmg-generator/RightDS_Store create mode 100644 packaging/mac-osx/dmg-generator/dmg_kicad.scpt create mode 100755 packaging/mac-osx/dmg-generator/make-diskimage.sh create mode 100755 packaging/mac-osx/dmg-generator/mkalias (limited to 'packaging/mac-osx/dmg-generator') diff --git a/packaging/mac-osx/dmg-generator/AdiumApplescriptRunner b/packaging/mac-osx/dmg-generator/AdiumApplescriptRunner new file mode 100755 index 0000000..4665eee Binary files /dev/null and b/packaging/mac-osx/dmg-generator/AdiumApplescriptRunner differ diff --git a/packaging/mac-osx/dmg-generator/Artwork/Anonymous_aiga_left_arrow.svg b/packaging/mac-osx/dmg-generator/Artwork/Anonymous_aiga_left_arrow.svg new file mode 100644 index 0000000..d91b1c3 --- /dev/null +++ b/packaging/mac-osx/dmg-generator/Artwork/Anonymous_aiga_left_arrow.svg @@ -0,0 +1,54 @@ + + + + + + AIGA_Symbol_Signs + EPS converted from http://aiga.org + + + symbol + mapsym + + + + + Open Clip Art Library + + + + + Jean-Victor Balin + + + + + Jean-Victor Balin + + + + image/svg+xml + + + en + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/packaging/mac-osx/dmg-generator/Artwork/dmgBackground.png b/packaging/mac-osx/dmg-generator/Artwork/dmgBackground.png new file mode 100644 index 0000000..d793778 Binary files /dev/null and b/packaging/mac-osx/dmg-generator/Artwork/dmgBackground.png differ diff --git a/packaging/mac-osx/dmg-generator/Artwork/dmgBackground.svg b/packaging/mac-osx/dmg-generator/Artwork/dmgBackground.svg new file mode 100644 index 0000000..2077006 --- /dev/null +++ b/packaging/mac-osx/dmg-generator/Artwork/dmgBackground.svg @@ -0,0 +1,196 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + KiCad EDA Suite + + + + + + + diff --git a/packaging/mac-osx/dmg-generator/Makefile b/packaging/mac-osx/dmg-generator/Makefile new file mode 100644 index 0000000..c214afe --- /dev/null +++ b/packaging/mac-osx/dmg-generator/Makefile @@ -0,0 +1,40 @@ +########### +# KiCad OSX DMG packaging +# Create a bin directory and copy the .app files in +# Create a build directory +# Then execute the makefile +# +# Original credits by Adium developers ! +# http://www.adium.im +########### +VERSION=`date +%Y%m%d` + +########### +# Variables +########### +BUILD_DIR=build +APP_DIR=release +KICAD_DIR=$(BUILD_DIR) +RELEASE_NAME=kicad-$(VERSION) + +########### +# Targets +########### +all: + echo "Copying application bundles" + mkdir release + cp -R ../../../*/*.app release + echo "Building kicad-${VERSION}.dmg" + rm -rfv build + mkdir build + + cp -r $(APP_DIR)/* $(BUILD_DIR) + mkdir -p $(BUILD_DIR)/.background + cp Artwork/dmgBackground.png $(BUILD_DIR)/.background + ./mkalias -r /Applications $(BUILD_DIR)/Applications + + mkdir -p $(BUILD_DIR)/.background + + ./make-diskimage.sh $(BUILD_DIR)/$(RELEASE_NAME).dmg $(KICAD_DIR) "KiCad" dmg_kicad.scpt $(ART_DIR) + + @echo "Build finished. `md5 $(BUILD_DIR)/$(RELEASE_NAME).dmg`" diff --git a/packaging/mac-osx/dmg-generator/RightDS_Store b/packaging/mac-osx/dmg-generator/RightDS_Store new file mode 100644 index 0000000..ab19329 Binary files /dev/null and b/packaging/mac-osx/dmg-generator/RightDS_Store differ diff --git a/packaging/mac-osx/dmg-generator/dmg_kicad.scpt b/packaging/mac-osx/dmg-generator/dmg_kicad.scpt new file mode 100644 index 0000000..9e72fbe Binary files /dev/null and b/packaging/mac-osx/dmg-generator/dmg_kicad.scpt differ diff --git a/packaging/mac-osx/dmg-generator/make-diskimage.sh b/packaging/mac-osx/dmg-generator/make-diskimage.sh new file mode 100755 index 0000000..062992b --- /dev/null +++ b/packaging/mac-osx/dmg-generator/make-diskimage.sh @@ -0,0 +1,78 @@ +# Create a read-only disk image of the contents of a folder +# +# Usage: make-diskimage +# +# +# +# +# + +set -e; + +DMG_DIRNAME=`dirname $1` +DMG_DIR=`cd $DMG_DIRNAME > /dev/null; pwd` +DMG_NAME=`basename $1` +DMG_TEMP_NAME=${DMG_DIR}/rw.${DMG_NAME} +SRC_FOLDER=`cd $2 > /dev/null; pwd` +VOLUME_NAME=$3 + +# optional arguments +APPLESCRIPT=$4 +ART_PATH=$5 +EULA_RSRC=$6 + +# Create the image +echo "Creating disk image..." +rm -f "${DMG_TEMP_NAME}" +hdiutil create -srcfolder "${SRC_FOLDER}" -volname "${VOLUME_NAME}" -fs HFS+ -fsargs "-c c=64,a=16,e=16" -format UDRW "${DMG_TEMP_NAME}" + +# mount it +echo "Mounting disk image..." +MOUNT_DIR="/Volumes/${VOLUME_NAME}" +DEV_NAME=`hdiutil attach -readwrite -noverify -noautoopen "${DMG_TEMP_NAME}" | egrep '^/dev/' | sed 1q | awk '{print $1}'` + +cp RightDS_Store "/Volumes/${VOLUME_NAME}/.DS_Store" + +# run applescript +if [ ! -z "${APPLESCRIPT}" -a "${APPLESCRIPT}" != "-null-" ]; then +# osascript "${APPLESCRIPT}" + # pass the applescript our volume name and our artwork path, to its process_disk_image function + echo "Running Applescript: ./AdiumApplescriptRunner \"${APPLESCRIPT}\" process_disk_image \"${VOLUME_NAME}\"" + ./AdiumApplescriptRunner "${APPLESCRIPT}" process_disk_image "${VOLUME_NAME}" "${ART_PATH}" || true + echo "Done running the applescript..." +fi + + +# run shell script +# if [ ! -z "${SHELLSCRIPT}" -a "${SHELLSCRIPT}" != "-null-" ]; then +# ./${SHELLSCRIPT} \"${VOLUME_NAME}\" +# fi + +# make sure it's not world writeable +echo "Fixing permissions..." +chmod -Rf go-w "${MOUNT_DIR}" || true + +# make the top window open itself on mount: +if [ -x /usr/local/bin/openUp ]; then + /usr/local/bin/openUp "${MOUNT_DIR}" +fi + +# unmount +echo "Unmounting disk image..." +hdiutil detach "${DEV_NAME}" + +# compress image +echo "Compressing disk image..." +hdiutil convert "${DMG_TEMP_NAME}" -format UDBZ -o "${DMG_DIR}/${DMG_NAME}" +rm -f "${DMG_TEMP_NAME}" + +# adding EULA resources +if [ ! -z "${EULA_RSRC}" -a "${EULA_RSRC}" != "-null-" ]; then + echo "adding EULA resources" + hdiutil unflatten "${DMG_DIR}/${DMG_NAME}" + /Developer/Tools/ResMerger -a "${EULA_RSRC}" -o "${DMG_DIR}/${DMG_NAME}" + hdiutil flatten "${DMG_DIR}/${DMG_NAME}" +fi + +echo "Disk image done" +exit 0 diff --git a/packaging/mac-osx/dmg-generator/mkalias b/packaging/mac-osx/dmg-generator/mkalias new file mode 100755 index 0000000..69a5fd9 Binary files /dev/null and b/packaging/mac-osx/dmg-generator/mkalias differ -- cgit