about summary refs log tree commit diff
path: root/pkgs/by-name/ap/apt-offline/package.nix
blob: 4eef07f030c5e181862cdaa42fa01c3023dcf4e6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
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 ];
  };
}