From d40336ac678729af86964112066a97ad6d9791bc Mon Sep 17 00:00:00 2001 From: thesn10 <38666407+thesn10@users.noreply.github.com> Date: Sun, 13 Jul 2025 21:17:32 +0200 Subject: [PATCH 1/4] maintainers: add thesn --- maintainers/maintainer-list.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/maintainers/maintainer-list.nix b/maintainers/maintainer-list.nix index abe14e72f668..eedff36b5640 100644 --- a/maintainers/maintainer-list.nix +++ b/maintainers/maintainer-list.nix @@ -25956,6 +25956,11 @@ githubId = 91203390; name = "Felix Kimmel"; }; + thesn = { + github = "thesn10"; + githubId = 38666407; + name = "TheSN"; + }; thesola10 = { email = "me@thesola.io"; github = "Thesola10"; From 3761916b05b72c28074fd7471ea3b9809884bdcb Mon Sep 17 00:00:00 2001 From: thesn10 <38666407+thesn10@users.noreply.github.com> Date: Sun, 13 Jul 2025 22:18:57 +0200 Subject: [PATCH 2/4] gpac: add ffmpeg support & refactor --- pkgs/by-name/gp/gpac/package.nix | 102 +++++++++++++++++++++++++------ pkgs/top-level/all-packages.nix | 13 ++++ 2 files changed, 96 insertions(+), 19 deletions(-) diff --git a/pkgs/by-name/gp/gpac/package.nix b/pkgs/by-name/gp/gpac/package.nix index 44da242fca32..3b86c7fe2043 100644 --- a/pkgs/by-name/gp/gpac/package.nix +++ b/pkgs/by-name/gp/gpac/package.nix @@ -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; }; } diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index dcd95dbaf55d..aaa4994a3284 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -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"; + }; } From 10bd45330a66da2a5d8af4c3c52175a23ab72e63 Mon Sep 17 00:00:00 2001 From: thesn10 <38666407+thesn10@users.noreply.github.com> Date: Sun, 26 Oct 2025 15:16:13 +0100 Subject: [PATCH 3/4] gpac: 2.4-unstable-2025-07-11 -> 2.4-unstable-2025-10-26 --- pkgs/by-name/gp/gpac/package.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/by-name/gp/gpac/package.nix b/pkgs/by-name/gp/gpac/package.nix index 3b86c7fe2043..ea9f1df7280d 100644 --- a/pkgs/by-name/gp/gpac/package.nix +++ b/pkgs/by-name/gp/gpac/package.nix @@ -36,15 +36,15 @@ stdenv.mkDerivation rec { pname = "gpac"; - version = if releaseChannel == "nightly" then "2.4-unstable-2025-07-11" else "2.4.0"; + version = if releaseChannel == "nightly" then "2.4-unstable-2025-10-26" else "2.4.0"; src = if releaseChannel == "nightly" then fetchFromGitHub { owner = "gpac"; repo = "gpac"; - rev = "fe88c3545aadd597b250ccf23271d5d3de50ccc8"; - hash = "sha256-c6B9Y19ZZ3PLz82GCcjkWzcUQSEK7ufVNEzqHQqOvrI="; + rev = "e1a54e81b3befba2b0bffd1d4c1cf50da516c5f3"; + hash = "sha256-jSMBPuWPmTDCebImdmAcCZl0hEQpJK4QMNGcEXgs3A4="; } else fetchFromGitHub { From 62d9589af359626a841841e8f991bf9bd57cc1bf Mon Sep 17 00:00:00 2001 From: thesn10 <38666407+thesn10@users.noreply.github.com> Date: Thu, 6 Nov 2025 00:55:23 +0100 Subject: [PATCH 4/4] gpac: libjpegturbo, x11, updateScript & refactor --- pkgs/by-name/gp/gpac/package.nix | 98 +++++++++++++++++++++----------- pkgs/top-level/all-packages.nix | 13 +---- 2 files changed, 66 insertions(+), 45 deletions(-) diff --git a/pkgs/by-name/gp/gpac/package.nix b/pkgs/by-name/gp/gpac/package.nix index ea9f1df7280d..5603ae754edf 100644 --- a/pkgs/by-name/gp/gpac/package.nix +++ b/pkgs/by-name/gp/gpac/package.nix @@ -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; }; -} +}) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index aaa4994a3284..1f983ac7f56a 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -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"; }; }