nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{ stdenv, lib, fetchFromGitHub, fetchurl }:
2
3stdenv.mkDerivation rec {
4 pname = "mp4v2";
5 version = "4.1.3";
6
7 src = fetchFromGitHub {
8 # 2020-06-20: THE current upstream, maintained and used in distros fork.
9 owner = "TechSmith";
10 repo = "mp4v2";
11 rev = "Release-ThirdParty-MP4v2-${version}";
12 sha256 = "053a0lgy819sbz92cfkq0vmkn2ky39bva554pj4ypky1j6vs04fv";
13 };
14
15 patches = [
16 (fetchurl {
17 # 2020-06-19: NOTE: # Fix build with C++11
18 # Close when https://github.com/TechSmith/mp4v2/pull/36 merged/closed.
19 url = "https://raw.githubusercontent.com/archlinux/svntogit-packages/203f5a72bc97ffe089b424c47b07dd9eaea35713/trunk/libmp4v2-c++11.patch";
20 sha256 = "0sbn0il7lmk77yrjyb4f0a3z3h8gsmdkscvz5n9hmrrrhrwf672w";
21 })
22 ] ++ lib.optionals stdenv.cc.isClang [
23 # unbreak build with Clang≥6 (C++14 by default). Based on https://reviews.freebsd.org/rP458678
24 ./fix-build-clang.patch
25 ];
26
27 NIX_CFLAGS_COMPILE = [ "-Wno-error=narrowing" ];
28
29 # `faac' expects `mp4.h'.
30 postInstall = "ln -s mp4v2/mp4v2.h $out/include/mp4.h";
31
32 enableParallelBuilding = true;
33
34 meta = {
35 description = "Provides functions to read, create, and modify mp4 files";
36 longDescription = ''
37 MP4v2 library provides an API to work with mp4 files
38 as defined by ISO-IEC:14496-1:2001 MPEG-4 Systems.
39 This container format is derived from Apple's QuickTime format.
40 '';
41 homepage = "https://github.com/TechSmith/mp4v2";
42 maintainers = [ lib.maintainers.Anton-Latukha ];
43 platforms = lib.platforms.unix;
44 license = lib.licenses.mpl11;
45 };
46}