summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorToyohisa Kameyama <fj5358cc@fujitsu.com>2022-03-15 19:10:59 +0900
committerGitHub <noreply@github.com>2022-03-15 04:10:59 -0600
commit8409443b1fa2c13eac83ed1f1548487c88bf365c (patch)
treeae6b48371d39fc31f9ccfe7adc4b195eafedccfd
parentaee763015e92c478112f0b583aa6abe241336d66 (diff)
downloadspack-8409443b1fa2c13eac83ed1f1548487c88bf365c.tar.gz
spack-8409443b1fa2c13eac83ed1f1548487c88bf365c.tar.bz2
spack-8409443b1fa2c13eac83ed1f1548487c88bf365c.tar.xz
spack-8409443b1fa2c13eac83ed1f1548487c88bf365c.zip
jogl: new package (#29332)
-rw-r--r--var/spack/repos/builtin/packages/jogl/noxf86vm.patch53
-rw-r--r--var/spack/repos/builtin/packages/jogl/package.py71
2 files changed, 124 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/jogl/noxf86vm.patch b/var/spack/repos/builtin/packages/jogl/noxf86vm.patch
new file mode 100644
index 0000000000..dac2a82eaf
--- /dev/null
+++ b/var/spack/repos/builtin/packages/jogl/noxf86vm.patch
@@ -0,0 +1,53 @@
+diff --git a/make/build-nativewindow.xml b/make/build-nativewindow.xml
+index 6c9405cfd..140416bba 100644
+--- a/make/build-nativewindow.xml
++++ b/make/build-nativewindow.xml
+@@ -446,19 +446,16 @@
+
+ <linker id="linker.cfg.linux.nativewindow.x11" extends="linker.cfg.linux">
+ <syslibset libs="X11"/>
+- <syslibset libs="Xxf86vm" />
+ <syslibset libs="Xrender"/>
+ </linker>
+
+ <linker id="linker.cfg.linux.x86.nativewindow.x11" extends="linker.cfg.linux.x86">
+ <syslibset libs="X11"/>
+- <syslibset libs="Xxf86vm" />
+ <syslibset libs="Xrender"/>
+ </linker>
+
+ <linker id="linker.cfg.linux.amd64.nativewindow.x11" extends="linker.cfg.linux.amd64">
+ <syslibset libs="X11"/>
+- <syslibset libs="Xxf86vm" />
+ <syslibset libs="Xrender"/>
+ </linker>
+
+@@ -470,7 +467,6 @@
+
+ <linker id="linker.cfg.linux.aarch64.nativewindow.x11" extends="linker.cfg.linux.aarch64">
+ <syslibset dir="${env.TARGET_PLATFORM_ROOT}/usr/lib" libs="X11" />
+- <syslibset dir="${env.TARGET_PLATFORM_ROOT}/usr/lib" libs="Xxf86vm" />
+ <syslibset dir="${env.TARGET_PLATFORM_ROOT}/usr/lib" libs="Xrender" />
+ </linker>
+
+diff --git a/src/nativewindow/native/x11/Xmisc.h b/src/nativewindow/native/x11/Xmisc.h
+index d8868f802..fb7f5f758 100644
+--- a/src/nativewindow/native/x11/Xmisc.h
++++ b/src/nativewindow/native/x11/Xmisc.h
+@@ -39,9 +39,6 @@
+ #include <X11/Xlib.h>
+ #include <X11/Xutil.h>
+
+-#if !defined(__sun_obsolete) && !defined(_HPUX)
+-#include <X11/extensions/xf86vmode.h>
+-#else
+ Bool XF86VidModeGetGammaRampSize(
+ Display* /* dpy */,
+ int /* screen */,
+@@ -63,6 +60,5 @@ Bool XF86VidModeSetGammaRamp(
+ unsigned short* /* green array */,
+ unsigned short* /* blue array */
+ );
+-#endif /* defined(__sun_obsolete) || defined(_HPUX) */
+
+ #endif /* Xmisc_h */
diff --git a/var/spack/repos/builtin/packages/jogl/package.py b/var/spack/repos/builtin/packages/jogl/package.py
new file mode 100644
index 0000000000..1f351f2e61
--- /dev/null
+++ b/var/spack/repos/builtin/packages/jogl/package.py
@@ -0,0 +1,71 @@
+# Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
+# Spack Project Developers. See the top-level COPYRIGHT file for details.
+#
+# SPDX-License-Identifier: (Apache-2.0 OR MIT)
+
+import os
+
+from spack import *
+
+
+class Jogl(Package):
+ """JOGL provides full access to the APIs in the OpenGL specification
+ as well as nearly all vendor extensions."""
+
+ homepage = "https://jogamp.org/jogl/www/"
+ git = "https://github.com/WadeWalker/jogl.git"
+
+ version('java-11-fixes', branch='java-11-fixes', submodules=True)
+
+ depends_on('ant', type='build')
+ depends_on('java', type=('build', 'run'))
+ depends_on('gluegen', type=('build', 'run'))
+ depends_on('gl', type='link')
+ depends_on('glu', type='link')
+ depends_on('libxcursor', type='link')
+
+ # Xfree86 Video mode extentions is deprecated
+ patch('noxf86vm.patch')
+
+ phases = ['edit', 'build', 'install']
+
+ def edit(self, spec, prefix):
+ common = join_path('make', 'build-common.xml')
+ filter_file('../../gluegen', spec['gluegen'].prefix, common)
+ for target in ['nativewindow', 'jogl', 'newt']:
+ conf = join_path('make', 'build-{0}.xml'.format(target))
+ filter_file(r'syslibset dir="\${env.TARGET_PLATFORM_ROOT}[^"]*"',
+ 'syslibset', conf)
+ filter_file('/usr/include', spec['libxcursor'].prefix.include,
+ conf)
+
+ compiler_mapping = {'gcc': 'gcc', 'clang': 'clang', 'fj': 'fcc'}
+
+ def build(self, spec, prefix):
+ cname = spec.compiler.name
+ compiler = self.compiler_mapping.get(cname, 'gcc')
+ ant = spec['ant'].command
+ antarg = ['-Dcommon.gluegen.build.done=true',
+ '-Dgcc.compat.compiler={0}'.format(compiler)]
+ with working_dir('make'):
+ ant(*antarg)
+
+ def install(self, spec, prefix):
+ mkdirp(prefix.lib)
+ with working_dir(join_path('build', 'jar')):
+ install('*.jar', prefix.lib)
+ with working_dir(join_path('build', 'lib')):
+ install('*.so', prefix.lib)
+
+ def setup_build_environment(self, env):
+ env.unset('CLASSPATH')
+
+ def setup_run_environment(self, env):
+ class_paths = find(prefix.lib, '*.jar')
+ classpath = os.pathsep.join(class_paths)
+ env.prepend_path('CLASSPATH', classpath)
+
+ def setup_dependent_build_environment(self, env, dependent_spec):
+ class_paths = find(prefix.lib, '*.jar')
+ classpath = os.pathsep.join(class_paths)
+ env.prepend_path('CLASSPATH', classpath)