about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/mp4v2
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/mp4v2')
-rw-r--r--nixpkgs/pkgs/development/libraries/mp4v2/default.nix34
-rw-r--r--nixpkgs/pkgs/development/libraries/mp4v2/fix-build-clang.patch13
2 files changed, 47 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/libraries/mp4v2/default.nix b/nixpkgs/pkgs/development/libraries/mp4v2/default.nix
new file mode 100644
index 000000000000..b9b0589bd80d
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/mp4v2/default.nix
@@ -0,0 +1,34 @@
+{ stdenv, lib, fetchFromGitHub, fetchurl }:
+
+stdenv.mkDerivation rec {
+  pname = "mp4v2";
+  version = "5.0.1";
+
+  src = fetchFromGitHub {
+    # 2020-06-20: THE current upstream, maintained and used in distros fork.
+    owner = "TechSmith";
+    repo = "mp4v2";
+    rev = "Release-ThirdParty-MP4v2-${version}";
+    sha256 = "sha256-OP+oVTH9pqYfHtYL1Kjrs1qey/J40ijLi5Gu8GJnvSY=";
+  };
+
+  env.NIX_CFLAGS_COMPILE = "-Wno-error=narrowing";
+
+  # `faac' expects `mp4.h'.
+  postInstall = "ln -s mp4v2/mp4v2.h $out/include/mp4.h";
+
+  enableParallelBuilding = true;
+
+  meta = {
+    description = "Provides functions to read, create, and modify mp4 files";
+    longDescription = ''
+      MP4v2 library provides an API to work with mp4 files
+      as defined by ISO-IEC:14496-1:2001 MPEG-4 Systems.
+      This container format is derived from Apple's QuickTime format.
+    '';
+    homepage = "https://github.com/TechSmith/mp4v2";
+    maintainers = [ lib.maintainers.Anton-Latukha ];
+    platforms = lib.platforms.unix;
+    license = lib.licenses.mpl11;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/mp4v2/fix-build-clang.patch b/nixpkgs/pkgs/development/libraries/mp4v2/fix-build-clang.patch
new file mode 100644
index 000000000000..5d99f1951f7a
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/mp4v2/fix-build-clang.patch
@@ -0,0 +1,13 @@
+diff --git a/src/mp4.cpp b/src/mp4.cpp
+index c2a7238..9bb3e38 100644
+--- a/src/mp4.cpp
++++ b/src/mp4.cpp
+@@ -870,7 +870,7 @@ MP4FileHandle MP4ReadProvider( const char* fileName, const MP4FileProvider* file
+         }
+ 
+         catch (...) {
+-            return MP4_INVALID_TRACK_ID;
++            return NULL;
+         }
+     }
+