Skip to content

Commit

Permalink
mir: 2.17.2 -> 2.18.2 (NixOS#342624)
Browse files Browse the repository at this point in the history
  • Loading branch information
OPNA2608 authored Oct 2, 2024
2 parents b12b45e + 27f1f46 commit b7d495d
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 48 deletions.
4 changes: 2 additions & 2 deletions pkgs/by-name/mi/miracle-wm/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@

stdenv.mkDerivation (finalAttrs: {
pname = "miracle-wm";
version = "0.3.5";
version = "0.3.6";

src = fetchFromGitHub {
owner = "mattkae";
repo = "miracle-wm";
rev = "v${finalAttrs.version}";
hash = "sha256-2OoMkD4ChNXzqqzdOvzYRL0UYU7Uecm5yTXCvG45jCI=";
hash = "sha256-fK/g6DhcxJMvxujZDZXs1yXRu2FGZQKmhxw7/czAQiY=";
};

patches = [
Expand Down
94 changes: 50 additions & 44 deletions pkgs/servers/mir/common.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
stdenv,
lib,
fetchFromGitHub,
nixosTests,
testers,
cmake,
pkg-config,
Expand All @@ -12,6 +13,7 @@
glib,
glm,
glog,
libapparmor,
libdrm,
libepoxy,
libevdev,
Expand Down Expand Up @@ -58,28 +60,31 @@ stdenv.mkDerivation (finalAttrs: {

inherit patches;

postPatch = ''
# Fix scripts that get run in tests
patchShebangs tools/detect_fd_leaks.bash tests/acceptance-tests/wayland-generator/test_wayland_generator.sh.in
# Fix LD_PRELOADing in tests
substituteInPlace \
cmake/MirCommon.cmake \
tests/umock-acceptance-tests/CMakeLists.txt \
tests/unit-tests/platforms/gbm-kms/kms/CMakeLists.txt \
tests/unit-tests/CMakeLists.txt \
--replace-warn 'LD_PRELOAD=liblttng-ust-fork.so' 'LD_PRELOAD=${lib.getLib lttng-ust}/lib/liblttng-ust-fork.so' \
--replace-warn 'LD_PRELOAD=libumockdev-preload.so.0' 'LD_PRELOAD=${lib.getLib umockdev}/lib/libumockdev-preload.so.0'
# Fix Xwayland default
substituteInPlace src/miral/x11_support.cpp \
--replace-fail '/usr/bin/Xwayland' '${lib.getExe xwayland}'
# Fix paths for generating drm-formats
substituteInPlace src/platform/graphics/CMakeLists.txt \
--replace-fail "/usr/include/drm/drm_fourcc.h" "${lib.getDev libdrm}/include/libdrm/drm_fourcc.h" \
--replace-fail "/usr/include/libdrm/drm_fourcc.h" "${lib.getDev libdrm}/include/libdrm/drm_fourcc.h"
'';
postPatch =
''
# Fix scripts that get run in tests
patchShebangs tools/detect_fd_leaks.bash tests/acceptance-tests/wayland-generator/test_wayland_generator.sh.in
# Fix LD_PRELOADing in tests
substituteInPlace \
cmake/MirCommon.cmake \
tests/umock-acceptance-tests/CMakeLists.txt \
tests/unit-tests/platforms/gbm-kms/kms/CMakeLists.txt \
tests/unit-tests/CMakeLists.txt \
--replace-warn 'LD_PRELOAD=liblttng-ust-fork.so' 'LD_PRELOAD=${lib.getLib lttng-ust}/lib/liblttng-ust-fork.so' \
--replace-warn 'LD_PRELOAD=libumockdev-preload.so.0' 'LD_PRELOAD=${lib.getLib umockdev}/lib/libumockdev-preload.so.0'
# Fix Xwayland default
substituteInPlace src/miral/x11_support.cpp \
--replace-fail '/usr/bin/Xwayland' '${lib.getExe xwayland}'
''
+ lib.optionalString (lib.strings.versionOlder version "2.18.0") ''
# Fix paths for generating drm-formats
substituteInPlace src/platform/graphics/CMakeLists.txt \
--replace-fail "/usr/include/drm/drm_fourcc.h" "${lib.getDev libdrm}/include/libdrm/drm_fourcc.h" \
--replace-fail "/usr/include/libdrm/drm_fourcc.h" "${lib.getDev libdrm}/include/libdrm/drm_fourcc.h"
'';

strictDeps = true;

Expand Down Expand Up @@ -127,7 +132,7 @@ stdenv.mkDerivation (finalAttrs: {
xorg.libXcursor
xorg.xorgproto
xwayland
];
] ++ lib.optionals (lib.strings.versionAtLeast version "2.18.0") [ libapparmor ];

nativeCheckInputs = [
dbus
Expand Down Expand Up @@ -181,7 +186,9 @@ stdenv.mkDerivation (finalAttrs: {
];

passthru = {
tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage;
tests = {
pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage;
} // lib.optionalAttrs (!pinned) { inherit (nixosTests) miriway miracle-wm; };
providedSessions = lib.optionals (lib.strings.versionOlder version "2.16.0") [
# More of an example than a fully functioning shell, some notes for the adventurous:
# - ~/.config/miral-shell.config is one possible user config location,
Expand All @@ -192,9 +199,7 @@ stdenv.mkDerivation (finalAttrs: {
# does not know about preferred terminal
"mir-shell"
];
} // lib.optionalAttrs (!pinned) {
updateScript = ./update.sh;
};
} // lib.optionalAttrs (!pinned) { updateScript = ./update.sh; };

meta = {
description = "Display server and Wayland compositor developed by Canonical";
Expand All @@ -206,22 +211,23 @@ stdenv.mkDerivation (finalAttrs: {
OPNA2608
];
platforms = lib.platforms.linux;
pkgConfigModules = [
"miral"
"mircommon"
"mircore"
"miroil"
"mirplatform"
"mir-renderer-gl-dev"
"mirrenderer"
"mirserver"
"mirtest"
"mirwayland"
] ++ lib.optionals (lib.strings.versionOlder version "2.17.0") [
"mircookie"
] ++ lib.optionals (lib.strings.versionAtLeast version "2.17.0") [
"mircommon-internal"
"mirserver-internal"
];
pkgConfigModules =
[
"miral"
"mircommon"
"mircore"
"miroil"
"mirplatform"
"mir-renderer-gl-dev"
"mirrenderer"
"mirserver"
"mirtest"
"mirwayland"
]
++ lib.optionals (lib.strings.versionOlder version "2.17.0") [ "mircookie" ]
++ lib.optionals (lib.strings.versionAtLeast version "2.17.0") [
"mircommon-internal"
"mirserver-internal"
];
};
})
4 changes: 2 additions & 2 deletions pkgs/servers/mir/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ let
in
{
mir = common {
version = "2.17.2";
hash = "sha256-OwOGt3X7+UchksyPf/sodit2PHpSlpP2S3gkCPcdzfE=";
version = "2.18.2";
hash = "sha256-Yko5ws8dUazPziXzM77Zg4p1taC0mbjAcpOKJR0dJ5M=";
};

mir_2_15 = common {
Expand Down

0 comments on commit b7d495d

Please sign in to comment.