Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ lib
2, stdenv
3, fetchurl
4, lv2
5, meson
6, ninja
7, pkg-config
8, serd
9, sord
10, writeScript
11}:
12
13stdenv.mkDerivation rec {
14 pname = "sratom";
15 version = "0.6.14";
16
17 outputs = [ "out" "dev" ];
18
19 src = fetchurl {
20 url = "https://download.drobilla.net/${pname}-${version}.tar.xz";
21 hash = "sha256-mYL69A24Ou3Zs4UOSZ/s1oUri0um3t5RQBNlXP+soeY=";
22 };
23
24 strictDeps = true;
25
26 nativeBuildInputs = [
27 meson
28 ninja
29 pkg-config
30 ];
31
32 buildInputs = [
33 lv2
34 serd
35 sord
36 ];
37
38 postPatch = ''
39 patchShebangs --build scripts/dox_to_sphinx.py
40 '';
41
42 mesonFlags = [
43 "-Ddocs=disabled"
44 ];
45
46 passthru = {
47 updateScript = writeScript "update-sratom" ''
48 #!/usr/bin/env nix-shell
49 #!nix-shell -i bash -p curl pcre common-updater-scripts
50
51 set -eu -o pipefail
52
53 # Expect the text in format of 'download.drobilla.net/sratom-0.30.16.tar.xz">'
54 new_version="$(curl -s https://drobilla.net/category/sratom/ |
55 pcregrep -o1 'download.drobilla.net/sratom-([0-9.]+).tar.xz' |
56 head -n1)"
57 update-source-version ${pname} "$new_version"
58 '';
59 };
60
61 meta = with lib; {
62 homepage = "https://drobilla.net/software/sratom";
63 description = "A library for serialising LV2 atoms to/from RDF";
64 license = licenses.mit;
65 maintainers = [ maintainers.goibhniu ];
66 platforms = platforms.unix;
67 };
68}