[jogl2] Initial commit

Clément David davidcl at fedoraproject.org
Thu Oct 11 15:31:52 UTC 2012


commit 46c21f52fbc376b4d2b6ddfc231515ae6a24617b
Author: Clément DAVID <clement.david at scilab-enterprises.com>
Date:   Thu Oct 11 17:31:10 2012 +0200

    Initial commit

 .gitignore                                |    1 +
 jogl2-0001-fix-gluegen-gl-classpath.patch |   10 ++
 jogl2-0002-deactivate-debug-printf.patch  |   59 +++++++++
 jogl2-pom.xml                             |   59 +++++++++
 jogl2.spec                                |  185 +++++++++++++++++++++++++++++
 5 files changed, 314 insertions(+), 0 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index e69de29..d63fe97 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/*.tar.7z
diff --git a/jogl2-0001-fix-gluegen-gl-classpath.patch b/jogl2-0001-fix-gluegen-gl-classpath.patch
new file mode 100644
index 0000000..867fd99
--- /dev/null
+++ b/jogl2-0001-fix-gluegen-gl-classpath.patch
@@ -0,0 +1,10 @@
+--- a/make/build-common.xml
++++ b/make/build-common.xml
+@@ -245,6 +245,7 @@
+ 
+         <path id="gluegen-gl.classpath">
+           <pathelement location="${gluegen.jar}" />
++          <pathelement location="${antlr.jar}" />
+           <pathelement location="${gluegen-gl.jar}" />
+         </path>
+ 
diff --git a/jogl2-0002-deactivate-debug-printf.patch b/jogl2-0002-deactivate-debug-printf.patch
new file mode 100644
index 0000000..535a35e
--- /dev/null
+++ b/jogl2-0002-deactivate-debug-printf.patch
@@ -0,0 +1,59 @@
+--- a/src/nativewindow/native/x11/XineramaHelper.c
++++ b/src/nativewindow/native/x11/XineramaHelper.c
+@@ -31,7 +31,7 @@
+ #include <stdio.h>
+ #include <dlfcn.h>
+ 
+-// #define DEBUG 1
++#define XINERAMA_DEBUG 0
+ 
+ static const char* XinExtName = "XINERAMA";
+ 
+@@ -82,7 +82,7 @@ void* XineramaGetLibHandle() {
+     xineramaLibHandle = dlopen(XineramaLibNames[i], RTLD_LAZY | RTLD_GLOBAL);
+   }
+ 
+-  #ifdef DEBUG
++  #if XINERAMA_DEBUG
+     if(NULL!=xineramaLibHandle) {
+       fprintf(stderr, "XineramaGetLibHandle: using lib %s -> %p\n", XineramaLibNames[i-1], xineramaLibHandle);
+     } else {
+@@ -94,7 +94,7 @@ void* XineramaGetLibHandle() {
+ }
+ 
+ Bool XineramaReleaseLibHandle(void* xineramaLibHandle) {
+-  #ifdef DEBUG
++  #if XINERAMA_DEBUG
+     fprintf(stderr, "XineramaReleaseLibHandle: release lib %p\n", xineramaLibHandle);
+   #endif
+   if(NULL==xineramaLibHandle) {
+@@ -111,17 +111,17 @@ void* XineramaGetQueryFunc(void *xineram
+     }
+ 
+     #ifdef __sun_obsolete
+-      #ifdef DEBUG
++      #if XINERAMA_DEBUG
+         fprintf(stderr, "XineramaGetQueryFunc: trying func %p -> %s\n", xineramaLibHandle, XineramaGetInfoName);
+       #endif
+       funcptr = dlsym(xineramaLibHandle, XineramaGetInfoName);
+     #else
+-      #ifdef DEBUG
++      #if XINERAMA_DEBUG
+         fprintf(stderr, "XineramaGetQueryFunc: trying func %p -> %s\n", xineramaLibHandle, XineramaIsActiveName);
+       #endif
+       funcptr = dlsym(xineramaLibHandle, XineramaIsActiveName);
+     #endif
+-    #ifdef DEBUG
++    #if XINERAMA_DEBUG
+       fprintf(stderr, "XineramaGetQueryFunc: got func %p\n", funcptr);
+     #endif
+     return funcptr;
+@@ -139,7 +139,7 @@ Bool XineramaIsEnabled(void *xineramaQue
+   gotXinExt = XQueryExtension(display, XinExtName, &major_opcode,
+                               &first_event, &first_error);
+ 
+-  #ifdef DEBUG
++  #if XINERAMA_DEBUG
+     fprintf(stderr, "XineramaIsEnabled: has Xinerama Ext: ext %d, query-func %p\n", gotXinExt, xineramaQueryFunc);
+   #endif
+ 
diff --git a/jogl2-pom.xml b/jogl2-pom.xml
new file mode 100644
index 0000000..ecbb666
--- /dev/null
+++ b/jogl2-pom.xml
@@ -0,0 +1,59 @@
+<project>
+    <modelVersion>4.0.0</modelVersion>
+    <groupId>org.jogamp.jogl</groupId>
+    <artifactId>jogl</artifactId>
+    <packaging>jar</packaging>
+    <name>JOGL</name>
+    <version>2.0</version>
+    <description>Java™ Binding for the OpenGL® API</description>
+    <url>http://jogamp.org/jogl/www</url>
+
+    <licenses>
+        <license>
+            <name>BSD</name>
+            <url>http://jogamp.org/jogl/LICENSE.txt</url>
+            <distribution>repo</distribution>
+        </license>
+    </licenses>
+
+    <dependencies>
+        <dependency>
+            <artifactId>gluegen-rt</artifactId>
+            <groupId>org.jogamp.gluegen</groupId>
+            <version>2.0</version>
+        </dependency>
+        <dependency>
+            <artifactId>cpptasks</artifactId>
+            <groupId>ant-contrib</groupId>
+            <version>1.0b5</version>
+            <scope>system</scope>
+            <systemPath>${_javadir}/cpptasks.jar</systemPath>
+        </dependency>
+    </dependencies>
+
+    <!--TODO: detect more OS types or inject encClassifier from ant-->
+    <profiles>
+        <profile>
+            <id>windows</id>
+            <activation>
+                <os>
+                    <family>windows</family>
+                </os>
+            </activation>
+            <properties>
+                <envClassifier>windows</envClassifier>
+            </properties>
+        </profile>
+        <profile>
+            <id>linux</id>
+            <activation>
+                <os>
+                    <family>unix</family>
+                </os>
+            </activation>
+            <properties>
+                <envClassifier>linux</envClassifier>
+            </properties>
+        </profile>
+    </profiles>
+</project>
diff --git a/jogl2.spec b/jogl2.spec
new file mode 100644
index 0000000..f0b8a7c
--- /dev/null
+++ b/jogl2.spec
@@ -0,0 +1,185 @@
+# baserelease defines which build revision of this version we're building.
+# The magical name baserelease is matched by the rpmdev-bumpspec tool, which
+# you should use.
+%global baserelease 4
+
+%global pkg_name jogl
+%global pkg_version 2.0
+%global pkg_rc rc10
+
+%if 0%{?pkg_rc:1}
+%global pkg_release 0.%{baserelease}.%{pkg_rc}
+%global src_name %{pkg_name}-v%{pkg_version}-%{pkg_rc}
+%else
+%global pkg_release %{baserelease}
+%global src_name %{pkg_name}-v%{pkg_version}
+%endif
+
+Name:           jogl2
+Version:        %{pkg_version}
+Release:        %{pkg_release}%{?dist}
+Summary:        Java bindings for the OpenGL API
+
+Group:          Development/Libraries
+# For a breakdown of the licensing, see LICENSE.txt 
+License:        BSD and MIT and ASL 2.0 and ASL 1.1 
+URL:            http://jogamp.org/
+Source0:        http://jogamp.org/deployment/jogamp-current/archive/Sources/%{src_name}.tar.7z
+Source1:        %{name}-pom.xml
+
+# https://github.com/sgothel/jogl/pull/51
+Patch1:         %{name}-0001-fix-gluegen-gl-classpath.patch
+Patch2:         %{name}-0002-deactivate-debug-printf.patch
+
+BuildRequires:  java-devel >= 1:1.6.0
+BuildRequires:  jpackage-utils
+BuildRequires:  p7zip
+BuildRequires:  gluegen2-devel
+BuildRequires:  eclipse-swt
+BuildRequires:  libXt-devel
+BuildRequires:  libXrender-devel
+BuildRequires:  libXxf86vm-devel
+BuildRequires:  libXrandr-devel
+BuildRequires:  maven
+
+Requires:       java >= 1:1.6.0
+Requires:       jpackage-utils
+Requires:       gluegen2
+
+%description
+The JOGL project hosts the development version of the Java Binding for
+the OpenGL API (JSR-231), and is designed to provide hardware-supported 3D
+graphics to applications written in Java. JOGL provides full access to the
+APIs in the OpenGL 2.0 specification as well as nearly all vendor extensions,
+and integrates with the AWT and Swing widget sets. It is part of a suite of
+open-source technologies initiated by the Game Technology Group at
+Sun Microsystems.
+
+%package javadoc
+Summary:        Javadoc for jogl2
+Group:          Documentation
+Requires:       jpackage-utils
+BuildArch:      noarch
+
+Requires:       jpackage-utils
+Requires:       %{name} = %{version}-%{release}
+
+%description javadoc
+Javadoc for jogl2.
+
+%package doc
+Summary:        User manual for jogl2
+Group:          Documentation
+BuildArch:      noarch
+
+Requires:       %{name} = %{version}-%{release}
+
+%description doc
+User manual for jogl2.
+
+%prep
+# inline %%setup as 7z archive are not supported
+%setup -c -T -n %{src_name}
+cd ..
+/usr/bin/7za e -y %{SOURCE0}
+tar -xf %{src_name}.tar
+rm %{src_name}.tar
+cd %{src_name}
+chmod -Rf a+rX,u+w,g-w,o-w .
+
+%patch1 -p1
+%patch2 -p1
+
+# Remove bundled dependencies
+find -name "*.jar" -type f -exec rm {} \;
+find -name "*.apk" -type f -exec rm {} \;
+rm -fr make/lib
+
+# Restore the gluegen2 source code from gluegen2-commons
+cp -r %{_datadir}/gluegen2 ../gluegen
+
+# Fix file-not-utf8
+for file in README.txt; do
+    iconv -f ISO-8859-1 -t UTF-8 -o $file.new $file && \
+    touch -r $file $file.new && \
+    mv $file.new $file
+done
+
+# git executable should not be used, use true (to avoid checkout) instead
+sed -i 's/executable="git"/executable="true"/' make/build.xml
+
+%build
+cd make
+ant -Dc.compiler.debug=true \
+    -Djavacdebug=false \
+    -Dcommon.gluegen.build.done=true \
+    \
+    -Dantlr.jar=$(build-classpath antlr.jar) \
+    -Djunit.jar=$(build-classpath junit.jar) \
+    -Dant.jar=$(build-classpath ant.jar) \
+    -Dant-junit.jar=/usr/share/java/ant/ant-junit.jar \
+    -Dgluegen.jar=$(build-classpath gluegen2) \
+    -Dgluegen-rt.jar=%{_libdir}/gluegen2/gluegen2-rt.jar \
+    -Dswt.jar=%{_jnidir}/swt.jar \
+    \
+    -Djavadoc.link=%{_javadocdir}/java \
+    -Dgluegen.link=%{_javadocdir}/gluegen2 \
+    \
+    all \
+    javadoc.all
+
+%install
+mkdir -p %{buildroot}%{_libdir}/%{name} \
+    %{buildroot}%{_jnidir}
+
+install build/jar/jogl-all.jar %{buildroot}%{_libdir}/%{name}/%{name}.jar
+install -t %{buildroot}%{_libdir}/%{name}/ build/lib/*.so
+ln -s ../%{name}/%{name}.jar %{buildroot}%{_jnidir}/
+
+# Provide JPP pom
+mkdir -p %{buildroot}%{_mavenpomdir}
+install -pm 644 %{SOURCE1} %{buildroot}%{_mavenpomdir}/JPP-%{name}.pom
+%add_maven_depmap JPP-%{name}.pom %{name}.jar -a "org.jogamp.jogl:jogl-all"
+
+# Make the javadoc package
+mkdir -p %{buildroot}%{_javadocdir}/%{name}
+cp -rdf build/javadoc/jogl/javadoc/* %{buildroot}%{_javadocdir}/%{name}
+
+# Make the doc package
+mkdir -p %{buildroot}%{_docdir}/%{name}
+cp -rdf doc/* %{buildroot}%{_docdir}/%{name}
+
+# update links to javadoc
+find %{buildroot}%{_docdir}/%{name} -name '*.html' \
+    -exec sed -i "s|/deployment/jogamp-next/javadoc/jogl/javadoc|%{_javadocdir}/%{name}|g" {} +
+
+%files
+%doc README.txt LICENSE.txt CHANGELOG.txt
+%{_libdir}/%{name}
+%{_jnidir}/*
+%{_mavendepmapfragdir}/%{name}
+%{_mavenpomdir}/JPP-%{name}.pom
+
+%files javadoc
+%doc LICENSE.txt
+%{_javadocdir}/%{name}
+
+%files doc
+%doc LICENSE.txt
+%{_docdir}/%{name}
+
+%changelog
+* Fri Oct 05 2012 Clément David <c.david86 at gmail.com> - 2.0-0.4.rc10
+- Add p7zip dependency (to extract source)
+- Fix fedora-review issues
+
+* Tue Oct 02 2012 Clément David <c.david86 at gmail.com> - 2.0-0.3.rc10
+- Provide a pom file
+
+* Mon Sep 20 2012 Clément David <c.david86 at gmail.com> - 2.0-0.2.rc10
+- Add javadoc full subpackage
+- Provide symlink on %%{jnidir}
+
+* Mon Sep 10 2012 Clément David <c.david86 at gmail.com> - 2.0-0.1.rc10
+- Initial package with inspiration on jogl spec
+


More information about the scm-commits mailing list