Skip to content

Commit

Permalink
Merge pull request #245911 from OPNA2608/init/qmenumodel
Browse files Browse the repository at this point in the history
qmenumodel: init at 0.9.2
  • Loading branch information
pbsds authored Nov 27, 2023
2 parents 538faba + 8838eb9 commit 5c41de4
Show file tree
Hide file tree
Showing 2 changed files with 103 additions and 0 deletions.
99 changes: 99 additions & 0 deletions pkgs/development/libraries/qmenumodel/default.nix
Original file line number Diff line number Diff line change
@@ -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"
];
};
})
4 changes: 4 additions & 0 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -24633,6 +24633,10 @@ with pkgs;

qdjango = libsForQt5.callPackage ../development/libraries/qdjango { };

qmenumodel = libsForQt5.callPackage ../development/libraries/qmenumodel {
inherit (lomiri) cmake-extras;
};

qoi = callPackage ../development/libraries/qoi { };

qolibri = libsForQt5.callPackage ../applications/misc/qolibri { };
Expand Down

0 comments on commit 5c41de4

Please sign in to comment.