about summary refs log tree commit diff
path: root/nixpkgs/pkgs/tools/networking/opendrop/default.nix
blob: a617eadfc410fb196a12c1ea5ebae58529b13b39 (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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
{ lib
, buildPythonApplication
, fetchFromGitHub
, fleep
, ifaddr
, libarchive-c
, pillow
, requests-toolbelt
, setuptools
, zeroconf
, pytestCheckHook
, openssl
}:

buildPythonApplication rec {
  pname = "opendrop";
  version = "0.13.0";
  format = "setuptools";

  src = fetchFromGitHub {
    owner = "seemoo-lab";
    repo = "opendrop";
    rev = "v${version}";
    hash = "sha256-4FeVQO7Z6t9mjIgesdjKx4Mi+Ro5EVGJpEFjCvB2SlA=";
  };

  nativeBuildInputs = [
    # Tests fail if I put it on buildInputs
    openssl
  ];

  propagatedBuildInputs = [
    fleep
    ifaddr
    libarchive-c
    pillow
    requests-toolbelt
    setuptools
    zeroconf
  ];

  makeWrapperArgs = [
    "--prefix PATH : ${lib.makeBinPath nativeBuildInputs}"
  ];

  checkInputs = [
    pytestCheckHook
  ];

  preCheck = ''
    # Solves PermissionError: [Errno 13] Permission denied: '/homeless-shelter'
    export HOME=$(mktemp -d)
  '';

  meta = with lib; {
    description = "An open Apple AirDrop implementation written in Python";
    homepage = "https://owlink.org/";
    changelog = "https://github.com/seemoo-lab/opendrop/releases/tag/${src.rev}";
    license = licenses.gpl3Only;
    maintainers = with maintainers; [ wolfangaukang ];
    mainProgram = "opendrop";
    platforms = [ "x86_64-linux" ];
  };
}