From ad2f75b5597a64ced96bf13095f9c6c01e7265c6 Mon Sep 17 00:00:00 2001 From: gardspirito Date: Thu, 4 Nov 2021 19:53:23 +0300 Subject: [PATCH 1/2] alfis: Add support for GUI dialogs --- pkgs/applications/blockchains/alfis/default.nix | 13 +++++++++---- pkgs/top-level/all-packages.nix | 1 + 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/pkgs/applications/blockchains/alfis/default.nix b/pkgs/applications/blockchains/alfis/default.nix index 7a808d2c72e9..58d2ecce53aa 100644 --- a/pkgs/applications/blockchains/alfis/default.nix +++ b/pkgs/applications/blockchains/alfis/default.nix @@ -1,6 +1,5 @@ -{ stdenv, lib, fetchFromGitHub, rustPlatform, pkg-config -, withGui ? true, webkitgtk, Cocoa, WebKit -}: +{ stdenv, lib, fetchFromGitHub, rustPlatform, pkg-config, withGui ? true +, webkitgtk, Cocoa, WebKit, dialog, makeWrapper }: rustPlatform.buildRustPackage rec { pname = "alfis"; @@ -27,10 +26,16 @@ rustPlatform.buildRustPackage rec { "--skip=dns::client::tests::test_udp_client" ]; - nativeBuildInputs = [ pkg-config ]; + nativeBuildInputs = [ pkg-config makeWrapper ]; buildInputs = lib.optional (withGui && stdenv.isLinux) webkitgtk ++ lib.optionals (withGui && stdenv.isDarwin) [ Cocoa WebKit ]; + postInstall = lib.optionalString (withGui && stdenv.isLinux) '' + cp $out/bin/alfis{,_unwrapped} + makeWrapper $out/bin/alfis{_unwrapped,} \ + --prefix PATH : ${lib.makeBinPath [ dialog ]} + ''; + meta = with lib; { description = "Alternative Free Identity System"; homepage = "https://alfis.name"; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 67c75abd5945..45b8c8451fce 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -28669,6 +28669,7 @@ with pkgs; alfis = callPackage ../applications/blockchains/alfis { inherit (darwin.apple_sdk.frameworks) Cocoa WebKit; + dialog = gnome.zenity; }; alfis-nogui = alfis.override { withGui = false; From 01537c17e114abb5d784297249ce0f544b7536ff Mon Sep 17 00:00:00 2001 From: gardspirito Date: Mon, 8 Nov 2021 17:25:59 +0300 Subject: [PATCH 2/2] matrix-synapse: compile only against zenity & use `wrapProgram` instead of `makeWrapper` --- pkgs/applications/blockchains/alfis/default.nix | 7 +++---- pkgs/top-level/all-packages.nix | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/pkgs/applications/blockchains/alfis/default.nix b/pkgs/applications/blockchains/alfis/default.nix index 58d2ecce53aa..0738661c0596 100644 --- a/pkgs/applications/blockchains/alfis/default.nix +++ b/pkgs/applications/blockchains/alfis/default.nix @@ -1,5 +1,5 @@ { stdenv, lib, fetchFromGitHub, rustPlatform, pkg-config, withGui ? true -, webkitgtk, Cocoa, WebKit, dialog, makeWrapper }: +, webkitgtk, Cocoa, WebKit, zenity, makeWrapper }: rustPlatform.buildRustPackage rec { pname = "alfis"; @@ -31,9 +31,8 @@ rustPlatform.buildRustPackage rec { ++ lib.optionals (withGui && stdenv.isDarwin) [ Cocoa WebKit ]; postInstall = lib.optionalString (withGui && stdenv.isLinux) '' - cp $out/bin/alfis{,_unwrapped} - makeWrapper $out/bin/alfis{_unwrapped,} \ - --prefix PATH : ${lib.makeBinPath [ dialog ]} + wrapProgram $out/bin/alfis \ + --prefix PATH : ${lib.makeBinPath [ zenity ]} ''; meta = with lib; { diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 45b8c8451fce..cc8e4e92bdc1 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -28669,7 +28669,7 @@ with pkgs; alfis = callPackage ../applications/blockchains/alfis { inherit (darwin.apple_sdk.frameworks) Cocoa WebKit; - dialog = gnome.zenity; + inherit (gnome) zenity; }; alfis-nogui = alfis.override { withGui = false;