summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-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');