1{ lib
2, stdenv
3, fetchurl
4, doxygen
5, mandoc
6, meson
7, ninja
8, pkg-config
9, python3
10, sphinx
11, writeScript
12}:
13
14stdenv.mkDerivation rec {
15 pname = "serd";
16 version = "0.30.16";
17
18 outputs = [ "out" "dev" "doc" "man" ];
19
20 src = fetchurl {
21 url = "https://download.drobilla.net/${pname}-${version}.tar.xz";
22 hash = "sha256-9Q9IbaUZzdjQOyDJ5CQU5FkTP1okRBHY5jyu+NmskUY=";
23 };
24
25 nativeBuildInputs = [
26 doxygen
27 mandoc
28 meson
29 ninja
30 pkg-config
31 python3
32 sphinx
33 ];
34
35 postPatch = ''
36 patchShebangs .
37 '';
38
39 passthru = {
40 updateScript = writeScript "update-poke" ''
41 #!/usr/bin/env nix-shell
42 #!nix-shell -i bash -p curl pcre common-updater-scripts
43
44 set -eu -o pipefail
45
46 # Expect the text in format of 'download.drobilla.net/serd-0.30.16.tar.xz">'
47 new_version="$(curl -s https://drobilla.net/category/serd/ |
48 pcregrep -o1 'download.drobilla.net/serd-([0-9.]+).tar.xz' |
49 head -n1)"
50 update-source-version ${pname} "$new_version"
51 '';
52 };
53
54 meta = with lib; {
55 description = "A lightweight C library for RDF syntax which supports reading and writing Turtle and NTriples";
56 homepage = "https://drobilla.net/software/serd";
57 license = licenses.mit;
58 maintainers = [ maintainers.goibhniu ];
59 mainProgram = "serdi";
60 platforms = platforms.unix;
61 };
62}