From 0a847fd83e45ffea5cdb0d401f86b635e7b052dd Mon Sep 17 00:00:00 2001 From: Fritz Elfert Date: Feb 22 2021 18:33:20 +0000 Subject: jdk11-compatibility --- diff --git a/jibri/0003-jdk11-compatibility.patch b/jibri/0003-jdk11-compatibility.patch new file mode 100644 index 0000000..d983707 --- /dev/null +++ b/jibri/0003-jdk11-compatibility.patch @@ -0,0 +1,158 @@ +diff -Naur a/pom.xml b/pom.xml +--- a/pom.xml 2020-10-07 19:49:38.000000000 +0200 ++++ b/pom.xml 2021-02-22 16:56:41.464916849 +0100 +@@ -25,6 +25,33 @@ + 1.1-54-g5387346 + + ++ ++ ++ target-jdk8 ++ ++ 1.8 ++ ++ ++ 1.8 ++ 1.8 ++ 1.8 ++ jdk8 ++ ++ ++ ++ target-jdk9 ++ ++ [9,) ++ ++ ++ 9 ++ 9 ++ 9 ++ jdk9 ++ ++ ++ ++ + + + ${project.groupId} +@@ -212,6 +239,7 @@ + + + ${project.basedir}/src/main/kotlin ++ ${project.basedir}/src/main/kotlin-${kcond} + ${project.basedir}/src/main/java + + +diff -Naur a/src/main/kotlin/org/jitsi/jibri/util/extensions/Process.kt b/src/main/kotlin/org/jitsi/jibri/util/extensions/Process.kt +--- a/src/main/kotlin/org/jitsi/jibri/util/extensions/Process.kt 2020-10-07 19:49:38.000000000 +0200 ++++ b/src/main/kotlin/org/jitsi/jibri/util/extensions/Process.kt 1970-01-01 01:00:00.000000000 +0100 +@@ -1,38 +0,0 @@ +-/* +- * Copyright @ 2018 - present 8x8, Inc. +- * +- * Licensed under the Apache License, Version 2.0 (the "License"); +- * you may not use this file except in compliance with the License. +- * You may obtain a copy of the License at +- * +- * http://www.apache.org/licenses/LICENSE-2.0 +- * +- * Unless required by applicable law or agreed to in writing, software +- * distributed under the License is distributed on an "AS IS" BASIS, +- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +- * See the License for the specific language governing permissions and +- * limitations under the License. +- */ +- +-package org.jitsi.jibri.util.extensions +- +-import java.lang.reflect.Field +- +-/** +- * Mimic the "pid" member of Java 9's [Process]. +- */ +-val Process.pidValue: Long +- get() { +- var pid: Long = -1 +- try { +- if (javaClass.name == "java.lang.UNIXProcess") { +- val field: Field = javaClass.getDeclaredField("pid") +- field.isAccessible = true +- pid = field.getLong(this) +- field.isAccessible = false +- } +- } catch (e: Exception) { +- pid = -1 +- } +- return pid +- } +diff -Naur a/src/main/kotlin-jdk8/org/jitsi/jibri/util/extensions/Process.kt b/src/main/kotlin-jdk8/org/jitsi/jibri/util/extensions/Process.kt +--- a/src/main/kotlin-jdk8/org/jitsi/jibri/util/extensions/Process.kt 1970-01-01 01:00:00.000000000 +0100 ++++ b/src/main/kotlin-jdk8/org/jitsi/jibri/util/extensions/Process.kt 2020-10-07 19:49:38.000000000 +0200 +@@ -0,0 +1,38 @@ ++/* ++ * Copyright @ 2018 - present 8x8, Inc. ++ * ++ * Licensed under the Apache License, Version 2.0 (the "License"); ++ * you may not use this file except in compliance with the License. ++ * You may obtain a copy of the License at ++ * ++ * http://www.apache.org/licenses/LICENSE-2.0 ++ * ++ * Unless required by applicable law or agreed to in writing, software ++ * distributed under the License is distributed on an "AS IS" BASIS, ++ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ++ * See the License for the specific language governing permissions and ++ * limitations under the License. ++ */ ++ ++package org.jitsi.jibri.util.extensions ++ ++import java.lang.reflect.Field ++ ++/** ++ * Mimic the "pid" member of Java 9's [Process]. ++ */ ++val Process.pidValue: Long ++ get() { ++ var pid: Long = -1 ++ try { ++ if (javaClass.name == "java.lang.UNIXProcess") { ++ val field: Field = javaClass.getDeclaredField("pid") ++ field.isAccessible = true ++ pid = field.getLong(this) ++ field.isAccessible = false ++ } ++ } catch (e: Exception) { ++ pid = -1 ++ } ++ return pid ++ } +diff -Naur a/src/main/kotlin-jdk9/org/jitsi/jibri/util/extensions/Process.kt b/src/main/kotlin-jdk9/org/jitsi/jibri/util/extensions/Process.kt +--- a/src/main/kotlin-jdk9/org/jitsi/jibri/util/extensions/Process.kt 1970-01-01 01:00:00.000000000 +0100 ++++ b/src/main/kotlin-jdk9/org/jitsi/jibri/util/extensions/Process.kt 2021-02-22 16:59:44.783666826 +0100 +@@ -0,0 +1,25 @@ ++/* ++ * Copyright @ 2018 - present 8x8, Inc. ++ * ++ * Licensed under the Apache License, Version 2.0 (the "License"); ++ * you may not use this file except in compliance with the License. ++ * You may obtain a copy of the License at ++ * ++ * http://www.apache.org/licenses/LICENSE-2.0 ++ * ++ * Unless required by applicable law or agreed to in writing, software ++ * distributed under the License is distributed on an "AS IS" BASIS, ++ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ++ * See the License for the specific language governing permissions and ++ * limitations under the License. ++ */ ++ ++package org.jitsi.jibri.util.extensions ++ ++/** ++ * Mimic the "pid" member of Java 9's [Process]. ++ */ ++val Process.pidValue: Long ++ get() { ++ return this.pid() ++ } diff --git a/jibri/jibri.spec b/jibri/jibri.spec index 78e0792..2abf083 100644 --- a/jibri/jibri.spec +++ b/jibri/jibri.spec @@ -25,6 +25,7 @@ Source12: %{name}.chromepolicy Source13: %{name}-icewm-setup.sh Patch1: 0001-logconfig.patch Patch2: 0002-allow-overriding-webdriver-log.patch +Patch3: 0003-jdk11-compatibility.patch BuildArch: noarch BuildRequires: maven @@ -40,7 +41,7 @@ Requires: alsa-utils Requires: icewm Requires: xorg-x11-drv-dummy Requires: curl -Requires: jre-1.8.0-headless +Requires: jre-headless Requires: systemd %{?sysusers_requires_compat}