Skip to content

Commit

Permalink
Add tor binary (and its dependencies) for arm64
Browse files Browse the repository at this point in the history
  • Loading branch information
EmiM committed Jun 12, 2023
1 parent fd86319 commit 34619ae
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 4 deletions.
9 changes: 7 additions & 2 deletions .github/actions/before-build/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,16 @@ runs:
run: cd packages/backend && npm run webpack:prod
shell: bash

- name: "Pull tor binary"
if: ${{ inputs.source-path == 'linux' || inputs.source-path == 'darwin' }}
- name: "Pull tor binary for Linux"
if: ${{ inputs.source-path == 'linux' }}
run: cd packages/desktop && export SOURCE_PATH=${{ inputs.source-path }} && npm run copyBinaries && npm run setMainEnvs
shell: bash

- name: "Pull tor binary for MacOS"
if: ${{ inputs.source-path == 'darwin' }}
run: cd packages/desktop && export SOURCE_PATH=${{ inputs.source-path }} && npm run copyBinariesDarwin && npm run setMainEnvs
shell: bash

- name: "Pull tor binary for Windows"
if: ${{ inputs.source-path == 'win32' }}
run: cd packages/desktop && export SOURCE_PATH=${{ inputs.source-path }} && npm run copyBinariesWin && npm run setMainEnvs
Expand Down
Binary file added 3rd-party/tor/darwin/arm64/libevent-2.1.7.dylib
Binary file not shown.
Binary file added 3rd-party/tor/darwin/arm64/tor
Binary file not shown.
File renamed without changes.
File renamed without changes.
3 changes: 2 additions & 1 deletion packages/backend/src/common/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,8 @@ export const torDirForPlatform = (basePath?: string): string => {
let torPath
if (!basePath) {
basePath = path.join(process.cwd(), '..', '..', '3rd-party')
torPath = path.join(basePath, 'tor', process.platform)
const platformPath = process.platform === 'darwin' ? path.join(process.platform, process.arch) : process.platform
torPath = path.join(basePath, 'tor', platformPath)
} else {
torPath = path.join(basePath, 'tor')
}
Expand Down
3 changes: 2 additions & 1 deletion packages/desktop/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,10 @@
"scripts": {
"version": "echo $npm_package_version",
"copyBinaries": "cp -R ../../3rd-party/tor/$SOURCE_PATH/ ./tor/ && chmod 775 ./tor/tor",
"copyBinariesDarwin": "cp -R ../../3rd-party/tor/$SOURCE_PATH/ ./tor/ && chmod 775 ./tor/arm64/tor ./tor/x64/tor",
"copyBinariesWin": "xcopy ..\\..\\3rd-party\\tor\\win32 .\\tor\\",
"pullLibs": "wget -N https://zbay-binaries.s3.us-east-2.amazonaws.com/$SOURCE_PATH/libssl.so -P ./ && chmod 775 ./libssl.so",
"dist": "export SOURCE_PATH=darwin && npm run copyBinaries && npm run build:prod && electron-builder --mac",
"dist": "export SOURCE_PATH=darwin && npm run copyBinariesDarwin && npm run build:prod && electron-builder --mac",
"distUbuntu": "export SOURCE_PATH=linux TEST_MODE=true && npm run setMainEnvs && npm run copyBinaries && npm run pullLibs && npm run build:prod && electron-builder --linux",
"distwin": "export SOURCE_PATH=win32 && npm run copyBinariesWin && npm run build:prod && electron-builder --win",
"lint": "eslint --ext .jsx,.js,.ts,.tsx ./src/ --fix",
Expand Down

0 comments on commit 34619ae

Please sign in to comment.