jogl: new package (#29332)
This commit is contained in:
parent
aee763015e
commit
8409443b1f
2 changed files with 124 additions and 0 deletions
53
var/spack/repos/builtin/packages/jogl/noxf86vm.patch
Normal file
53
var/spack/repos/builtin/packages/jogl/noxf86vm.patch
Normal file
|
@ -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 */
|
71
var/spack/repos/builtin/packages/jogl/package.py
Normal file
71
var/spack/repos/builtin/packages/jogl/package.py
Normal file
|
@ -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)
|
Loading…
Reference in a new issue