git.iko.soy/typeable/nixpkgs
on master help sign in
simplescreenrecorder: fix paths to LD_PRELOADed part
commitf57fe6c2f92f4390ebad951fc39d7324a47487a7 authorNikolay Amiantov <ab@fmap.me> dateMon 11 Jul 2016, 01:41 (10 years ago) parentec5ec31
2 files changed+47−1
pkgs/applications/video/simplescreenrecorder/default.nix+12−1 pkgs/applications/video/simplescreenrecorder/fix-paths.patch+35
pkgs/applications/video/simplescreenrecorder/default.nix+12−1
@@ -11,7 +11,18 @@ stdenv.mkDerivation rec {
1111 sha256 = "1d89ncspjd8c4mckf0nb6y3hrxpv4rjpbj868pznhvfmdgr5nvql";
1212 };
1313
14− postPatch = "sed '1i#include <random>' -i src/Benchmark.cpp";
14+ patches = [ ./fix-paths.patch ];
15+
16+ postPatch = ''
17+ # #455
18+ sed '1i#include <random>' -i src/Benchmark.cpp
19+
20+ for i in scripts/ssr-glinject src/AV/Input/GLInjectInput.cpp; do
21+ substituteInPlace $i \
22+ --subst-var out \
23+ --subst-var-by sh ${stdenv.shell}
24+ done
25+ '';
1526
1627 buildInputs = [
1728 alsaLib ffmpeg libjack2 libX11 libXext libXfixes mesa pkgconfig
pkgs/applications/video/simplescreenrecorder/fix-paths.patchnew file+35
@@ -0,0 +1,35 @@
1+diff --git a/scripts/ssr-glinject b/scripts/ssr-glinject
2+index 48be48d..5038d4c 100755
3+--- a/scripts/ssr-glinject
4++++ b/scripts/ssr-glinject
5+@@ -59,6 +59,6 @@ do
6+ fi
7+ done
8+
9+-echo "ssr-glinject: LD_PRELOAD = $LD_PRELOAD:libssr-glinject.so"
10++echo "ssr-glinject: LD_PRELOAD = $LD_PRELOAD:@out@/lib/libssr-glinject.so"
11+ echo "ssr-glinject: command = $@"
12+-LD_PRELOAD="$LD_PRELOAD:libssr-glinject.so" "$@"
13++LD_PRELOAD="$LD_PRELOAD:@out@/lib/libssr-glinject.so" "$@"
14+diff --git a/src/AV/Input/GLInjectInput.cpp b/src/AV/Input/GLInjectInput.cpp
15+index 6b378f8..cbcf82b 100644
16+--- a/src/AV/Input/GLInjectInput.cpp
17++++ b/src/AV/Input/GLInjectInput.cpp
18+@@ -96,7 +96,7 @@ void GLInjectInput::SetCapturing(bool capturing) {
19+ bool GLInjectInput::LaunchApplication(const QString& channel, bool relax_permissions, const QString& command, const QString& working_directory) {
20+
21+ // prepare command
22+- QString full_command = "LD_PRELOAD=\"libssr-glinject.so\" ";
23++ QString full_command = "LD_PRELOAD=\"@out@/lib/libssr-glinject.so\" ";
24+ full_command += "SSR_CHANNEL=\"" + ShellEscape(channel) + "\" ";
25+ if(relax_permissions)
26+ full_command += "SSR_STREAM_RELAX_PERMISSIONS=1 ";
27+@@ -106,7 +106,7 @@ bool GLInjectInput::LaunchApplication(const QString& channel, bool relax_permiss
28+ QStringList args;
29+ args.push_back("-c");
30+ args.push_back(full_command);
31+- return QProcess::startDetached("/bin/sh", args, working_directory);
32++ return QProcess::startDetached("@sh@", args, working_directory);
33+
34+ }
35+