40 stdenv.mkDerivation (finalAttrs: {
44 src = fetchFromGitHub {
47 rev = "v${finalAttrs.version}";
48 hash = "sha256-c1+gxzLEtNCjR/mx76O5QElQ8+AO4WsfcG7Wy1+nC6E=";
53 # Remove when version > 2.15.0
55 name = "0001-mir-Fix-the-signature-of-drmModeCrtcSetGamma.patch";
56 url = "https://github.com/MirServer/mir/commit/98250e9c32c5b9b940da2fb0a32d8139bbc68157.patch";
57 hash = "sha256-tTtOHGNue5rsppOIQSfkOH5sVfFSn/KPGHmubNlRtLI=";
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
66 for needsPreloadFixing in \
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
72 substituteInPlace $needsPreloadFixing \
73 --replace 'LD_PRELOAD=liblttng-ust-fork.so' 'LD_PRELOAD=${lib.getLib lttng-ust}/lib/liblttng-ust-fork.so' \
74 --replace '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 '/usr/bin/Xwayland' '${lib.getExe xwayland}'
81 # Fix paths for generating drm-formats
82 substituteInPlace src/platform/graphics/CMakeLists.txt \
83 --replace "/usr/include/drm/drm_fourcc.h" "${lib.getDev libdrm}/include/libdrm/drm_fourcc.h" \
84 --replace "/usr/include/libdrm/drm_fourcc.h" "${lib.getDev libdrm}/include/libdrm/drm_fourcc.h"
92 lttng-ust # lttng-gen-tp
94 (python3.withPackages (ps: with ps; [
96 ] ++ lib.optionals finalAttrs.finalPackage.doCheck [
131 nativeCheckInputs = [
142 "-DBUILD_DOXYGEN=OFF"
143 "-DMIR_PLATFORM='gbm-kms;x11;eglstream-kms;wayland'"
144 "-DMIR_ENABLE_TESTS=${if finalAttrs.finalPackage.doCheck then "ON" else "OFF"}"
145 # BadBufferTest.test_truncated_shm_file *doesn't* throw an error as the test expected, mark as such
146 # https://github.com/MirServer/mir/pull/1947#issuecomment-811810872
147 "-DMIR_SIGBUS_HANDLER_ENVIRONMENT_BROKEN=ON"
148 "-DMIR_EXCLUDE_TESTS=${lib.strings.concatStringsSep ";" [
150 # These get built but don't get executed by default, yet they get installed when tests are enabled
151 "-DMIR_BUILD_PERFORMANCE_TESTS=OFF"
152 "-DMIR_BUILD_PLATFORM_TEST_HARNESS=OFF"
153 # https://github.com/MirServer/mir/issues/2987
154 # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106799
155 "-DMIR_USE_PRECOMPILED_HEADERS=OFF"
158 doCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform;
161 # Needs to be exactly /tmp so some failing tests don't get run, don't know why they fail yet
162 # https://github.com/MirServer/mir/issues/2801
163 export XDG_RUNTIME_DIR=/tmp
166 outputs = [ "out" "dev" ];
169 tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage;
170 updateScript = gitUpdater {
173 # More of an example than a fully functioning shell, some notes for the adventurous:
174 # - ~/.config/miral-shell.config is one possible user config location,
175 # accepted options=value are according to `mir-shell --help`
176 # - default icon theme setting is DMZ-White, needs vanilla-dmz installed & on XCURSOR_PATH
177 # or setting to be changed to an available theme
178 # - terminal emulator setting may need to be changed if miral-terminal script
179 # does not know about preferred terminal
180 providedSessions = [ "mir-shell" ];
184 description = "A display server and Wayland compositor developed by Canonical";
185 homepage = "https://mir-server.io";
186 changelog = "https://github.com/MirServer/mir/releases/tag/v${finalAttrs.version}";
187 license = licenses.gpl2Plus;
188 maintainers = with maintainers; [ onny OPNA2608 ];
189 platforms = platforms.linux;
197 "mir-renderer-gl-dev"