about summary refs log tree commit diff
path: root/pkgs/desktops/deepin
diff options
context:
space:
mode:
authorrewine <lhongxu@outlook.com>2023-04-12 23:32:29 +0800
committerrewine <lhongxu@outlook.com>2023-04-12 23:33:14 +0800
commitee4da217062c2e1ca2f86efa9dbc3d1f23d84263 (patch)
tree1a7e91c2f266c8a28d8fe39c61da4b0bc8be54e0 /pkgs/desktops/deepin
parent83ca2cd74539fb8e79d46e233f6bb1d978c36f32 (diff)
deepin.deepin-movie-reborn: Use absolute paths to ensure dynamic libraries are found
Diffstat (limited to 'pkgs/desktops/deepin')
-rw-r--r--pkgs/desktops/deepin/apps/deepin-movie-reborn/default.nix22
1 files changed, 16 insertions, 6 deletions
diff --git a/pkgs/desktops/deepin/apps/deepin-movie-reborn/default.nix b/pkgs/desktops/deepin/apps/deepin-movie-reborn/default.nix
index f70cbfbf9f7bb..b4741fe2f9c1a 100644
--- a/pkgs/desktops/deepin/apps/deepin-movie-reborn/default.nix
+++ b/pkgs/desktops/deepin/apps/deepin-movie-reborn/default.nix
@@ -46,20 +46,30 @@ stdenv.mkDerivation rec {
 
   patches = [
     (fetchpatch {
-      name = "chore: dont use </usr/include/linux/cdrom.h>";
-      url = "https://github.com/linuxdeepin/deepin-movie-reborn/commit/2afc63541589adab8b0c8c48e290f03535ec2996.patch";
-      sha256 = "sha256-Q9dv5L5sUGeuvNxF8ypQlZuZVuU4NIR/8d8EyP/Q5wk=";
-    })
-    (fetchpatch {
-      name = "feat: rewrite libPath to read LD_LIBRARY_PATH";
+      name = "feat-rewrite-libPath-to-read-LD_LIBRARY_PATH.patch";
       url = "https://github.com/linuxdeepin/deepin-movie-reborn/commit/432bf452ed244c256e99ecaf80bb6a0eef9b4a74.patch";
       sha256 = "sha256-5hRQ8D9twBKgouVpIBa1pdAGk0lI/wEdQaHBBHFCZBA";
     })
   ];
 
   postPatch = ''
+    # https://github.com/linuxdeepin/deepin-movie-reborn/pull/198
+    substituteInPlace src/common/diskcheckthread.cpp \
+      --replace "/usr/include/linux/cdrom.h" "linux/cdrom.h"
     substituteInPlace src/widgets/toolbox_proxy.cpp \
       --replace "/bin/bash" "${runtimeShell}"
+
+    # libdmr always assume that these libraries exist
+    # otherwise it will lead to coredump
+    # This affects the preview plugin for dde-file-manager
+
+    substituteInPlace src/libdmr/{filefilter.cpp,playlist_model.cpp,gstutils.cpp} \
+      --replace 'LibraryLoader::libPath("libavcodec.so")' '"${lib.getLib ffmpeg}/lib/libavcodec.so"' \
+      --replace 'LibraryLoader::libPath("libavformat.so")' '"${lib.getLib ffmpeg}/lib/libavformat.so"' \
+      --replace 'LibraryLoader::libPath("libavutil.so")' '"${lib.getLib ffmpeg}/lib/libavutil.so"' \
+      --replace 'LibraryLoader::libPath("libffmpegthumbnailer.so")' '"${lib.getLib ffmpegthumbnailer}/lib/libffmpegthumbnailer.so"' \
+      --replace 'LibraryLoader::libPath("libgstreamer-1.0.so")' '"${lib.getLib gst_all_1.gstreamer}/lib/libgstreamer-1.0.so"' \
+      --replace 'LibraryLoader::libPath("libgstpbutils-1.0.so")' '"${lib.getLib gst_all_1.gst-plugins-base}/lib/libgstpbutils-1.0.so"'
   '';
 
   outputs = [ "out" "dev" ];