1{
2 stdenv,
3 lib,
4 fetchFromGitHub,
5 fetchpatch,
6 gitUpdater,
7 bison,
8 flex,
9 qmake,
10 pkg-config,
11 libxcrypt,
12}:
13
14stdenv.mkDerivation (finalAttrs: {
15 pname = "libiodata";
16 version = "0.19.14";
17
18 outputs = [
19 "out"
20 "dev"
21 ];
22
23 src = fetchFromGitHub {
24 owner = "sailfishos";
25 repo = "libiodata";
26 tag = finalAttrs.version;
27 hash = "sha256-hhcPKZtg9PEE6rrEfRJ/e4E5xMyButH0Rm0eM3iHPh8=";
28 };
29
30 patches = [
31 # Remove when version > 0.19.14
32 (fetchpatch {
33 name = "0001-libiodata-Fix-dependencies-between-sub-projects.patch";
34 url = "https://github.com/sailfishos/libiodata/commit/85517a9f2103e461cbb69dc195335df73b7a8b7e.patch";
35 hash = "sha256-qrRZ1Af5uBJvEoRHifgUSeVHFC5RATDsL3374CmoUDc=";
36 })
37 ];
38
39 postPatch = ''
40 substituteInPlace root.pro \
41 --replace-fail '$$[QT_HOST_DATA]' "$dev"
42
43 substituteInPlace src/src.pro \
44 --replace-fail '$$[QT_INSTALL_LIBS]' "$out/lib" \
45 --replace-fail '/usr/include' "$dev/include"
46
47 substituteInPlace tests/tests.pro \
48 --replace-fail '/usr/bin' "$dev/bin" \
49 --replace-fail '/usr/share' "$dev/share"
50
51 substituteInPlace type-to-cxx/type-to-cxx.pro \
52 --replace-fail '/usr/bin' "$dev/bin"
53 '';
54
55 # QMake doesn't handle strictDeps well
56 strictDeps = false;
57
58 nativeBuildInputs = [
59 bison
60 flex
61 pkg-config
62 qmake
63 ];
64
65 buildInputs = [
66 libxcrypt
67 ];
68
69 dontWrapQtApps = true;
70
71 postConfigure = ''
72 make qmake_all
73 '';
74
75 env.IODATA_VERSION = "${finalAttrs.version}";
76
77 passthru.updateScript = gitUpdater { };
78
79 meta = {
80 description = "Library for reading and writing simple structured data";
81 homepage = "https://github.com/sailfishos/libiodata";
82 changelog = "https://github.com/sailfishos/libiodata/releases/tag/${finalAttrs.version}";
83 license = lib.licenses.lgpl21Only;
84 teams = [ lib.teams.lomiri ];
85 platforms = lib.platforms.linux;
86 };
87})