tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
lol
0
fork
atom
overview
issues
pulls
pipelines
libvdpau: fix tracing feature
Luna
1 year ago
3a7c4af8
29fa4665
+31
-10
3 changed files
expand all
collapse all
unified
split
pkgs
by-name
li
libvdpau
installdir.patch
package.nix
tracing.patch
-9
pkgs/by-name/li/libvdpau/installdir.patch
···
1
1
-
--- a/trace/meson.build 2020-02-15 16:34:58.698832000 +0100
2
2
-
+++ b/trace/meson.build 2020-02-15 16:39:05.359952802 +0100
3
3
-
@@ -4,5 +4,5 @@
4
4
-
dependencies : libdl,
5
5
-
version : '1.0.0',
6
6
-
install : true,
7
7
-
- install_dir : moduledir,
8
8
-
+ install_dir : get_option('prefix') + '/lib/libvdpau',
9
9
-
)
+7
-1
pkgs/by-name/li/libvdpau/package.nix
···
8
8
url = "https://gitlab.freedesktop.org/vdpau/libvdpau/-/archive/${version}/${pname}-${version}.tar.bz2";
9
9
sha256 = "sha256-pdUKQrjCiP68BxUatkOsjeBqGERpZcckH4m06BCCGRM=";
10
10
};
11
11
-
patches = [ ./installdir.patch ];
11
11
+
patches = [ ./tracing.patch ];
12
12
13
13
outputs = [ "out" "dev" ];
14
14
···
20
20
mesonFlags = lib.optionals stdenv.hostPlatform.isLinux [ "-Dmoduledir=${mesa.driverLink}/lib/vdpau" ];
21
21
22
22
NIX_LDFLAGS = lib.optionalString stdenv.hostPlatform.isDarwin "-lX11";
23
23
+
24
24
+
# The tracing library in this package must be conditionally loaded with dlopen().
25
25
+
# Therefore, we must restore the RPATH entry for the library itself that was removed by the patchelf hook.
26
26
+
postFixup = lib.optionalString stdenv.hostPlatform.isElf ''
27
27
+
patchelf $out/lib/libvdpau.so --add-rpath $out/lib
28
28
+
'';
23
29
24
30
meta = with lib; {
25
31
homepage = "https://www.freedesktop.org/wiki/Software/VDPAU/";
+24
pkgs/by-name/li/libvdpau/tracing.patch
···
1
1
+
diff --git a/src/vdpau_wrapper.c b/src/vdpau_wrapper.c
2
2
+
index 79dcb94..6249af4 100644
3
3
+
--- a/src/vdpau_wrapper.c
4
4
+
+++ b/src/vdpau_wrapper.c
5
5
+
@@ -185,8 +185,7 @@ static VdpStatus _vdp_open_driver(
6
6
+
if (vdpau_trace && atoi(vdpau_trace)) {
7
7
+
SetDllHandle * set_dll_handle;
8
8
+
9
9
+
- _vdp_trace_dll = dlopen(VDPAU_MODULEDIR "/libvdpau_trace.so.1",
10
10
+
- RTLD_NOW | RTLD_GLOBAL);
11
11
+
+ _vdp_trace_dll = dlopen("libvdpau_trace.so.1", RTLD_NOW | RTLD_GLOBAL);
12
12
+
if (!_vdp_trace_dll) {
13
13
+
fprintf(stderr, "Failed to open VDPAU trace library %s\n", dlerror());
14
14
+
_VDP_ERROR_BREAKPOINT();
15
15
+
diff --git a/trace/meson.build b/trace/meson.build
16
16
+
index 5381b8b..4af408f 100644
17
17
+
--- a/trace/meson.build
18
18
+
+++ b/trace/meson.build
19
19
+
@@ -4,5 +4,4 @@ trace = shared_library('vdpau_trace',
20
20
+
dependencies : libdl,
21
21
+
version : '1.0.0',
22
22
+
install : true,
23
23
+
- install_dir : moduledir,
24
24
+
)