[Backport release-24.11] mission-center: use RUSTFLAGS to link libGL and libvulkan; adopt (#357509)

This commit is contained in:
Gaétan Lepage 2024-11-20 23:09:46 +01:00 committed by GitHub
commit 4cb4d316e6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -35,9 +35,8 @@
pango,
sqlite,
udev,
wayland,
vulkan-loader,
wayland,
versionCheckHook,
}:
@ -111,6 +110,7 @@ stdenv.mkDerivation rec {
pango
sqlite
udev
vulkan-loader
wayland
];
@ -118,12 +118,6 @@ stdenv.mkDerivation rec {
substituteInPlace src/sys_info_v2/gatherer.rs \
--replace-fail '"missioncenter-gatherer"' '"${placeholder "out"}/bin/missioncenter-gatherer"'
substituteInPlace $cargoDepsCopy/gl_loader-*/src/glad.c \
--replace-fail "libGL.so.1" "${libGL}/lib/libGL.so.1"
substituteInPlace $cargoDepsCopy/ash-*/src/entry.rs \
--replace-fail '"libvulkan.so.1"' '"${vulkan-loader}/lib/libvulkan.so.1"'
SRC_GATHERER=$NIX_BUILD_TOP/source/src/sys_info_v2/gatherer
SRC_GATHERER_NVTOP=$SRC_GATHERER/3rdparty/nvtop
@ -151,12 +145,27 @@ stdenv.mkDerivation rec {
versionCheckProgram = "${builtins.placeholder "out"}/bin/${meta.mainProgram}";
doInstallCheck = true;
env = {
# Make sure libGL and libvulkan can be found by dlopen()
RUSTFLAGS = toString (
map (flag: "-C link-arg=" + flag) [
"-Wl,--push-state,--no-as-needed"
"-lGL"
"-lvulkan"
"-Wl,--pop-state"
]
);
};
meta = {
description = "Monitor your CPU, Memory, Disk, Network and GPU usage";
homepage = "https://gitlab.com/mission-center-devs/mission-center";
changelog = "https://gitlab.com/mission-center-devs/mission-center/-/releases/v${version}";
license = lib.licenses.gpl3Only;
maintainers = with lib.maintainers; [ GaetanLepage ];
maintainers = with lib.maintainers; [
GaetanLepage
getchoo
];
platforms = lib.platforms.linux;
mainProgram = "missioncenter";
};