From 243ec9a4e70ca6cd8158317c248766f86e389047 Mon Sep 17 00:00:00 2001 From: jwijenbergh Date: Fri, 5 Jan 2024 15:12:33 +0100 Subject: [PATCH] eduvpn-client: init at 4.2.0 --- .../ed/eduvpn-client/nix-python-prefix.patch | 13 ++++ pkgs/by-name/ed/eduvpn-client/package.nix | 60 +++++++++++++++++++ 2 files changed, 73 insertions(+) create mode 100644 pkgs/by-name/ed/eduvpn-client/nix-python-prefix.patch create mode 100644 pkgs/by-name/ed/eduvpn-client/package.nix diff --git a/pkgs/by-name/ed/eduvpn-client/nix-python-prefix.patch b/pkgs/by-name/ed/eduvpn-client/nix-python-prefix.patch new file mode 100644 index 000000000000..4d5fc53b0993 --- /dev/null +++ b/pkgs/by-name/ed/eduvpn-client/nix-python-prefix.patch @@ -0,0 +1,13 @@ +diff --git a/eduvpn/utils.py b/eduvpn/utils.py +index db0bf0c..76fc52a 100644 +--- a/eduvpn/utils.py ++++ b/eduvpn/utils.py +@@ -69,7 +69,7 @@ def get_prefix() -> str: + """ + target = "share/eduvpn/builder/mainwindow.ui" + local = path.dirname(path.dirname(path.abspath(__file__))) +- options = [local, path.expanduser("~/.local"), "/usr/local", prefix] ++ options = ["@out@"] + for option in options: + logger.debug(f"looking for '{target}' in '{option}'") + if path.isfile(path.join(option, target)): diff --git a/pkgs/by-name/ed/eduvpn-client/package.nix b/pkgs/by-name/ed/eduvpn-client/package.nix new file mode 100644 index 000000000000..a68ed0474536 --- /dev/null +++ b/pkgs/by-name/ed/eduvpn-client/package.nix @@ -0,0 +1,60 @@ +{ lib +, fetchurl +, gdk-pixbuf +, gobject-introspection +, gtk3 +, libnotify +, libsecret +, networkmanager +, python3Packages +, wrapGAppsHook +}: + +python3Packages.buildPythonApplication rec { + pname = "eduvpn-client"; + version = "4.2.0"; + + src = fetchurl { + url = "https://github.com/eduvpn/python-${pname}/releases/download/${version}/python-${pname}-${version}.tar.xz"; + hash = "sha256-W5z0ykrwWANZmW+lQt6m+BmYPI0cutsamx8V2JrpeHA="; + }; + + nativeBuildInputs = [ + gdk-pixbuf + gobject-introspection + wrapGAppsHook + ]; + + buildInputs = [ + gtk3 + libnotify + libsecret + networkmanager + ]; + + propagatedBuildInputs = with python3Packages; [ + eduvpn-common + pygobject3 + setuptools + ]; + + patches = [ ./nix-python-prefix.patch ]; + + postPatch = '' + substituteInPlace eduvpn/utils.py --subst-var-by out $out + ''; + + checkInputs = with python3Packages; [ + pytestCheckHook + ]; + + meta = with lib; { + changelog = "https://raw.githubusercontent.com/eduvpn/python-eduvpn-client/${version}/CHANGES.md"; + description = "Linux client for eduVPN"; + homepage = "https://github.com/eduvpn/python-eduvpn-client"; + license = licenses.gpl3Plus; + mainProgram = "eduvpn-gui"; + maintainers = with maintainers; [ benneti jwijenbergh ]; + platforms = platforms.linux; + }; +}