From 5425b309461e1d7b72252fd48b50a01f8f04da37 Mon Sep 17 00:00:00 2001 From: Chris Hodapp Date: Sat, 25 Oct 2025 16:25:16 -0700 Subject: [PATCH 1/4] libbluray: 1.3.4 -> 1.4.0 This updates libbluray from version 1.3.4 to the latest v1.4.0. This change is a bit more consequential than a typical version bump because the underlying project switched from building with autotools to building with meson in this release. Also, the underlying project is now compatible with JDK 21, so the JDK version has been bumped. Unfortunately, stable libbluray is not yet compatible with JDK 25 (changes that should hopefully make this work have been merged to their mainline branch, but as of yet, no release has been made). This change also introduces a new alternate version of libbluray into nixpkgs, `libbluray-full`, which adds in all of the optional dependencies, such as Java and libaacs. Nearly ten years ago, these dependencies were removed from the default version of the package because eelco didn't appreciate that a JDK was being installed on his system, thus inflating the his closure. Although it is outside the scope of this change, adding a "full" version of libbluray to nixpkgs should allow downstream packages to consume it in the future and provide users with full blu-ray support without having to build many of their packages from scratch. --- pkgs/by-name/li/libbluray-full/package.nix | 8 +++++ pkgs/by-name/li/libbluray/package.nix | 34 ++++++++++++++-------- 2 files changed, 30 insertions(+), 12 deletions(-) create mode 100644 pkgs/by-name/li/libbluray-full/package.nix diff --git a/pkgs/by-name/li/libbluray-full/package.nix b/pkgs/by-name/li/libbluray-full/package.nix new file mode 100644 index 000000000000..ee6459ee568b --- /dev/null +++ b/pkgs/by-name/li/libbluray-full/package.nix @@ -0,0 +1,8 @@ +{ + callPackage, +}: +callPackage ../libbluray/package.nix { + withAACS = true; + withBDplus = true; + withJava = true; +} diff --git a/pkgs/by-name/li/libbluray/package.nix b/pkgs/by-name/li/libbluray/package.nix index b65ebdf349e3..34e40ef20c62 100644 --- a/pkgs/by-name/li/libbluray/package.nix +++ b/pkgs/by-name/li/libbluray/package.nix @@ -1,12 +1,14 @@ { lib, + callPackage, stdenv, fetchurl, pkg-config, fontconfig, - autoreconfHook, + meson, + ninja, withJava ? false, - jdk17, + jdk21_headless, # Newer JDK's depend on a release with a fix for https://code.videolan.org/videolan/libbluray/-/issues/46 ant, stripJavaArchivesHook, withAACS ? false, @@ -24,19 +26,20 @@ stdenv.mkDerivation rec { pname = "libbluray"; - version = "1.3.4"; + version = "1.4.0"; src = fetchurl { - url = "https://get.videolan.org/libbluray/${version}/${pname}-${version}.tar.bz2"; - hash = "sha256-R4/9aKD13ejvbKmJt/A1taCiLFmRQuXNP/ewO76+Xys="; + url = "https://get.videolan.org/libbluray/${version}/${pname}-${version}.tar.xz"; + hash = "sha256-d5N7rwfq3aSysxHPOvTFAmnS6jFlBB9YQ9lkdsTJJ3c="; }; nativeBuildInputs = [ + meson + ninja pkg-config - autoreconfHook ] ++ lib.optionals withJava [ - jdk17 + jdk21_headless ant stripJavaArchivesHook ]; @@ -49,15 +52,15 @@ stdenv.mkDerivation rec { propagatedBuildInputs = lib.optional withAACS libaacs; - env.JAVA_HOME = lib.optionalString withJava jdk17.home; # Fails at runtime without this + env.JAVA_HOME = lib.optionalString withJava jdk21_headless.home; # Fails at runtime without this env.NIX_LDFLAGS = lib.optionalString withAACS "-L${libaacs}/lib -laacs" + lib.optionalString withBDplus " -L${libbdplus}/lib -lbdplus"; - configureFlags = - lib.optional (!withJava) "--disable-bdjava-jar" - ++ lib.optional (!withMetadata) "--without-libxml2" - ++ lib.optional (!withFonts) "--without-freetype"; + mesonFlags = + lib.optional (!withJava) "-Dbdj_jar=disabled" + ++ lib.optional (!withMetadata) "-dlibxml2=disabled" + ++ lib.optional (!withFonts) "-Dfreetype=disabled"; meta = with lib; { homepage = "http://www.videolan.org/developers/libbluray.html"; @@ -66,4 +69,11 @@ stdenv.mkDerivation rec { maintainers = [ ]; platforms = platforms.unix; }; + + passthru = { + tests = { + # Verify the "full" package when verifying changes to this package + full = callPackage ../libbluray-full/package.nix { }; + }; + }; } From 7d9466e53a0bd4e70f11ac4f4999b67040430d4c Mon Sep 17 00:00:00 2001 From: Chris Hodapp Date: Sat, 25 Oct 2025 21:14:02 -0700 Subject: [PATCH 2/4] Refactor variant package structure --- pkgs/by-name/li/libbluray-full/package.nix | 8 -------- pkgs/by-name/li/libbluray/package.nix | 9 ++++++++- pkgs/top-level/all-packages.nix | 2 ++ 3 files changed, 10 insertions(+), 9 deletions(-) delete mode 100644 pkgs/by-name/li/libbluray-full/package.nix diff --git a/pkgs/by-name/li/libbluray-full/package.nix b/pkgs/by-name/li/libbluray-full/package.nix deleted file mode 100644 index ee6459ee568b..000000000000 --- a/pkgs/by-name/li/libbluray-full/package.nix +++ /dev/null @@ -1,8 +0,0 @@ -{ - callPackage, -}: -callPackage ../libbluray/package.nix { - withAACS = true; - withBDplus = true; - withJava = true; -} diff --git a/pkgs/by-name/li/libbluray/package.nix b/pkgs/by-name/li/libbluray/package.nix index 34e40ef20c62..8a4a77a4f974 100644 --- a/pkgs/by-name/li/libbluray/package.nix +++ b/pkgs/by-name/li/libbluray/package.nix @@ -71,9 +71,16 @@ stdenv.mkDerivation rec { }; passthru = { + variants = { + full = callPackage ./package.nix { + withAACS = true; + withBDplus = true; + withJava = true; + }; + }; tests = { # Verify the "full" package when verifying changes to this package - full = callPackage ../libbluray-full/package.nix { }; + full = passthru.variants.full; }; }; } diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 0667cce2eda9..39587892f86c 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -7284,6 +7284,8 @@ with pkgs; } ); + libbluray-full = libbluray.variants.full; + mtrace = callPackage ../development/libraries/glibc/mtrace.nix { }; # Provided by libc on Operating Systems that use the Extensible Linker Format. From a0b8c3e88ab59a1af6870f56015f80049dbbc065 Mon Sep 17 00:00:00 2001 From: Chris Hodapp Date: Sat, 22 Nov 2025 21:12:49 -0800 Subject: [PATCH 3/4] Code review comments --- pkgs/by-name/li/libbluray-full/package.nix | 6 ++++++ pkgs/by-name/li/libbluray/package.nix | 10 ++-------- pkgs/top-level/all-packages.nix | 2 -- 3 files changed, 8 insertions(+), 10 deletions(-) create mode 100644 pkgs/by-name/li/libbluray-full/package.nix diff --git a/pkgs/by-name/li/libbluray-full/package.nix b/pkgs/by-name/li/libbluray-full/package.nix new file mode 100644 index 000000000000..043d0f6ba7a0 --- /dev/null +++ b/pkgs/by-name/li/libbluray-full/package.nix @@ -0,0 +1,6 @@ +{libbluray}: +libbluray.override { + withAACS = true; + withBDplus = true; + withJava = true; +} diff --git a/pkgs/by-name/li/libbluray/package.nix b/pkgs/by-name/li/libbluray/package.nix index 8a4a77a4f974..de3bae4c7cd6 100644 --- a/pkgs/by-name/li/libbluray/package.nix +++ b/pkgs/by-name/li/libbluray/package.nix @@ -19,6 +19,7 @@ libxml2, withFonts ? true, freetype, + libbluray-full, # Used for tests }: # Info on how to use: @@ -71,16 +72,9 @@ stdenv.mkDerivation rec { }; passthru = { - variants = { - full = callPackage ./package.nix { - withAACS = true; - withBDplus = true; - withJava = true; - }; - }; tests = { # Verify the "full" package when verifying changes to this package - full = passthru.variants.full; + inherit libbluray-full; }; }; } diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 39587892f86c..0667cce2eda9 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -7284,8 +7284,6 @@ with pkgs; } ); - libbluray-full = libbluray.variants.full; - mtrace = callPackage ../development/libraries/glibc/mtrace.nix { }; # Provided by libc on Operating Systems that use the Extensible Linker Format. From 469c1fb173f340a66a21793010e37953d0cc5ad2 Mon Sep 17 00:00:00 2001 From: Chris Hodapp Date: Sat, 22 Nov 2025 21:33:32 -0800 Subject: [PATCH 4/4] Formatting --- pkgs/by-name/li/libbluray-full/package.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/by-name/li/libbluray-full/package.nix b/pkgs/by-name/li/libbluray-full/package.nix index 043d0f6ba7a0..5a09f78f35d0 100644 --- a/pkgs/by-name/li/libbluray-full/package.nix +++ b/pkgs/by-name/li/libbluray-full/package.nix @@ -1,4 +1,4 @@ -{libbluray}: +{ libbluray }: libbluray.override { withAACS = true; withBDplus = true;