34 gobject-introspection,
48 stdenv.mkDerivation (finalAttrs: {
52 src = fetchFromGitHub {
55 rev = "v${finalAttrs.version}";
62 # Fix scripts that get run in tests
63 patchShebangs tools/detect_fd_leaks.bash tests/acceptance-tests/wayland-generator/test_wayland_generator.sh.in
65 # Fix LD_PRELOADing in tests
67 cmake/MirCommon.cmake \
68 tests/umock-acceptance-tests/CMakeLists.txt \
69 tests/unit-tests/platforms/gbm-kms/kms/CMakeLists.txt \
70 tests/unit-tests/CMakeLists.txt \
71 --replace-warn 'LD_PRELOAD=liblttng-ust-fork.so' 'LD_PRELOAD=${lib.getLib lttng-ust}/lib/liblttng-ust-fork.so' \
72 --replace-warn 'LD_PRELOAD=libumockdev-preload.so.0' 'LD_PRELOAD=${lib.getLib umockdev}/lib/libumockdev-preload.so.0'
74 # Fix Xwayland default
75 substituteInPlace src/miral/x11_support.cpp \
76 --replace-fail '/usr/bin/Xwayland' '${lib.getExe xwayland}'
78 # Fix paths for generating drm-formats
79 substituteInPlace src/platform/graphics/CMakeLists.txt \
80 --replace-fail "/usr/include/drm/drm_fourcc.h" "${lib.getDev libdrm}/include/libdrm/drm_fourcc.h" \
81 --replace-fail "/usr/include/libdrm/drm_fourcc.h" "${lib.getDev libdrm}/include/libdrm/drm_fourcc.h"
89 lttng-ust # lttng-gen-tp
91 (python3.withPackages (
95 ++ lib.optionals finalAttrs.finalPackage.doCheck [
132 nativeCheckInputs = [
134 gobject-introspection
144 (lib.cmakeBool "BUILD_DOXYGEN" false)
145 (lib.cmakeFeature "MIR_PLATFORM" (
146 lib.strings.concatStringsSep ";" [
153 (lib.cmakeBool "MIR_ENABLE_TESTS" finalAttrs.finalPackage.doCheck)
154 # BadBufferTest.test_truncated_shm_file *doesn't* throw an error as the test expected, mark as such
155 # https://github.com/canonical/mir/pull/1947#issuecomment-811810872
156 (lib.cmakeBool "MIR_SIGBUS_HANDLER_ENVIRONMENT_BROKEN" true)
157 (lib.cmakeFeature "MIR_EXCLUDE_TESTS" (lib.strings.concatStringsSep ";" [ ]))
158 # These get built but don't get executed by default, yet they get installed when tests are enabled
159 (lib.cmakeBool "MIR_BUILD_PERFORMANCE_TESTS" false)
160 (lib.cmakeBool "MIR_BUILD_PLATFORM_TEST_HARNESS" false)
161 # https://github.com/canonical/mir/issues/2987
162 # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106799
163 (lib.cmakeBool "MIR_USE_PRECOMPILED_HEADERS" false)
164 (lib.cmakeFeature "MIR_COMPILER_QUIRKS" (
165 lib.strings.concatStringsSep ";" [
166 # https://github.com/canonical/mir/issues/3017 actually affects x86_64 as well
167 "test_touchspot_controller.cpp:array-bounds"
172 doCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform;
175 export XDG_RUNTIME_DIR=$TMP
184 tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage;
185 providedSessions = lib.optionals (lib.strings.versionOlder version "2.16.0") [
186 # More of an example than a fully functioning shell, some notes for the adventurous:
187 # - ~/.config/miral-shell.config is one possible user config location,
188 # accepted options=value are according to `mir-shell --help`
189 # - default icon theme setting is DMZ-White, needs vanilla-dmz installed & on XCURSOR_PATH
190 # or setting to be changed to an available theme
191 # - terminal emulator setting may need to be changed if miral-terminal script
192 # does not know about preferred terminal
195 } // lib.optionalAttrs (!pinned) {
196 updateScript = ./update.sh;
200 description = "Display server and Wayland compositor developed by Canonical";
201 homepage = "https://mir-server.io";
202 changelog = "https://github.com/canonical/mir/releases/tag/v${finalAttrs.version}";
203 license = licenses.gpl2Plus;
204 maintainers = with maintainers; [
208 platforms = platforms.linux;
215 "mir-renderer-gl-dev"
220 ] ++ lib.optionals (lib.strings.versionOlder version "2.17.0") [
222 ] ++ lib.optionals (lib.strings.versionAtLeast version "2.17.0") [