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