diff --git a/snap/gui/signal-desktop.desktop b/snap/gui/signal-desktop.desktop new file mode 100644 index 000000000..7b09057f5 --- /dev/null +++ b/snap/gui/signal-desktop.desktop @@ -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; diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index feafa4538..bc90b3958 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -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 @@ -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