From 1dc7490047460e136d83475a35be568530f954ec Mon Sep 17 00:00:00 2001 From: Norberto Lopez <106690103+nobes888@users.noreply.github.com> Date: Wed, 18 Dec 2024 18:30:36 -0500 Subject: [PATCH] Changes associated with version 0.71: [1] Added support to build compressed DMG files. --- README.md | 5 +++++ doc/ReadMe.txt | 2 +- script/appleUtils.py | 26 ++++++++++++++++++++++++-- src/distMaker/DistApp.java | 2 +- tools/buildRelease | 2 +- 5 files changed, 32 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 3367693..8694d42 100644 --- a/README.md +++ b/README.md @@ -61,6 +61,11 @@ The following sofware are dependencies for compiling DistMaker: Note, you will have to edit the script, ./tools/buildRelease, so that the variables antPath and jdkPath are relative to your system. +In addition, if DistMaker is to build compressed DMG files you will need to get a copy of the libdmg-hfsplus software. That software is located at: + +    https://github.com/fanquake/libdmg-hfsplus + +You would then need to update the file ./script/appleUtils.py, and change the compressCmd to reflect the location to the actual dmg executable. This executable does the actual compression. ## Legal Notice DistMaker utilizes a number of copyrighted products. diff --git a/doc/ReadMe.txt b/doc/ReadMe.txt index 025ae98..f5f7e81 100644 --- a/doc/ReadMe.txt +++ b/doc/ReadMe.txt @@ -1,5 +1,5 @@ Product: DistMaker -Version: 0.70 +Version: 0.71 diff --git a/script/appleUtils.py b/script/appleUtils.py index 47fea32..deb0381 100644 --- a/script/appleUtils.py +++ b/script/appleUtils.py @@ -29,6 +29,13 @@ import miscUtils import deployJreDist +# Define the command used to compress the DMG file. Leave this variable set to +# None, if you do not have an installed copy of the libdmg-hfsplus 'dmg' +# command. Otherwise specify the path to the command here: +# compressCmd = '/spare/libdmg-hfsplus/build/dmg/dmg' +compressCmd = None + + def buildRelease(aArgs, aBuildPath, aJreNodeL): # We mutate args - thus make a custom copy args = copy.copy(aArgs) @@ -98,7 +105,22 @@ def buildRelease(aArgs, aBuildPath, aJreNodeL): if proc.returncode != 0: print('\tError: Failed to form DMG image. Return code: ' + str(proc.returncode) + '\n') else: - print('\tFinished building release: ' + os.path.basename(dmgFile) + '\n') + if compressCmd != None: + print('\tCompressing DMG image: ' + os.path.basename(dmgFile)) + isoFile = dmgFile + '.iso' + os.rename(dmgFile, isoFile) + + cmd2 = [compressCmd, isoFile, dmgFile] + proc = miscUtils.executeAndLog(cmd2, indentStr) + if proc.returncode != 0: + print('\tError: Failed to compress DMG image. Return code: ' + str(proc.returncode) + '\n') + else: + print('\tFinished building release: ' + os.path.basename(dmgFile) + '\n') + + os.remove(isoFile) + else: + print('\tNote the dmg file is not compressed... Consider defining the compressCmd to enable compression.') + print('\tFinished building release: ' + os.path.basename(dmgFile) + '\n') # Perform cleanup shutil.rmtree(tmpPath) @@ -297,7 +319,7 @@ def buildDistTree(aBuildPath, aRootPath, aArgs, aJreNode): # Update the .DS_Store file to reflect the new volume name srcPath = os.path.join(aRootPath, '.DS_Store') - classPath = appInstallRoot + '/lib/glum-2.0.0.jar:' + appInstallRoot + '/lib/distMaker-0.70.jar:' + appInstallRoot + '/lib/guava-18.0.jar' + classPath = appInstallRoot + '/lib/glum-2.0.0.jar:' + appInstallRoot + '/lib/distMaker-0.71.jar:' + appInstallRoot + '/lib/guava-18.0.jar' cmd = ['java', '-cp', classPath, 'dsstore.MainApp', srcPath, appName] proc = miscUtils.executeAndLog(cmd, "\t\tdsstore.MainApp: ") if proc.returncode != 0: diff --git a/src/distMaker/DistApp.java b/src/distMaker/DistApp.java index 0261cab..c439bfd 100644 --- a/src/distMaker/DistApp.java +++ b/src/distMaker/DistApp.java @@ -28,7 +28,7 @@ import glum.version.Version; public class DistApp { /** The DistMaker version is defined here. */ - public static final Version version = new PlainVersion(0, 70, 0); + public static final Version version = new PlainVersion(0, 71, 0); /** * Main entry point that will print out the version of DistMaker to stdout. diff --git a/tools/buildRelease b/tools/buildRelease index bdb9652..b1ac5a9 100755 --- a/tools/buildRelease +++ b/tools/buildRelease @@ -11,7 +11,7 @@ import traceback # Define the (baseline) version -baseVersion = "0.70" +baseVersion = "0.71" # Define relevant base names appBaseName = 'DistMaker'