added and applied patch605 soundFontPatch.patch as repalcement for removed sound font links, removed hardcoded soundfont links

This commit is contained in:
Jiri Vanek 2015-11-13 15:43:17 +01:00
parent bfb4c76e34
commit 5ad9abd6ef
2 changed files with 60 additions and 7 deletions

View File

@ -448,7 +448,6 @@ exit 0
%{_mandir}/man1/unpack200-%{uniquesuffix %%1}.1* %{_mandir}/man1/unpack200-%{uniquesuffix %%1}.1*
%{_mandir}/man1/policytool-%{uniquesuffix %%1}.1* %{_mandir}/man1/policytool-%{uniquesuffix %%1}.1*
%config(noreplace) %{_jvmdir}/%{jredir %%1}/lib/security/nss.cfg %config(noreplace) %{_jvmdir}/%{jredir %%1}/lib/security/nss.cfg
%{_jvmdir}/%{jredir %%1}/lib/audio/
%ifarch %{jit_arches} %ifarch %{jit_arches}
%ifnarch %{power64} %ifnarch %{power64}
%attr(664, root, root) %ghost %{_jvmdir}/%{jredir %%1}/lib/%{archinstall}/server/classes.jsa %attr(664, root, root) %ghost %{_jvmdir}/%{jredir %%1}/lib/%{archinstall}/server/classes.jsa
@ -660,7 +659,7 @@ Obsoletes: java-1.7.0-openjdk-accessibility%1
Name: java-%{javaver}-%{origin} Name: java-%{javaver}-%{origin}
Version: %{javaver}.%{updatever} Version: %{javaver}.%{updatever}
Release: 1.%{buildver}%{?dist} Release: 2.%{buildver}%{?dist}
# java-1.5.0-ibm from jpackage.org set Epoch to 1 for unknown reasons, # java-1.5.0-ibm from jpackage.org set Epoch to 1 for unknown reasons,
# and this change was brought into RHEL-4. java-1.5.0-ibm packages # and this change was brought into RHEL-4. java-1.5.0-ibm packages
# also included the epoch in their virtual provides. This created a # also included the epoch in their virtual provides. This created a
@ -756,6 +755,7 @@ Patch601: %{name}-rh1191652-root.patch
Patch602: %{name}-rh1191652-jdk.patch Patch602: %{name}-rh1191652-jdk.patch
Patch603: %{name}-rh1191652-hotspot-aarch64.patch Patch603: %{name}-rh1191652-hotspot-aarch64.patch
Patch604: aarch64-ifdefbugfix.patch Patch604: aarch64-ifdefbugfix.patch
Patch605: soundFontPatch.patch
BuildRequires: autoconf BuildRequires: autoconf
BuildRequires: automake BuildRequires: automake
@ -1026,6 +1026,7 @@ sh %{SOURCE12}
%patch601 %patch601
%patch602 %patch602
%patch604 %patch604
%patch605
%patch504 %patch504
%patch511 %patch511
@ -1212,11 +1213,6 @@ rm -rf $RPM_BUILD_ROOT
STRIP_KEEP_SYMTAB=libjvm* STRIP_KEEP_SYMTAB=libjvm*
for suffix in %{build_loop} ; do for suffix in %{build_loop} ; do
# Install symlink to default soundfont
install -d -m 755 $RPM_BUILD_ROOT%{_jvmdir}/%{jredir $suffix}/lib/audio
pushd $RPM_BUILD_ROOT%{_jvmdir}/%{jredir $suffix}/lib/audio
ln -s %{_datadir}/soundfonts/default.sf2
popd
pushd %{buildoutputdir $suffix}/images/%{j2sdkimage} pushd %{buildoutputdir $suffix}/images/%{j2sdkimage}
@ -1713,6 +1709,10 @@ end
%endif %endif
%changelog %changelog
* Fri Nov 13 2015 Jiri Vanek <jvanek@redhat.com> - 1:1.8.0.65-2.b17
- added and applied patch605 soundFontPatch.patch as repalcement for removed sound font links
- removed hardcoded soundfont links
* Thu Nov 12 2015 Jiri Vanek <jvanek@redhat.com> - 1:1.8.0.65-1.b17 * Thu Nov 12 2015 Jiri Vanek <jvanek@redhat.com> - 1:1.8.0.65-1.b17
- updated to u65b17 - updated to u65b17

53
soundFontPatch.patch Normal file
View File

@ -0,0 +1,53 @@
# HG changeset patch
# User omajid
# Date 1445973555 14400
# Node ID 3e006ea10d21a7fcf15725c51f2ab7ededce53ab
# Parent dfeaf40df80032570558c031f37f6630dc729e3f
8140620: Find and load default.sf2 as the default soundbank on Linux
Reviewed-by: serb
+++ openjdk/jdk/src/share/classes/com/sun/media/sound/SoftSynthesizer.java
--- openjdk/jdk/src/share/classes/com/sun/media/sound/SoftSynthesizer.java
@@ -671,6 +671,40 @@
actions.add(new PrivilegedAction<InputStream>() {
public InputStream run() {
if (System.getProperties().getProperty("os.name")
+ .startsWith("Linux")) {
+
+ File[] systemSoundFontsDir = new File[] {
+ /* Arch, Fedora, Mageia */
+ new File("/usr/share/soundfonts/"),
+ new File("/usr/local/share/soundfonts/"),
+ /* Debian, Gentoo, OpenSUSE, Ubuntu */
+ new File("/usr/share/sounds/sf2/"),
+ new File("/usr/local/share/sounds/sf2/"),
+ };
+
+ /*
+ * Look for a default.sf2
+ */
+ for (File systemSoundFontDir : systemSoundFontsDir) {
+ if (systemSoundFontDir.exists()) {
+ File defaultSoundFont = new File(systemSoundFontDir, "default.sf2");
+ if (defaultSoundFont.exists()) {
+ try {
+ return new FileInputStream(defaultSoundFont);
+ } catch (IOException e) {
+ // continue with lookup
+ }
+ }
+ }
+ }
+ }
+ return null;
+ }
+ });
+
+ actions.add(new PrivilegedAction<InputStream>() {
+ public InputStream run() {
+ if (System.getProperties().getProperty("os.name")
.startsWith("Windows")) {
File gm_dls = new File(System.getenv("SystemRoot")
+ "\\system32\\drivers\\gm.dls");