From a3e32656bc3f43843c8a6cbb77b5843ff9964c6b Mon Sep 17 00:00:00 2001 From: Chris Araman Date: Wed, 28 Apr 2021 22:28:29 -0700 Subject: [PATCH] =?UTF-8?q?=F0=9F=97=9C=20Update=20mas.pkg=20build?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Package/Components.plist | 23 ----------------------- script/build_artifacts | 1 - script/install | 2 -- script/package | 24 ++++++++---------------- script/package_install | 2 +- 5 files changed, 9 insertions(+), 43 deletions(-) delete mode 100644 Package/Components.plist diff --git a/Package/Components.plist b/Package/Components.plist deleted file mode 100644 index e331dda..0000000 --- a/Package/Components.plist +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - BundleIsVersionChecked - - BundleOverwriteAction - upgrade - ChildBundles - - - BundleOverwriteAction - - RootRelativeBundlePath - Frameworks/MasKit.framework/Versions/A/Frameworks/Commandant.framework - - - RootRelativeBundlePath - Frameworks/MasKit.framework - - - diff --git a/script/build_artifacts b/script/build_artifacts index 479ddae..a3b3a10 100755 --- a/script/build_artifacts +++ b/script/build_artifacts @@ -13,5 +13,4 @@ echo "Building mas $VERSION artifacts" script/clean script/build script/archive -script/install script/package diff --git a/script/install b/script/install index 5d5f495..20c4466 100755 --- a/script/install +++ b/script/install @@ -21,8 +21,6 @@ else PREFIX=/usr/local fi -script/build - echo "==> 📲 Installing mas ($VERSION) for $ARCH to $PREFIX" ditto -v \ ".build/apple/Products/Release/mas" \ diff --git a/script/package b/script/package index b989614..526c2c4 100755 --- a/script/package +++ b/script/package @@ -6,46 +6,38 @@ # Builds macOS installer component and distribution packages. # -BUILD_DIR="$PWD/build" +BUILD_DIR="$PWD/.build" COMPONENT_PACKAGE="$BUILD_DIR/mas_components.pkg" DISTRIBUTION_PACKAGE="$BUILD_DIR/mas.pkg" IDENTIFIER="com.mphys.mas-cli" -# Component package definition -COMPONENTS_PLIST="Package/Components.plist" - # Distribution package definition # https://developer.apple.com/library/archive/documentation/DeveloperTools/Reference/DistributionDefinitionRef/Chapters/Distribution_XML_Ref.html DISTRIBUTION_PLIST="Package/Distribution.plist" -# Destination for `xcodebuild install` -# DSTROOT will be updated if unset. -INSTALL_TEMPORARY_FOLDER=${DSTROOT:-build/distributions} -mkdir -p "$INSTALL_TEMPORARY_FOLDER" +# Destination for install root +DSTROOT=.build/distributions +script/install "$DSTROOT/usr/local" VERSION=$(script/version) echo "==> 📦 Assemble an installer package" # Assemble macOS installer component package (aka "product archive"). -# Using /usr/local prefix to avoid the following errors with "/" -# - installer: The install failed (The Installer encountered an error that caused the installation to fail. Contact the software manufacturer for assistance.) -# - GUI warning: This package is incompatible with this version of macOS and may fail to install. (may damage your system... ) pkgbuild \ --identifier "$IDENTIFIER" \ - --install-location "/usr/local" \ + --install-location "/" \ --version "$VERSION" \ - --root "$INSTALL_TEMPORARY_FOLDER" \ - --component-plist "$COMPONENTS_PLIST" \ + --root "$DSTROOT" \ "$COMPONENT_PACKAGE" # Build distribution package (aka "product archive"). Not sure why, but this is how Carthage does it. -# https://github.com/Carthage/Carthage/blob/master/Makefile#L87 +# https://github.com/Carthage/Carthage/blob/master/Makefile#L69 productbuild \ --distribution "$DISTRIBUTION_PLIST" \ --package-path "$BUILD_DIR" \ "$DISTRIBUTION_PACKAGE" -echo "==> 🔢 Files Hashes" +echo "==> 🔢 File Hash" shasum -a 256 "$DISTRIBUTION_PACKAGE" diff --git a/script/package_install b/script/package_install index 61def1a..3419135 100755 --- a/script/package_install +++ b/script/package_install @@ -11,7 +11,7 @@ IDENTIFIER=com.mphys.mas-cli echo "==> 📲 Installing mas" sudo installer \ - -pkg build/mas.pkg \ + -pkg .build/mas.pkg \ -target / pkgutil --pkg-info "$IDENTIFIER"