Skip to content

Commit

Permalink
feat: build from source; enable arm64
Browse files Browse the repository at this point in the history
  • Loading branch information
jnsgruk committed Oct 30, 2023
1 parent 5d0550a commit 3dcff61
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 2 deletions.
10 changes: 10 additions & 0 deletions snap/gui/signal-desktop.desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[Desktop Entry]
Name=Signal
Exec=/opt/Signal/signal-desktop --no-sandbox %U
Terminal=false
Type=Application
Icon=signal-desktop
StartupWMClass=Signal
Comment=Private messaging from your desktop
MimeType=x-scheme-handler/sgnl;x-scheme-handler/signalcaptcha;
Categories=Network;InstantMessaging;Chat;
59 changes: 57 additions & 2 deletions snap/snapcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,68 @@ confinement: strict

architectures:
- build-on: amd64
- build-on: arm64
compression: lzo

parts:
signal-desktop:
plugin: dump
source: https://updates.signal.org/desktop/apt/pool/s/signal-desktop/signal-desktop_$SNAPCRAFT_PROJECT_VERSION_amd64.deb
source: https://github.com/signalapp/Signal-Desktop
source-type: git
source-tag: v$SNAPCRAFT_PROJECT_VERSION
build-packages:
- curl
- git-lfs
- jq
- python3
build-environment:
- SIGNAL_ENV: "production"
- USE_SYSTEM_FPM: "true"
override-build: |
git lfs install
# Install the version of NodeJS used by the upstream project
git clone https://github.com/asdf-vm/asdf.git ./.asdf --branch v0.13.1
. "./.asdf/asdf.sh"
asdf plugin add nodejs
asdf install nodejs 18.15.0
asdf global nodejs 18.15.0
# Install Yarn globally
npm install -g yarn
# Make sure that node-gyp uses the right Python
yarn config set python /usr/bin/python3
# Disable yarn auto clean functionality
rm .yarnclean
# Don't try to build a deb (this fails on arm64)
cp package.json package.json.tmp
cat package.json.tmp | jq '.build.linux.target = ["dir"]' > package.json
# Install the node dependencies.
yarn install --frozen-lockfile
# This is the equivalent of 'yarn generate'. The upstream package.json
# uses npm-run-all to run multiple things, which has a bug that prevents
# this from succeeding in the snapcraft build env, so this just breaks
# that apart into its component parts.
yarn build-protobuf
yarn build:esbuild
yarn sass
yarn get-expire-time
yarn copy-components
# This is the equivalent of 'yarn build-linux' which also runs 'yarn generate'
# which is broken (as described above).
yarn build:esbuild:prod
yarn build:release --publish=never
yarn build:electron --config.directories.output=release
# Stage the built release. Directory is called 'linux-unpacked' for amd64,
# and 'linux-arm64-unpacked' for arm64.
mkdir -p ${CRAFT_PART_INSTALL}/opt
mv release/linux-*unpacked ${CRAFT_PART_INSTALL}/opt/Signal
stage-packages:
- libxss1
- libnspr4
Expand Down Expand Up @@ -94,7 +150,6 @@ parts:
apps:
signal-desktop:
extensions: [gnome]
desktop: usr/share/applications/signal-desktop.desktop
command: opt/Signal/signal-desktop --use-tray-icon --no-sandbox
plugs:
- browser-support
Expand Down

0 comments on commit 3dcff61

Please sign in to comment.