gpac: add ffmpeg support & refactor

This commit is contained in:
thesn10
2025-11-06 01:46:39 +01:00
parent d40336ac67
commit 3761916b05
2 changed files with 96 additions and 19 deletions
+83 -19
View File
@@ -5,35 +5,98 @@
cctools,
pkg-config,
zlib,
ffmpeg,
freetype,
libjpeg,
libpng,
libmad,
faad2,
libogg,
libvorbis,
libtheora,
a52dec,
nghttp2,
openjpeg,
libcaca,
libXv,
mesa,
mesa_glu,
xvidcore,
openssl,
jack2,
alsa-lib,
pulseaudio,
SDL2,
curl,
withFullDeps ? false,
withFfmpeg ? withFullDeps,
releaseChannel ? "stable",
}:
stdenv.mkDerivation rec {
pname = "gpac";
version = "2.4.0";
version = if releaseChannel == "nightly" then "2.4-unstable-2025-07-11" else "2.4.0";
src = fetchFromGitHub {
owner = "gpac";
repo = "gpac";
rev = "v${version}";
hash = "sha256-RADDqc5RxNV2EfRTzJP/yz66p0riyn81zvwU3r9xncM=";
};
src =
if releaseChannel == "nightly" then
fetchFromGitHub {
owner = "gpac";
repo = "gpac";
rev = "fe88c3545aadd597b250ccf23271d5d3de50ccc8";
hash = "sha256-c6B9Y19ZZ3PLz82GCcjkWzcUQSEK7ufVNEzqHQqOvrI=";
}
else
fetchFromGitHub {
owner = "gpac";
repo = "gpac";
rev = "v${version}";
hash = "sha256-RADDqc5RxNV2EfRTzJP/yz66p0riyn81zvwU3r9xncM=";
};
# this is the bare minimum configuration, as I'm only interested in MP4Box
# For most other functionality, this should probably be extended
nativeBuildInputs = [
pkg-config
]
++ lib.optionals stdenv.hostPlatform.isDarwin [
cctools
];
nativeBuildInputs =
[
pkg-config
]
++ lib.optionals stdenv.hostPlatform.isDarwin [
cctools
]
++ lib.optionals withFfmpeg [
ffmpeg
];
# ref: https://wiki.gpac.io/Build/build/GPAC-Build-Guide-for-Linux/#gpac-easy-build-recommended-for-most-users
buildInputs = [
zlib
]
++ lib.optionals withFullDeps [
freetype
libjpeg
libpng
libmad
faad2
libogg
libvorbis
libtheora
a52dec
nghttp2
openjpeg
libcaca
libXv
mesa
mesa_glu
xvidcore
openssl
jack2
alsa-lib
pulseaudio
SDL2
curl
];
enableParallelBuilding = true;
meta = with lib; {
meta = {
description = "Open Source multimedia framework for research and academic purposes";
longDescription = ''
GPAC is an Open Source multimedia framework for research and academic purposes.
@@ -48,10 +111,11 @@ stdenv.mkDerivation rec {
And some server tools included in MP4Box and MP42TS applications.
'';
homepage = "https://gpac.wp.imt.fr";
license = licenses.lgpl21;
maintainers = with maintainers; [
license = lib.licenses.lgpl21;
maintainers = with lib.maintainers; [
mgdelacroix
thesn
];
platforms = platforms.unix;
platforms = lib.platforms.unix;
};
}
+13
View File
@@ -14539,4 +14539,17 @@ with pkgs;
davis = callPackage ../by-name/da/davis/package.nix {
php = php83; # https://github.com/tchapi/davis/issues/195
};
gpac = callPackage ../by-name/gp/gpac/package.nix {
ffmpeg = ffmpeg.override {
version = "7.0.2";
hash = "sha256-6bcTxMt0rH/Nso3X7zhrFNkkmWYtxsbUqVQKh25R1Fs=";
ffmpegVariant = "headless";
};
};
gpac_nightly = callPackage ../by-name/gp/gpac/package.nix {
ffmpeg = ffmpeg-headless;
releaseChannel = "nightly";
};
}