signal-desktop: Adds support for aarch64-linux
This adds support for `signal-desktop` on `aarch64-linux`. This is achieved by leveraging a community deb package that builds it for `aarch64`. A future version may switches to a full custom build of the package, so that we don't need to use any debs at all.
This commit is contained in:
parent
449c6fb06b
commit
46e35b98e7
@ -1,12 +1,17 @@
|
|||||||
{ callPackage }: builtins.mapAttrs (pname: attrs: callPackage ./generic.nix (attrs // { inherit pname; })) {
|
{ callPackage, stdenv }: builtins.mapAttrs (pname: attrs: callPackage ./generic.nix (attrs // { inherit pname; })) {
|
||||||
signal-desktop = {
|
signal-desktop = rec {
|
||||||
dir = "Signal";
|
dir = "Signal";
|
||||||
version = "6.40.0";
|
version = "6.40.0";
|
||||||
|
version-aarch64 = "6.40.0";
|
||||||
|
url = "https://updates.signal.org/desktop/apt/pool/s/signal-desktop/signal-desktop_${version}_amd64.deb";
|
||||||
|
url-aarch64 = "https://github.com/0mniteck/Signal-Desktop-Mobian/raw/${version-aarch64}/builds/release/signal-desktop_${version-aarch64}_arm64.deb";
|
||||||
hash = "sha256-vyXHlycPSyEyv938IKzGM6pdERHHerx2CLY/U+WMrH4=";
|
hash = "sha256-vyXHlycPSyEyv938IKzGM6pdERHHerx2CLY/U+WMrH4=";
|
||||||
|
hash-aarch64 = "sha256-3Pi0c+CGcJR1M4ll51m+B5PmGIcIjjlc0qa9b8rkMeU=";
|
||||||
};
|
};
|
||||||
signal-desktop-beta = {
|
signal-desktop-beta = rec {
|
||||||
dir = "Signal Beta";
|
dir = "Signal Beta";
|
||||||
version = "6.40.0-beta.2";
|
version = "6.40.0-beta.2";
|
||||||
hash = "sha256-pfedkxbZ25DFgz+/N7ZEb9LwKrHuoMM+Zi+Tc21QPsg=";
|
hash = "sha256-pfedkxbZ25DFgz+/N7ZEb9LwKrHuoMM+Zi+Tc21QPsg=";
|
||||||
|
url = "https://updates.signal.org/desktop/apt/pool/s/signal-desktop-beta/signal-desktop-beta_${version}_amd64.deb";
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,11 @@
|
|||||||
{ pname
|
{ pname
|
||||||
, dir
|
, dir
|
||||||
, version
|
, version
|
||||||
|
, version-aarch64 ? ""
|
||||||
, hash
|
, hash
|
||||||
|
, hash-aarch64 ? ""
|
||||||
|
, url
|
||||||
|
, url-aarch64 ? ""
|
||||||
, stdenv
|
, stdenv
|
||||||
, lib
|
, lib
|
||||||
, fetchurl
|
, fetchurl
|
||||||
@ -51,8 +55,15 @@
|
|||||||
, wayland
|
, wayland
|
||||||
}:
|
}:
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
let
|
||||||
inherit pname version; # Please backport all updates to the stable channel.
|
inherit (stdenv) targetPlatform;
|
||||||
|
ARCH = if targetPlatform.isAarch64 then "arm64" else "x64";
|
||||||
|
final-version = if targetPlatform.isAarch64 then version-aarch64 else version;
|
||||||
|
in stdenv.mkDerivation rec {
|
||||||
|
inherit pname;
|
||||||
|
version = final-version;
|
||||||
|
|
||||||
|
# Please backport all updates to the stable channel.
|
||||||
# All releases have a limited lifetime and "expire" 90 days after the release.
|
# All releases have a limited lifetime and "expire" 90 days after the release.
|
||||||
# When releases "expire" the application becomes unusable until an update is
|
# When releases "expire" the application becomes unusable until an update is
|
||||||
# applied. The expiration date for the current release can be extracted with:
|
# applied. The expiration date for the current release can be extracted with:
|
||||||
@ -61,8 +72,8 @@ stdenv.mkDerivation rec {
|
|||||||
# few additional steps and might not be the best idea.)
|
# few additional steps and might not be the best idea.)
|
||||||
|
|
||||||
src = fetchurl {
|
src = fetchurl {
|
||||||
url = "https://updates.signal.org/desktop/apt/pool/s/${pname}/${pname}_${version}_amd64.deb";
|
url = if targetPlatform.isAarch64 then url-aarch64 else url;
|
||||||
inherit hash;
|
hash = if targetPlatform.isAarch64 then hash-aarch64 else hash;
|
||||||
};
|
};
|
||||||
|
|
||||||
nativeBuildInputs = [
|
nativeBuildInputs = [
|
||||||
@ -163,7 +174,7 @@ stdenv.mkDerivation rec {
|
|||||||
${if pname == "signal-desktop" then "--replace \"bin/signal-desktop\" \"bin/signal-desktop --use-tray-icon\"" else ""}
|
${if pname == "signal-desktop" then "--replace \"bin/signal-desktop\" \"bin/signal-desktop --use-tray-icon\"" else ""}
|
||||||
|
|
||||||
autoPatchelf --no-recurse -- "$out/lib/${dir}/"
|
autoPatchelf --no-recurse -- "$out/lib/${dir}/"
|
||||||
patchelf --add-needed ${libpulseaudio}/lib/libpulse.so "$out/lib/${dir}/resources/app.asar.unpacked/node_modules/@signalapp/ringrtc/build/linux/libringrtc-x64.node"
|
patchelf --add-needed ${libpulseaudio}/lib/libpulse.so "$out/lib/${dir}/resources/app.asar.unpacked/node_modules/@signalapp/ringrtc/build/linux/libringrtc-${ARCH}.node"
|
||||||
'';
|
'';
|
||||||
|
|
||||||
# Tests if the application launches and waits for "Link your phone to Signal Desktop":
|
# Tests if the application launches and waits for "Link your phone to Signal Desktop":
|
||||||
@ -176,11 +187,11 @@ stdenv.mkDerivation rec {
|
|||||||
"Signal Android" or "Signal iOS" app.
|
"Signal Android" or "Signal iOS" app.
|
||||||
'';
|
'';
|
||||||
homepage = "https://signal.org/";
|
homepage = "https://signal.org/";
|
||||||
changelog = "https://github.com/signalapp/Signal-Desktop/releases/tag/v${version}";
|
changelog = "https://github.com/signalapp/Signal-Desktop/releases/tag/v${final-version}";
|
||||||
license = lib.licenses.agpl3Only;
|
license = lib.licenses.agpl3Only;
|
||||||
maintainers = with lib.maintainers; [ mic92 equirosa urandom ];
|
maintainers = with lib.maintainers; [ mic92 equirosa urandom bkchr ];
|
||||||
mainProgram = pname;
|
mainProgram = pname;
|
||||||
platforms = [ "x86_64-linux" ];
|
platforms = if builtins.stringLength version-aarch64 > 0 then [ "x86_64-linux" "aarch64-linux" ] else [ "x86_64-linux" ];
|
||||||
sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
|
sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user