Skip to content

Commit

Permalink
signal-desktop: init darwin at 7.5.1
Browse files Browse the repository at this point in the history
  • Loading branch information
juuyokka committed Apr 29, 2024
1 parent 949c7f6 commit 0b2c556
Show file tree
Hide file tree
Showing 7 changed files with 51 additions and 16 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
{ hostPlatform, callPackage }: {
signal-desktop = if hostPlatform.system == "aarch64-linux"
then callPackage ./signal-desktop-aarch64.nix { }
else callPackage ./signal-desktop.nix { };
signal-desktop-beta = callPackage ./signal-desktop-beta.nix{ };
{ targetPlatform, callPackage }: {
signal-desktop = callPackage ./signal-desktop-${targetPlatform.system}.nix { };
signal-desktop-beta = callPackage ./signal-desktop-beta.nix { };
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
, fetchurl
, autoPatchelfHook
, dpkg
, undmg
, wrapGAppsHook
, makeWrapper
, nixosTests
Expand Down Expand Up @@ -72,13 +73,13 @@ in stdenv.mkDerivation rec {
inherit url hash;
};

nativeBuildInputs = [
nativeBuildInputs = lib.optionals stdenv.isLinux [
autoPatchelfHook
dpkg
(wrapGAppsHook.override { inherit makeWrapper; })
];
] ++ lib.optional stdenv.isDarwin undmg;

buildInputs = [
buildInputs = lib.optionals stdenv.isLinux [
alsa-lib
at-spi2-atk
at-spi2-core
Expand Down Expand Up @@ -115,7 +116,7 @@ in stdenv.mkDerivation rec {
xorg.libxshmfence
];

runtimeDependencies = [
runtimeDependencies = lib.optionals stdenv.isLinux [
(lib.getLib systemd)
libappindicator-gtk3
libnotify
Expand All @@ -126,12 +127,12 @@ in stdenv.mkDerivation rec {
wayland
];

unpackPhase = "dpkg-deb -x $src .";
unpackPhase = if stdenv.isLinux then "dpkg-deb -x $src ." else "undmg $src";

dontBuild = true;
dontConfigure = true;

installPhase = ''
installPhase = if stdenv.isLinux then ''
runHook preInstall
mkdir -p $out/lib
Expand All @@ -146,10 +147,18 @@ in stdenv.mkDerivation rec {
# Create required symlinks:
ln -s libGLESv2.so "$out/lib/${dir}/libGLESv2.so.2"
runHook postInstall
''
else ''
runHook preInstall
mkdir -p $out/Applications
mv Signal.app $out/Applications
runHook postInstall
'';

preFixup = ''
preFixup = lib.optionalString stdenv.isLinux ''
gappsWrapperArgs+=(
--add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations}}"
--suffix PATH : ${lib.makeBinPath [ xdg-utils ]}
Expand Down Expand Up @@ -182,7 +191,7 @@ in stdenv.mkDerivation rec {
license = lib.licenses.agpl3Only;
maintainers = with lib.maintainers; [ eclairevoyant mic92 equirosa urandom bkchr ];
mainProgram = pname;
platforms = [ "x86_64-linux" "aarch64-linux" ];
platforms = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ];
sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
};
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{ callPackage }:
callPackage ./generic.nix { } rec {
pname = "signal-desktop";
dir = "Signal";
version = "7.5.1";
url = "https://updates.signal.org/desktop/signal-desktop-mac-arm64-${version}.dmg";
hash = "sha256-q3+v5u//niA+ortlGMsNuVSJaIM72PF97NgG0yaGHlI=";
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{ callPackage }:
callPackage ./generic.nix { } rec {
pname = "signal-desktop";
dir = "Signal";
version = "7.5.1";
url = "https://updates.signal.org/desktop/signal-desktop-mac-x64-${version}.dmg";
hash = "sha256-3GFGiMWYQSQX1EQPYPWikr+0iAo36KZUjsTGkR9MQdA=";
}
18 changes: 15 additions & 3 deletions pkgs/applications/networking/instant-messengers/signal-desktop/update.sh
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,25 @@ signal-desktop)
echo "Updating signal-desktop for x86_64-linux"
nix-update --version "$latestVersion" \
--system x86_64-linux \
--override-filename "$SCRIPT_DIR/signal-desktop.nix" \
signal-desktop
--override-filename "$SCRIPT_DIR/signal-desktop-x86_64-linux.nix" \
signal-desktop

echo "Updating signal-desktop for aarch64-linux"
nix-update --version "$latestVersionAarch64" \
--system aarch64-linux \
--override-filename "$SCRIPT_DIR/signal-desktop-aarch64.nix" \
--override-filename "$SCRIPT_DIR/signal-desktop-aarch64-linux.nix" \
signal-desktop

echo "Updating signal-desktop for x86_64-darwin"
nix-update --version "$latestVersion" \
--system x86_64-darwin \
--override-filename "$SCRIPT_DIR/signal-desktop-x86_64-darwin.nix" \
signal-desktop

echo "Updating signal-desktop for aarch64-darwin"
nix-update --version "$latestVersion" \
--system aarch64-darwin \
--override-filename "$SCRIPT_DIR/signal-desktop-aarch64-darwin.nix" \
signal-desktop
;;
signal-desktop-beta)
Expand Down

0 comments on commit 0b2c556

Please sign in to comment.