From 27d1be5c52f36d623742f6e7b633bfc57bf24cce Mon Sep 17 00:00:00 2001 From: ixgbe00 Date: Sat, 23 Nov 2024 07:12:57 +0800 Subject: [PATCH] * Add support for `linux-riscv64` with `linux-riscv64.properties` (pull #781) --- .github/workflows/javacpp.yml | 6 +- .travis.yml | 11 +++ CHANGELOG.md | 2 + platform/pom.xml | 95 ++++++++++++++++++- src/it/osgi/pom.xml | 9 ++ .../properties/linux-riscv64.properties | 31 ++++++ 6 files changed, 152 insertions(+), 2 deletions(-) create mode 100644 src/main/resources/org/bytedeco/javacpp/properties/linux-riscv64.properties diff --git a/.github/workflows/javacpp.yml b/.github/workflows/javacpp.yml index 334b833e7..b93fcb7da 100644 --- a/.github/workflows/javacpp.yml +++ b/.github/workflows/javacpp.yml @@ -45,6 +45,10 @@ jobs: runs-on: ubuntu-22.04 steps: - uses: bytedeco/javacpp-presets/.github/actions/deploy-ubuntu@actions + linux-riscv64: + runs-on: ubuntu-22.04 + steps: + - uses: bytedeco/javacpp-presets/.github/actions/deploy-ubuntu@actions # linux-x86: # runs-on: ubuntu-22.04 # steps: @@ -77,7 +81,7 @@ jobs: - uses: bytedeco/javacpp-presets/.github/actions/deploy-windows@actions redeploy: # needs: [android-arm, android-arm64, android-x86, android-x86_64, ios-arm64, ios-x86_64, linux-armhf, linux-arm64, linux-ppc64le, linux-x86, linux-x86_64, macosx-arm64, macosx-x86_64, windows-x86, windows-x86_64] - needs: [android-arm64, android-x86_64, ios-arm64, ios-x86_64, linux-arm64, linux-ppc64le, linux-x86_64, macosx-arm64, macosx-x86_64, windows-x86_64] + needs: [android-arm64, android-x86_64, ios-arm64, ios-x86_64, linux-arm64, linux-ppc64le, linux-riscv64, linux-x86_64, macosx-arm64, macosx-x86_64, windows-x86_64] runs-on: ubuntu-22.04 steps: - uses: bytedeco/javacpp-presets/.github/actions/redeploy@actions diff --git a/.travis.yml b/.travis.yml index 27568822c..4dd2c9a3b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -57,6 +57,17 @@ jobs: - export JAVA_HOME="/usr/lib/jvm/java-8-openjdk-ppc64el" script: - mvn clean $MAVEN_PHASE -B -V -U -s $HOME/settings.xml -Djavacpp.platform=linux-ppc64le + - os: linux + arch: riscv64 + language: java + addons: + apt: + packages: openjdk-8-jdk-headless maven + env: PLATFORMS="linux-riscv64" + install: + - export JAVA_HOME="/usr/lib/jvm/java-8-openjdk-riscv64" + script: + - mvn clean $MAVEN_PHASE -B -V -U -s $HOME/settings.xml -Djavacpp.platform=linux-riscv64 - os: linux arch: amd64 language: java diff --git a/CHANGELOG.md b/CHANGELOG.md index b4682b28a..2ac493449 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,6 @@ + * Add support for `linux-riscv64` with `linux-riscv64.properties` ([pull #781](https://github.com/bytedeco/javacpp/pull/781)) + ### November 16, 2024 version 1.5.11 * Fix `Generator` flakiness caused by calls to `Class.getDeclaredMethods()` ([pull #784](https://github.com/bytedeco/javacpp/pull/784)) * Add minimal mappings for `std::chrono` from C++11 ([pull #766](https://github.com/bytedeco/javacpp/pull/766)) diff --git a/platform/pom.xml b/platform/pom.xml index 19e27c799..a9d6224fb 100644 --- a/platform/pom.xml +++ b/platform/pom.xml @@ -67,6 +67,7 @@ linux-armhf${javacpp.platform.extension} linux-arm64${javacpp.platform.extension} linux-ppc64le${javacpp.platform.extension} + linux-riscv64${javacpp.platform.extension} linux-x86${javacpp.platform.extension} linux-x86_64${javacpp.platform.extension} macosx-arm64${javacpp.platform.extension} @@ -135,6 +136,12 @@ ${project.version} ${javacpp.platform.linux-ppc64le} + + org.bytedeco + javacpp + ${project.version} + ${javacpp.platform.linux-riscv64} + @@ -240,7 +247,7 @@ - javacpp.jar javacpp-linux-armhf.jar javacpp-linux-arm64.jar javacpp-linux-ppc64le.jar javacpp-linux-x86.jar javacpp-linux-x86_64.jar javacpp-macosx-arm64.jar javacpp-macosx-x86_64.jar javacpp-windows-x86.jar javacpp-windows-x86_64.jar + javacpp.jar javacpp-linux-armhf.jar javacpp-linux-arm64.jar javacpp-linux-ppc64le.jar javacpp-linux-riscv64.jar javacpp-linux-x86.jar javacpp-linux-x86_64.jar javacpp-macosx-arm64.jar javacpp-macosx-x86_64.jar javacpp-windows-x86.jar javacpp-windows-x86_64.jar @@ -301,6 +308,7 @@ requires static org.bytedeco.javacpp.linux.armhf; requires static org.bytedeco.javacpp.linux.arm64; requires static org.bytedeco.javacpp.linux.ppc64le; + requires static org.bytedeco.javacpp.linux.riscv64; requires static org.bytedeco.javacpp.linux.x86; requires static org.bytedeco.javacpp.linux.x86_64; requires static org.bytedeco.javacpp.macosx.arm64; @@ -425,6 +433,7 @@ ${javacpp.platform}${javacpp.platform.extension} ${javacpp.platform}${javacpp.platform.extension} ${javacpp.platform}${javacpp.platform.extension} + ${javacpp.platform}${javacpp.platform.extension} ${javacpp.platform}${javacpp.platform.extension} ${javacpp.platform}${javacpp.platform.extension} ${javacpp.platform}${javacpp.platform.extension} @@ -454,6 +463,7 @@ ${os.name}-${os.arch}${javacpp.platform.extension} ${os.name}-${os.arch}${javacpp.platform.extension} ${os.name}-${os.arch}${javacpp.platform.extension} + ${os.name}-${os.arch}${javacpp.platform.extension} ${os.name}-${os.arch}${javacpp.platform.extension} ${os.name}-${os.arch}${javacpp.platform.extension} ${os.name}-${os.arch}${javacpp.platform.extension} @@ -483,6 +493,7 @@ + @@ -512,6 +523,7 @@ + @@ -542,6 +554,7 @@ + @@ -571,6 +584,7 @@ + @@ -600,6 +614,7 @@ + @@ -629,6 +644,7 @@ + @@ -658,6 +674,7 @@ + @@ -687,6 +704,7 @@ + @@ -716,6 +734,7 @@ + @@ -745,6 +764,7 @@ + @@ -774,6 +794,7 @@ ${javacpp.platform}${javacpp.platform.extension} + @@ -803,6 +824,7 @@ ${javacpp.platform}${javacpp.platform.extension} + @@ -832,6 +854,37 @@ ${javacpp.platform}${javacpp.platform.extension} + + + + + + + + + + + + javacpp-platform-linux-riscv64 + + + javacpp.platform + linux-riscv64 + + + + + + + + + + + + + + + ${javacpp.platform}${javacpp.platform.extension} @@ -861,6 +914,7 @@ + ${javacpp.platform}${javacpp.platform.extension} @@ -890,6 +944,7 @@ + ${javacpp.platform}${javacpp.platform.extension} @@ -919,6 +974,7 @@ + ${javacpp.platform}${javacpp.platform.extension} @@ -948,6 +1004,7 @@ + @@ -977,6 +1034,7 @@ + @@ -1006,6 +1064,7 @@ + @@ -1149,6 +1208,18 @@ + + javacpp.platform.linux-riscv64-true + + + javacpp.platform.linux-riscv64 + + + + linux-riscv64${javacpp.platform.extension} + + + javacpp.platform.linux-x86-true @@ -1299,6 +1370,19 @@ + + javacpp.platform.custom-linux-riscv64 + + + javacpp.platform.host + + linuxriscv64 + + + linux-riscv64${javacpp.platform.extension} + + + javacpp.platform.custom-linux-amd64 @@ -1513,6 +1597,15 @@ arm64 + + riscv64 + + riscv64 + + + riscv64 + + i386 diff --git a/src/it/osgi/pom.xml b/src/it/osgi/pom.xml index a13f924de..eee6561dd 100644 --- a/src/it/osgi/pom.xml +++ b/src/it/osgi/pom.xml @@ -82,6 +82,15 @@ arm64 + + riscv64 + + riscv64 + + + riscv64 + + i386 diff --git a/src/main/resources/org/bytedeco/javacpp/properties/linux-riscv64.properties b/src/main/resources/org/bytedeco/javacpp/properties/linux-riscv64.properties new file mode 100644 index 000000000..6e9096100 --- /dev/null +++ b/src/main/resources/org/bytedeco/javacpp/properties/linux-riscv64.properties @@ -0,0 +1,31 @@ +platform=linux-riscv64 +platform.path.separator=: +platform.source.suffix=.cpp +platform.includepath.prefix=-I +platform.includepath= +platform.compiler=riscv64-linux-gnu-g++ +platform.compiler.cpp98=-std=c++98 +platform.compiler.cpp03=-std=c++03 +platform.compiler.cpp11=-std=c++11 +platform.compiler.cpp14=-std=c++14 +platform.compiler.cpp17=-std=c++17 +platform.compiler.debug=-O0 -g +platform.compiler.default=-march=rv64gc -mabi=lp64d -O3 -s +platform.compiler.fastfpu=-ffast-math +platform.compiler.nodeprecated=-Wno-deprecated-declarations +platform.compiler.noexceptions=-fno-exceptions -fno-rtti +platform.compiler.nowarnings=-w +platform.compiler.output=-Wl,-rpath,$ORIGIN/ -Wl,-z,noexecstack -Wl,-Bsymbolic -Wall -fPIC -pthread -shared -o\u0020 +platform.linkpath.prefix=-L +platform.linkpath.prefix2=-Wl,-rpath, +platform.linkpath= +platform.link.prefix=-l +platform.link.suffix= +platform.link= +platform.framework.prefix=-F +platform.framework.suffix= +platform.framework= +platform.executable.prefix= +platform.executable.suffix= +platform.library.prefix=lib +platform.library.suffix=.so