about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/gsettings-qt
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/gsettings-qt')
-rw-r--r--nixpkgs/pkgs/development/libraries/gsettings-qt/default.nix62
1 files changed, 62 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/libraries/gsettings-qt/default.nix b/nixpkgs/pkgs/development/libraries/gsettings-qt/default.nix
new file mode 100644
index 000000000000..5f09f437f04f
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gsettings-qt/default.nix
@@ -0,0 +1,62 @@
+{ stdenv, fetchbzr, pkgconfig
+, qmake, qtbase, qtdeclarative, wrapQtAppsHook
+, glib, gobject-introspection
+}:
+
+stdenv.mkDerivation {
+  pname = "gsettings-qt";
+  version = "0.1.20170824";
+
+  src = fetchbzr {
+    url = "http://bazaar.launchpad.net/~system-settings-touch/gsettings-qt/trunk";
+    rev = "85";
+    sha256 = "1kcw0fgdyndx9c0dyha11wkj0gi05spdc1adf1609mrinbb4rnyi";
+  };
+
+  nativeBuildInputs = [
+    pkgconfig
+    qmake
+    gobject-introspection
+    wrapQtAppsHook
+  ];
+
+  buildInputs = [
+    glib
+    qtdeclarative
+  ];
+
+  patchPhase = ''
+    # force ordered build of subdirs
+    sed -i -e "\$aCONFIG += ordered" gsettings-qt.pro
+
+    # It seems that there is a bug in qtdeclarative: qmlplugindump fails
+    # because it can not find or load the Qt platform plugin "minimal".
+    # A workaround is to set QT_PLUGIN_PATH and QML2_IMPORT_PATH explicitly.
+    export QT_PLUGIN_PATH=${qtbase.bin}/${qtbase.qtPluginPrefix}
+    export QML2_IMPORT_PATH=${qtdeclarative.bin}/${qtbase.qtQmlPrefix}
+
+    substituteInPlace GSettings/gsettings-qt.pro \
+      --replace '$$[QT_INSTALL_QML]' "$out/$qtQmlPrefix" \
+      --replace '$$[QT_INSTALL_BINS]/qmlplugindump' "qmlplugindump"
+
+    substituteInPlace src/gsettings-qt.pro \
+      --replace '$$[QT_INSTALL_LIBS]' "$out/lib" \
+      --replace '$$[QT_INSTALL_HEADERS]' "$out/include"
+  '';
+
+  preInstall = ''
+    # do not install tests
+    for f in tests/Makefile{,.cpptest}; do
+      substituteInPlace $f \
+        --replace "install: install_target" "install: "
+    done
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Qt/QML bindings for GSettings";
+    homepage = "https://launchpad.net/gsettings-qt";
+    license = licenses.lgpl3;
+    platforms = platforms.linux;
+    maintainers = [ maintainers.romildo ];
+  };
+}