Merge pull request #232227 from OPNA2608/fix/mir_modernise

This commit is contained in:
Sandro 2023-05-29 20:23:40 +02:00 committed by GitHub
commit 90475fe1f8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3,6 +3,7 @@
, fetchFromGitHub
, fetchpatch
, gitUpdater
, testers
, cmake
, pkg-config
, python3
@ -35,26 +36,17 @@
, gtest
, umockdev
, wlcs
, validatePkgConfig
}:
let
doCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform;
pythonEnv = python3.withPackages(ps: with ps; [
pillow
] ++ lib.optionals doCheck [
pygobject3
python-dbusmock
]);
in
stdenv.mkDerivation rec {
stdenv.mkDerivation (finalAttrs: {
pname = "mir";
version = "2.13.0";
src = fetchFromGitHub {
owner = "MirServer";
repo = "mir";
rev = "v${version}";
rev = "v${finalAttrs.version}";
hash = "sha256-Ip8p4mjcgmZQJTU4MNvWkTTtSJc+cCL3x1mMDFlZrVY=";
};
@ -109,7 +101,13 @@ stdenv.mkDerivation rec {
libxslt
lttng-ust # lttng-gen-tp
pkg-config
pythonEnv
(python3.withPackages (ps: with ps; [
pillow
] ++ lib.optionals finalAttrs.doCheck [
pygobject3
python-dbusmock
]))
validatePkgConfig
];
buildInputs = [
@ -138,21 +136,23 @@ stdenv.mkDerivation rec {
xorg.libXcursor
xorg.xorgproto
xwayland
] ++ lib.optionals doCheck [
gtest
umockdev
wlcs
];
nativeCheckInputs = [
dbus
];
checkInputs = [
gtest
umockdev
wlcs
];
buildFlags = [ "all" "doc" ];
cmakeFlags = [
"-DMIR_PLATFORM='gbm-kms;x11;eglstream-kms;wayland'"
"-DMIR_ENABLE_TESTS=${if doCheck then "ON" else "OFF"}"
"-DMIR_ENABLE_TESTS=${if finalAttrs.doCheck then "ON" else "OFF"}"
# BadBufferTest.test_truncated_shm_file *doesn't* throw an error as the test expected, mark as such
# https://github.com/MirServer/mir/pull/1947#issuecomment-811810872
"-DMIR_SIGBUS_HANDLER_ENVIRONMENT_BROKEN=ON"
@ -163,7 +163,7 @@ stdenv.mkDerivation rec {
"-DMIR_BUILD_PLATFORM_TEST_HARNESS=OFF"
];
inherit doCheck;
doCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform;
preCheck = ''
# Needs to be exactly /tmp so some failing tests don't get run, don't know why they fail yet
@ -174,6 +174,7 @@ stdenv.mkDerivation rec {
outputs = [ "out" "dev" "doc" ];
passthru = {
tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage;
updateScript = gitUpdater {
rev-prefix = "v";
};
@ -190,8 +191,22 @@ stdenv.mkDerivation rec {
meta = with lib; {
description = "A display server and Wayland compositor developed by Canonical";
homepage = "https://mir-server.io";
changelog = "https://github.com/MirServer/mir/releases/tag/v${finalAttrs.version}";
license = licenses.gpl2Plus;
maintainers = with maintainers; [ onny OPNA2608 ];
platforms = platforms.linux;
pkgConfigModules = [
"miral"
"mircommon"
"mircookie"
"mircore"
"miroil"
"mirplatform"
"mir-renderer-gl-dev"
"mirrenderer"
"mirserver"
"mirtest"
"mirwayland"
];
};
}
})