Temporary hack for 64bit build

This commit is contained in:
Levente Farkas 2010-07-22 21:47:03 +00:00
parent ce80c5d9a9
commit bfac7b287d
9 changed files with 197 additions and 44 deletions

View File

@ -1 +1 @@
jna-3.2.4.tar.bz2
jna-3.2.7.tar.bz2

View File

@ -1 +1,2 @@
jna-3_2_4-1_el5:HEAD:jna-3.2.4-1.el5.src.rpm:1259001126
jna-3_2_7-2_fc12:F-13:jna-3.2.7-2.fc12.src.rpm:1279835196

12
jna-3.2.5-direct.patch Normal file
View File

@ -0,0 +1,12 @@
diff -up ./native/dispatch.c.old ./native/dispatch.c
--- ./native/dispatch.c.old 2010-05-12 09:56:55.478872622 +0200
+++ ./native/dispatch.c 2010-05-12 09:57:11.639872467 +0200
@@ -2808,7 +2808,7 @@ Java_com_sun_jna_Native_unregister(JNIEn
free(md);
}
(*env)->ReleaseLongArrayElements(env, handles, data, 0);
- (*env)->UnregisterNatives(env, cls);
+ //(*env)->UnregisterNatives(env, cls);
}
JNIEXPORT jlong JNICALL

37
jna-3.2.5-junit.patch Normal file
View File

@ -0,0 +1,37 @@
diff -up ./build.xml.junit ./build.xml
--- ./build.xml.junit 2010-05-01 12:18:55.547238394 +0200
+++ ./build.xml 2010-05-01 12:20:49.253989440 +0200
@@ -161,9 +161,6 @@
<path id="compile-test.path">
<pathelement path="${test.src}"/>
<path id="test.libs">
- <fileset dir="lib">
- <include name="junit.jar"/>
- </fileset>
<pathelement path="${classes}"/>
</path>
<path id="compile.path">
@@ -419,13 +416,12 @@
<mkdir dir="${build}/jws"/>
<copy todir="${build}/jws" file="${build}/${jar}"/>
<copy todir="${build}/jws" file="${build}/${testjar}"/>
- <copy todir="${build}/jws" file="lib/junit.jar"/>
<copy todir="${build}/jws" file="lib/clover.jar"/>
<jar jarfile="${build}/jws/jnidispatch.jar">
<fileset dir="${build.native}" includes="*jnidispatch.*"/>
</jar>
<signjar alias="jna" keystore="jna.keystore" storepass="jnadev" lazy="true">
- <fileset dir="${build}/jws" includes="jna.jar,jna-test.jar,junit.jar,jnidispatch.jar,clover.jar"/>
+ <fileset dir="${build}/jws" includes="jna.jar,jna-test.jar,jnidispatch.jar,clover.jar"/>
</signjar>
</target>
@@ -633,7 +629,7 @@
<!-- Full sources required to build and test everything -->
<zip zipfile="${dist}/src-full.zip">
<zipfileset src="${dist}/src.zip"/>
- <zipfileset dir="lib" includes="junit.jar,clover.jar" prefix="lib"/>
+ <zipfileset dir="lib" includes="clover.jar" prefix="lib"/>
<zipfileset dir="." includes=".classpath,.project"/>
<zipfileset dir="nbproject" includes="**/*" prefix="nbproject"/>
<zipfileset dir="${native}" includes="libffi,libffi/**/*" prefix="native"/>

View File

@ -1,7 +1,7 @@
diff -up ./src/com/sun/jna/Native.java.loadlib ./src/com/sun/jna/Native.java
--- ./src/com/sun/jna/Native.java.loadlib 2009-11-09 10:23:05.000000000 +0100
+++ ./src/com/sun/jna/Native.java 2009-11-09 10:30:41.000000000 +0100
@@ -630,131 +630,19 @@ public final class Native {
--- ./src/com/sun/jna/Native.java.loadlib 2010-05-01 10:54:09.949779524 +0200
+++ ./src/com/sun/jna/Native.java 2010-05-01 10:55:08.405824567 +0200
@@ -631,131 +631,19 @@ public final class Native {
}
/**
@ -88,7 +88,7 @@ diff -up ./src/com/sun/jna/Native.java.loadlib ./src/com/sun/jna/Native.java
- File lib = null;
- if (url.getProtocol().toLowerCase().equals("file")) {
- try {
- lib = new File(url.toURI());
- lib = new File(new URI(url.toString()));
- }
- catch(URISyntaxException e) {
- lib = new File(url.getPath());

View File

@ -1,17 +1,19 @@
--- build.xml.orig 2010-04-22 15:22:49.082452327 -0400
+++ build.xml 2010-04-22 15:22:54.266203934 -0400
@@ -540,8 +540,6 @@
<group title="Examples" packages="com.sun.jna.examples,com.sun.jna.examples.dnd"/>
<group title="Unix Examples" packages="com.sun.jna.examples.unix"/>
<group title="Windows Examples" packages="com.sun.jna.examples.win32"/>
-
diff -up ./build.xml.gcj-javadoc ./build.xml
--- ./build.xml.gcj-javadoc 2010-07-22 11:47:35.097371333 +0200
+++ ./build.xml 2010-07-22 11:47:56.222245622 +0200
@@ -555,8 +555,6 @@
<group title="Java Native Access" packages="com.sun.jna,com.sun.jna.ptr,com.sun.jna.types,com.sun.jna.win32"/>
<group title="Platform Specific" packages="com.sun.jna.platform"/>
-
- <arg value="-notimestamp"/>
</javadoc>
</target>
--- src/com/sun/jna/Function.java.orig 2010-04-22 15:23:32.766205632 -0400
+++ src/com/sun/jna/Function.java 2010-04-22 15:23:55.909207399 -0400
@@ -76,7 +76,7 @@
<subant target="javadoc">
<fileset dir="${contrib}" includes="platform/build.xml"/>
diff -up ./src/com/sun/jna/Function.java.gcj-javadoc ./src/com/sun/jna/Function.java
--- ./src/com/sun/jna/Function.java.gcj-javadoc 2010-07-22 11:48:33.732370892 +0200
+++ ./src/com/sun/jna/Function.java 2010-07-22 11:49:25.324392691 +0200
@@ -76,7 +76,7 @@ public class Function extends Pointer {
* Library in which to find the native function
* @param functionName
* Name of the native function to be linked with
@ -20,7 +22,7 @@
* the given function name is not found within the library.
*/
public static Function getFunction(String libraryName, String functionName) {
@@ -97,7 +97,7 @@
@@ -97,7 +97,7 @@ public class Function extends Pointer {
* @param callFlags
* Function <a href="#callflags">call flags</a>
*
@ -29,7 +31,7 @@
* the given function name is not found within the library.
*/
public static Function getFunction(String libraryName, String functionName, int callFlags) {
@@ -161,7 +161,7 @@
@@ -161,7 +161,7 @@ public class Function extends Pointer {
* Name of the native function to be linked with
* @param callFlags
* Function <a href="#callflags">call flags</a>

52
jna-pom.xml Normal file
View File

@ -0,0 +1,52 @@
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>net.java.dev.jna</groupId>
<artifactId>jna</artifactId>
<packaging>jar</packaging>
<version>VERSION</version>
<name>Java Native Access</name>
<distributionManagement>
<repository>
<uniqueVersion>false</uniqueVersion>
<id>java.net-maven2-repository</id>
<url>java-net:/maven2-repository/trunk/repository/</url>
</repository>
</distributionManagement>
<build>
<plugins>
<!-- fake out maven and install the binary artifact -->
<plugin>
<groupId>org.jvnet.maven-antrun-extended-plugin</groupId>
<artifactId>maven-antrun-extended-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<tasks>
<!--<ant dir="." target="dist" />-->
<attachArtifact file="dist/jna.jar" />
<attachArtifact file="dist/src-mvn.zip" classifier="sources" type="jar"/>
</tasks>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
<extensions>
<extension>
<groupId>org.jvnet.wagon-svn</groupId>
<artifactId>wagon-svn</artifactId>
<version>1.8</version>
</extension>
</extensions>
</build>
</project>

View File

@ -1,6 +1,6 @@
Name: jna
Version: 3.2.4
Release: 5%{?dist}
Version: 3.2.7
Release: 2%{?dist}
Summary: Pure Java access to native libraries
Group: Development/Libraries
@ -9,29 +9,35 @@ URL: https://jna.dev.java.net/
# The source for this package was pulled from upstream's vcs. Use the
# following commands to generate the tarball:
# svn export https://jna.dev.java.net/svn/jna/tags/%{version}/jnalib/ --username guest jna-%{version}
# rm jna-%{version}/dist/*
# tar -cjf jna-%{version}.tar.bz2 jna-%{version}
# rm -rf jna-%{version}/dist/*
# tar cjf ~/rpm/SOURCES/jna-%{version}.tar.bz2 jna-%{version}
Source0: %{name}-%{version}.tar.bz2
Source1: %{name}-pom.xml
# This patch is Fedora-specific for now until we get the huge
# JNI library location mess sorted upstream
Patch1: jna-3.2.4-loadlibrary.patch
Patch1: jna-3.2.5-loadlibrary.patch
# The X11 tests currently segfault; overall I think the X11 JNA stuff is just a
# Really Bad Idea, for relying on AWT internals, using the X11 API at all,
# and using a complex API like X11 through JNA just increases the potential
# for problems.
Patch2: jna-3.2.4-tests-headless.patch
# Upstream appears to have some sort of MD5 check on the contents of their
# native jar. Carve that out so we always build it.
Patch3: jna-3.2.4-build-md5.patch
# Build using GCJ javadoc
Patch4: jna-3.2.4-gcj-javadoc.patch
Patch4: jna-3.2.7-gcj-javadoc.patch
# junit cames from rpm
Patch5: jna-3.2.5-junit.patch
# see: https://jna.dev.java.net/issues/show_bug.cgi?id=154
Patch6: jna-3.2.5-direct.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: java-devel ant jpackage-utils ant-nodeps
BuildRequires: libX11-devel libXt-devel libffi-devel
# We manually require libffi because find-requires doesn't work
# inside jars.
Requires: java jpackage-utils libffi
Requires: java >= 1:1.6.0 jpackage-utils libffi
Requires(post): jpackage-utils
Requires(postun): jpackage-utils
BuildRequires: java-devel >= 1:1.6.0 ant jpackage-utils ant-nodeps
BuildRequires: libX11-devel libXt-devel libffi-devel
# for ExcludeArch see bug: 468831
%if 0%{?rhel} < 6 && 0%{?fedora} < 10
ExcludeArch: ppc ppc64
@ -57,26 +63,30 @@ Requires: %{name} = %{version}-%{release}
This package contains the javadocs for %{name}.
%package examples
Summary: Examples for %{name}
%package contrib
Summary: Contrib for %{name}
Group: Documentation
Requires: %{name} = %{version}-%{release}
%description examples
This package contains the examples for %{name}.
%description contrib
This package contains the contributed examples for %{name}.
%prep
%setup -q -n %{name}-%{version}
sed -e 's|@JNIPATH@|%{_libdir}/%{name}|' %{PATCH1} | patch -p1
%patch2 -p1 -b .tests-headless
%patch3 -p0 -R -b .md5
#patch3 -p0 -R -b .md5
%patch4 -p0 -b .gcj-javadoc
%patch5 -p1 -b .junit
#patch6 -p1 -b .direct
cp %{SOURCE1} ./
# all java binaries must be removed from the sources
find . -name '*.jar' -exec rm -f '{}' \;
find . -name '*.class' -exec rm -f '{}' \;
#find . -name '*.jar' -delete
rm lib/junit.jar
find . -name '*.class' -delete
# remove internal copy of libffi
rm -rf native/libffi
@ -89,16 +99,25 @@ chmod 0644 LICENSE.txt
%build
# We pass -Ddynlink.native which comes from our patch because
# upstream doesn't want to default to dynamic linking.
ant -Dcflags_extra.native="%{optflags}" -Ddynlink.native=true -Dnomixedjar.native=true jar examples
ant javadoc
ant -Dcflags_extra.native="%{optflags}" -Ddynlink.native=true -Dnomixedjar.native=true jar
# dirty 64bit hack
%ifarch x86_64
ln -s build-d64 build
%endif
ant -Dcflags_extra.native="%{optflags}" -Ddynlink.native=true -Dnomixedjar.native=true javadoc
# remove compiled contribs
find contrib -name build -delete || :
sed -i "s/VERSION/%{version}/" %{name}-pom.xml
%install
rm -rf %{buildroot}
# dirty 64bit hack
%ifarch x86_64
rm build
%endif
# jars
install -D -m 644 build*/%{name}.jar %{buildroot}%{_javadir}/%{name}-%{version}.jar
install -D -m 644 build*/examples.jar %{buildroot}%{_javadir}/%{name}-examples-%{version}.jar
(cd %{buildroot}%{_javadir}/; for jar in `ls *-%{version}.jar`; do ln -s $jar `echo $jar | sed -e 's/-%{version}//'`; done)
# NOTE: JNA has highly custom code to look for native jars in this
# directory. Since this roughly matches the jpackage guidelines,
@ -106,21 +125,43 @@ install -D -m 644 build*/examples.jar %{buildroot}%{_javadir}/%{name}-examples-%
install -d -m 755 %{buildroot}%{_libdir}/%{name}
install -m 755 build*/native/libjnidispatch*.so %{buildroot}%{_libdir}/%{name}/
# install maven pom file
install -Dm 644 %{name}-pom.xml %{buildroot}%{_mavenpomdir}/JPP.%{name}.pom
# ... and maven depmap
%add_to_maven_depmap net.java.dev.jna %{name} %{version} JPP %{name}
# javadocs
install -p -d -m 755 %{buildroot}%{_javadocdir}/%{name}-%{version}
cp -a doc/javadoc/* %{buildroot}%{_javadocdir}/%{name}-%{version}
%if 0%{?fedora} >= 9
%check
#ant -Dcflags_extra.native="%{optflags}" -Ddynlink.native=true -Dnomixedjar.native=true test
%endif
%clean
rm -rf %{buildroot}
%post
%update_maven_depmap
%postun
%update_maven_depmap
%files
%defattr(-,root,root,-)
%doc LICENSE.txt
%{_libdir}/%{name}
%{_javadir}/%{name}.jar
%{_javadir}/%{name}-%{version}.jar
%{_mavenpomdir}/*.pom
%{_mavendepmapfragdir}/%{name}
%files javadoc
@ -128,13 +169,21 @@ rm -rf %{buildroot}
%{_javadocdir}/%{name}-%{version}
%files examples
%files contrib
%defattr(-,root,root,-)
%{_javadir}/%{name}-examples.jar
%{_javadir}/%{name}-examples-%{version}.jar
%doc contrib
%changelog
* Thu Jul 23 2010 Levente Farkas <lfarkas@lfarkas.org> - 3.2.7-2
- Temporary hack for 64bit build
* Thu Jul 22 2010 Levente Farkas <lfarkas@lfarkas.org> - 3.2.7-1
- Rebase on upstream 3.2.7
* Wed Jul 21 2010 Stanislav Ochotnicky <sochotnicky@redhat.com> - 3.2.4-6
- Add maven depmap
* Thu Apr 22 2010 Colin Walters <walters@verbum.org> - 3.2.4-5
- Add patches to make the build happen with gcj

View File

@ -1 +1 @@
3e53de2ba6c9e3920ec681224114209e jna-3.2.4.tar.bz2
59c5d5ac6b49f86b7ae701265f04a48c jna-3.2.7.tar.bz2