Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{
2 stdenv,
3 lib,
4 fetchFromGitLab,
5 gitUpdater,
6 python3Packages,
7}:
8
9stdenv.mkDerivation (finalAttrs: {
10 pname = "bencodetools";
11 version = "1.0.1";
12
13 src = fetchFromGitLab {
14 owner = "heikkiorsila";
15 repo = "bencodetools";
16 rev = "refs/tags/v${finalAttrs.version}";
17 hash = "sha256-5Y1r6+aVtK22lYr2N+YUPPdUts9PIF9I/Pq/mI+WqQs=";
18 };
19
20 postPatch = ''
21 patchShebangs configure
22 '';
23
24 enableParallelBuilding = true;
25
26 configureFlags = [ (lib.strings.withFeature false "python") ];
27
28 # installCheck instead of check due to -install_name'd library on Darwin
29 doInstallCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform;
30
31 installCheckPhase = ''
32 runHook preInstallCheck
33
34 ./bencodetest
35
36 runHook postInstallCheck
37 '';
38
39 passthru = {
40 tests.python-module = python3Packages.bencodetools;
41 updateScript = gitUpdater { rev-prefix = "v"; };
42 };
43
44 meta = {
45 description = "Collection of tools for manipulating bencoded data";
46 homepage = "https://gitlab.com/heikkiorsila/bencodetools";
47 license = lib.licenses.bsd2;
48 maintainers = with lib.maintainers; [ OPNA2608 ];
49 mainProgram = "bencat";
50 platforms = lib.platforms.unix;
51 };
52})