Skip to content

Commit 123f011

Browse files
authored
mjpg-streamer: Fix input_uvc.so: undefined symbol: resolutions_help (NixOS#465036)
2 parents 47145e9 + 1f2a2d2 commit 123f011

File tree

2 files changed

+40
-2
lines changed

2 files changed

+40
-2
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
From 7b24e2a593a0029c6f555c9001be87a34eceecc6 Mon Sep 17 00:00:00 2001
2+
From: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
3+
Date: Tue, 6 Aug 2024 17:04:55 +0200
4+
Subject: [PATCH] Export all symbols of mjpg_streamer binary
5+
6+
Fixes runtime error with stripped binary
7+
8+
dlopen: /usr/lib/mjpg-streamer/input_uvc.so: undefined symbol: resolutions_help
9+
10+
Source: http://lists.busybox.net/pipermail/buildroot/2024-August/759732.html
11+
12+
Signed-off-by: Bernd Kuhls <bernd@kuhls.net>
13+
---
14+
mjpg-streamer-experimental/CMakeLists.txt | 1 +
15+
1 file changed, 1 insertion(+)
16+
17+
diff --git a/mjpg-streamer-experimental/CMakeLists.txt b/mjpg-streamer-experimental/CMakeLists.txt
18+
index cf26620e..3ff12cdf 100644
19+
--- a/mjpg-streamer-experimental/CMakeLists.txt
20+
+++ b/mjpg-streamer-experimental/CMakeLists.txt
21+
@@ -92,6 +92,7 @@ set (CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
22+
add_executable(mjpg_streamer mjpg_streamer.c
23+
utils.c)
24+
25+
+set_property(TARGET mjpg_streamer PROPERTY ENABLE_EXPORTS ON)
26+
target_link_libraries(mjpg_streamer pthread dl)
27+
install(TARGETS mjpg_streamer DESTINATION bin)
28+
29+

pkgs/by-name/mj/mjpg-streamer/package.nix

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,23 @@ stdenv.mkDerivation {
1717
sha256 = "1cl159svfs1zzzrd3zgn4x7qy6751bvlnxfwf5hn5fmg4iszajw7";
1818
};
1919

20+
patches = [
21+
# https://patchwork.ozlabs.org/project/buildroot/patch/20240808192126.1767471-1-bernd@kuhls.net/#3373402
22+
# https://github.com/jacksonliam/mjpg-streamer/pull/401
23+
./fix-undefined-symbol-error.patch
24+
];
25+
2026
prePatch = ''
21-
cd mjpg-streamer-experimental
22-
substituteInPlace ./CMakeLists.txt --replace-fail "cmake_minimum_required(VERSION 2.8.3)" "cmake_minimum_required(VERSION 2.8.3...3.10)"
27+
substituteInPlace ./mjpg-streamer-experimental/CMakeLists.txt --replace-fail "cmake_minimum_required(VERSION 2.8.3)" "cmake_minimum_required(VERSION 2.8.3...3.10)"
2328
'';
2429

2530
nativeBuildInputs = [ cmake ];
2631
buildInputs = [ libjpeg ];
2732

33+
preConfigure = ''
34+
cd mjpg-streamer-experimental
35+
'';
36+
2837
postFixup = ''
2938
patchelf --set-rpath "$(patchelf --print-rpath $out/bin/mjpg_streamer):$out/lib/mjpg-streamer" $out/bin/mjpg_streamer
3039
'';

0 commit comments

Comments
 (0)