From bb6a40ebb6a738f95ba973481c5f239c5efe8eda Mon Sep 17 00:00:00 2001 From: figsoda Date: Tue, 6 Sep 2022 14:30:05 -0400 Subject: [PATCH] iwgtk: 0.4.0 -> 0.8.0 --- pkgs/tools/networking/iwgtk/default.nix | 29 +++++++++++++++---- .../networking/iwgtk/systemd-service.patch | 12 ++++++++ 2 files changed, 35 insertions(+), 6 deletions(-) create mode 100644 pkgs/tools/networking/iwgtk/systemd-service.patch diff --git a/pkgs/tools/networking/iwgtk/default.nix b/pkgs/tools/networking/iwgtk/default.nix index 5c89facd3fa3..ef220a8c28e2 100644 --- a/pkgs/tools/networking/iwgtk/default.nix +++ b/pkgs/tools/networking/iwgtk/default.nix @@ -1,21 +1,38 @@ -{ fetchFromGitHub, gtk3, lib, pkg-config, stdenv }: +{ lib +, stdenv +, fetchFromGitHub +, meson +, ninja +, pkg-config +, scdoc +, wrapGAppsHook +, gtk4 +, qrencode +}: stdenv.mkDerivation rec { pname = "iwgtk"; - version = "0.4"; + version = "0.8"; src = fetchFromGitHub { owner = "j-lentz"; repo = pname; rev = "v${version}"; - sha256 = "129h7vq9b1r9a5c79hk8d06bj8lgzrnhq55x54hqri9c471jjh0s"; + sha256 = "sha256-89rzDxalZtQkwAKS6hKPVY87kOWPySwDeZrPs2rGs/k="; }; - nativeBuildInputs = [ pkg-config ]; + # patch systemd service to pass necessary environments and use absolute paths + patches = [ ./systemd-service.patch ]; - buildInputs = [ gtk3 ]; + nativeBuildInputs = [ meson ninja pkg-config scdoc wrapGAppsHook ]; - makeFlags = [ "prefix=$(out)" ]; + buildInputs = [ gtk4 qrencode ]; + + postInstall = '' + mv $out/share/lib/systemd $out/share + rmdir $out/share/lib + substituteInPlace $out/share/systemd/user/iwgtk.service --subst-var out + ''; meta = with lib; { description = "Lightweight, graphical wifi management utility for Linux"; diff --git a/pkgs/tools/networking/iwgtk/systemd-service.patch b/pkgs/tools/networking/iwgtk/systemd-service.patch new file mode 100644 index 000000000000..fbe9abe0a217 --- /dev/null +++ b/pkgs/tools/networking/iwgtk/systemd-service.patch @@ -0,0 +1,12 @@ +--- a/misc/iwgtk.service ++++ b/misc/iwgtk.service +@@ -6,7 +6,8 @@ PartOf=graphical-session.target + After=graphical-session.target + + [Service] +-ExecStart=iwgtk -i ++ExecStart=@out@/bin/iwgtk -i ++PassEnvironment=DISPLAY XAUTHORITY + Restart=on-failure + + [Install]