gpac: libjpegturbo, x11, updateScript & refactor

This commit is contained in:
thesn10
2025-11-06 01:50:28 +01:00
parent 10bd45330a
commit 62d9589af3
2 changed files with 66 additions and 45 deletions
+64 -34
View File
@@ -2,12 +2,14 @@
lib,
stdenv,
fetchFromGitHub,
gitUpdater,
unstableGitUpdater,
cctools,
pkg-config,
zlib,
ffmpeg,
ffmpeg-headless,
freetype,
libjpeg,
libjpeg_turbo,
libpng,
libmad,
faad2,
@@ -18,7 +20,6 @@
nghttp2,
openjpeg,
libcaca,
libXv,
mesa,
mesa_glu,
xvidcore,
@@ -28,42 +29,67 @@
pulseaudio,
SDL2,
curl,
xorg,
withFullDeps ? false,
withFfmpeg ? withFullDeps,
releaseChannel ? "stable",
}:
stdenv.mkDerivation rec {
let
stable = rec {
version = "2.4.0"; # See below TODO.
src = fetchFromGitHub {
owner = "gpac";
repo = "gpac";
rev = "v${version}";
hash = "sha256-RADDqc5RxNV2EfRTzJP/yz66p0riyn81zvwU3r9xncM=";
};
updateScript = gitUpdater {
odd-unstable = true;
rev-prefix = "v";
ignoredVersions = "^(abi|test)";
};
}
// {
# ffmpeg 7.0.2 works, but 7.1.1 (which is packaged in nixpkgs) doesn't
# because v2.4.0 of this package relies on internal private ffmpeg fields.
# TODO: remove this, and switch to simply using ffmpeg-headless,
# when updating stable to 2.6
ffmpeg-headless = ffmpeg-headless.override {
version = "7.0.2";
hash = "sha256-6bcTxMt0rH/Nso3X7zhrFNkkmWYtxsbUqVQKh25R1Fs=";
};
};
unstable = {
version = "2.4-unstable-2025-10-26";
src = fetchFromGitHub {
owner = "gpac";
repo = "gpac";
rev = "e1a54e81b3befba2b0bffd1d4c1cf50da516c5f3";
hash = "sha256-jSMBPuWPmTDCebImdmAcCZl0hEQpJK4QMNGcEXgs3A4=";
};
updateScript = unstableGitUpdater {
tagFormat = "v*";
tagPrefix = "v";
};
inherit ffmpeg-headless;
};
channelToUse = if releaseChannel == "unstable" then unstable else stable;
in
stdenv.mkDerivation (finalAttrs: {
pname = "gpac";
version = if releaseChannel == "nightly" then "2.4-unstable-2025-10-26" else "2.4.0";
inherit (channelToUse) version src;
src =
if releaseChannel == "nightly" then
fetchFromGitHub {
owner = "gpac";
repo = "gpac";
rev = "e1a54e81b3befba2b0bffd1d4c1cf50da516c5f3";
hash = "sha256-jSMBPuWPmTDCebImdmAcCZl0hEQpJK4QMNGcEXgs3A4=";
}
else
fetchFromGitHub {
owner = "gpac";
repo = "gpac";
rev = "v${version}";
hash = "sha256-RADDqc5RxNV2EfRTzJP/yz66p0riyn81zvwU3r9xncM=";
};
nativeBuildInputs =
[
pkg-config
]
++ lib.optionals stdenv.hostPlatform.isDarwin [
cctools
]
++ lib.optionals withFfmpeg [
ffmpeg
];
nativeBuildInputs = [
pkg-config
]
++ lib.optionals stdenv.hostPlatform.isDarwin [
cctools
]
++ lib.optionals withFfmpeg [
channelToUse.ffmpeg-headless
];
# ref: https://wiki.gpac.io/Build/build/GPAC-Build-Guide-for-Linux/#gpac-easy-build-recommended-for-most-users
buildInputs = [
@@ -71,7 +97,7 @@ stdenv.mkDerivation rec {
]
++ lib.optionals withFullDeps [
freetype
libjpeg
libjpeg_turbo
libpng
libmad
faad2
@@ -82,7 +108,9 @@ stdenv.mkDerivation rec {
nghttp2
openjpeg
libcaca
libXv
xorg.libX11
xorg.libXv
xorg.xorgproto
mesa
mesa_glu
xvidcore
@@ -96,6 +124,8 @@ stdenv.mkDerivation rec {
enableParallelBuilding = true;
passthru.updateScript = channelToUse.updateScript;
meta = {
description = "Open Source multimedia framework for research and academic purposes";
longDescription = ''
@@ -118,4 +148,4 @@ stdenv.mkDerivation rec {
];
platforms = lib.platforms.unix;
};
}
})
+2 -11
View File
@@ -14540,16 +14540,7 @@ with pkgs;
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";
gpac-unstable = callPackage ../by-name/gp/gpac/package.nix {
releaseChannel = "unstable";
};
}