Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ lib, stdenv
2, fetchurl
3, fetchpatch
4, pkg-config
5, meson
6, ninja
7, gettext
8, gobject-introspection
9, gtk-doc
10, docbook_xsl
11, glib
12, libsoup_3
13, libxml2
14, libxslt
15, check
16, curl
17, perl
18, hwdata
19, osinfo-db
20, substituteAll
21, vala ? null
22}:
23
24stdenv.mkDerivation rec {
25 pname = "libosinfo";
26 version = "1.10.0";
27
28 src = fetchurl {
29 url = "https://releases.pagure.org/${pname}/${pname}-${version}.tar.xz";
30 sha256 = "sha256-olLgD8WA3rIdoNqMCqA7jDHoRAuESMi5gUP6tHfTIwU=";
31 };
32
33 outputs = [ "out" "dev" ]
34 ++ lib.optional (stdenv.hostPlatform == stdenv.buildPlatform) "devdoc";
35
36 nativeBuildInputs = [
37 pkg-config
38 meson
39 ninja
40 vala
41 gettext
42 gobject-introspection
43 gtk-doc
44 docbook_xsl
45 perl # for pod2man
46 ];
47 buildInputs = [
48 glib
49 libsoup_3
50 libxml2
51 libxslt
52 ];
53 nativeCheckInputs = [
54 check
55 curl
56 perl
57 ];
58
59 patches = [
60 (substituteAll {
61 src = ./osinfo-db-data-dir.patch;
62 osinfo_db_data_dir = "${osinfo-db}/share";
63 })
64 ];
65
66 mesonFlags = [
67 "-Dwith-usb-ids-path=${hwdata}/share/hwdata/usb.ids"
68 "-Dwith-pci-ids-path=${hwdata}/share/hwdata/pci.ids"
69 "-Denable-gtk-doc=true"
70 ];
71
72 preCheck = ''
73 patchShebangs ../osinfo/check-symfile.pl ../osinfo/check-symsorting.pl
74 '';
75
76 doCheck = true;
77
78 meta = with lib; {
79 description = "GObject based library API for managing information about operating systems, hypervisors and the (virtual) hardware devices they can support";
80 homepage = "https://libosinfo.org/";
81 changelog = "https://gitlab.com/libosinfo/libosinfo/-/blob/v${version}/NEWS";
82 license = licenses.lgpl2Plus;
83 platforms = platforms.unix;
84 maintainers = [ maintainers.bjornfor ];
85 };
86}