From b848abc3841167188c485e99d9900f58dcdab111 Mon Sep 17 00:00:00 2001 From: Andrew Marshall Date: Sat, 10 Jan 2026 09:29:00 -0500 Subject: [PATCH 1/3] libbluray: fix withJava JAVA_HOME was always broken, it should have been JDK_HOME (however a fix for that has been needing review for more than a year). With libbluray 1.4.0, this is now set via the Meson flag `jdk_home`. Additionally, headless JDK is no longer sufficient as it requires `java.awt.Toolkit` at runtime. --- pkgs/by-name/li/libbluray/package.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/by-name/li/libbluray/package.nix b/pkgs/by-name/li/libbluray/package.nix index fe6f8feb611f..c7186f8a8ccb 100644 --- a/pkgs/by-name/li/libbluray/package.nix +++ b/pkgs/by-name/li/libbluray/package.nix @@ -8,7 +8,7 @@ meson, ninja, withJava ? false, - jdk21_headless, # Newer JDK's depend on a release with a fix for https://code.videolan.org/videolan/libbluray/-/issues/46 + jdk21, # Newer JDK's depend on a release with a fix for https://code.videolan.org/videolan/libbluray/-/issues/46 ant, stripJavaArchivesHook, withAACS ? false, @@ -40,7 +40,7 @@ stdenv.mkDerivation rec { pkg-config ] ++ lib.optionals withJava [ - jdk21_headless + jdk21 ant stripJavaArchivesHook ]; @@ -53,13 +53,13 @@ stdenv.mkDerivation rec { propagatedBuildInputs = lib.optional withAACS libaacs; - 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"; mesonFlags = lib.optional (!withJava) "-Dbdj_jar=disabled" + ++ lib.optional withJava "-Djdk_home=${jdk21.home}" ++ lib.optional (!withMetadata) "-dlibxml2=disabled" ++ lib.optional (!withFonts) "-Dfreetype=disabled"; From 455e209f662fb99fd6ff07c4e9bcd899712fe901 Mon Sep 17 00:00:00 2001 From: Andrew Marshall Date: Sat, 10 Jan 2026 09:35:14 -0500 Subject: [PATCH 2/3] libbluray: fix withAACS & withBDplus It will try to dynamically load these libs from non-Nix paths. So replace with the correct paths. --- pkgs/by-name/li/libbluray/package.nix | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pkgs/by-name/li/libbluray/package.nix b/pkgs/by-name/li/libbluray/package.nix index c7186f8a8ccb..5b5bbec797de 100644 --- a/pkgs/by-name/li/libbluray/package.nix +++ b/pkgs/by-name/li/libbluray/package.nix @@ -34,6 +34,14 @@ stdenv.mkDerivation rec { hash = "sha256-d5N7rwfq3aSysxHPOvTFAmnS6jFlBB9YQ9lkdsTJJ3c="; }; + postPatch = + lib.optionalString withAACS '' + substituteInPlace src/libbluray/disc/aacs.c --replace-fail 'getenv("LIBAACS_PATH")' '"${libaacs}/lib/libaacs"' + '' + + lib.optionalString withBDplus '' + substituteInPlace src/libbluray/disc/bdplus.c --replace-fail 'getenv("LIBBDPLUS_PATH")' '"${libbdplus}/lib/libbdplus"' + ''; + nativeBuildInputs = [ meson ninja From 0cf7d1a86c5ee73813a4958eaec188cd50def0a5 Mon Sep 17 00:00:00 2001 From: Andrew Marshall Date: Sat, 10 Jan 2026 09:37:23 -0500 Subject: [PATCH 3/3] libbluray: adopt maintainership --- pkgs/by-name/li/libbluray/package.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/by-name/li/libbluray/package.nix b/pkgs/by-name/li/libbluray/package.nix index 5b5bbec797de..7139008ec761 100644 --- a/pkgs/by-name/li/libbluray/package.nix +++ b/pkgs/by-name/li/libbluray/package.nix @@ -75,7 +75,7 @@ stdenv.mkDerivation rec { homepage = "http://www.videolan.org/developers/libbluray.html"; description = "Library to access Blu-Ray disks for video playback"; license = lib.licenses.lgpl21; - maintainers = [ ]; + maintainers = [ lib.maintainers.amarshall ]; platforms = lib.platforms.unix; };