diff --git a/jansi-2.4.0.tar.gz b/jansi-2.4.0.tar.gz new file mode 100644 index 0000000..e2cefe7 --- /dev/null +++ b/jansi-2.4.0.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ba18c50770eebb0b6f472254ada8608138e70045a564efa43626a09691dcf553 +size 225579 diff --git a/jansi-build.xml b/jansi-build.xml index 0785792..3d511bd 100644 --- a/jansi-build.xml +++ b/jansi-build.xml @@ -1,44 +1,27 @@ - + - - + - - - - + + + - - - - - - + + + - - - - - - - - - - - - @@ -54,186 +37,82 @@ - - + - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - =================================== WARNING =================================== - JUnit is not present in the test classpath or your $ANT_HOME/lib directory. Tests not executed. - =============================================================================== - - - - <![CDATA[jansi API Reference (${project.version})]]> - - + linksource="false" + breakiterator="false"/> - - + - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + diff --git a/jansi-jni.patch b/jansi-jni.patch new file mode 100644 index 0000000..c63bba2 --- /dev/null +++ b/jansi-jni.patch @@ -0,0 +1,14 @@ +--- a/src/main/java/org/fusesource/jansi/internal/JansiLoader.java 2020-12-15 03:03:00.000000000 -0700 ++++ b/src/main/java/org/fusesource/jansi/internal/JansiLoader.java 2020-12-15 07:57:30.238720226 -0700 +@@ -295,6 +295,11 @@ public class JansiLoader { + } else { + triedPaths.add(jansiNativeLibraryPath); + } ++ } else { ++ if (loadNativeLibrary(new File("@LIBDIR@/jansi", jansiNativeLibraryName))) { ++ loaded = true; ++ return; ++ } + } + + // Load the os-dependent library from the jar file diff --git a/jansi-project-1.17.1.tar.gz b/jansi-project-1.17.1.tar.gz deleted file mode 100644 index 8b86466..0000000 --- a/jansi-project-1.17.1.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:3d7280eb14edc82e480d66b225470ed6a1da5c5afa4faeab7804a1f15e53b2cd -size 270221 diff --git a/jansi.changes b/jansi.changes index 0b708df..e63a6d9 100644 --- a/jansi.changes +++ b/jansi.changes @@ -1,3 +1,14 @@ +------------------------------------------------------------------- +Mon May 16 11:00:15 UTC 2022 - Fridrich Strba + +- Upgrade the latest upstream release 2.4.0 + * Integrates jansi-native libraries + * Does not depend on jansi-native and hawtjni-runtime +- Added patch: + * jansi-jni.patch + + Give a possibility to load the native libjansi.so from + system + ------------------------------------------------------------------- Wed Mar 23 23:34:23 UTC 2022 - Fridrich Strba diff --git a/jansi.spec b/jansi.spec index 96ff390..922c5a8 100644 --- a/jansi.spec +++ b/jansi.spec @@ -16,27 +16,20 @@ # -%bcond_with tests Name: jansi -Version: 1.17.1 +Version: 2.4.0 Release: 0 Summary: Java library for generating and interpreting ANSI escape sequences License: Apache-2.0 Group: Development/Libraries/Java -URL: http://fusesource.github.io/jansi/ -Source0: https://github.com/fusesource/jansi/archive/jansi-project-%{version}.tar.gz +URL: https://fusesource.github.io/jansi/ +Source0: https://github.com/fusesource/jansi/archive/jansi-%{version}.tar.gz Source1: %{name}-build.xml +Patch0: %{name}-jni.patch BuildRequires: ant BuildRequires: fdupes -BuildRequires: hawtjni-runtime -BuildRequires: jansi-native +BuildRequires: gcc BuildRequires: javapackages-local -%if %{with tests} -BuildRequires: ant-junit -%endif -Requires: mvn(org.fusesource.hawtjni:hawtjni-runtime) -Requires: mvn(org.fusesource.jansi:jansi-native) -BuildArch: noarch %description Jansi is a java library that allows you to use ANSI escape sequences @@ -47,68 +40,84 @@ when output is being sent to output devices which cannot support ANSI sequences. %package javadoc Summary: Javadocs for %{name} Group: Documentation/HTML +BuildArch: noarch %description javadoc This package contains the API documentation for %{name}. %prep -%setup -q -n jansi-jansi-project-%{version} -cp %{SOURCE1} . +%setup -q -n jansi-jansi-%{version} +cp %{SOURCE1} build.xml -%pom_disable_module example +%pom_remove_parent + +# We don't need the Fuse JXR skin %pom_xpath_remove "pom:build/pom:extensions" -%pom_remove_plugin -r :maven-site-plugin +# Plugins not needed for an RPM build +%pom_remove_plugin :maven-gpg-plugin +%pom_remove_plugin :maven-javadoc-plugin +%pom_remove_plugin :nexus-staging-maven-plugin -# No maven-uberize-plugin -%pom_remove_plugin -r :maven-uberize-plugin +# We don't want GraalVM support in Fedora +%pom_remove_plugin :exec-maven-plugin +%pom_remove_dep :picocli-codegen -# Remove unnecessary deps for jansi-native builds -pushd jansi -%pom_remove_dep :jansi-windows32 -%pom_remove_dep :jansi-windows64 -%pom_remove_dep :jansi-osx -%pom_remove_dep :jansi-freebsd32 -%pom_remove_dep :jansi-freebsd64 -# it's there only to be bundled in uberjar and we disable uberjar generation -%pom_remove_dep :jansi-linux32 -%pom_remove_dep :jansi-linux64 -popd +# Build for JDK 1.8 at a minimum +%pom_xpath_set "//pom:properties/pom:jdkTarget" 1.8 -%pom_remove_parent jansi -%pom_xpath_inject pom:project " - org.fusesource.jansi - %{version}" jansi -%pom_change_dep ::\${jansi-native-version} ::1.8 jansi +# Remove prebuilt shared objects +rm -fr src/main/resources/org/fusesource/jansi/internal + +# Unbundle the JNI headers +rm src/main/native/inc_linux/*.h +ln -s %{java_home}/include/jni.h src/main/native/inc_linux +ln -s %{java_home}/include/linux/jni_md.h src/main/native/inc_linux + +# Set the JNI path +sed -i 's,@LIBDIR@,%{_libdir},' \ + src/main/java/org/fusesource/jansi/internal/JansiLoader.java +# Filtering complicated with ant +sed -i 's,\${project.version},%{version},' \ + src/main/resources/org/fusesource/jansi/jansi.properties %build -mkdir -p jansi/lib -build-jar-repository -s jansi/lib \ - hawtjni/hawtjni-runtime jansi-native/jansi-native -%{ant} -f %{name}-build.xml \ -%if %{without tests} - -Dtest.skip=true \ -%endif - jar javadoc +# Build the native artifact +CFLAGS="$CFLAGS -I. -I%{java_home}/include -I%{java_home}/include/linux -fPIC -fvisibility=hidden" +pushd src/main/native +%__cc $CFLAGS -c jansi.c +%__cc $CFLAGS -c jansi_isatty.c +%__cc $CFLAGS -c jansi_structs.c +%__cc $CFLAGS -c jansi_ttyname.c +%__cc $CFLAGS $LDFLAGS -shared -o libjansi.so *.o -lutil +popd + +# Build the Java artifacts +%{ant} jar javadoc %install +# Install the native artifact +install -dm 0755 %{buildroot}%{_libdir}/%{name} +install -pm 0755 src/main/native/libjansi.so %{buildroot}%{_libdir}/%{name} + # jar -install -dm 0755 %{buildroot}%{_javadir}/%{name} -install -pm 0644 jansi/target/%{name}-%{version}.jar %{buildroot}%{_javadir}/%{name}/%{name}.jar +install -dm 0755 %{buildroot}%{_jnidir}/%{name} +install -pm 0644 target/%{name}-%{version}.jar %{buildroot}%{_jnidir}/%{name}/%{name}.jar # pom install -dm 0755 %{buildroot}%{_mavenpomdir}/%{name} -install -pm 0644 jansi/pom.xml %{buildroot}%{_mavenpomdir}/%{name}/%{name}.pom +install -pm 0644 pom.xml %{buildroot}%{_mavenpomdir}/%{name}/%{name}.pom %add_maven_depmap %{name}/%{name}.pom %{name}/%{name}.jar # javadoc %fdupes -s %{buildroot}%{_javadocdir} # javadoc install -dm 0755 %{buildroot}%{_javadocdir}/%{name} -cp -pr jansi/target/site/apidocs/* %{buildroot}%{_javadocdir}/%{name} +cp -pr target/site/apidocs/* %{buildroot}%{_javadocdir}/%{name} %fdupes -s %{buildroot}%{_javadocdir} %files -f .mfiles %license license.txt %doc readme.md changelog.md +%{_libdir}/%{name} %files javadoc %{_javadocdir}/%{name}