@@ -0,0 +1,58 @@
1+{ stdenv, fetchbzr, pkgconfig, qmake, qtbase, qtdeclarative, glib, gobjectIntrospection }:
2+
3+stdenv.mkDerivation rec {
4+ name = "gsettings-qt-${version}";
5+ version = "0.1.20170824";
6+
7+ src = fetchbzr {
8+ url = http://bazaar.launchpad.net/~system-settings-touch/gsettings-qt/trunk;
9+ rev = "85";
10+ sha256 = "1kcw0fgdyndx9c0dyha11wkj0gi05spdc1adf1609mrinbb4rnyi";
11+ };
12+
13+ nativeBuildInputs = [
14+ pkgconfig
15+ qmake
16+ gobjectIntrospection
17+ ];
18+
19+ buildInputs = [
20+ glib
21+ qtdeclarative
22+ ];
23+
24+ patchPhase = ''
25+ # force ordered build of subdirs
26+ sed -i -e "\$aCONFIG += ordered" gsettings-qt.pro
27+
28+ # It seems that there is a bug in qtdeclarative: qmlplugindump fails
29+ # because it can not find or load the Qt platform plugin "minimal".
30+ # A workaround is to set QT_PLUGIN_PATH and QML2_IMPORT_PATH explicitly.
31+ export QT_PLUGIN_PATH=${qtbase.bin}/${qtbase.qtPluginPrefix}
32+ export QML2_IMPORT_PATH=${qtdeclarative.bin}/${qtbase.qtQmlPrefix}
33+
34+ substituteInPlace GSettings/gsettings-qt.pro \
35+ --replace '$$[QT_INSTALL_QML]' "$out/$qtQmlPrefix" \
36+ --replace '$$[QT_INSTALL_BINS]/qmlplugindump' "qmlplugindump"
37+
38+ substituteInPlace src/gsettings-qt.pro \
39+ --replace '$$[QT_INSTALL_LIBS]' "$out/lib" \
40+ --replace '$$[QT_INSTALL_HEADERS]' "$out/include"
41+ '';
42+
43+ preInstall = ''
44+ # do not install tests
45+ for f in tests/Makefile{,.cpptest}; do
46+ substituteInPlace $f \
47+ --replace "install: install_target" "install: "
48+ done
49+ '';
50+
51+ meta = with stdenv.lib; {
52+ description = "Qt/QML bindings for GSettings";
53+ homepage = https://launchpad.net/gsettings-qt;
54+ license = licenses.lgpl3;
55+ platforms = platforms.linux;
56+ maintainers = [ maintainers.romildo ];
57+ };
58+}