mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-21 22:43:01 +00:00
mission-center: use RUSTFLAGS to link libGL and libvulkan
A less crude method than patching `$cargoDepsCopy`
This commit is contained in:
parent
8b230d41d2
commit
dd78a15b79
@ -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,6 +145,18 @@ 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";
|
||||
|
Loading…
Reference in New Issue
Block a user