已开启
Use nodejs-18 to enable webui for riscv64 #64
Dingli Zhang创建于 2025年1月17日
Use nodejs-18 to enable webui for riscv64 #64
已开启
从refs/pull/64/head合入到master
共 4 个文件变更+55-15
| @@ -0,0 +1,31 @@ | |||
| 1 | +From d193fc6f8a272c661ba4b0603b01ef0d36185812 Mon Sep 17 00:00:00 2001 | ||
| 2 | +From: Dingli Zhang <dingli@iscas.ac.cn> | ||
| 3 | +Date: Sun, 5 May 2024 11:27:18 +0800 | ||
| 4 | +Subject: [PATCH] Add RISC-V support for frontend-maven-plugin | ||
| 5 | + | ||
| 6 | + | ||
| 7 | +diff --git a/frontend-plugin-core/src/main/java/com/github/eirslett/maven/plugins/frontend/lib/Platform.java b/frontend-plugin-core/src/main/java/com/github/eirslett/maven/plugins/frontend/lib/Platform.java | ||
| 8 | +index 3bdb029..2f82c1e 100644 | ||
| 9 | +--- a/frontend-plugin-core/src/main/java/com/github/eirslett/maven/plugins/frontend/lib/Platform.java | ||
| 10 | ++++ b/frontend-plugin-core/src/main/java/com/github/eirslett/maven/plugins/frontend/lib/Platform.java | ||
| 11 | +@@ -2,7 +2,7 @@ package com.github.eirslett.maven.plugins.frontend.lib; | ||
| 12 | + | ||
| 13 | + import java.io.File; | ||
| 14 | + | ||
| 15 | +-enum Architecture { x86, x64, ppc64le, s390x, arm64, armv7l; | ||
| 16 | ++enum Architecture { x86, x64, ppc64le, s390x, arm64, armv7l, riscv64; | ||
| 17 | + public static Architecture guess(){ | ||
| 18 | + String arch = System.getProperty("os.arch"); | ||
| 19 | + String version = System.getProperty("os.version"); | ||
| 20 | +@@ -15,6 +15,8 @@ enum Architecture { x86, x64, ppc64le, s390x, arm64, armv7l; | ||
| 21 | + return s390x; | ||
| 22 | + } else if (arch.equals("arm") && version.contains("v7")) { | ||
| 23 | + return armv7l; | ||
| 24 | ++ } else if (arch.equals("riscv64")) { | ||
| 25 | ++ return riscv64; | ||
| 26 | + } else { | ||
| 27 | + return arch.contains("64") ? x64 : x86; | ||
| 28 | + } | ||
| 29 | +-- | ||
| 30 | +2.41.0 | ||
| 31 | + | ||
| @@ -11,7 +11,7 @@ | |||
| 11 | 11 | ||
| 12 | Name: flink | 12 | Name: flink |
| 13 | Version: 1.17.1 | 13 | Version: 1.17.1 |
| 14 | -Release: 5 | 14 | +Release: 6 |
| 15 | Summary: Stateful Computations over Data Streams | 15 | Summary: Stateful Computations over Data Streams |
| 16 | License: Apache License v2.0 | 16 | License: Apache License v2.0 |
| 17 | URL: https://github.com/apache/%{name} | 17 | URL: https://github.com/apache/%{name} |
| @@ -24,6 +24,8 @@ Source6: npm-8.1.2.tar.gz | |||
| 24 | Source7: https://github.com/protocolbuffers/protobuf/archive/refs/tags/v3.21.7.tar.gz | 24 | Source7: https://github.com/protocolbuffers/protobuf/archive/refs/tags/v3.21.7.tar.gz |
| 25 | Source8: https://github.com/os72/protoc-jar/archive/refs/tags/v3.11.4.tar.gz | 25 | Source8: https://github.com/os72/protoc-jar/archive/refs/tags/v3.11.4.tar.gz |
| 26 | Source9: https://github.com/os72/protoc-jar-maven-plugin/archive/refs/tags/v3.11.4.zip | 26 | Source9: https://github.com/os72/protoc-jar-maven-plugin/archive/refs/tags/v3.11.4.zip |
| 27 | +Source10: https://github.com/eirslett/frontend-maven-plugin/archive/refs/tags/frontend-plugins-1.11.0.tar.gz | ||
| 28 | +Source11: https://unofficial-builds.nodejs.org/download/release/v18.0.0/node-v18.0.0-linux-riscv64.tar.gz | ||
| 27 | 29 | ||
| 28 | Patch0: 0001-add-npm.hw-repo.patch | 30 | Patch0: 0001-add-npm.hw-repo.patch |
| 29 | Patch1: 0002-fix-compilation-failure.patch | 31 | Patch1: 0002-fix-compilation-failure.patch |
| @@ -32,6 +34,7 @@ Patch3: 0004-update-npm.hw-repo.patch | |||
| 32 | Patch4: 0005-upgrade-os-maven-plugin-to-1.7.1.patch | 34 | Patch4: 0005-upgrade-os-maven-plugin-to-1.7.1.patch |
| 33 | Patch1000: 1000-Add-protoc-java-support-for-riscv64.patch | 35 | Patch1000: 1000-Add-protoc-java-support-for-riscv64.patch |
| 34 | Patch1001: 1001-Added-support-for-building-the-riscv64-protoc-binari.patch | 36 | Patch1001: 1001-Added-support-for-building-the-riscv64-protoc-binari.patch |
| 37 | +Patch1002: 1002-Add-RISC-V-support-for-frontend-maven-plugin.patch | ||
| 35 | BuildRequires: java-1.8.0-openjdk-devel maven npm | 38 | BuildRequires: java-1.8.0-openjdk-devel maven npm |
| 36 | Requires: java-1.8.0-openjdk | 39 | Requires: java-1.8.0-openjdk |
| 37 | %ifarch riscv64 | 40 | %ifarch riscv64 |
| @@ -42,18 +45,14 @@ BuildRequires: autoconf automake libtool pkgconfig zlib-devel libstdc++-static | |||
| 42 | 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. | 45 | 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. |
| 43 | 46 | ||
| 44 | %prep | 47 | %prep |
| 48 | +%setup -n %{name}-release-%{version} | ||
| 49 | +%autopatch -M999 -p1 | ||
| 45 | %ifarch riscv64 | 50 | %ifarch riscv64 |
| 46 | -%setup -qn %{name}-release-%{version} | ||
| 47 | -%patch0 -p1 | ||
| 48 | -%patch1 -p1 | ||
| 49 | -%patch2 -p1 | ||
| 50 | -%patch3 -p1 | ||
| 51 | -%patch4 -p1 | ||
| 52 | mkdir -p ${HOME}/%{name}-prep_dir | 51 | mkdir -p ${HOME}/%{name}-prep_dir |
| 53 | # protoc | 52 | # protoc |
| 54 | tar -mxf %{SOURCE7} -C ${HOME}/%{name}-prep_dir | 53 | tar -mxf %{SOURCE7} -C ${HOME}/%{name}-prep_dir |
| 55 | pushd ${HOME}/%{name}-prep_dir/protobuf-3.21.7 | 54 | pushd ${HOME}/%{name}-prep_dir/protobuf-3.21.7 |
| 56 | -%patch1001 -p1 | 55 | +%patch 1001 -p1 |
| 57 | ./autogen.sh | 56 | ./autogen.sh |
| 58 | ./protoc-artifacts/build-protoc.sh linux riscv64 protoc | 57 | ./protoc-artifacts/build-protoc.sh linux riscv64 protoc |
| 59 | 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 | 58 | 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 |
| @@ -61,7 +60,7 @@ popd | |||
| 61 | # protoc-jar | 60 | # protoc-jar |
| 62 | tar -mxf %{SOURCE8} -C ${HOME}/%{name}-prep_dir | 61 | tar -mxf %{SOURCE8} -C ${HOME}/%{name}-prep_dir |
| 63 | pushd ${HOME}/%{name}-prep_dir/protoc-jar-3.11.4 | 62 | pushd ${HOME}/%{name}-prep_dir/protoc-jar-3.11.4 |
| 64 | -%patch1000 -p1 | 63 | +%patch 1000 -p1 |
| 65 | mvn clean install -Dmaven.test.skip=true -Dmaven.javadoc.skip=true | 64 | mvn clean install -Dmaven.test.skip=true -Dmaven.javadoc.skip=true |
| 66 | popd | 65 | popd |
| 67 | # protoc-jar-maven-plugin | 66 | # protoc-jar-maven-plugin |
| @@ -69,9 +68,17 @@ unzip %{SOURCE9} -d ${HOME}/%{name}-prep_dir | |||
| 69 | pushd ${HOME}/%{name}-prep_dir/protoc-jar-maven-plugin-3.11.4 | 68 | pushd ${HOME}/%{name}-prep_dir/protoc-jar-maven-plugin-3.11.4 |
| 70 | mvn clean install -Dmaven.test.skip=true -Dmaven.javadoc.skip=true | 69 | mvn clean install -Dmaven.test.skip=true -Dmaven.javadoc.skip=true |
| 71 | popd | 70 | popd |
| 72 | -%else | 71 | +# frontend-plugin |
| 73 | -%setup -n %{name}-release-%{version} | 72 | +tar -mxf %{SOURCE10} -C ${HOME}/%{name}-prep_dir |
| 74 | -%autopatch -M999 -p1 | 73 | +pushd ${HOME}/%{name}-prep_dir/frontend-maven-plugin-frontend-plugins-1.11.0 |
| 74 | +%patch 1002 -p1 | ||
| 75 | +mvn clean install -Dmaven.test.skip=true -Dmaven.javadoc.skip=true | ||
| 76 | +popd | ||
| 77 | +# Use nodejs-18 for riscv64 | ||
| 78 | +sed -i 's/v16.13.2/v18.0.0/g' flink-runtime-web/pom.xml | ||
| 79 | +mkdir -p ${HOME}/.m2/repository/com/github/eirslett/node/18.0.0/ | ||
| 80 | +cp %{SOURCE11} ${HOME}/.m2/repository/com/github/eirslett/node/18.0.0/ | ||
| 81 | +mv ${HOME}/.m2/repository/com/github/eirslett/node/18.0.0/node-v18.0.0-linux-riscv64.tar.gz ${HOME}/.m2/repository/com/github/eirslett/node/18.0.0/node-18.0.0-linux-riscv64.tar.gz | ||
| 75 | %endif | 82 | %endif |
| 76 | mvn install:install-file -DgroupId=io.confluent -DartifactId=kafka-schema-registry-client -Dversion=7.2.2 -Dpackaging=jar -Dfile=%{SOURCE2} | 83 | mvn install:install-file -DgroupId=io.confluent -DartifactId=kafka-schema-registry-client -Dversion=7.2.2 -Dpackaging=jar -Dfile=%{SOURCE2} |
| 77 | mvn install:install-file -DgroupId=io.confluent -DartifactId=kafka-avro-serializer -Dversion=7.2.2 -Dpackaging=jar -Dfile=%{SOURCE3} | 84 | mvn install:install-file -DgroupId=io.confluent -DartifactId=kafka-avro-serializer -Dversion=7.2.2 -Dpackaging=jar -Dfile=%{SOURCE3} |
| @@ -84,11 +91,9 @@ cp %{SOURCE6} ${HOME}/.m2/repository/com/github/eirslett/npm/8.1.2/ | |||
| 84 | %ifarch riscv64 | 91 | %ifarch riscv64 |
| 85 | export MAVEN_OPTS="-Xms10240m -Xmx10240m -Xss2m -XX:MaxTenuringThreshold=0" | 92 | export MAVEN_OPTS="-Xms10240m -Xmx10240m -Xss2m -XX:MaxTenuringThreshold=0" |
| 86 | export JAVA_TOOL_OPTIONS="-Xms10240m -Xmx10240m" | 93 | export JAVA_TOOL_OPTIONS="-Xms10240m -Xmx10240m" |
| 87 | -mvn clean install -DskipTests -Dfast -T 2 -Pskip-webui-build | 94 | +%endif |
| 88 | -%else | ||
| 89 | npm config set registry https://repo.huaweicloud.com/repository/npm/ | 95 | npm config set registry https://repo.huaweicloud.com/repository/npm/ |
| 90 | mvn clean install -DskipTests -Dfast -T 2 | 96 | mvn clean install -DskipTests -Dfast -T 2 |
| 91 | -%endif | ||
| 92 | 97 | ||
| 93 | %install | 98 | %install |
| 94 | mkdir -p %{buildroot}/opt/ | 99 | mkdir -p %{buildroot}/opt/ |
| @@ -102,6 +107,10 @@ find %{buildroot}/opt/apache-%{name}-%{version}/ -type f -name '*.py' | xargs -i | |||
| 102 | %license LICENSE | 107 | %license LICENSE |
| 103 | 108 | ||
| 104 | %changelog | 109 | %changelog |
| 110 | +* Tue Jan 14 2025 Dingli Zhang <dingli@iscas.ac.cn> - 1.17.1-6 | ||
| 111 | +- Use nodejs-18 to enable webui for riscv64 | ||
| 112 | +- Remove unused source file | ||
| 113 | + | ||
| 105 | * Tue Dec 10 2024 shenzhongwei <shenzhongwei@kylinos.cn> - 1.17.1-5 | 114 | * Tue Dec 10 2024 shenzhongwei <shenzhongwei@kylinos.cn> - 1.17.1-5 |
| 106 | - include all patches in the source package. | 115 | - include all patches in the source package. |
| 107 | 116 | ||
Binary files do not support preview