1{ stdenv
2, lib
3, fetchFromGitLab
4, python3
5}:
6
7stdenv.mkDerivation rec {
8 pname = "bencodetools";
9 version = "unstable-2022-05-11";
10
11 src = fetchFromGitLab {
12 owner = "heikkiorsila";
13 repo = "bencodetools";
14 rev = "384d78d297a561dddbbd0f4632f0c74c0db41577";
15 sha256 = "1d699q9r33hkmmqkbh92ax54mcdf9smscmc0dza2gp4srkhr83qm";
16 };
17
18 postPatch = ''
19 patchShebangs configure
20 substituteInPlace configure \
21 --replace 'python_install_option=""' 'python_install_option="--prefix=$out"'
22 '';
23
24 enableParallelBuilding = true;
25
26 nativeBuildInputs = [
27 python3
28 ];
29
30 # installCheck instead of check due to -install_name'd library on Darwin
31 doInstallCheck = stdenv.buildPlatform == stdenv.hostPlatform;
32 installCheckTarget = "check";
33
34 meta = with lib; {
35 description = "Collection of tools for manipulating bencoded data";
36 homepage = "https://gitlab.com/heikkiorsila/bencodetools";
37 license = licenses.bsd2;
38 maintainers = with maintainers; [ OPNA2608 ];
39 mainProgram = "bencat";
40 platforms = platforms.unix;
41 };
42}