Skip to content

Commit aa5fecf

Browse files
committed
integrate wget for auto installation
1 parent 09b9231 commit aa5fecf

File tree

9 files changed

+124
-2
lines changed

9 files changed

+124
-2
lines changed

build-hnp/Makefile

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
PKGS=zstd \
22
zlib \
3+
openssl \
4+
libidn2 \
5+
c-ares \
6+
curl \
7+
wget \
38
pcre2 \
49
libglib \
510
qemu-10
@@ -14,15 +19,27 @@ copy: harmonix-public.hnp
1419

1520
harmonix-public.hnp: $(STAMP) Makefile
1621
# reduce size
22+
rm -rf sysroot
1723
mkdir -p sysroot/bin
1824
mkdir -p sysroot/lib
25+
1926
cp -r buildroot/lib/libz.so* sysroot/lib/
2027
cp -r buildroot/lib/libglib-2.0.so* sysroot/lib/
2128
cp -r buildroot/lib/libgmodule-2.0.so* sysroot/lib/
2229
cp -r buildroot/lib/libintl.so* sysroot/lib/
2330
cp -r buildroot/lib/libpcre2-8.so* sysroot/lib/
24-
cp -r buildroot/bin/qemu-* sysroot/bin/
31+
cp -r buildroot/lib/libssl.so* sysroot/lib/
32+
cp -r buildroot/lib/libcares.so* sysroot/lib/
33+
cp -r buildroot/lib/libidn2.so* sysroot/lib/
34+
cp -r buildroot/lib/libcrypto.so* sysroot/lib/
35+
36+
cp -r buildroot/bin/wget sysroot/bin/hmx_wget
2537
cp -r buildroot/bin/harmonix sysroot/bin/
38+
cp -r buildroot/bin/qemu-* sysroot/bin/
39+
40+
# cp -r buildroot/lib/libcurl.so* sysroot/lib/
41+
# cp -r buildroot/bin/curl sysroot/bin/hmx_curl
42+
2643
# create hnp manually
2744
cp hnp.json sysroot
2845
rm -f harmonix-public.hnp

build-hnp/c-ares/Makefile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
include ../utils/Makefrag
2+
3+
SOURCE_URL = https://github.com/c-ares/c-ares/releases/download/v1.34.5/c-ares-1.34.5.tar.gz
4+
SOURCE_FILE = c-ares-1.34.5.tar.gz
5+
SOURCE_DIR = c-ares-1.34.5
6+
CMAKE_ARGS = -DCMAKE_INSTALL_PREFIX=$(PREFIX) -DCARES_STATIC=OFF -DCARES_SHARED=ON -DCMAKE_SYSTEM_NAME=Linux -DCMAKE_SYSTEM_PROCESSOR=$(OHOS_ARCH) -DCMAKE_BUILD_TYPE=RelWithDebInfo
7+
8+
$(eval $(call define_cmake_package))

build-hnp/curl/Makefile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
include ../utils/Makefrag
2+
3+
SOURCE_URL = https://github.com/curl/curl/releases/download/curl-8_14_1/curl-8.14.1.tar.xz
4+
SOURCE_FILE = curl-8.14.1.tar.xz
5+
SOURCE_DIR = curl-8.14.1
6+
CONFIG_ARGS = --prefix=$(PREFIX) --host $(OHOS_ARCH)-unknown-linux-musl --without-libssh --without-libssh2 --without-libpsl --with-libidn2 --enable-ares --without-nghttp2 --without-brotli --without-zstd --without-libgsasl --enable-shared --disable-static --disable-ldap --disable-ldaps --disable-rtsp --disable-dict --disable-telnet --disable-tftp --disable-pop3 --disable-imap --disable-smtp --disable-gopher --disable-manual --disable-unix-sockets --with-ca-path=/etc/ssl/certs --with-ca-bundle=/etc/ssl/certs/cacert.pem --disable-http-auth-gssnegotiate --disable-mqtt --disable-nls --disable-proxy --enable-optimize --with-ssl CFLAGS="-O2 -g -pipe -fstack-protector-strong -fno-omit-frame-pointer" CPPFLAGS="-I$(shell pwd)/../buildroot/include -D_FORTIFY_SOURCE=2"
7+
8+
$(eval $(call define_autotools_package))

build-hnp/libidn2/Makefile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
include ../utils/Makefrag
2+
3+
SOURCE_URL = $(GNU_MIRROR)/gnu/libidn/libidn2-2.3.8.tar.gz
4+
SOURCE_FILE = libidn2-2.3.8.tar.gz
5+
SOURCE_DIR = libidn2-2.3.8
6+
CONFIG_ARGS = --prefix=$(PREFIX) --disable-static --enable-shared --host $(OHOS_ARCH)-unknown-linux-musl
7+
8+
$(eval $(call define_autotools_package))
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
--- a/crypto/armcap.c 2025-06-09 19:48:43
2+
+++ a/crypto/armcap.c 2025-06-09 19:50:46
3+
@@ -348,8 +348,8 @@
4+
if (getauxval(OSSL_HWCAP) & OSSL_HWCAP_SVE)
5+
OPENSSL_armcap_P |= ARMV8_SVE;
6+
7+
- if (getauxval(OSSL_HWCAP2) & OSSL_HWCAP2_SVE2)
8+
- OPENSSL_armcap_P |= ARMV8_SVE2;
9+
+ // if (getauxval(OSSL_HWCAP2) & OSSL_HWCAP2_SVE2)
10+
+ // OPENSSL_armcap_P |= ARMV8_SVE2;
11+
12+
if (getauxval(OSSL_HWCAP2) & OSSL_HWCAP2_RNG)
13+
OPENSSL_armcap_P |= ARMV8_RNG;
14+
@@ -394,7 +394,7 @@
15+
}
16+
# ifdef __aarch64__
17+
OPENSSL_armcap_P |= arm_probe_for(_armv8_sve_probe, ARMV8_SVE);
18+
- OPENSSL_armcap_P |= arm_probe_for(_armv8_sve2_probe, ARMV8_SVE2);
19+
+ // OPENSSL_armcap_P |= arm_probe_for(_armv8_sve2_probe, ARMV8_SVE2);
20+
OPENSSL_armcap_P |= arm_probe_for(_armv8_rng_probe, ARMV8_RNG);
21+
# endif
22+
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
diff --git a/crypto/armcap.c b/crypto/armcap.c
2+
index 091f24d840..43ad743d97 100644
3+
--- a/crypto/armcap.c
4+
+++ b/crypto/armcap.c
5+
@@ -67,6 +67,9 @@ uint32_t OPENSSL_rdtsc(void)
6+
# include <sys/auxv.h>
7+
# define OSSL_IMPLEMENT_GETAUXVAL
8+
# endif
9+
+# elif defined(__OHOS__)
10+
+# include <sys/auxv.h>
11+
+# define OSSL_IMPLEMENT_GETAUXVAL
12+
# elif defined(__ANDROID_API__)
13+
/* see https://developer.android.google.cn/ndk/guides/cpu-features */
14+
# if __ANDROID_API__ >= 18
15+
diff --git a/crypto/uid.c b/crypto/uid.c
16+
index 45b63a431e..cc69762a0a 100644
17+
--- a/crypto/uid.c
18+
+++ b/crypto/uid.c
19+
@@ -36,6 +36,9 @@ int OPENSSL_issetugid(void)
20+
# include <sys/auxv.h>
21+
# define OSSL_IMPLEMENT_GETAUXVAL
22+
# endif
23+
+# elif defined(__OHOS__)
24+
+# include <sys/auxv.h>
25+
+# define OSSL_IMPLEMENT_GETAUXVAL
26+
# elif defined(__ANDROID_API__)
27+
/* see https://developer.android.google.cn/ndk/guides/cpu-features */
28+
# if __ANDROID_API__ >= 18

build-hnp/openssl/Makefile

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
include ../utils/Makefrag
2+
3+
all: download/openssl-3.5.0.tar.gz
4+
rm -rf temp build
5+
mkdir -p temp build/bin
6+
cd temp && tar xvf ../download/openssl-3.5.0.tar.gz
7+
cd temp/openssl-3.5.0 && cat ../../0001-ohos-getauxval.diff | patch -Np1
8+
cd temp/openssl-3.5.0 && ./Configure linux-$(OHOS_ARCH) shared no-tests --prefix=$(PREFIX) --openssldir=$(PREFIX) -D__OHOS__ CC=$(OHOS_SDK_HOME)/native/llvm/bin/$(OHOS_ARCH)-unknown-linux-ohos-clang AR=$(OHOS_SDK_HOME)/native/llvm/bin/llvm-ar RANLIB=$(OHOS_SDK_HOME)/native/llvm/bin/llvm-ranlib STRIP=$(OHOS_SDK_HOME)/native/llvm/bin/llvm-strip
9+
cd temp/openssl-3.5.0 && make -j $(shell nproc)
10+
cd temp/openssl-3.5.0 && make install_sw DESTDIR=$(shell pwd)/build
11+
mkdir -p ../buildroot
12+
$(OHOS_SDK_HOME)/native/llvm/bin/llvm-strip build/$(PREFIX)/lib/*.so
13+
rm -f ./build/$(PREFIX)/lib/*.a
14+
cp -rv ./build/$(PREFIX)/. ../buildroot | tee file.lst
15+
16+
download/openssl-3.5.0.tar.gz:
17+
mkdir -p download
18+
cd download && wget https://github.com/openssl/openssl/releases/download/openssl-3.5.0/openssl-3.5.0.tar.gz

build-hnp/qemu-10/scripts/harmonix

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,12 @@ install_default() {
3232
mkdir -p "$TMP_DIR"
3333
cd "$TMP_DIR" || exit 1
3434
rm -f minirootfs.tar.gz
35-
wget "$URL" -O minirootfs.tar.gz
35+
36+
if which wget >/dev/null 2>&1; then
37+
wget "$URL" -O minirootfs.tar.gz
38+
else
39+
hmx_wget "$URL" -O minirootfs.tar.gz --no-check-certificate
40+
fi
3641

3742
mkdir -p "$DIR"
3843
tar xvf "$TMP_DIR/minirootfs.tar.gz" -C "$DIR"

build-hnp/wget/Makefile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
include ../utils/Makefrag
2+
3+
SOURCE_URL = $(GNU_MIRROR)/gnu/wget/wget-1.25.0.tar.gz
4+
SOURCE_FILE = wget-1.25.0.tar.gz
5+
SOURCE_DIR = wget-1.25.0
6+
CONFIG_ARGS = --prefix=$(PREFIX) --host=$(OHOS_ARCH)-unknown-linux-musl --disable-shared --enable-static --with-ssl=openssl CFLAGS="-O2 -g -pipe -fstack-protector-strong -fno-omit-frame-pointer" CPPFLAGS="-I$(shell pwd)/../buildroot/include"
7+
8+
$(eval $(call define_autotools_package))

0 commit comments

Comments
 (0)