7 stdenv.mkDerivation rec {
11 src = fetchFromGitHub {
12 owner = "axiomatic-systems";
15 hash = "sha256-Qy8D3cbCVHmLAaXtiF64rL2oRurXNCtd5Dsgt0W7WdY=";
19 ./libap4.patch # include all libraries as shared, not static
22 nativeBuildInputs = [ cmake ];
26 "-DBUILD_SHARED_LIBS=ON"
28 ++ lib.optionals stdenv.hostPlatform.isDarwin [
29 "-DCMAKE_OSX_ARCHITECTURES="
34 mkdir -p $out/{lib,bin}
35 find -iname '*${stdenv.hostPlatform.extensions.sharedLibrary}' -exec mv --target-directory="$out/lib" {} \;
36 find -maxdepth 1 -executable -type f -exec mv --target-directory="$out/bin" {} \;
40 # Patch binaries to use our dylib
41 postInstall = lib.optionalString stdenv.hostPlatform.isDarwin ''
42 find $out/bin -maxdepth 1 -executable -type f -exec install_name_tool -change @rpath/libap4.dylib $out/lib/libap4.dylib {} \;
46 description = "Full-featured MP4 format and MPEG DASH library and tools";
47 homepage = "http://bento4.com";
48 license = licenses.gpl2Plus;
49 maintainers = with maintainers; [ makefu ];
50 platforms = platforms.unix;