36 gobject-introspection,
50 stdenv.mkDerivation (finalAttrs: {
54 src = fetchFromGitHub {
57 rev = "v${finalAttrs.version}";
65 # Fix scripts that get run in tests
66 patchShebangs tools/detect_fd_leaks.bash tests/acceptance-tests/wayland-generator/test_wayland_generator.sh.in
68 # Fix LD_PRELOADing in tests
70 cmake/MirCommon.cmake \
71 tests/umock-acceptance-tests/CMakeLists.txt \
72 tests/unit-tests/platforms/gbm-kms/kms/CMakeLists.txt \
73 tests/unit-tests/CMakeLists.txt \
74 --replace-warn 'LD_PRELOAD=liblttng-ust-fork.so' 'LD_PRELOAD=${lib.getLib lttng-ust}/lib/liblttng-ust-fork.so' \
75 --replace-warn 'LD_PRELOAD=libumockdev-preload.so.0' 'LD_PRELOAD=${lib.getLib umockdev}/lib/libumockdev-preload.so.0'
77 # Fix Xwayland default
78 substituteInPlace src/miral/x11_support.cpp \
79 --replace-fail '/usr/bin/Xwayland' '${lib.getExe xwayland}'
81 + lib.optionalString (lib.strings.versionOlder version "2.18.0") ''
83 # Fix paths for generating drm-formats
84 substituteInPlace src/platform/graphics/CMakeLists.txt \
85 --replace-fail "/usr/include/drm/drm_fourcc.h" "${lib.getDev libdrm}/include/libdrm/drm_fourcc.h" \
86 --replace-fail "/usr/include/libdrm/drm_fourcc.h" "${lib.getDev libdrm}/include/libdrm/drm_fourcc.h"
94 lttng-ust # lttng-gen-tp
96 (python3.withPackages (
100 ++ lib.optionals finalAttrs.finalPackage.doCheck [
135 ] ++ lib.optionals (lib.strings.versionAtLeast version "2.18.0") [ libapparmor ];
137 nativeCheckInputs = [
139 gobject-introspection
149 (lib.cmakeBool "BUILD_DOXYGEN" false)
150 (lib.cmakeFeature "MIR_PLATFORM" (
151 lib.strings.concatStringsSep ";" [
158 (lib.cmakeBool "MIR_ENABLE_TESTS" finalAttrs.finalPackage.doCheck)
159 # BadBufferTest.test_truncated_shm_file *doesn't* throw an error as the test expected, mark as such
160 # https://github.com/canonical/mir/pull/1947#issuecomment-811810872
161 (lib.cmakeBool "MIR_SIGBUS_HANDLER_ENVIRONMENT_BROKEN" true)
162 (lib.cmakeFeature "MIR_EXCLUDE_TESTS" (lib.strings.concatStringsSep ";" [ ]))
163 # These get built but don't get executed by default, yet they get installed when tests are enabled
164 (lib.cmakeBool "MIR_BUILD_PERFORMANCE_TESTS" false)
165 (lib.cmakeBool "MIR_BUILD_PLATFORM_TEST_HARNESS" false)
166 # https://github.com/canonical/mir/issues/2987
167 # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106799
168 (lib.cmakeBool "MIR_USE_PRECOMPILED_HEADERS" false)
169 (lib.cmakeFeature "MIR_COMPILER_QUIRKS" (
170 lib.strings.concatStringsSep ";" [
171 # https://github.com/canonical/mir/issues/3017 actually affects x86_64 as well
172 "test_touchspot_controller.cpp:array-bounds"
177 doCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform;
180 export XDG_RUNTIME_DIR=$TMP
190 pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage;
191 } // lib.optionalAttrs (!pinned) { inherit (nixosTests) miriway miracle-wm; };
192 providedSessions = lib.optionals (lib.strings.versionOlder version "2.16.0") [
193 # More of an example than a fully functioning shell, some notes for the adventurous:
194 # - ~/.config/miral-shell.config is one possible user config location,
195 # accepted options=value are according to `mir-shell --help`
196 # - default icon theme setting is DMZ-White, needs vanilla-dmz installed & on XCURSOR_PATH
197 # or setting to be changed to an available theme
198 # - terminal emulator setting may need to be changed if miral-terminal script
199 # does not know about preferred terminal
202 } // lib.optionalAttrs (!pinned) { updateScript = ./update.sh; };
205 description = "Display server and Wayland compositor developed by Canonical";
206 homepage = "https://mir-server.io";
207 changelog = "https://github.com/canonical/mir/releases/tag/v${finalAttrs.version}";
208 license = lib.licenses.gpl2Plus;
209 maintainers = with lib.maintainers; [
213 platforms = lib.platforms.linux;
221 "mir-renderer-gl-dev"
227 ++ lib.optionals (lib.strings.versionOlder version "2.17.0") [ "mircookie" ]
228 ++ lib.optionals (lib.strings.versionAtLeast version "2.17.0") [