lol
1{ lib
2, stdenv
3, fetchFromGitHub
4, meson
5, ninja
6, python3
7, nix-update-script
8, testers
9}:
10
11stdenv.mkDerivation (finalAttrs: {
12 pname = "libvarlink";
13 version = "23";
14
15 src = fetchFromGitHub {
16 owner = "varlink";
17 repo = finalAttrs.pname;
18 rev = finalAttrs.version;
19 sha256 = "sha256-oUy9HhybNMjRBWoqqal1Mw8cC5RddgN4izxAl0cgnKE=";
20 };
21
22 nativeBuildInputs = [ meson ninja ];
23
24 postPatch = ''
25 substituteInPlace varlink-wrapper.py \
26 --replace "/usr/bin/env python3" "${python3}/bin/python3"
27
28 # test-object: ../lib/test-object.c:129: main: Assertion `setlocale(LC_NUMERIC, "de_DE.UTF-8") != 0' failed.
29 # PR that added it https://github.com/varlink/libvarlink/pull/27
30 substituteInPlace lib/test-object.c \
31 --replace 'assert(setlocale(LC_NUMERIC, "de_DE.UTF-8") != 0);' ""
32
33 patchShebangs lib/test-symbols.sh
34 '';
35
36 doCheck = true;
37
38 passthru = {
39 updateScript = nix-update-script {
40 attrPath = finalAttrs.pname;
41 };
42 tests = {
43 version = testers.testVersion {
44 package = finalAttrs.finalPackage;
45 command = "varlink --version";
46 };
47 };
48 };
49
50 meta = with lib; {
51 description = "C implementation of the Varlink protocol and command line tool";
52 homepage = "https://github.com/varlink/libvarlink";
53 license = licenses.asl20;
54 maintainers = with maintainers; [ artturin ];
55 platforms = platforms.linux;
56 };
57})