!60 [sync] PR-55: Build protoc, protoc-jar and protoc-jar-maven-plugin in prep state for riscv64
From: @openeuler-sync-bot Reviewed-by: @wenwj0 Signed-off-by: @wenwj0
This commit is contained in:
commit
540d9a4a14
23
1000-Add-protoc-java-support-for-riscv64.patch
Normal file
23
1000-Add-protoc-java-support-for-riscv64.patch
Normal file
@ -0,0 +1,23 @@
|
||||
From 2c52801962444baa444401b8fafd09bd6cfab92b Mon Sep 17 00:00:00 2001
|
||||
From: Dingli Zhang <dingli@iscas.ac.cn>
|
||||
Date: Thu, 9 May 2024 00:02:35 +0800
|
||||
Subject: [PATCH] Add support for riscv64
|
||||
|
||||
---
|
||||
src/main/java/com/github/os72/protocjar/PlatformDetector.java | 3 +++
|
||||
1 file changed, 3 insertions(+)
|
||||
|
||||
diff --git a/src/main/java/com/github/os72/protocjar/PlatformDetector.java b/src/main/java/com/github/os72/protocjar/PlatformDetector.java
|
||||
index 7a99348..b8f08e5 100644
|
||||
--- a/src/main/java/com/github/os72/protocjar/PlatformDetector.java
|
||||
+++ b/src/main/java/com/github/os72/protocjar/PlatformDetector.java
|
||||
@@ -211,6 +211,9 @@ private static String normalizeArch(String value) {
|
||||
if ("ppc64le".equals(value)) {
|
||||
return "ppcle_64";
|
||||
}
|
||||
+ if ("riscv64".equals(value)) {
|
||||
+ return "riscv64";
|
||||
+ }
|
||||
if ("s390".equals(value)) {
|
||||
return "s390_32";
|
||||
}
|
||||
@ -0,0 +1,56 @@
|
||||
From 8b626946fcabc659a41de3b15cbe6f5d45bd596e Mon Sep 17 00:00:00 2001
|
||||
From: Dingli Zhang <dingli@iscas.ac.cn>
|
||||
Date: Tue, 7 May 2024 13:56:04 +0800
|
||||
Subject: [PATCH] Added support for building the riscv64 protoc binaries with
|
||||
Kokoro
|
||||
|
||||
|
||||
diff --git a/kokoro/release/protoc/linux/build.sh b/kokoro/release/protoc/linux/build.sh
|
||||
index 44a95aab3..13be7b2ed 100755
|
||||
--- a/kokoro/release/protoc/linux/build.sh
|
||||
+++ b/kokoro/release/protoc/linux/build.sh
|
||||
@@ -22,6 +22,9 @@ protoc-artifacts/build-protoc.sh linux aarch_64 protoc
|
||||
sudo apt install -y g++-powerpc64le-linux-gnu
|
||||
protoc-artifacts/build-protoc.sh linux ppcle_64 protoc
|
||||
|
||||
+sudo apt install -y g++-riscv64-linux-gnu
|
||||
+protoc-artifacts/build-protoc.sh linux riscv64 protoc
|
||||
+
|
||||
sudo apt install -y g++-s390x-linux-gnu
|
||||
protoc-artifacts/build-protoc.sh linux s390_64 protoc
|
||||
|
||||
diff --git a/protoc-artifacts/build-protoc.sh b/protoc-artifacts/build-protoc.sh
|
||||
index 460284262..20ca05739 100755
|
||||
--- a/protoc-artifacts/build-protoc.sh
|
||||
+++ b/protoc-artifacts/build-protoc.sh
|
||||
@@ -93,6 +93,8 @@ checkArch ()
|
||||
assertEq $format "elf64-x86-64" $LINENO
|
||||
elif [[ "$ARCH" == aarch_64 ]]; then
|
||||
assertEq $format "elf64-little" $LINENO
|
||||
+ elif [[ "$ARCH" == riscv64 ]]; then
|
||||
+ assertEq $format "elf64-littleriscv" $LINENO
|
||||
elif [[ "$ARCH" == s390_64 ]]; then
|
||||
if [[ $host_machine == s390x ]];then
|
||||
assertEq $format "elf64-s390" $LINENO
|
||||
@@ -162,6 +164,9 @@ checkDependencies ()
|
||||
elif [[ "$ARCH" == aarch_64 ]]; then
|
||||
dump_cmd='objdump -p '"$1"' | grep NEEDED'
|
||||
white_list="libpthread\.so\.0\|libm\.so\.6\|libc\.so\.6\|ld-linux-aarch64\.so\.1"
|
||||
+ elif [[ "$ARCH" == riscv64 ]]; then
|
||||
+ dump_cmd='objdump -p '"$1"' | grep NEEDED'
|
||||
+ white_list="libz\.so\.1\|libm\.so\.6\|libc\.so\.6\|ld-linux-riscv64-lp64d\.so\.1"
|
||||
fi
|
||||
elif [[ "$OS" == osx ]]; then
|
||||
dump_cmd='otool -L '"$1"' | fgrep dylib'
|
||||
@@ -226,6 +231,8 @@ elif [[ "$(uname)" == Linux* ]]; then
|
||||
elif [[ "$ARCH" == ppcle_64 ]]; then
|
||||
CXXFLAGS="$CXXFLAGS -m64"
|
||||
CONFIGURE_ARGS="$CONFIGURE_ARGS --host=powerpc64le-linux-gnu"
|
||||
+ elif [[ "$ARCH" == riscv64 ]]; then
|
||||
+ CONFIGURE_ARGS="$CONFIGURE_ARGS --host=riscv64-linux-gnu"
|
||||
elif [[ "$ARCH" == s390_64 ]]; then
|
||||
CXXFLAGS="$CXXFLAGS -m64"
|
||||
CONFIGURE_ARGS="$CONFIGURE_ARGS --host=s390x-linux-gnu"
|
||||
--
|
||||
2.41.0
|
||||
|
||||
55
flink.spec
55
flink.spec
@ -11,7 +11,7 @@
|
||||
|
||||
Name: flink
|
||||
Version: 1.17.1
|
||||
Release: 3
|
||||
Release: 4
|
||||
Summary: Stateful Computations over Data Streams
|
||||
License: Apache License v2.0
|
||||
URL: https://github.com/apache/%{name}
|
||||
@ -19,11 +19,11 @@ Source0: https://github.com/apache/%{name}/archive/release-%{version}.tar
|
||||
Source2: https://packages.confluent.io/maven/io/confluent/kafka-schema-registry-client/7.2.2/kafka-schema-registry-client-7.2.2.jar
|
||||
Source3: https://packages.confluent.io/maven/io/confluent/kafka-avro-serializer/7.2.2/kafka-avro-serializer-7.2.2.jar
|
||||
Source4: https://packages.confluent.io/maven/io/confluent/kafka-schema-serializer/7.2.2/kafka-schema-serializer-7.2.2.jar
|
||||
Source5: https://packages.confluent.io/maven/org/apache/kafka/kafka-clients/7.2.2-ccs/kafka-clients-7.2.2-ccs.jar
|
||||
Source5: https://packages.confluent.io/maven/org/apache/kafka/kafka-clients/7.2.2-ccs/kafka-clients-7.2.2-ccs.jar
|
||||
Source6: npm-8.1.2.tar.gz
|
||||
Source7: protoc-jar-3.11.4.tar.gz
|
||||
Source8: protoc-jar-maven-plugin-3.11.4.tar.gz
|
||||
Source9: protoc-3.21.7-linux-riscv64.exe
|
||||
Source7: https://github.com/protocolbuffers/protobuf/archive/refs/tags/v3.21.7.tar.gz
|
||||
Source8: https://github.com/os72/protoc-jar/archive/refs/tags/v3.11.4.tar.gz
|
||||
Source9: https://github.com/os72/protoc-jar-maven-plugin/archive/refs/tags/v3.11.4.zip
|
||||
|
||||
Patch0: 0001-add-npm.hw-repo.patch
|
||||
Patch1: 0002-fix-compilation-failure.patch
|
||||
@ -32,23 +32,50 @@ Patch3: 0004-update-npm.hw-repo.patch
|
||||
Patch4: 0005-upgrade-os-maven-plugin-to-1.7.1.patch
|
||||
BuildRequires: java-1.8.0-openjdk-devel maven npm
|
||||
Requires: java-1.8.0-openjdk
|
||||
%ifarch riscv64
|
||||
BuildRequires: autoconf automake libtool pkgconfig zlib-devel libstdc++-static gcc-c++
|
||||
Patch1000: 1000-Add-protoc-java-support-for-riscv64.patch
|
||||
Patch1001: 1001-Added-support-for-building-the-riscv64-protoc-binari.patch
|
||||
%endif
|
||||
|
||||
%description
|
||||
Apache Flink is a framework and distributed processing engine for stateful computations over unbounded and bounded data streams. Flink has been designed to run in all common cluster environments, perform computations at in-memory speed and at any scale.
|
||||
|
||||
%prep
|
||||
%ifarch riscv64
|
||||
%setup -qn %{name}-release-%{version}
|
||||
%patch0 -p1
|
||||
%patch1 -p1
|
||||
%patch2 -p1
|
||||
%patch3 -p1
|
||||
%patch4 -p1
|
||||
mkdir -p ${HOME}/%{name}-prep_dir
|
||||
# protoc
|
||||
tar -mxf %{SOURCE7} -C ${HOME}/%{name}-prep_dir
|
||||
pushd ${HOME}/%{name}-prep_dir/protobuf-3.21.7
|
||||
%patch1001 -p1
|
||||
./autogen.sh
|
||||
./protoc-artifacts/build-protoc.sh linux riscv64 protoc
|
||||
mvn install:install-file -DgroupId=com.google.protobuf -DartifactId=protoc -Dversion=3.21.7 -Dclassifier=linux-riscv64 -Dpackaging=exe -Dfile=protoc-artifacts/target/linux/riscv64/protoc.exe
|
||||
popd
|
||||
# protoc-jar
|
||||
tar -mxf %{SOURCE8} -C ${HOME}/%{name}-prep_dir
|
||||
pushd ${HOME}/%{name}-prep_dir/protoc-jar-3.11.4
|
||||
%patch1000 -p1
|
||||
mvn clean install -Dmaven.test.skip=true -Dmaven.javadoc.skip=true
|
||||
popd
|
||||
# protoc-jar-maven-plugin
|
||||
unzip %{SOURCE9} -d ${HOME}/%{name}-prep_dir
|
||||
pushd ${HOME}/%{name}-prep_dir/protoc-jar-maven-plugin-3.11.4
|
||||
mvn clean install -Dmaven.test.skip=true -Dmaven.javadoc.skip=true
|
||||
popd
|
||||
%else
|
||||
%autosetup -p1 -n %{name}-release-%{version}
|
||||
%endif
|
||||
mvn install:install-file -DgroupId=io.confluent -DartifactId=kafka-schema-registry-client -Dversion=7.2.2 -Dpackaging=jar -Dfile=%{SOURCE2}
|
||||
mvn install:install-file -DgroupId=io.confluent -DartifactId=kafka-avro-serializer -Dversion=7.2.2 -Dpackaging=jar -Dfile=%{SOURCE3}
|
||||
mvn install:install-file -DgroupId=io.confluent -DartifactId=kafka-schema-serializer -Dversion=7.2.2 -Dpackaging=jar -Dfile=%{SOURCE4}
|
||||
mvn install:install-file -DgroupId=org.apache.kafka -DartifactId=kafka-clients -Dversion=7.2.2-ccs -Dpackaging=jar -Dfile=%{SOURCE5}
|
||||
%ifarch riscv64
|
||||
mkdir -p ${HOME}/.m2/repository/com/github/os72/protoc-jar/
|
||||
tar -mxf %{SOURCE7} -C ${HOME}/.m2/repository/com/github/os72/protoc-jar/
|
||||
mkdir -p ${HOME}/.m2/repository/com/github/os72/protoc-jar-maven-plugin/
|
||||
tar -mxf %{SOURCE8} -C ${HOME}/.m2/repository/com/github/os72/protoc-jar-maven-plugin/
|
||||
mvn install:install-file -DgroupId=com.google.protobuf -DartifactId=protoc -Dversion=3.21.7 -Dclassifier=linux-riscv64 -Dpackaging=exe -Dfile=%{SOURCE9}
|
||||
%endif
|
||||
mkdir -p ${HOME}/.m2/repository/com/github/eirslett/npm/8.1.2/
|
||||
cp %{SOURCE6} ${HOME}/.m2/repository/com/github/eirslett/npm/8.1.2/
|
||||
|
||||
@ -74,6 +101,10 @@ find %{buildroot}/opt/apache-%{name}-%{version}/ -type f -name '*.py' | xargs -i
|
||||
%license LICENSE
|
||||
|
||||
%changelog
|
||||
* Tue Jun 25 2024 Dingli Zhang <dingli@iscas.ac.cn> - 1.17.1-4
|
||||
- Remove riscv64 prebuilded files
|
||||
- Build protoc, protoc-jar and protoc-jar-maven-plugin in prep state for riscv64
|
||||
|
||||
* Wed May 29 2024 Dingli Zhang <dingli@iscas.ac.cn> - 1.17.1-3
|
||||
- Fix riscv64 support
|
||||
- Upgrade os-maven-plugin to 1.7.1
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
v3.11.4.tar.gz
Normal file
BIN
v3.11.4.tar.gz
Normal file
Binary file not shown.
BIN
v3.11.4.zip
Normal file
BIN
v3.11.4.zip
Normal file
Binary file not shown.
BIN
v3.21.7.tar.gz
Normal file
BIN
v3.21.7.tar.gz
Normal file
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user