Merge pull request #186474 from GovanifY/bluray-fix

This commit is contained in:
Sandro 2022-08-16 11:43:01 +02:00 committed by GitHub
commit b81a4af7f0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 47 additions and 20 deletions

View file

@ -1,27 +1,27 @@
diff --git a/configure.ac b/configure.ac
index 5fd3c8de..7ae343e0 100644
index 5007bbd..f46de1a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -228,6 +228,10 @@ if test "x$use_bdjava_jar" = "xyes" && test "x$HAVE_ANT" = "xno"; then
AC_MSG_ERROR([BD-J requires ANT, but ant was not found. Please install it.])
fi
@@ -253,7 +253,7 @@ AS_IF([test "x${JDK_HOME}" != "x"], [
])
+if test "x$use_bdjava_jar" = "xyes"; then
+ CPPFLAGS="${CPPFLAGS} -DJARDIR='\"\$(datadir)/java\"'"
+fi
+
AC_DEFINE_UNQUOTED([JAVA_ARCH], ["$java_arch"], ["Defines the architecture of the java vm."])
AC_DEFINE_UNQUOTED([JDK_HOME], ["$JDK_HOME"], [""])
AM_CONDITIONAL([USING_BDJAVA_BUILD_JAR], [ test $use_bdjava_jar = "yes" ])
AS_IF([test "x$use_bdjava_jar" = "xyes"], [
-
+ CPPFLAGS="${CPPFLAGS} -DJARDIR='\"\$(datadir)/java\"'"
dnl check for ant
AC_CHECK_PROG(HAVE_ANT, [ant], yes, no)
AS_IF([test "x$HAVE_ANT" = "xno"], [
diff --git a/src/libbluray/bdj/bdj.c b/src/libbluray/bdj/bdj.c
index 511ad533..e273b9e0 100644
index 1cb1bfe..f3711c2 100644
--- a/src/libbluray/bdj/bdj.c
+++ b/src/libbluray/bdj/bdj.c
@@ -478,6 +478,7 @@ static const char *_find_libbluray_jar(BDJ_STORAGE *storage)
// pre-defined search paths for libbluray.jar
static const char * const jar_paths[] = {
#ifndef _WIN32
@@ -533,6 +533,9 @@ static char *_find_libbluray_jar0()
# ifdef __FreeBSD__
"/usr/local/share/java/" BDJ_JARFILE,
# else
+# ifdef JARDIR
+ JARDIR "/" BDJ_JARFILE,
+# endif
"/usr/share/java/" BDJ_JARFILE,
"/usr/share/libbluray/lib/" BDJ_JARFILE,
#endif
# endif

View file

@ -20,11 +20,13 @@ stdenv.mkDerivation rec {
sha256 = "sha256-wksPQcW3N7u2XFRP5jSVY3p3HBClGd/IAudp8RK0O3U=";
};
patches = optional withJava ./BDJ-JARFILE-path.patch;
patches = [
./BDJ-JARFILE-path.patch
./libbluray-1.3.1-Fix-build-failure-after-Oracle-Java-CPU-for-April-2022.patch
];
nativeBuildInputs = [ pkg-config autoreconfHook ]
++ optionals withJava [ ant ]
;
++ optionals withJava [ ant ];
buildInputs = [ fontconfig ]
++ optional withJava jdk

View file

@ -0,0 +1,25 @@
From 8f26777b1ce124ff761f80ef52d6be10bcea323e Mon Sep 17 00:00:00 2001
From: Fridrich Strba <fstrba@suse.com>
Date: Mon, 25 Apr 2022 14:28:58 +0300
Subject: [PATCH] Fix build failure after Oracle Java CPU for April 2022
--- a/src/libbluray/bdj/java/java/io/BDFileSystem.java
+++ b/src/libbluray/bdj/java/java/io/BDFileSystem.java
@@ -227,6 +227,17 @@ public abstract class BDFileSystem extends FileSystem {
return fs.isAbsolute(f);
}
+ public boolean isInvalid(File f) {
+ try {
+ Method m = fs.getClass().getDeclaredMethod("isInvalid", new Class[] { File.class });
+ Object[] args = new Object[] {(Object)f};
+ Boolean result = (Boolean)m.invoke(fs, args);
+ return result.booleanValue();
+ } finally {
+ return false;
+ }
+ }
+
public String resolve(File f) {
if (!booted)
return fs.resolve(f);