about summary refs log tree commit diff
path: root/pkgs/by-name/ap
diff options
context:
space:
mode:
authorAnderson Torres <torres.anderson.85@protonmail.com>2023-11-13 18:56:31 -0300
committerAnderson Torres <torres.anderson.85@protonmail.com>2023-11-22 16:09:50 -0300
commit1751247c95441716d5ba9b263be0928ce1d1c8a2 (patch)
tree9740f43c6b20e8ca9a6cc1e57a98f29321a3cf76 /pkgs/by-name/ap
parent18c71e751b43f0554149e22dcdc2c15abb4fc45e (diff)
apt-offline: adopt and refactor
- remove rec
- remove nested with
Diffstat (limited to 'pkgs/by-name/ap')
-rw-r--r--pkgs/by-name/ap/apt-offline/package.nix45
1 files changed, 45 insertions, 0 deletions
diff --git a/pkgs/by-name/ap/apt-offline/package.nix b/pkgs/by-name/ap/apt-offline/package.nix
new file mode 100644
index 0000000000000..4eef07f030c5e
--- /dev/null
+++ b/pkgs/by-name/ap/apt-offline/package.nix
@@ -0,0 +1,45 @@
+{ lib
+, fetchFromGitHub
+, python3Packages
+, gnupg
+}:
+
+let
+  pname = "apt-offline";
+  version = "1.8.4";
+
+  src = fetchFromGitHub {
+    owner = "rickysarraf";
+    repo = "apt-offline";
+    rev = "v${version}";
+    hash = "sha256-RBf/QG0ewLS6gnQTBXi0I18z8QrxoBAqEXZ7dro9z5A=";
+  };
+in
+python3Packages.buildPythonApplication {
+  inherit pname version src;
+
+  postPatch = ''
+    substituteInPlace org.debian.apt.aptoffline.policy \
+      --replace /usr/bin/ "$out/bin"
+
+    substituteInPlace apt_offline_core/AptOfflineCoreLib.py \
+      --replace /usr/bin/gpgv "${gnupg}/bin/gpgv"
+  '';
+
+  preFixup = ''
+    rm "$out/bin/apt-offline-gui"
+    rm "$out/bin/apt-offline-gui-pkexec"
+  '';
+
+  doCheck = false; # API incompatibilities, maybe?
+
+  pythonImportsCheck = [ "apt_offline_core" ];
+
+  meta = {
+    homepage = "https://github.com/rickysarraf/apt-offline";
+    description = "Offline APT package manager";
+    license = with lib.licenses; [ gpl3Plus ];
+    mainProgram = "apt-offline";
+    maintainers = with lib.maintainers; [ AndersonTorres ];
+  };
+}