summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorOskar Nyberg <oskar@mullvad.net>2022-01-11 17:31:17 +0100
committerOskar Nyberg <oskar@mullvad.net>2022-01-11 17:31:17 +0100
commitacb5357702fb6dfd5fc3adbcd4b6a5db4d533c46 (patch)
tree554e5598d840c3c2397c235e6e2b4e8dd4991e1a
parent027c43afd62c07bb71b712a8dd23c4bfda0a1a07 (diff)
parenta1f95677ae474c0db0d3dd51954eba557d3202d7 (diff)
downloadmullvadvpn-acb5357702fb6dfd5fc3adbcd4b6a5db4d533c46.tar.xz
mullvadvpn-acb5357702fb6dfd5fc3adbcd4b6a5db4d533c46.zip
Merge branch 'always-move-macos-binaries-to-target-dir'
-rwxr-xr-xbuild.sh8
-rw-r--r--gui/tasks/distribution.js17
2 files changed, 24 insertions, 1 deletions
diff --git a/build.sh b/build.sh
index 7aee2eb91c..68f0960f80 100755
--- a/build.sh
+++ b/build.sh
@@ -336,7 +336,13 @@ if [[ -n ${TARGETS:-""} ]]; then
done
else
source env.sh ""
- build
+ if [[ "$(uname -s)" == "Darwin" ]]; then
+ # Provide target for non-universal macOS builds to use the same output location as for
+ # universal builds
+ build "$ENV_TARGET"
+ else
+ build
+ fi
fi
################################################################################
diff --git a/gui/tasks/distribution.js b/gui/tasks/distribution.js
index 411970486d..1134351da4 100644
--- a/gui/tasks/distribution.js
+++ b/gui/tasks/distribution.js
@@ -46,6 +46,19 @@ const config = {
'!node_modules/@types',
],
+ // Make sure that all files declared in "extraResources" exists and abort if they don't.
+ afterPack: (context) => {
+ const resources = context.packager.platformSpecificBuildOptions.extraResources;
+
+ for (const resource of resources) {
+ const filePath = resource.from.replace('${env.TARGET_TRIPLE}', process.env.TARGET_TRIPLE);
+
+ if (!fs.existsSync(filePath)) {
+ throw new Error(`Can't find file: ${filePath}`);
+ }
+ }
+ },
+
mac: {
target: {
target: 'pkg',
@@ -227,6 +240,8 @@ function packMac() {
return true;
},
afterPack: (context) => {
+ config.afterPack?.(context);
+
delete process.env.TARGET_TRIPLE;
appOutDirs.push(context.appOutDir);
return Promise.resolve();
@@ -278,6 +293,8 @@ function packLinux() {
config: {
...config,
afterPack: async (context) => {
+ config.afterPack?.(context);
+
const sourceExecutable = path.join(context.appOutDir, 'mullvad-vpn');
const targetExecutable = path.join(context.appOutDir, 'mullvad-gui');
const launcherScript = path.join(context.appOutDir, 'mullvad-gui-launcher.sh');