Merge pull request #259804 from OPNA2608/init/lomiri/qtmir

lomiri.qtmir: init at 0.7.2-unstable-2024-01-08

authored by Peder Bergebakken Sundt and committed by GitHub e7120ab3 0d308a02

+161
+1
pkgs/desktops/lomiri/default.nix
··· 24 24 libusermetrics = callPackage ./development/libusermetrics { }; 25 25 lomiri-api = callPackage ./development/lomiri-api { }; 26 26 lomiri-app-launch = callPackage ./development/lomiri-app-launch { }; 27 + qtmir = callPackage ./development/qtmir { }; 27 28 trust-store = callPackage ./development/trust-store { }; 28 29 u1db-qt = callPackage ./development/u1db-qt { }; 29 30
+160
pkgs/desktops/lomiri/development/qtmir/default.nix
··· 1 + { stdenv 2 + , lib 3 + , fetchFromGitLab 4 + , fetchpatch 5 + , testers 6 + , cmake 7 + , cmake-extras 8 + , pkg-config 9 + , wrapQtAppsHook 10 + , gsettings-qt 11 + , gtest 12 + , libqtdbustest 13 + , libqtdbusmock 14 + , libuuid 15 + , lomiri-api 16 + , lomiri-app-launch 17 + , lomiri-url-dispatcher 18 + , lttng-ust 19 + , mir 20 + , process-cpp 21 + , qtbase 22 + , qtdeclarative 23 + , qtsensors 24 + , valgrind 25 + , protobuf 26 + , glm 27 + , boost 28 + , properties-cpp 29 + , glib 30 + , validatePkgConfig 31 + , wayland 32 + , xwayland 33 + }: 34 + 35 + stdenv.mkDerivation (finalAttrs: { 36 + # Not regular qtmir, experimental support for Mir 2.x 37 + # Currently following https://gitlab.com/ubports/development/core/qtmir/-/tree/personal/mariogrip/desktop-development 38 + pname = "qtmir-mir2"; 39 + version = "0.7.2-unstable-2024-01-08"; 40 + 41 + src = fetchFromGitLab { 42 + owner = "ubports"; 43 + repo = "development/core/qtmir"; 44 + rev = "ae0d87415d5c9ed2c4fd2284ba0807d23d564bb0"; 45 + hash = "sha256-fE8ttCC0FNavs91pASGGG7k7nKVg2lD3JK0WTmCA3gM="; 46 + }; 47 + 48 + outputs = [ 49 + "out" 50 + "dev" 51 + ]; 52 + 53 + patches = [ 54 + # Mir 2.15 compatibility patch 55 + # Remove when https://gitlab.com/ubports/development/core/qtmir/-/merge_requests/70 merged into branch 56 + (fetchpatch { 57 + name = "0001-qtmir-Update-for-Mir-2.15-removals.patch"; 58 + url = "https://gitlab.com/ubports/development/core/qtmir/-/commit/ead5cacd4d69094ab956627f4dd94ecaff1fd69e.patch"; 59 + hash = "sha256-hUUUnYwhNH3gm76J21M8gA5okaRd/Go03ZFJ4qn0JUo="; 60 + }) 61 + 62 + # Remove when https://gitlab.com/ubports/development/core/qtmir/-/merge_requests/72 merged in branch 63 + (fetchpatch { 64 + name = "0002-qtmir-Add-more-better-GNUInstallDirs-variables-usage.patch"; 65 + url = "https://gitlab.com/ubports/development/core/qtmir/-/commit/87e2cd31052ce15e9625c1327807a320ee5d12af.patch"; 66 + hash = "sha256-MTE9tHw+xJhraEO1up7dLg0UIcmfHXgWOeuyYrVu2wc="; 67 + }) 68 + 69 + # Remove when https://gitlab.com/ubports/development/core/qtmir/-/merge_requests/73 merged in branch 70 + (fetchpatch { 71 + name = "0003-qtmir-CMakeLists-Only-require-test-dependencies-when-building-tests.patch"; 72 + url = "https://gitlab.com/ubports/development/core/qtmir/-/commit/b7144e67bcbb4cfbd2283d5d05146fb22b7d8cd4.patch"; 73 + hash = "sha256-Afbj40MopztchDnk6fphTYk86YrQkiK8L1e/oXiL1Mw="; 74 + }) 75 + 76 + # Remove when https://gitlab.com/ubports/development/core/qtmir/-/merge_requests/74 merged in branch 77 + (fetchpatch { 78 + name = "0004-qtmir-CMakeLists-Drop-call-of-Qt-internal-macro.patch"; 79 + url = "https://gitlab.com/ubports/development/core/qtmir/-/commit/8f9c599a4dbc4cf35e289157fd0c82df55b9f8d9.patch"; 80 + hash = "sha256-SMAErXnlMtVleWRPgO4xuUI7gAAy6W18LxtgXgetRA4="; 81 + }) 82 + ]; 83 + 84 + postPatch = '' 85 + substituteInPlace CMakeLists.txt \ 86 + --replace "\''${CMAKE_INSTALL_FULL_LIBDIR}/qt5/qml" "\''${CMAKE_INSTALL_PREFIX}/${qtbase.qtQmlPrefix}" \ 87 + --replace "\''${CMAKE_INSTALL_FULL_LIBDIR}/qt5/plugins/platforms" "\''${CMAKE_INSTALL_PREFIX}/${qtbase.qtPluginPrefix}/platforms" \ 88 + 89 + substituteInPlace data/xwayland.qtmir.desktop \ 90 + --replace '/usr/bin/Xwayland' 'Xwayland' 91 + ''; 92 + 93 + strictDeps = true; 94 + 95 + nativeBuildInputs = [ 96 + cmake 97 + glib # glib-compile-schemas 98 + pkg-config 99 + validatePkgConfig 100 + wrapQtAppsHook 101 + ]; 102 + 103 + buildInputs = [ 104 + cmake-extras 105 + boost 106 + gsettings-qt 107 + libuuid 108 + lomiri-api 109 + lomiri-app-launch 110 + lomiri-url-dispatcher 111 + lttng-ust 112 + mir 113 + process-cpp 114 + protobuf 115 + qtbase 116 + qtdeclarative 117 + qtsensors 118 + valgrind 119 + 120 + glm # included by mir header 121 + wayland # mirwayland asks for this 122 + properties-cpp # included by l-a-l header 123 + ]; 124 + 125 + propagatedBuildInputs = [ 126 + # Needs Xwayland on PATH for desktop file, else launching X11 applications crashes qtmir 127 + xwayland 128 + ]; 129 + 130 + checkInputs = [ 131 + gtest 132 + libqtdbustest 133 + libqtdbusmock 134 + ]; 135 + 136 + cmakeFlags = [ 137 + (lib.cmakeBool "NO_TESTS" (!finalAttrs.finalPackage.doCheck)) 138 + (lib.cmakeBool "WITH_MIR2" true) 139 + ]; 140 + 141 + postInstall = '' 142 + glib-compile-schemas $out/share/glib-2.0/schemas 143 + ''; 144 + 145 + # Tests currently unavailable when building with Mir2 146 + doCheck = false; 147 + 148 + passthru.tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage; 149 + 150 + meta = with lib; { 151 + description = "QPA plugin to make Qt a Mir server"; 152 + homepage = "https://gitlab.com/ubports/development/core/qtmir"; 153 + license = licenses.lgpl3Only; 154 + maintainers = teams.lomiri.members; 155 + platforms = platforms.linux; 156 + pkgConfigModules = [ 157 + "qtmirserver" 158 + ]; 159 + }; 160 + })