about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/qmenumodel
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2023-12-01 19:00:09 +0100
committerAlyssa Ross <hi@alyssa.is>2023-12-01 19:00:09 +0100
commit9e9b07490d5bab5d115c66b80bdb10ff0c11ed8d (patch)
tree4368f9e4cb2d5b93a956c085337e45cb70f1e331 /nixpkgs/pkgs/development/libraries/qmenumodel
parenta9cbfb6941b47d6f50129e6e36927882392daed7 (diff)
parent2344fe1da14cb08b0c18743b207995f9b8597915 (diff)
downloadnixlib-9e9b07490d5bab5d115c66b80bdb10ff0c11ed8d.tar
nixlib-9e9b07490d5bab5d115c66b80bdb10ff0c11ed8d.tar.gz
nixlib-9e9b07490d5bab5d115c66b80bdb10ff0c11ed8d.tar.bz2
nixlib-9e9b07490d5bab5d115c66b80bdb10ff0c11ed8d.tar.lz
nixlib-9e9b07490d5bab5d115c66b80bdb10ff0c11ed8d.tar.xz
nixlib-9e9b07490d5bab5d115c66b80bdb10ff0c11ed8d.tar.zst
nixlib-9e9b07490d5bab5d115c66b80bdb10ff0c11ed8d.zip
Merge https://github.com/NixOS/nixpkgs
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/qmenumodel')
-rw-r--r--nixpkgs/pkgs/development/libraries/qmenumodel/default.nix99
1 files changed, 99 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/libraries/qmenumodel/default.nix b/nixpkgs/pkgs/development/libraries/qmenumodel/default.nix
new file mode 100644
index 000000000000..a8d11529808f
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qmenumodel/default.nix
@@ -0,0 +1,99 @@
+{ stdenv
+, lib
+, fetchFromGitHub
+, gitUpdater
+, testers
+, cmake
+, cmake-extras
+, dbus
+, dbus-test-runner
+, glib
+, pkg-config
+, python3
+, qtbase
+, qtdeclarative
+}:
+
+stdenv.mkDerivation (finalAttrs: {
+  pname = "qmenumodel";
+  version = "0.9.2";
+
+  src = fetchFromGitHub {
+    owner = "AyatanaIndicators";
+    repo = "qmenumodel";
+    rev = finalAttrs.version;
+    hash = "sha256-zbKAfq9R5fD2IqVYOAhy903QX1TDom9m6Ib2qpkFMak=";
+  };
+
+  outputs = [ "out" "dev" ];
+
+  postPatch = ''
+    substituteInPlace libqmenumodel/src/qmenumodel.pc.in \
+      --replace "\''${exec_prefix}/@CMAKE_INSTALL_LIBDIR@" "\''${prefix}/lib" \
+      --replace "\''${prefix}/@CMAKE_INSTALL_INCLUDEDIR@" "\''${prefix}/include"
+
+    substituteInPlace libqmenumodel/QMenuModel/CMakeLists.txt \
+      --replace "\''${CMAKE_INSTALL_LIBDIR}/qt5/qml" "\''${CMAKE_INSTALL_PREFIX}/${qtbase.qtQmlPrefix}"
+  '' + lib.optionalString finalAttrs.doCheck ''
+    patchShebangs tests/{client,script}/*.py
+  '';
+
+  strictDeps = true;
+
+  nativeBuildInputs = [
+    cmake
+    pkg-config
+  ];
+
+  buildInputs = [
+    cmake-extras
+    glib
+    qtbase
+    qtdeclarative
+  ];
+
+  nativeCheckInputs = [
+    dbus
+    dbus-test-runner
+    (python3.withPackages (ps: with ps; [
+      dbus-python
+      pygobject3
+    ]))
+  ];
+
+  dontWrapQtApps = true;
+
+  cmakeFlags = [
+    "-DENABLE_TESTS=${lib.boolToString finalAttrs.doCheck}"
+  ];
+
+  doCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform;
+
+  # Tests have been flaky sometimes, hoping that not running in parallel helps
+  enableParallelChecking = false;
+
+  preCheck = ''
+    # Tests all need some Qt stuff
+    export QT_PLUGIN_PATH=${lib.getBin qtbase}/${qtbase.qtPluginPrefix}
+  '';
+
+  passthru = {
+    tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage;
+    updateScript = gitUpdater { };
+  };
+
+  meta = with lib; {
+    description = "Qt5 renderer for Ayatana Indicators";
+    longDescription = ''
+      QMenuModel - a Qt/QML binding for GMenuModel
+      (see http://developer.gnome.org/gio/unstable/GMenuModel.html)
+    '';
+    homepage = "https://github.com/AyatanaIndicators/qmenumodel";
+    license = licenses.lgpl3Only;
+    maintainers = teams.lomiri.members;
+    platforms = platforms.linux;
+    pkgConfigModules = [
+      "qmenumodel"
+    ];
+  };
+})