guix_mirror_bot pushed a commit to branch gnome-team
in repository guix.

commit e29ba640dbcc30b9c2fe8dffac31f39d83caef24
Author: Maxim Cournoyer <[email protected]>
AuthorDate: Thu Apr 2 08:40:38 2026 +0900

    gnu: libbluray: Build BD-J for Blu-ray menu support.
    
    Note that this augments the closure of ffmpeg from 958.4 Mio to 1295.2 Mio, 
or
    26%; it seems justified by the fact that a library called `libbluray' should
    provide complete support for handling Blu-ray discs.
    
    * gnu/packages/video.scm (libbluray)
    [#:disallowed-references]: New.
    [#:phases] {set-java-home}: New.
    {patch-dlopen-calls}: Patch JDK_HOME macro/string.
    [native-inputs]: Add ant, openjdk11:jdk.
    [inputs]: Add openjdk11.
    
    Change-Id: Ifd40f85034b0d843414827464554b558af20d29c
---
 gnu/packages/video.scm | 26 ++++++++++++++++++++++++--
 1 file changed, 24 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/video.scm b/gnu/packages/video.scm
index d5da0c6571..c81680737c 100644
--- a/gnu/packages/video.scm
+++ b/gnu/packages/video.scm
@@ -177,6 +177,7 @@
   #:use-module (gnu packages image-processing)
   #:use-module (gnu packages imagemagick)
   #:use-module (gnu packages iso-codes)
+  #:use-module (gnu packages java)
   #:use-module (gnu packages kde-frameworks)
   #:use-module (gnu packages libbsd)
   #:use-module (gnu packages libcanberra)
@@ -3753,8 +3754,18 @@ soon as it starts.")
     (build-system meson-build-system)
     (arguments
      (list
+      #:disallowed-references
+      (list (gexp-input (this-package-native-input "openjdk") "jdk"))
       #:phases
       #~(modify-phases %standard-phases
+          (add-before 'build 'set-java-home
+            (lambda* (#:key inputs #:allow-other-keys)
+              ;; There is a jdk_home build option, but it conflates build-time
+              ;; (openjdk:jdk) and runtime (openjdk), so use JAVA_HOME
+              ;; instead.
+              (setenv "JAVA_HOME"
+                      #$(gexp-input (this-package-native-input "openjdk")
+                                    "jdk"))))
           (add-after 'unpack 'fix-dlopen-paths
             (lambda* (#:key inputs #:allow-other-keys)
               (define (lib/no.so library)
@@ -3764,6 +3775,14 @@ soon as it starts.")
               (substitute* "src/libbluray/disc/aacs.c"
                 (("\"libaacs\"")
                  (string-append "\"" (lib/no.so "lib/libaacs.so") "\"")))
+              (substitute* "src/libbluray/bdj/bdj.c"
+                ;; Manually fix the JDK_HOME macro that is set by Meson for
+                ;; the `jdk_home' option and embedded in the binaries for use
+                ;; at runtime.  The Meson option is not used because we need
+                ;; to build with the 'jdk' output but don't want to retain a
+                ;; reference to it.
+                (("JDK_HOME")
+                 (format #f "~s" #$(this-package-input "openjdk"))))
               (substitute* "src/libbluray/disc/bdplus.c"
                 (("\"libbdplus\"")
                  (string-append "\"" (lib/no.so "lib/libbdplus.so") "\"")))))
@@ -3784,8 +3803,11 @@ soon as it starts.")
                                 " -L" (search-input-vicinity "freetype")
                                 " -L" (search-input-vicinity "fontconfig")
                                 " -lxml2 -lfreetype -lfontconfig"))))))))
-    (native-inputs (list pkg-config))
-    (inputs (list fontconfig freetype libaacs libbdplus libudfread libxml2))
+    ;; The latest OpenJDK 25 is not yet supported, so we use an older version
+    ;; that is a bit smaller and produces less warnings at runtime.
+    (native-inputs (list ant `(,openjdk11 "jdk") pkg-config))
+    (inputs (list fontconfig freetype libaacs libbdplus libudfread libxml2
+                  openjdk11))
     (home-page "https://www.videolan.org/developers/libbluray.html";)
     (synopsis "Blu-Ray Disc playback library")
     (description

Reply via email to