about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/bencodetools/default.nix
blob: 0a9694367340d670f454803adab8d85bc0713045 (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
{ stdenv
, lib
, fetchFromGitLab
, python3
}:

stdenv.mkDerivation rec {
  pname = "bencodetools";
  version = "unstable-2022-05-11";

  src = fetchFromGitLab {
    owner = "heikkiorsila";
    repo = "bencodetools";
    rev = "384d78d297a561dddbbd0f4632f0c74c0db41577";
    sha256 = "1d699q9r33hkmmqkbh92ax54mcdf9smscmc0dza2gp4srkhr83qm";
  };

  postPatch = ''
    patchShebangs configure
    substituteInPlace configure \
      --replace 'python_install_option=""' 'python_install_option="--prefix=$out"'
  '';

  enableParallelBuilding = true;

  nativeBuildInputs = [
    python3
  ];

  # installCheck instead of check due to -install_name'd library on Darwin
  doInstallCheck = stdenv.buildPlatform == stdenv.hostPlatform;
  installCheckTarget = "check";

  meta = with lib; {
    description = "Collection of tools for manipulating bencoded data";
    homepage = "https://gitlab.com/heikkiorsila/bencodetools";
    license = licenses.bsd2;
    maintainers = with maintainers; [ OPNA2608 ];
    mainProgram = "bencat";
    platforms = platforms.unix;
  };
}