mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-17 03:05:57 +01:00
Meson: try to find udis86 through pkgconfig, fallback to subproject
Only the fork provides a .pc file, so there's no risk of linking the wrong lib version. If pkg-config can't find it (most cases), fall back to using the subproject through the wrap file.
This commit is contained in:
parent
14942bca60
commit
27211c71e9
5 changed files with 29 additions and 11 deletions
|
@ -43,10 +43,6 @@ xcb_xfixes_dep = dependency('xcb-xfixes', required: get_option('xwayland'))
|
||||||
|
|
||||||
gio_dep = dependency('gio-2.0', required: true)
|
gio_dep = dependency('gio-2.0', required: true)
|
||||||
|
|
||||||
cmake = import('cmake')
|
|
||||||
udis = cmake.subproject('udis86')
|
|
||||||
udis86 = udis.dependency('libudis86')
|
|
||||||
|
|
||||||
if not xcb_dep.found()
|
if not xcb_dep.found()
|
||||||
add_project_arguments('-DNO_XWAYLAND', language: 'cpp')
|
add_project_arguments('-DNO_XWAYLAND', language: 'cpp')
|
||||||
endif
|
endif
|
||||||
|
|
|
@ -6,7 +6,6 @@
|
||||||
pkgconf,
|
pkgconf,
|
||||||
makeWrapper,
|
makeWrapper,
|
||||||
meson,
|
meson,
|
||||||
cmake,
|
|
||||||
ninja,
|
ninja,
|
||||||
aquamarine,
|
aquamarine,
|
||||||
binutils,
|
binutils,
|
||||||
|
@ -17,7 +16,6 @@
|
||||||
hyprlang,
|
hyprlang,
|
||||||
hyprutils,
|
hyprutils,
|
||||||
hyprwayland-scanner,
|
hyprwayland-scanner,
|
||||||
jq,
|
|
||||||
libGL,
|
libGL,
|
||||||
libdrm,
|
libdrm,
|
||||||
libexecinfo,
|
libexecinfo,
|
||||||
|
@ -27,9 +25,9 @@
|
||||||
mesa,
|
mesa,
|
||||||
pango,
|
pango,
|
||||||
pciutils,
|
pciutils,
|
||||||
python3,
|
|
||||||
systemd,
|
systemd,
|
||||||
tomlplusplus,
|
tomlplusplus,
|
||||||
|
udis86-hyprland,
|
||||||
wayland,
|
wayland,
|
||||||
wayland-protocols,
|
wayland-protocols,
|
||||||
wayland-scanner,
|
wayland-scanner,
|
||||||
|
@ -96,13 +94,10 @@ in
|
||||||
|
|
||||||
nativeBuildInputs = [
|
nativeBuildInputs = [
|
||||||
hyprwayland-scanner
|
hyprwayland-scanner
|
||||||
jq
|
|
||||||
makeWrapper
|
makeWrapper
|
||||||
meson
|
meson
|
||||||
cmake
|
|
||||||
ninja
|
ninja
|
||||||
pkg-config
|
pkg-config
|
||||||
python3 # for udis86
|
|
||||||
];
|
];
|
||||||
|
|
||||||
outputs = [
|
outputs = [
|
||||||
|
@ -129,6 +124,7 @@ in
|
||||||
pango
|
pango
|
||||||
pciutils
|
pciutils
|
||||||
tomlplusplus
|
tomlplusplus
|
||||||
|
udis86-hyprland
|
||||||
wayland
|
wayland
|
||||||
wayland-protocols
|
wayland-protocols
|
||||||
wayland-scanner
|
wayland-scanner
|
||||||
|
|
|
@ -26,6 +26,7 @@ in {
|
||||||
inputs.hyprlang.overlays.default
|
inputs.hyprlang.overlays.default
|
||||||
inputs.hyprutils.overlays.default
|
inputs.hyprutils.overlays.default
|
||||||
inputs.hyprwayland-scanner.overlays.default
|
inputs.hyprwayland-scanner.overlays.default
|
||||||
|
self.overlays.udis86
|
||||||
|
|
||||||
# Hyprland packages themselves
|
# Hyprland packages themselves
|
||||||
(final: prev: let
|
(final: prev: let
|
||||||
|
@ -64,4 +65,20 @@ in {
|
||||||
hyprland-extras = lib.composeManyExtensions [
|
hyprland-extras = lib.composeManyExtensions [
|
||||||
inputs.xdph.overlays.xdg-desktop-portal-hyprland
|
inputs.xdph.overlays.xdg-desktop-portal-hyprland
|
||||||
];
|
];
|
||||||
|
|
||||||
|
# udis86 from nixpkgs is too old, and also does not provide a .pc file
|
||||||
|
# this version is the one used in the git submodule, and allows us to
|
||||||
|
# fetch the source without '?submodules=1'
|
||||||
|
udis86 = final: prev: {
|
||||||
|
udis86-hyprland = prev.udis86.overrideAttrs (self: super: {
|
||||||
|
src = final.fetchFromGitHub {
|
||||||
|
owner = "canihavesomecoffee";
|
||||||
|
repo = "udis86";
|
||||||
|
rev = "5336633af70f3917760a6d441ff02d93477b0c86";
|
||||||
|
hash = "sha256-HifdUQPGsKQKQprByeIznvRLONdOXeolOsU5nkwIv3g=";
|
||||||
|
};
|
||||||
|
|
||||||
|
patches = [];
|
||||||
|
});
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,7 +31,11 @@ executable(
|
||||||
backtrace_dep,
|
backtrace_dep,
|
||||||
epoll_dep,
|
epoll_dep,
|
||||||
gio_dep,
|
gio_dep,
|
||||||
udis86,
|
|
||||||
|
# Try to find canihavesomecoffee's udis86 using pkgconfig
|
||||||
|
# vmt/udis86 does not provide a .pc file and won't be detected this way
|
||||||
|
# Falls back to using the subproject through udis86.wrap
|
||||||
|
dependency('udis86'),
|
||||||
|
|
||||||
dependency('pixman-1'),
|
dependency('pixman-1'),
|
||||||
dependency('gl', 'opengl'),
|
dependency('gl', 'opengl'),
|
||||||
|
|
5
subprojects/udis86.wrap
Normal file
5
subprojects/udis86.wrap
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
[wrap-file]
|
||||||
|
method = cmake
|
||||||
|
|
||||||
|
[provide]
|
||||||
|
udis86 = libudis86_dep
|
Loading…
Reference in a new issue