about summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
authorPeder Bergebakken Sundt <pbsds@hotmail.com>2024-05-31 22:48:48 +0200
committerGitHub <noreply@github.com>2024-05-31 22:48:48 +0200
commit1014ea3e585de5c409cce606e741e7276cfd5b33 (patch)
tree6d44619a3dbab7d14090097e7ea864f0c8e75442 /pkgs
parent3ef3b36a8ec345ea51f898c96f024ae5ba40fbe9 (diff)
parent65c5904b209dca7496a1dca668040dcaad2274f9 (diff)
Merge pull request #314598 from Scrumplex/pkgs/simplescreenrecorder/0.4.4
simplescreenrecorder: 0.4.3 -> 0.4.4
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/applications/video/simplescreenrecorder/default.nix21
-rw-r--r--pkgs/applications/video/simplescreenrecorder/fix-paths.patch35
2 files changed, 11 insertions, 45 deletions
diff --git a/pkgs/applications/video/simplescreenrecorder/default.nix b/pkgs/applications/video/simplescreenrecorder/default.nix
index cbeb325e7ce09..3669666cee8ac 100644
--- a/pkgs/applications/video/simplescreenrecorder/default.nix
+++ b/pkgs/applications/video/simplescreenrecorder/default.nix
@@ -1,16 +1,16 @@
 { lib, stdenv, mkDerivation, fetchFromGitHub, alsa-lib, ffmpeg_4, libjack2, libX11, libXext, libXinerama, qtx11extras
-, libXfixes, libGLU, libGL, pkg-config, libpulseaudio, libv4l, qtbase, qttools, cmake, ninja
+, libXfixes, libGLU, libGL, pkg-config, libpulseaudio, libv4l, qtbase, qttools, cmake, ninja, nix-update-script
 }:
 
 mkDerivation rec {
   pname = "simplescreenrecorder";
-  version = "0.4.3";
+  version = "0.4.4";
 
   src = fetchFromGitHub {
     owner = "MaartenBaert";
     repo = "ssr";
     rev = version;
-    sha256 = "0mrx8wprs8bi42fwwvk6rh634ic9jnn0gkfpd6q9pcawnnbz3vq8";
+    sha256 = "sha256-cVjQmyk+rCqmDJzdnDk7bQ8kpyD3HtTw3wLVx2thHok=";
   };
 
   cmakeFlags = [
@@ -18,14 +18,13 @@ mkDerivation rec {
     "-DWITH_GLINJECT=${if stdenv.hostPlatform.isx86 then "TRUE" else "FALSE"}"
   ];
 
-  patches = [ ./fix-paths.patch ];
-
   postPatch = ''
-    for i in scripts/ssr-glinject src/AV/Input/GLInjectInput.cpp; do
-      substituteInPlace $i \
-        --subst-var out \
-        --subst-var-by sh ${stdenv.shell}
-    done
+    substituteInPlace scripts/ssr-glinject \
+      --replace-fail "libssr-glinject.so" "$out/lib/libssr-glinject.so"
+
+    substituteInPlace src/AV/Input/GLInjectInput.cpp \
+      --replace-fail "/bin/sh" "${stdenv.shell}" \
+      --replace-fail "libssr-glinject.so" "$out/lib/libssr-glinject.so"
   '';
 
   nativeBuildInputs = [ pkg-config cmake ninja ];
@@ -34,6 +33,8 @@ mkDerivation rec {
     libpulseaudio libv4l qtbase qttools qtx11extras
   ];
 
+  passthru.updateScript = nix-update-script { };
+
   meta = with lib; {
     description = "A screen recorder for Linux";
     homepage = "https://www.maartenbaert.be/simplescreenrecorder";
diff --git a/pkgs/applications/video/simplescreenrecorder/fix-paths.patch b/pkgs/applications/video/simplescreenrecorder/fix-paths.patch
deleted file mode 100644
index 9cf634285fcbf..0000000000000
--- a/pkgs/applications/video/simplescreenrecorder/fix-paths.patch
+++ /dev/null
@@ -1,35 +0,0 @@
-diff --git a/scripts/ssr-glinject b/scripts/ssr-glinject
-index 48be48d..5038d4c 100755
---- a/scripts/ssr-glinject
-+++ b/scripts/ssr-glinject
-@@ -59,6 +59,6 @@ do
- 	fi
- done
- 
--echo "ssr-glinject: LD_PRELOAD = $LD_PRELOAD:libssr-glinject.so"
-+echo "ssr-glinject: LD_PRELOAD = $LD_PRELOAD:@out@/lib/libssr-glinject.so"
- echo "ssr-glinject: command = $@"
--LD_PRELOAD="$LD_PRELOAD:libssr-glinject.so" "$@"
-+LD_PRELOAD="$LD_PRELOAD:@out@/lib/libssr-glinject.so" "$@"
-diff --git a/src/AV/Input/GLInjectInput.cpp b/src/AV/Input/GLInjectInput.cpp
-index fc98f31..18f5196 100644
---- a/src/AV/Input/GLInjectInput.cpp
-+++ b/src/AV/Input/GLInjectInput.cpp
-@@ -113,7 +113,7 @@ bool ExecuteDetached(const char* command, const char* working_directory) {
- 
- 			// try to execute command
- 			do {
--				res = execl("/bin/sh", "/bin/sh", "-c", command, (char*) NULL);
-+				res = execl("@sh@", "@sh@", "-c", command, (char*) NULL);
- 			} while(res == -1 and errno == EINTR);
- 
- 			// failed, send feedback
-@@ -207,7 +207,7 @@ void GLInjectInput::SetCapturing(bool capturing) {
- bool GLInjectInput::LaunchApplication(const QString& channel, bool relax_permissions, const QString& command, const QString& working_directory) {
- 
- 	// prepare command
--	QString full_command = "LD_PRELOAD=\"libssr-glinject.so\" ";
-+	QString full_command = "LD_PRELOAD=\"@out@/lib/libssr-glinject.so\" ";
- 	full_command += "SSR_CHANNEL=\"" + ShellEscape(channel) + "\" ";
- 	if(relax_permissions)
- 		full_command += "SSR_STREAM_RELAX_PERMISSIONS=1 ";