Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/hnp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ jobs:
- name: Build hnp
shell: bash
run: |
USE_CCACHE=1 make -C build-hnp
USE_CCACHE=1 OHOS_ARCH=aarch64 OHOS_ABI=arm64-v8a make -C build-hnp

- name: Upload hnp
uses: actions/upload-artifact@v4
Expand Down
92 changes: 80 additions & 12 deletions build-hnp/Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
ifeq ($(OHOS_ARCH),aarch64)
PKGS=gettext \
bash \
binutils \
Expand Down Expand Up @@ -62,14 +63,81 @@ PKGS=gettext \
libogg \
libvorbis \
ffmpeg
else ifeq ($(OHOS_ARCH),x86_64)
PKGS=gettext \
bash \
binutils \
busybox \
coremark \
lz4 \
make \
ncurses \
talloc \
openssl \
zstd \
pcre2 \
zlib \
libarchive \
proot \
strace \
tar \
tree \
vim \
xxhash \
libunistring \
libidn2 \
c-ares \
curl \
yyjson \
fastfetch \
sl \
openssh \
ncnn \
readline \
htop \
vkpeak \
libevent \
tmux \
fish \
elf-loader \
gmp \
mpfr \
mpc \
gcc \
expat \
git \
aria2 \
xz \
python \
libusb \
hdc \
libffi \
glib \
qemu \
qemu-vroot \
libx264 \
libx265 \
libvpx \
libsvt-av1 \
libmp3-lame \
libfdk-aac \
libopus \
libogg \
libvorbis \
ffmpeg
else
echo "Unsupported OHOS_ARCH=$(OHOS_ARCH)"
exit 1
endif

STAMP=$(patsubst %,%/.stamp,$(PKGS))

all: copy

copy: base.hnp
rm -f ../entry/hnp/arm64-v8a/*.hnp
cp $^ ../entry/hnp/arm64-v8a
cp $^ ../entry/hnp/arm64-v8a/base-public.hnp
rm -f ../entry/hnp/$(OHOS_ABI)/*.hnp
cp $^ ../entry/hnp/$(OHOS_ABI)
cp $^ ../entry/hnp/$(OHOS_ABI)/base-public.hnp

base.hnp: $(STAMP) utils/pbcopy utils/pbpaste utils/empty.a Makefile
# reduce size
Expand All @@ -80,15 +148,15 @@ base.hnp: $(STAMP) utils/pbcopy utils/pbpaste utils/empty.a Makefile
cp utils/pbcopy sysroot/bin
cp utils/pbpaste sysroot/bin
# let gcc work out of box
mkdir -p sysroot/aarch64-unknown-linux-musl/lib
cp $(OHOS_SDK_HOME)/native/sysroot/usr/lib/aarch64-linux-ohos/crt1.o sysroot/aarch64-unknown-linux-musl/lib/crt1.o
cp $(OHOS_SDK_HOME)/native/sysroot/usr/lib/aarch64-linux-ohos/crti.o sysroot/aarch64-unknown-linux-musl/lib/crti.o
cp $(OHOS_SDK_HOME)/native/sysroot/usr/lib/aarch64-linux-ohos/crtn.o sysroot/aarch64-unknown-linux-musl/lib/crtn.o
cp $(OHOS_SDK_HOME)/native/llvm/lib/clang/15.0.4/lib/aarch64-linux-ohos/clang_rt.crtbegin.o sysroot/aarch64-unknown-linux-musl/lib/crtbegin.o
cp $(OHOS_SDK_HOME)/native/llvm/lib/clang/15.0.4/lib/aarch64-linux-ohos/clang_rt.crtend.o sysroot/aarch64-unknown-linux-musl/lib/crtend.o
cp $(OHOS_SDK_HOME)/native/llvm/lib/clang/15.0.4/lib/aarch64-linux-ohos/libclang_rt.builtins.a sysroot/aarch64-unknown-linux-musl/lib/libgcc.a
cp $(OHOS_SDK_HOME)/native/llvm/lib/clang/15.0.4/lib/aarch64-linux-ohos/libclang_rt.builtins.a sysroot/aarch64-unknown-linux-musl/lib/libgcc_s.a
cp utils/empty.a sysroot/aarch64-unknown-linux-musl/lib/libgcc_eh.a
mkdir -p sysroot/$(OHOS_ARCH)-unknown-linux-musl/lib
cp $(OHOS_SDK_HOME)/native/sysroot/usr/lib/$(OHOS_ARCH)-linux-ohos/crt1.o sysroot/$(OHOS_ARCH)-unknown-linux-musl/lib/crt1.o
cp $(OHOS_SDK_HOME)/native/sysroot/usr/lib/$(OHOS_ARCH)-linux-ohos/crti.o sysroot/$(OHOS_ARCH)-unknown-linux-musl/lib/crti.o
cp $(OHOS_SDK_HOME)/native/sysroot/usr/lib/$(OHOS_ARCH)-linux-ohos/crtn.o sysroot/$(OHOS_ARCH)-unknown-linux-musl/lib/crtn.o
cp $(OHOS_SDK_HOME)/native/llvm/lib/clang/15.0.4/lib/$(OHOS_ARCH)-linux-ohos/clang_rt.crtbegin.o sysroot/$(OHOS_ARCH)-unknown-linux-musl/lib/crtbegin.o
cp $(OHOS_SDK_HOME)/native/llvm/lib/clang/15.0.4/lib/$(OHOS_ARCH)-linux-ohos/clang_rt.crtend.o sysroot/$(OHOS_ARCH)-unknown-linux-musl/lib/crtend.o
cp $(OHOS_SDK_HOME)/native/llvm/lib/clang/15.0.4/lib/$(OHOS_ARCH)-linux-ohos/libclang_rt.builtins.a sysroot/$(OHOS_ARCH)-unknown-linux-musl/lib/libgcc.a
cp $(OHOS_SDK_HOME)/native/llvm/lib/clang/15.0.4/lib/$(OHOS_ARCH)-linux-ohos/libclang_rt.builtins.a sysroot/$(OHOS_ARCH)-unknown-linux-musl/lib/libgcc_s.a
cp utils/empty.a sysroot/$(OHOS_ARCH)-unknown-linux-musl/lib/libgcc_eh.a
# create hnp manually
# $(OHOS_SDK_HOME)/toolchains/hnpcli pack -i sysroot -n base -v 1.0
cp hnp.json sysroot
Expand Down
2 changes: 1 addition & 1 deletion build-hnp/aria2/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ include ../utils/Makefrag
SOURCE_URL = https://github.com/aria2/aria2/releases/download/release-1.37.0/aria2-1.37.0.tar.gz
SOURCE_FILE = aria2-1.37.0.tar.gz
SOURCE_DIR = aria2-1.37.0
CONFIG_ARGS = --prefix=$(PREFIX) --host aarch64-unknown-linux-musl --disable-nls --with-openssl --without-gnutls OPENSSL_CFLAGS="-D_FORTIFY_SOURCE=2" OPENSSL_LIBS="-lssl -lcrypto" --with-sysroot=$(OHOS_SDK_HOME)/native/sysroot --enable-libaria2 --with-ca-bundle=/etc/ssl/certs/cacert.pem CFLAGS="-I$(shell pwd)/../sysroot/include -D_FORTIFY_SOURCE=2 -O2 -g -pipe -fstack-protector-strong -fno-omit-frame-pointer" CPPFLAGS="-I$(shell pwd)/../sysroot/include -D_FORTIFY_SOURCE=2" LDFLAGS="-L$(shell pwd)/../sysroot/lib"
CONFIG_ARGS = --prefix=$(PREFIX) --host $(OHOS_ARCH)-unknown-linux-musl --disable-nls --with-openssl --without-gnutls OPENSSL_CFLAGS="-D_FORTIFY_SOURCE=2" OPENSSL_LIBS="-lssl -lcrypto" --with-sysroot=$(OHOS_SDK_HOME)/native/sysroot --enable-libaria2 --with-ca-bundle=/etc/ssl/certs/cacert.pem CFLAGS="-I$(shell pwd)/../sysroot/include -D_FORTIFY_SOURCE=2 -O2 -g -pipe -fstack-protector-strong -fno-omit-frame-pointer" CPPFLAGS="-I$(shell pwd)/../sysroot/include -D_FORTIFY_SOURCE=2" LDFLAGS="-L$(shell pwd)/../sysroot/lib"

$(eval $(call define_autotools_package))
2 changes: 1 addition & 1 deletion build-hnp/bash/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ export CFLAGS_FOR_BUILD := -std=gnu17
SOURCE_URL = $(GNU_MIRROR)/gnu/bash/bash-5.3.tar.gz
SOURCE_FILE = bash-5.3.tar.gz
SOURCE_DIR = bash-5.3
CONFIG_ARGS = --prefix=$(PREFIX) --host aarch64-unknown-linux-musl --without-bash-malloc --disable-nls
CONFIG_ARGS = --prefix=$(PREFIX) --host $(OHOS_ARCH)-unknown-linux-musl --without-bash-malloc --disable-nls

$(eval $(call define_autotools_package))
2 changes: 1 addition & 1 deletion build-hnp/binutils/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ include ../utils/Makefrag
SOURCE_URL = $(GNU_MIRROR)/gnu/binutils/binutils-2.44.tar.xz
SOURCE_FILE = binutils-2.44.tar.xz
SOURCE_DIR = binutils-2.44
CONFIG_ARGS = --prefix=$(PREFIX) --disable-static --enable-shared --host aarch64-unknown-linux-musl
CONFIG_ARGS = --prefix=$(PREFIX) --disable-static --enable-shared --host $(OHOS_ARCH)-unknown-linux-musl

$(eval $(call define_autotools_package))
2 changes: 1 addition & 1 deletion build-hnp/busybox/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ all: download/busybox-1.37.0.tar.bz2
cd temp/busybox-1.37.0 && /usr/bin/sed -i.bak "s/if (setgid(gid))/\\/\\//" libbb/xfuncs_printf.c
cd temp/busybox-1.37.0 && /usr/bin/sed -i.bak "s/setgid(rgid)/\\/\\//" libbb/appletlib.c
cd temp/busybox-1.37.0 && /usr/bin/sed -i.bak "s/setuid(ruid)/\\/\\//" libbb/appletlib.c
cd temp/busybox-1.37.0 && make -j $(shell nproc) CC=$(OHOS_SDK_HOME)/native/llvm/bin/aarch64-unknown-linux-ohos-clang AR=$(OHOS_SDK_HOME)/native/llvm/bin/llvm-ar CFLAGS="-Wno-int-conversion" busybox_unstripped
cd temp/busybox-1.37.0 && make -j $(shell nproc) CC=$(OHOS_SDK_HOME)/native/llvm/bin/$(OHOS_ARCH)-unknown-linux-ohos-clang AR=$(OHOS_SDK_HOME)/native/llvm/bin/llvm-ar CFLAGS="-Wno-int-conversion" busybox_unstripped
$(OHOS_SDK_HOME)/native/llvm/bin/llvm-strip temp/busybox-1.37.0/busybox_unstripped
mkdir -p ../sysroot/bin
cp -v temp/busybox-1.37.0/busybox_unstripped ../sysroot/bin/busybox | tee file.lst
Expand Down
2 changes: 1 addition & 1 deletion build-hnp/c-ares/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ include ../utils/Makefrag
SOURCE_URL = https://github.com/c-ares/c-ares/releases/download/v1.34.5/c-ares-1.34.5.tar.gz
SOURCE_FILE = c-ares-1.34.5.tar.gz
SOURCE_DIR = c-ares-1.34.5
CMAKE_ARGS = -DCMAKE_INSTALL_PREFIX=$(PREFIX) -DCARES_STATIC=OFF -DCARES_SHARED=ON -DCMAKE_SYSTEM_NAME=Linux -DCMAKE_SYSTEM_PROCESSOR=aarch64 -DCMAKE_BUILD_TYPE=RelWithDebInfo
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

$(eval $(call define_cmake_package))
2 changes: 1 addition & 1 deletion build-hnp/curl/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ include ../utils/Makefrag
SOURCE_URL = https://github.com/curl/curl/releases/download/curl-8_14_1/curl-8.14.1.tar.xz
SOURCE_FILE = curl-8.14.1.tar.xz
SOURCE_DIR = curl-8.14.1
CONFIG_ARGS = --prefix=$(PREFIX) --host aarch64-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)/../sysroot/include -D_FORTIFY_SOURCE=2"
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)/../sysroot/include -D_FORTIFY_SOURCE=2"

$(eval $(call define_autotools_package))
7 changes: 7 additions & 0 deletions build-hnp/elf-loader/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,14 @@ all: download/elf
mkdir -p temp build/bin
cd temp && cp -vr ../download/elf elf
cd temp/elf && git apply ../../jit.patch
ifeq ($(OHOS_ARCH),aarch64)
cd temp/elf && make -C src ARCH=aarch64 CFLAGS="-ffreestanding -DELFCLASS=ELFCLASS64"
else ifeq ($(OHOS_ARCH),x86_64)
cd temp/elf && make -C src ARCH=amd64 CFLAGS="-ffreestanding -DELFCLASS=ELFCLASS64"
else
echo "Unsupported OHOS_ARCH=$(OHOS_ARCH)"
exit 1
endif
cp temp/elf/src/loader ./build/bin/
mkdir -p ../sysroot
cp -rv ./build/. ../sysroot | tee file.lst
Expand Down
2 changes: 1 addition & 1 deletion build-hnp/expat/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ include ../utils/Makefrag
SOURCE_URL = https://github.com/libexpat/libexpat/releases/download/R_2_7_1/expat-2.7.1.tar.xz
SOURCE_FILE = expat-2.7.1.tar.xz
SOURCE_DIR = expat-2.7.1
CONFIG_ARGS = --prefix=$(PREFIX) --disable-static --enable-shared --host aarch64-unknown-linux-musl
CONFIG_ARGS = --prefix=$(PREFIX) --disable-static --enable-shared --host $(OHOS_ARCH)-unknown-linux-musl

$(eval $(call define_autotools_package))
2 changes: 1 addition & 1 deletion build-hnp/fastfetch/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ SOURCE_URL = https://github.com/fastfetch-cli/fastfetch/archive/refs/tags/2.49.0
SOURCE_FILE = 2.49.0.tar.gz
SOURCE_DIR = fastfetch-2.49.0
PATCH_SOURCE = cd temp/$(SOURCE_DIR) && /usr/bin/sed -i.bak 's|FF_HAVE_UTMPX=1|FF_HAVE_UTMPX=0|g' CMakeLists.txt
CMAKE_ARGS = -DCMAKE_INSTALL_PREFIX=$(PREFIX) -DCMAKE_SYSTEM_NAME=Linux -DCMAKE_SYSTEM_PROCESSOR=aarch64 -DIS_MUSL=ON -DENABLE_PCIACCESS=ON -DENABLE_SQLITE3=OFF -DENABLE_VULKAN=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_SYSROOT=$(OHOS_SDK_HOME)/native/sysroot -DCMAKE_C_FLAGS="$(CFLAGS) -I$(shell pwd)/../sysroot/include/glib-2.0 -I$(shell pwd)/../sysroot/lib/glib-2.0/include"
CMAKE_ARGS = -DCMAKE_INSTALL_PREFIX=$(PREFIX) -DCMAKE_SYSTEM_NAME=Linux -DCMAKE_SYSTEM_PROCESSOR=$(OHOS_ARCH) -DIS_MUSL=ON -DENABLE_PCIACCESS=ON -DENABLE_SQLITE3=OFF -DENABLE_VULKAN=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_SYSROOT=$(OHOS_SDK_HOME)/native/sysroot -DCMAKE_C_FLAGS="$(CFLAGS) -I$(shell pwd)/../sysroot/include/glib-2.0 -I$(shell pwd)/../sysroot/lib/glib-2.0/include"

$(eval $(call define_cmake_package))
2 changes: 1 addition & 1 deletion build-hnp/ffmpeg/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ all: download/src.zip ohos_config.sh
pkg-config --cflags --libs SvtAv1Enc opus

# configure and build
cd temp/src && ./ohos_config.sh $(shell pwd)/temp/src $(PREFIX) aarch64 $(OHOS_SDK_HOME)/native/llvm $(OHOS_SDK_HOME)/native/sysroot false
cd temp/src && ./ohos_config.sh $(shell pwd)/temp/src $(PREFIX) $(OHOS_ARCH) $(OHOS_SDK_HOME)/native/llvm $(OHOS_SDK_HOME)/native/sysroot false
cd temp/src && make -j $(shell nproc) && make install DESTDIR=$(shell pwd)/build

# strip all elf files
Expand Down
12 changes: 6 additions & 6 deletions build-hnp/ffmpeg/ohos_config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ FF_CONFIG_OPTIONS="
--enable-nonfree
"

if [ ${FFMPEG_PLAT} = "aarch64" ]; then
if [ ${FFMPEG_PLAT} = "${OHOS_ARCH}" ]; then

FF_CONFIG_OPTIONS="$FF_CONFIG_OPTIONS
--arch=aarch64
--arch=${OHOS_ARCH}
--target-os=linux
--enable-cross-compile
--cc=${LLVM_PATH}/bin/clang
Expand All @@ -54,24 +54,24 @@ FF_CONFIG_OPTIONS+="
fi

EXTRA_CFLAGS="
--target=aarch64-linux-ohos
--target=${OHOS_ARCH}-linux-ohos
--sysroot=${SYSROOT_PATH}
"
EXTRA_LDFLAGS="
--target=aarch64-linux-ohos
--target=${OHOS_ARCH}-linux-ohos
--sysroot=${SYSROOT_PATH}
"

if [ ${USE_CLANG_COVERAGE} = "true" ]; then
EXTRA_CFLAGS="
--target=aarch64-linux-ohos
--target=${OHOS_ARCH}-linux-ohos
--sysroot=${SYSROOT_PATH}
--coverage
-mllvm
-limited-coverage-experimental=true
"
EXTRA_LDFLAGS="
--target=aarch64-linux-ohos
--target=${OHOS_ARCH}-linux-ohos
--sysroot=${SYSROOT_PATH}
--coverage
-fno-use-cxa-atexit
Expand Down
2 changes: 1 addition & 1 deletion build-hnp/fish/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ PATCH_SOURCE = sed -i.bak 's/TCSANOW,/TCSADRAIN,/' temp/$(SOURCE_DIR)/src/reader
# it makes hap installation fail
AFTER_INSTALL = rm -fv build$(PREFIX)/share/fish/completions/..fish

CMAKE_ARGS = -DSYS_PCRE2_LIB="$(shell pwd)/../sysroot/lib/libpcre2-32.so" -DSYS_PCRE2_INCLUDE_DIR="$(shell pwd)/../sysroot/include" -DCMAKE_DISABLE_FIND_PACKAGE_Curses=ON -DCURSES_HAVE_CURSES_H=ON -DCMAKE_SYSTEM_NAME=Linux -DCMAKE_SYSTEM_PROCESSOR=aarch64 -DCMAKE_C_COMPILER=$(OHOS_SDK_HOME)/native/llvm/bin/aarch64-unknown-linux-ohos-clang -DCMAKE_CXX_COMPILER=$(OHOS_SDK_HOME)/native/llvm/bin/aarch64-unknown-linux-ohos-clang++ -DCMAKE_AR=$(OHOS_SDK_HOME)/native/llvm/bin/llvm-ar -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCURSES_FOUND=ON -DCURSES_INCLUDE_DIRS="$(shell pwd)/../sysroot/include;$(shell pwd)/../sysroot/include/ncursesw" -DCURSES_LIBRARY=ncursesw -DCURSES_TINFO="$(shell pwd)/../sysroot/lib/libtinfow.so" -DCMAKE_EXE_LINKER_FLAGS="-L $(shell pwd)/../sysroot/lib" -DCMAKE_CXX_FLAGS="-DTPUTS_USES_INT_ARG=1" -DFISH_USE_SYSTEM_PCRE2=ON -DWITH_GETTEXT=OFF -DCMAKE_POLICY_VERSION_MINIMUM=3.5 -DCMAKE_INSTALL_PREFIX=$(PREFIX) -DBUILD_DOCS=OFF
CMAKE_ARGS = -DSYS_PCRE2_LIB="$(shell pwd)/../sysroot/lib/libpcre2-32.so" -DSYS_PCRE2_INCLUDE_DIR="$(shell pwd)/../sysroot/include" -DCMAKE_DISABLE_FIND_PACKAGE_Curses=ON -DCURSES_HAVE_CURSES_H=ON -DCMAKE_SYSTEM_NAME=Linux -DCMAKE_SYSTEM_PROCESSOR=$(OHOS_ARCH) -DCMAKE_C_COMPILER=$(OHOS_SDK_HOME)/native/llvm/bin/$(OHOS_ARCH)-unknown-linux-ohos-clang -DCMAKE_CXX_COMPILER=$(OHOS_SDK_HOME)/native/llvm/bin/$(OHOS_ARCH)-unknown-linux-ohos-clang++ -DCMAKE_AR=$(OHOS_SDK_HOME)/native/llvm/bin/llvm-ar -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCURSES_FOUND=ON -DCURSES_INCLUDE_DIRS="$(shell pwd)/../sysroot/include;$(shell pwd)/../sysroot/include/ncursesw" -DCURSES_LIBRARY=ncursesw -DCURSES_TINFO="$(shell pwd)/../sysroot/lib/libtinfow.so" -DCMAKE_EXE_LINKER_FLAGS="-L $(shell pwd)/../sysroot/lib" -DCMAKE_CXX_FLAGS="-DTPUTS_USES_INT_ARG=1" -DFISH_USE_SYSTEM_PCRE2=ON -DWITH_GETTEXT=OFF -DCMAKE_POLICY_VERSION_MINIMUM=3.5 -DCMAKE_INSTALL_PREFIX=$(PREFIX) -DBUILD_DOCS=OFF

$(eval $(call define_cmake_package))
6 changes: 3 additions & 3 deletions build-hnp/gcc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ all: download/gcc-15.1.0.tar.xz
mkdir -p temp build
cd temp && tar xvf ../download/gcc-15.1.0.tar.xz
cd temp/gcc-15.1.0 && mkdir build
cd temp/gcc-15.1.0/build && ../configure --host aarch64-unknown-linux-musl --enable-host-shared
cd temp/gcc-15.1.0/build && ../configure --host $(OHOS_ARCH)-unknown-linux-musl --enable-host-shared
cd temp/gcc-15.1.0/build && make all-gcc -j $(shell nproc) -k || true
cd temp/gcc-15.1.0/build && cat ../../../0001-fix-gcc.diff | patch -Np1
cd temp/gcc-15.1.0/build && make all-gcc -j $(shell nproc)
cd temp/gcc-15.1.0/build && make install-gcc DESTDIR=$(shell pwd)/build
$(OHOS_SDK_HOME)/native/llvm/bin/llvm-strip build/usr/local/bin/*
rm -f build/usr/local/libexec/gcc/aarch64-unknown-linux-musl/15.1.0/*.la
find build/usr/local/libexec/gcc/aarch64-unknown-linux-musl/15.1.0/ -maxdepth 1 -type f | xargs $(OHOS_SDK_HOME)/native/llvm/bin/llvm-strip
rm -f build/usr/local/libexec/gcc/$(OHOS_ARCH)-unknown-linux-musl/15.1.0/*.la
find build/usr/local/libexec/gcc/$(OHOS_ARCH)-unknown-linux-musl/15.1.0/ -maxdepth 1 -type f | xargs $(OHOS_SDK_HOME)/native/llvm/bin/llvm-strip
mkdir -p ../sysroot
cp -rfv build/usr/local/. ../sysroot | tee file.lst

Expand Down
2 changes: 1 addition & 1 deletion build-hnp/gdb/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ include ../utils/Makefrag
SOURCE_URL = $(GNU_MIRROR)/gnu/gdb/gdb-16.3.tar.xz
SOURCE_FILE = gdb-16.3.tar.xz
SOURCE_DIR = gdb-16.3
CONFIG_ARGS = --prefix=$(PREFIX) --with-lzma --disable-sim --disable-static --enable-shared --with-system-readline --host aarch64-unknown-linux-musl --disable-nls
CONFIG_ARGS = --prefix=$(PREFIX) --with-lzma --disable-sim --disable-static --enable-shared --with-system-readline --host $(OHOS_ARCH)-unknown-linux-musl --disable-nls

$(eval $(call define_autotools_package))
2 changes: 1 addition & 1 deletion build-hnp/gettext/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ include ../utils/Makefrag
SOURCE_URL = $(GNU_MIRROR)/gnu/gettext/gettext-0.25.tar.xz
SOURCE_FILE = gettext-0.25.tar.xz
SOURCE_DIR = gettext-0.25
CONFIG_ARGS = --prefix=$(PREFIX) --enable-static --enable-shared --host aarch64-unknown-linux-musl
CONFIG_ARGS = --prefix=$(PREFIX) --enable-static --enable-shared --host $(OHOS_ARCH)-unknown-linux-musl

$(eval $(call define_autotools_package))
2 changes: 1 addition & 1 deletion build-hnp/git/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ all: download/v2.49.0.tar.gz
mkdir -p temp build
cd temp && tar xvf ../download/v2.49.0.tar.gz
cd temp/git-2.49.0 && mkdir build
cd temp/git-2.49.0 && make -j $(shell nproc) INSTALL_SYMLINKS=1 uname_S=Linux NO_REGEX=NeedsStartEnd CFLAGS="-DNO_PTHREADS -DNO_GETTEXT -Wno-int-conversion -I$(shell pwd)/../sysroot/include" LDFLAGS="-L $(shell pwd)/../sysroot/lib -lcurl" V=1 prefix=/data/app/base.org/base_1.0 CC=$(OHOS_SDK_HOME)/native/llvm/bin/aarch64-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 LD=$(OHOS_SDK_HOME)/native/llvm/bin/aarch64-unknown-linux-ohos-clang all install DESTDIR=$(shell pwd)/build
cd temp/git-2.49.0 && make -j $(shell nproc) INSTALL_SYMLINKS=1 uname_S=Linux NO_REGEX=NeedsStartEnd CFLAGS="-DNO_PTHREADS -DNO_GETTEXT -Wno-int-conversion -I$(shell pwd)/../sysroot/include" LDFLAGS="-L $(shell pwd)/../sysroot/lib -lcurl" V=1 prefix=/data/app/base.org/base_1.0 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 LD=$(OHOS_SDK_HOME)/native/llvm/bin/$(OHOS_ARCH)-unknown-linux-ohos-clang all install DESTDIR=$(shell pwd)/build
mkdir -p ../sysroot
$(OHOS_SDK_HOME)/native/llvm/bin/llvm-strip build/data/app/base.org/base_1.0/bin/git
$(OHOS_SDK_HOME)/native/llvm/bin/llvm-strip build/data/app/base.org/base_1.0/bin/git-shell
Expand Down
8 changes: 4 additions & 4 deletions build-hnp/glib/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ all: download/glib
cd temp && cp -vr ../download/glib glib
cd temp/glib && rm cross.txt || true
cd temp/glib && echo "[binaries]" >> cross.txt
cd temp/glib && echo "c = '${OHOS_SDK_HOME}/native/llvm/bin/aarch64-unknown-linux-ohos-clang'" >> cross.txt
cd temp/glib && echo "cpp = '${OHOS_SDK_HOME}/native/llvm/bin/aarch64-unknown-linux-ohos-clang++'" >> cross.txt
cd temp/glib && echo "c = '${OHOS_SDK_HOME}/native/llvm/bin/$(OHOS_ARCH)-unknown-linux-ohos-clang'" >> cross.txt
cd temp/glib && echo "cpp = '${OHOS_SDK_HOME}/native/llvm/bin/$(OHOS_ARCH)-unknown-linux-ohos-clang++'" >> cross.txt
cd temp/glib && echo "ar = '${OHOS_SDK_HOME}/native/llvm/bin/llvm-ar'" >> cross.txt
cd temp/glib && echo "ld = '${OHOS_SDK_HOME}/native/llvm/bin/ld.lld'" >> cross.txt
cd temp/glib && echo "strip = '${OHOS_SDK_HOME}/native/llvm/bin/llvm-strip'" >> cross.txt
cd temp/glib && echo "[host_machine]" >> cross.txt
cd temp/glib && echo "system = 'linux'" >> cross.txt
cd temp/glib && echo "cpu_family = 'aarch64'" >> cross.txt
cd temp/glib && echo "cpu = 'aarch64'" >> cross.txt
cd temp/glib && echo "cpu_family = '$(OHOS_ARCH)'" >> cross.txt
cd temp/glib && echo "cpu = '$(OHOS_ARCH)'" >> cross.txt
cd temp/glib && echo "endian = 'little'" >> cross.txt
cd temp/glib && echo "[properties]" >> cross.txt
cd temp/glib && echo "needs_exe_wrapper = true" >> cross.txt
Expand Down
Loading