about summary refs log tree commit diff
diff options
context:
space:
mode:
authorSam Willcocks <sam@wlcx.cc>2023-05-20 22:49:23 +0800
committerSam Willcocks <sam@wlcx.cc>2023-05-21 10:42:14 +0800
commit6b8d30fc5036dc7176680f372121a7eece401151 (patch)
treef6c4475e19ecfba125d35ce7bbc5b5c8ad789966
parent65e9e6ce2aba058cb6e18325faaebf67c4640e5c (diff)
bento4: fix on darwin, remove broken on aarch64
-rw-r--r--pkgs/tools/video/bento4/default.nix8
1 files changed, 6 insertions, 2 deletions
diff --git a/pkgs/tools/video/bento4/default.nix b/pkgs/tools/video/bento4/default.nix
index 826eb7a97db93..fcd5627f32fc4 100644
--- a/pkgs/tools/video/bento4/default.nix
+++ b/pkgs/tools/video/bento4/default.nix
@@ -23,17 +23,21 @@ stdenv.mkDerivation rec {
   installPhase = ''
     runHook preInstall
     mkdir -p $out/{lib,bin}
-    find -iname '*.so' -exec mv --target-directory="$out/lib" {} \;
+    find -iname '*${stdenv.hostPlatform.extensions.sharedLibrary}' -exec mv --target-directory="$out/lib" {} \;
     find -maxdepth 1 -executable -type f -exec mv --target-directory="$out/bin" {} \;
     runHook postInstall
   '';
 
+  # Patch binaries to use our dylib
+  postInstall = lib.optionalString stdenv.isDarwin ''
+    find $out/bin -maxdepth 1 -executable -type f -exec install_name_tool -change @rpath/libap4.dylib $out/lib/libap4.dylib {} \;
+  '';
+
   meta = with lib; {
     description = "Full-featured MP4 format and MPEG DASH library and tools";
     homepage = "http://bento4.com";
     license = licenses.gpl2Plus;
     maintainers = with maintainers; [ makefu ];
-    broken = stdenv.isAarch64;
     platforms = platforms.unix;
   };
 }