Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apple silicon support (M1) #368

Merged
merged 7 commits into from
Jul 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added build/background.tiff
Binary file not shown.
4 changes: 4 additions & 0 deletions ci/notarize.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ exports.default = async function notarizing(context) {
if (electronPlatformName !== "darwin") {
return
}
if (process.env.CSC_IDENTITY_AUTO_DISCOVERY === "false") {
console.log("CSC_IDENTITY_AUTO_DISCOVERY is set to false, skipping notarization")
return
}

const appName = context.packager.appInfo.productFilename

Expand Down
30 changes: 20 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@
},
"license": "MIT",
"scripts": {
"postinstall": "shx rm -rf static/bin && shx cp -r node_modules/@mysteriumnetwork/node/bin static/bin",
"dev": "electron-webpack dev",
"lint": "eslint src",
"clean": "shx rm -rf dist",
"build": "electron-webpack",
"bundle": "yarn build && electron-builder"
"bundle": "yarn build && electron-builder",
"bundle-dev": "yarn build && CSC_IDENTITY_AUTO_DISCOVERY=false electron-builder"
},
"engines": {
"node": ">=16"
Expand All @@ -26,7 +26,7 @@
"@fortawesome/free-brands-svg-icons": "^5.15.3",
"@fortawesome/free-solid-svg-icons": "^5.15.3",
"@fortawesome/react-fontawesome": "^0.1.14",
"@mysteriumnetwork/node": "1.9.3",
"@mysteriumnetwork/node": "1.9.5-p3",
"@mysteriumnetwork/terms": "0.0.41",
"@sentry/electron": "^3.0.7",
"@use-it/interval": "^1.0.0",
Expand Down Expand Up @@ -84,8 +84,8 @@
"@types/webpack-env": "^1.16.3",
"@typescript-eslint/eslint-plugin": "^5.23.0",
"@typescript-eslint/parser": "^5.23.0",
"electron": "^19.0.5",
"electron-builder": "^23.0.3",
"electron": "^19.0.8",
"electron-builder": "^23.1.0",
"electron-devtools-installer": "^3.2.0",
"electron-download": "^4.1.1",
"electron-notarize": "^1.2.1",
Expand Down Expand Up @@ -124,15 +124,25 @@
"buildResources": "build",
"output": "dist"
},
"files": [
"!**/node_modules/@mysteriumnetwork/node/bin/**",
"**/node_modules/@mysteriumnetwork/node/bin/${platform}/${arch}/**"
],
"mac": {
"target": [
"dmg",
"zip"
],
"target": {
"target": "default",
"arch": "universal"
},
"singleArchFiles": "**/node_modules/@mysteriumnetwork/node/bin/**",
"icon": "static/logo.icns",
"hardenedRuntime": true,
"entitlements": "build/entitlements.mac.plist",
"entitlementsInherit": "build/entitlements.mac.plist"
"entitlementsInherit": "build/entitlements.mac.plist",
"category": "public.app-category.productivity"
},
"dmg": {
"background": "build/background.tiff",
"iconTextSize": 14
},
"win": {
"target": [
Expand Down
9 changes: 2 additions & 7 deletions src/main/node/mysteriumNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,22 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
import { platform } from "os"
import { ChildProcess } from "child_process"

import { NodeHealthcheck, TequilapiClientFactory } from "mysterium-vpn-js"
import { BrowserWindow, dialog, ipcMain, IpcMainInvokeEvent } from "electron"
import { mysteriumNodeBin } from "@mysteriumnetwork/node"

import { spawnProcess } from "../../utils/spawn"
import { log, logErrorMessage } from "../../shared/log/log"
import { TEQUILAPI_PORT } from "../../app/tequilapi"
import { staticAssetPath } from "../../utils/paths"
import { IpcResponse, MainIpcListenChannels } from "../../shared/ipc"
import { isProduction } from "../../utils/env"
import { ExportIdentityOpts, ImportIdentityOpts } from "../../shared/node/mysteriumNodeIPC"
import { parseError } from "../../shared/errors/parseError"

const mystBin = (): string => {
let mystBinaryName = "bin/myst"
if (platform() === "win32") {
mystBinaryName += ".exe"
}
return staticAssetPath(mystBinaryName)
return mysteriumNodeBin(process.platform, process.arch).replace("app.asar", "app.asar.unpacked")
}

const parseCLIError = (message: string): string => {
Expand Down
11 changes: 3 additions & 8 deletions src/main/node/supervisor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,8 @@ import { platform } from "os"

import semver from "semver"
import { ipcMain } from "electron"
import { mysteriumSupervisorBin, nodeVersion } from "@mysteriumnetwork/node"

import * as packageJson from "../../../package.json"
import { staticAssetPath } from "../../utils/paths"
import { log } from "../../shared/log/log"
import { sudoExec } from "../../utils/sudo"
import { uid } from "../../utils/user"
Expand All @@ -28,11 +27,7 @@ function mystSockPath(): string {
}

const supervisorBin = (): string => {
let supervisorBinaryName = "bin/myst_supervisor"
if (isWin) {
supervisorBinaryName += ".exe"
}
return staticAssetPath(supervisorBinaryName)
return mysteriumSupervisorBin(process.platform, process.arch).replace("app.asar", "app.asar.unpacked")
}

export class Supervisor {
Expand Down Expand Up @@ -99,7 +94,7 @@ export class Supervisor {
}

async upgrade(): Promise<void> {
const bundledVersion = packageJson.dependencies["@mysteriumnetwork/node"]
const bundledVersion = nodeVersion()

let runningVersion = ""
try {
Expand Down
Loading