From 172bd20824fa87d8e888d58e8b02253da442cbbb Mon Sep 17 00:00:00 2001 From: xuwenlong Date: Mon, 31 Jul 2023 19:04:42 +0800 Subject: [PATCH 01/15] add icu Signed-off-by: xuwenlong --- thirdparty/icu/HPKBUILD | 75 ++++++++++++++++++++++++++++++++++++++++ thirdparty/icu/SHA512SUM | 1 + 2 files changed, 76 insertions(+) create mode 100644 thirdparty/icu/HPKBUILD create mode 100644 thirdparty/icu/SHA512SUM diff --git a/thirdparty/icu/HPKBUILD b/thirdparty/icu/HPKBUILD new file mode 100644 index 00000000..d1d75c2c --- /dev/null +++ b/thirdparty/icu/HPKBUILD @@ -0,0 +1,75 @@ +# Contributor: wlxuz +# Maintainer: wlxuz + +pkgname=icu +pkgver=release-73-2 +pkgrel=0 +pkgdesc="icu is short for International Components for Unicode." +url="https://github.com/unicode-org/icu" +archs=("armeabi-v7a" "arm64-v8a") +license=("BSD License") +depends=() +makedepends=() +source="https://github.com/unicode-org/$pkgname/archive/refs/tags/$pkgver.tar.gz" +buildtools="configure" + +autounpack=true +downloadpackage=true +buildhost=true + +builddir=$pkgname-${pkgver} +packagename=$pkgname-$pkgver.tar.gz + +source envset.sh +host= + +prepare() { + # 需要先编译host版本 + if [ $buildhost == true ];then + mkdir -p $builddir/host-build + cd $builddir/host-build + ../icu4c/source/configure > `pwd`/build.log 2>&1 + make -j4 VERBOSE=1 >> `pwd`/build.log 2>&1 + cd $OLDPWD + buildhost=false + fi + mkdir -p $builddir/$ARCH-build + + if [ $ARCH == "armeabi-v7a" ];then + setarm32ENV + host=arm-linux + elif [ $ARCH == "arm64-v8a" ];then + setarm64ENV + host=aarch64-linux + else + echo "$ARCH not support" + return -1 + fi +} + +build() { + cd $builddir/$ARCH-build + echo "$@" + CXXFLAGS="$CXXFLAGS -std=c++11" ../icu4c/source/configure "$@" --host=$host --with-cross-build=`pwd`/../host-build > `pwd`/build.log 2>&1 + make -j4 VERBOSE=1 >> `pwd`/build.log 2>&1 + + ret=$? + cd $OLDPWD + return $ret +} + +package() { + cd $builddir/$ARCH-build + make install VERBOSE=1 >> `pwd`/build.log 2>&1 + cd $OLDPWD +} + +check() { + echo "The test must be on an OpenHarmony device!" + # real test +} + +# 清理环境 +cleanbuild(){ + rm -rf ${PWD}/$builddir #${PWD}/$packagename +} diff --git a/thirdparty/icu/SHA512SUM b/thirdparty/icu/SHA512SUM new file mode 100644 index 00000000..136ce7fe --- /dev/null +++ b/thirdparty/icu/SHA512SUM @@ -0,0 +1 @@ +f234fb9c76af62dad59e159ef7f7792aca563d88f2988d3d1ecc8be6250837beb9a530ec121e0949f6925ee8e5171a0d04fa41a0c50d9993c4061fa55be6836e icu-release-73-2.tar.gz -- Gitee From af1db3480fd06c92d1f03f58ed901cf7659aa56f Mon Sep 17 00:00:00 2001 From: xuwenlong Date: Tue, 1 Aug 2023 09:03:37 +0800 Subject: [PATCH 02/15] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: xuwenlong --- thirdparty/icu/HPKBUILD | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/thirdparty/icu/HPKBUILD b/thirdparty/icu/HPKBUILD index d1d75c2c..6e6a8f85 100644 --- a/thirdparty/icu/HPKBUILD +++ b/thirdparty/icu/HPKBUILD @@ -49,10 +49,8 @@ prepare() { build() { cd $builddir/$ARCH-build - echo "$@" CXXFLAGS="$CXXFLAGS -std=c++11" ../icu4c/source/configure "$@" --host=$host --with-cross-build=`pwd`/../host-build > `pwd`/build.log 2>&1 make -j4 VERBOSE=1 >> `pwd`/build.log 2>&1 - ret=$? cd $OLDPWD return $ret @@ -62,11 +60,19 @@ package() { cd $builddir/$ARCH-build make install VERBOSE=1 >> `pwd`/build.log 2>&1 cd $OLDPWD + if [ $ARCH == "armeabi-v7a" ];then + unsetarm32ENV + elif [ $ARCH == "arm64-v8a" ];then + unsetarm64ENV + else + echo "$ARCH not support" + return -1 + fi } check() { echo "The test must be on an OpenHarmony device!" - # real test + # TODO } # 清理环境 -- Gitee From c2b4b295adfc65fab4e3664290ceeb2132871945 Mon Sep 17 00:00:00 2001 From: xuwenlong Date: Fri, 25 Aug 2023 10:19:50 +0800 Subject: [PATCH 03/15] add glib Signed-off-by: xuwenlong --- thirdparty/glib_with_host/HPKBUILD | 94 +++++++++++++++++++ thirdparty/glib_with_host/SHA512SUM | 1 + .../glib_with_host/arm64-v8a-cross-file.txt | 26 +++++ .../glib_with_host/armeabi-v7a-cross-file.txt | 26 +++++ 4 files changed, 147 insertions(+) create mode 100644 thirdparty/glib_with_host/HPKBUILD create mode 100644 thirdparty/glib_with_host/SHA512SUM create mode 100644 thirdparty/glib_with_host/arm64-v8a-cross-file.txt create mode 100644 thirdparty/glib_with_host/armeabi-v7a-cross-file.txt diff --git a/thirdparty/glib_with_host/HPKBUILD b/thirdparty/glib_with_host/HPKBUILD new file mode 100644 index 00000000..5c809165 --- /dev/null +++ b/thirdparty/glib_with_host/HPKBUILD @@ -0,0 +1,94 @@ +# Contributor: 城meto +# Maintainer: 城meto +pkgname=glib_with_host +pkgver=2.77.1 +pkgrel=0 +pkgdesc="GLib is a general-purpose, portable utility library, which provides many useful data types, macros, type conversions, string utilities, file utilities, a mainloop abstraction, and so on." +url="https://docs.gtk.org/glib/" +archs=("armeabi-v7a" "arm64-v8a") +license=("Apache 2.0" "CC0-1.0" "GPL-2.0" "LGPL-2.1" "LLVM" "old-glib" "MIT") +depends=("libffi" "pcre2") # 将依赖库独立编译,两个库都比较大 +makedepends=("meson" "ninja") + +source="https://github.com/GNOME/${pkgname:0:4}/archive/refs/tags/$pkgver.tar.gz" + +downloadpackage=true +autounpack=true +buildtools="meson" + +builddir=${pkgname:0:4}-$pkgver +packagename=${pkgname:0:4}-$pkgver.tar.gz + +buildhost=true +clonesrcflag=true +pkgconfigpath= + +prepare() { + # git clone对网络要求太高了,而且耗时长,这个版本使用压缩包 + if $clonesrcflag + then + cd $builddir + git clone https://github.com/GNOME/gvdb.git subprojects/gvdb + cd $OLDPWD + clonesrcflag=false + fi + + # 编译host版本,其他多个库需要使用 + if [ $buildhost == true ];then + mkdir -p $builddir/host-build + cd $builddir + meson setup host-build --prefix=$LYCIUM_ROOT/usr/$pkgname/$(uname -m) > `pwd`/host-build/build.log 2>&1 + ninja -j4 -C host-build -v >> `pwd`/host-build/build.log 2>&1 + ninja install -j4 -C host-build -v >> `pwd`/host-build/build.log 2>&1 + cd $OLDPWD + buildhost=false + fi + + # 依赖库加入 pkg_config_path 路径 + for depend in ${depends[@]} + do + dependpath=$LYCIUM_ROOT/usr/$depend/$ARCH/lib/pkgconfig + if [ ! -d ${dependpath} ] + then + continue + fi + pkgconfigpath=$pkgconfigpath"${dependpath}:" + done + pkgconfigpath=${pkgconfigpath%:*} + + cp $ARCH-cross-file.txt $builddir + mkdir -p $builddir/$ARCH-build +} + +build() { + cd $builddir + ohos_sdk_path=${OHOS_SDK//\//\\\/} + sed -i 's/ohos_sdk/'"$ohos_sdk_path"'/g' $ARCH-cross-file.txt + + # 需要设置pkg路径 + meson setup $ARCH-build --cross-file $ARCH-cross-file.txt \ + --pkg-config-path $pkgconfigpath \ + --prefix=$LYCIUM_ROOT/usr/$pkgname/$ARCH > $ARCH-build/build.log 2>&1 + ninja -C $ARCH-build -v >> $ARCH-build/build.log 2>&1 + ret=$? + cd $OLDPWD + return $ret +} + +package() { + cd $builddir + ninja -v -C $ARCH-build install >> build.log 2>&1 + # 还原 + pkgconfigpath="" + cd $OLDPWD +} + +check() { + echo "The test must be on an OpenHarmony device!" + # TODO +} + +# 清理环境 +cleanbuild() { + rm -rf ${PWD}/$builddir +} diff --git a/thirdparty/glib_with_host/SHA512SUM b/thirdparty/glib_with_host/SHA512SUM new file mode 100644 index 00000000..609880d9 --- /dev/null +++ b/thirdparty/glib_with_host/SHA512SUM @@ -0,0 +1 @@ +172ba4dab2a9331bba145a18b7ebd1662a91bb1ced5f7822e0d06f2851159fe1c9d518f7ddbebd30016da7ac84aef61cfcb88691f4106e4660db48b14ee6a511 glib-2.77.1.tar.gz diff --git a/thirdparty/glib_with_host/arm64-v8a-cross-file.txt b/thirdparty/glib_with_host/arm64-v8a-cross-file.txt new file mode 100644 index 00000000..34ad3f25 --- /dev/null +++ b/thirdparty/glib_with_host/arm64-v8a-cross-file.txt @@ -0,0 +1,26 @@ +[binaries] +c = 'ohos_sdk/native/llvm/bin/aarch64-linux-ohos-clang' +cpp = 'ohos_sdk/native/llvm/bin/aarch64-linux-ohos-clang++' +ar = 'ohos_sdk/native/llvm/bin/llvm-ar' +strip = 'ohos_sdk/native/llvm/bin/llvm-strip' +ld = 'ohos_sdk/native/llvm/bin/ld.lld' +pkgconfig = '/usr/bin/pkg-config' + +[host_machine] +system = 'linux' +cpu_family = 'aarch64' +cpu = 'arm64-v8a' +endian = 'little' + +[properties] +needs_exe_wrapper = true +skip_sanity_check = true +sys_root = '' +platform = 'generic' +pkg_config_libdir = '' + +[built-in options] +c_args = ['-D__MUSL__=1', '-mfpu=neon'] +cpp_args = ['-D__MUSL__=1', '-mfpu=neon'] +c_link_args = [] +cpp_link_args = [] diff --git a/thirdparty/glib_with_host/armeabi-v7a-cross-file.txt b/thirdparty/glib_with_host/armeabi-v7a-cross-file.txt new file mode 100644 index 00000000..2b6e25f2 --- /dev/null +++ b/thirdparty/glib_with_host/armeabi-v7a-cross-file.txt @@ -0,0 +1,26 @@ +[binaries] +c = 'ohos_sdk/native/llvm/bin/arm-linux-ohos-clang' +cpp = 'ohos_sdk/native/llvm/bin/arm-linux-ohos-clang++' +ar = 'ohos_sdk/native/llvm/bin/llvm-ar' +strip = 'ohos_sdk/native/llvm/bin/llvm-strip' +ld = 'ohos_sdk/native/llvm/bin/ld.lld' +pkgconfig = '/usr/bin/pkg-config' + +[host_machine] +system = 'linux' +cpu_family = 'arm' +cpu = 'armeabi-v7a' +endian = 'little' + +[properties] +needs_exe_wrapper = true +skip_sanity_check = true +sys_root = '' +platform = 'generic' +pkg_config_libdir = '' + +[built-in options] +c_args = ['-fPIC', '-march=armv7a', '-mfloat-abi=softfp', '-mfpu=neon', '-D__MUSL__=1'] +cpp_args = ['-fPIC', '-march=armv7a', '-mfloat-abi=softfp', '-mfpu=neon', '-D__MUSL__=1'] +c_link_args = [] +cpp_link_args = [] -- Gitee From 055fb61d43523507ebe0ac3e522f5aa086108adf Mon Sep 17 00:00:00 2001 From: xuwenlong Date: Fri, 25 Aug 2023 10:23:34 +0800 Subject: [PATCH 04/15] =?UTF-8?q?=E4=BF=AE=E6=94=B9glib=E7=89=88=E6=9D=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: xuwenlong --- thirdparty/glib_with_host/HPKBUILD | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/thirdparty/glib_with_host/HPKBUILD b/thirdparty/glib_with_host/HPKBUILD index 5c809165..d2d2a339 100644 --- a/thirdparty/glib_with_host/HPKBUILD +++ b/thirdparty/glib_with_host/HPKBUILD @@ -1,3 +1,16 @@ +# Copyright (c) 2023 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + # Contributor: 城meto # Maintainer: 城meto pkgname=glib_with_host @@ -39,7 +52,6 @@ prepare() { cd $builddir meson setup host-build --prefix=$LYCIUM_ROOT/usr/$pkgname/$(uname -m) > `pwd`/host-build/build.log 2>&1 ninja -j4 -C host-build -v >> `pwd`/host-build/build.log 2>&1 - ninja install -j4 -C host-build -v >> `pwd`/host-build/build.log 2>&1 cd $OLDPWD buildhost=false fi -- Gitee From db278ca6a06d8a41d235d964f5c68a2348a3716b Mon Sep 17 00:00:00 2001 From: xuwenlong Date: Fri, 25 Aug 2023 11:00:02 +0800 Subject: [PATCH 05/15] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: xuwenlong --- thirdparty/icu/HPKBUILD | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/thirdparty/icu/HPKBUILD b/thirdparty/icu/HPKBUILD index 6e6a8f85..4e34b806 100644 --- a/thirdparty/icu/HPKBUILD +++ b/thirdparty/icu/HPKBUILD @@ -1,5 +1,18 @@ -# Contributor: wlxuz -# Maintainer: wlxuz +# Copyright (c) 2023 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Contributor: 城meto +# Maintainer: 城meto pkgname=icu pkgver=release-73-2 @@ -30,8 +43,10 @@ prepare() { cd $builddir/host-build ../icu4c/source/configure > `pwd`/build.log 2>&1 make -j4 VERBOSE=1 >> `pwd`/build.log 2>&1 + if [ $? -eq 0 ];then + buildhost=false + fi cd $OLDPWD - buildhost=false fi mkdir -p $builddir/$ARCH-build @@ -59,6 +74,7 @@ build() { package() { cd $builddir/$ARCH-build make install VERBOSE=1 >> `pwd`/build.log 2>&1 + unset host cd $OLDPWD if [ $ARCH == "armeabi-v7a" ];then unsetarm32ENV -- Gitee From 893572d4b758a03106b93e57735a76c8b2ef50ab Mon Sep 17 00:00:00 2001 From: xuwenlong Date: Fri, 25 Aug 2023 15:57:26 +0800 Subject: [PATCH 06/15] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=8B=E8=BD=BD?= =?UTF-8?q?=E6=BA=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: xuwenlong --- thirdparty/icu/HPKBUILD | 6 +++--- thirdparty/icu/SHA512SUM | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/thirdparty/icu/HPKBUILD b/thirdparty/icu/HPKBUILD index 4e34b806..dd6b8ded 100644 --- a/thirdparty/icu/HPKBUILD +++ b/thirdparty/icu/HPKBUILD @@ -23,15 +23,15 @@ archs=("armeabi-v7a" "arm64-v8a") license=("BSD License") depends=() makedepends=() -source="https://github.com/unicode-org/$pkgname/archive/refs/tags/$pkgver.tar.gz" +source="https://gitee.com/lycium_pkg_mirror/$pkgname/repository/archive/$pkgver.zip" buildtools="configure" autounpack=true downloadpackage=true buildhost=true -builddir=$pkgname-${pkgver} -packagename=$pkgname-$pkgver.tar.gz +builddir=$pkgname-$pkgver +packagename=$pkgname-$pkgver.zip source envset.sh host= diff --git a/thirdparty/icu/SHA512SUM b/thirdparty/icu/SHA512SUM index 136ce7fe..c2b7229c 100644 --- a/thirdparty/icu/SHA512SUM +++ b/thirdparty/icu/SHA512SUM @@ -1 +1 @@ -f234fb9c76af62dad59e159ef7f7792aca563d88f2988d3d1ecc8be6250837beb9a530ec121e0949f6925ee8e5171a0d04fa41a0c50d9993c4061fa55be6836e icu-release-73-2.tar.gz +6b9bc9ca0edab71bc63781361677bab32b4e7bc35277321e444f06e1f0aab4aa2cd542167b237649f3857a58955ae37b51d68e1bad2185f7fcfcf97bcd1859a0 icu-release-73-2.zip -- Gitee From 393c7dd58b932ec8fce47a102e2579f53709436b Mon Sep 17 00:00:00 2001 From: xuwenlong Date: Fri, 25 Aug 2023 16:09:40 +0800 Subject: [PATCH 07/15] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: xuwenlong --- thirdparty/icu/HPKBUILD | 1 + 1 file changed, 1 insertion(+) diff --git a/thirdparty/icu/HPKBUILD b/thirdparty/icu/HPKBUILD index dd6b8ded..311fce6f 100644 --- a/thirdparty/icu/HPKBUILD +++ b/thirdparty/icu/HPKBUILD @@ -23,6 +23,7 @@ archs=("armeabi-v7a" "arm64-v8a") license=("BSD License") depends=() makedepends=() +# 官方下载地址https://github.com/unicode-org/$pkgname/archive/refs/tags/$pkgver.tar.gz受网络影响可能存在下载失败的情况,现使用gitee镜像可以与官方仓库保持同步 source="https://gitee.com/lycium_pkg_mirror/$pkgname/repository/archive/$pkgver.zip" buildtools="configure" -- Gitee From f0592e0f6c745c23e6c2042bd61ac54460be43b2 Mon Sep 17 00:00:00 2001 From: xuwenlong Date: Fri, 25 Aug 2023 16:44:44 +0800 Subject: [PATCH 08/15] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=A3=80=E6=B5=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: xuwenlong --- thirdparty/icu/HPKBUILD | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/thirdparty/icu/HPKBUILD b/thirdparty/icu/HPKBUILD index 311fce6f..0d8f3399 100644 --- a/thirdparty/icu/HPKBUILD +++ b/thirdparty/icu/HPKBUILD @@ -44,9 +44,10 @@ prepare() { cd $builddir/host-build ../icu4c/source/configure > `pwd`/build.log 2>&1 make -j4 VERBOSE=1 >> `pwd`/build.log 2>&1 - if [ $? -eq 0 ];then - buildhost=false + if [ $? -ne 0 ];then + return -1 fi + buildhost=false cd $OLDPWD fi mkdir -p $builddir/$ARCH-build -- Gitee From 54fec5ba9c91f62145d8fbbe8c05dc96babca8fc Mon Sep 17 00:00:00 2001 From: xuwenlong Date: Sat, 26 Aug 2023 18:38:24 +0800 Subject: [PATCH 09/15] =?UTF-8?q?=E6=B7=BB=E5=8A=A0libiconv?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: xuwenlong --- thirdparty/icu/HPKBUILD | 48 +++++++++++++++++++++++++++++++++++++++-- 1 file changed, 46 insertions(+), 2 deletions(-) diff --git a/thirdparty/icu/HPKBUILD b/thirdparty/icu/HPKBUILD index 0d8f3399..a9ae8cce 100644 --- a/thirdparty/icu/HPKBUILD +++ b/thirdparty/icu/HPKBUILD @@ -30,6 +30,10 @@ buildtools="configure" autounpack=true downloadpackage=true buildhost=true +libiconvbuild=true +prefixpath="" +oldlibpath=$LD_LIBRARY_PATH +oldpath=$PATH builddir=$pkgname-$pkgver packagename=$pkgname-$pkgver.zip @@ -37,7 +41,45 @@ packagename=$pkgname-$pkgver.zip source envset.sh host= + # 编译gnu工具 +buildgnutool() { + toolname=$1 + toolver=$2 + toolpath=$toolname-$toolver + prefixpath=`pwd`/$toolpath/install + down=0 + rm -rf $toolpath + if [ ! -f $toolname-$toolver.tar.gz ];then + wget -O $toolname-$toolver.tar.gz -c http://ftp.gnu.org/gnu/$toolname/$toolname-$toolver.tar.gz + down=$? + fi + if [ $down -ne 0 ];then + return -1 + fi + tar -xf $toolname-$toolver.tar.gz + cd $toolpath + ./configure --prefix=$prefixpath >> `pwd`/build.log 2>&1 + make -j4 VERBOSE=1 >> `pwd`/build.log 2>&1 + make -j4 install VERBOSE=1 >> `pwd`/build.log 2>&1 + if [ $? -ne 0 ];then + return -2 + fi + cd $OLDPWD +} + prepare() { + # 需要libiconv工具 + if [ $libiconvbuild == true ];then + buildgnutool libiconv 1.17 + if [ $? -ne 0 ];then + return -1 + fi + export LD_LIBRARY_PATH=$prefixpath/lib:$LD_LIBRARY_PATH + export PATH=$prefixpath/bin:$PATH + libiconvbuild=false + unset prefixpath + fi + # 需要先编译host版本 if [ $buildhost == true ];then mkdir -p $builddir/host-build @@ -45,9 +87,11 @@ prepare() { ../icu4c/source/configure > `pwd`/build.log 2>&1 make -j4 VERBOSE=1 >> `pwd`/build.log 2>&1 if [ $? -ne 0 ];then - return -1 + return -2 fi buildhost=false + export LD_LIBRARY_PATH=$oldlibpath + export PATH=$oldpath cd $OLDPWD fi mkdir -p $builddir/$ARCH-build @@ -60,7 +104,7 @@ prepare() { host=aarch64-linux else echo "$ARCH not support" - return -1 + return -3 fi } -- Gitee From c6a141e2f0155d5949b2d9ead2665ca95d08a768 Mon Sep 17 00:00:00 2001 From: xuwenlong Date: Sat, 26 Aug 2023 19:08:31 +0800 Subject: [PATCH 10/15] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=8E=AF=E5=A2=83?= =?UTF-8?q?=E5=8F=98=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: xuwenlong --- thirdparty/icu/HPKBUILD | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/thirdparty/icu/HPKBUILD b/thirdparty/icu/HPKBUILD index a9ae8cce..4c3db60d 100644 --- a/thirdparty/icu/HPKBUILD +++ b/thirdparty/icu/HPKBUILD @@ -74,11 +74,11 @@ prepare() { if [ $? -ne 0 ];then return -1 fi - export LD_LIBRARY_PATH=$prefixpath/lib:$LD_LIBRARY_PATH - export PATH=$prefixpath/bin:$PATH libiconvbuild=false - unset prefixpath fi + # 设置环境变量 + export LD_LIBRARY_PATH=$prefixpath/lib:$LD_LIBRARY_PATH + export PATH=$prefixpath/bin:$PATH # 需要先编译host版本 if [ $buildhost == true ];then @@ -90,8 +90,6 @@ prepare() { return -2 fi buildhost=false - export LD_LIBRARY_PATH=$oldlibpath - export PATH=$oldpath cd $OLDPWD fi mkdir -p $builddir/$ARCH-build @@ -121,6 +119,8 @@ package() { cd $builddir/$ARCH-build make install VERBOSE=1 >> `pwd`/build.log 2>&1 unset host + export LD_LIBRARY_PATH=$oldlibpath + export PATH=$oldpath cd $OLDPWD if [ $ARCH == "armeabi-v7a" ];then unsetarm32ENV -- Gitee From 32334a2c40d815fb610afecd9fc4954cdaabd436 Mon Sep 17 00:00:00 2001 From: xuwenlong Date: Sat, 26 Aug 2023 20:27:44 +0800 Subject: [PATCH 11/15] =?UTF-8?q?=E5=8E=BB=E6=8E=89Namespace?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: xuwenlong --- thirdparty/icu/HPKBUILD | 42 ++--------------------------------------- 1 file changed, 2 insertions(+), 40 deletions(-) diff --git a/thirdparty/icu/HPKBUILD b/thirdparty/icu/HPKBUILD index 4c3db60d..7e6d6e19 100644 --- a/thirdparty/icu/HPKBUILD +++ b/thirdparty/icu/HPKBUILD @@ -41,51 +41,13 @@ packagename=$pkgname-$pkgver.zip source envset.sh host= - # 编译gnu工具 -buildgnutool() { - toolname=$1 - toolver=$2 - toolpath=$toolname-$toolver - prefixpath=`pwd`/$toolpath/install - down=0 - rm -rf $toolpath - if [ ! -f $toolname-$toolver.tar.gz ];then - wget -O $toolname-$toolver.tar.gz -c http://ftp.gnu.org/gnu/$toolname/$toolname-$toolver.tar.gz - down=$? - fi - if [ $down -ne 0 ];then - return -1 - fi - tar -xf $toolname-$toolver.tar.gz - cd $toolpath - ./configure --prefix=$prefixpath >> `pwd`/build.log 2>&1 - make -j4 VERBOSE=1 >> `pwd`/build.log 2>&1 - make -j4 install VERBOSE=1 >> `pwd`/build.log 2>&1 - if [ $? -ne 0 ];then - return -2 - fi - cd $OLDPWD -} - prepare() { - # 需要libiconv工具 - if [ $libiconvbuild == true ];then - buildgnutool libiconv 1.17 - if [ $? -ne 0 ];then - return -1 - fi - libiconvbuild=false - fi - # 设置环境变量 - export LD_LIBRARY_PATH=$prefixpath/lib:$LD_LIBRARY_PATH - export PATH=$prefixpath/bin:$PATH - # 需要先编译host版本 if [ $buildhost == true ];then mkdir -p $builddir/host-build cd $builddir/host-build ../icu4c/source/configure > `pwd`/build.log 2>&1 - make -j4 VERBOSE=1 >> `pwd`/build.log 2>&1 + CXXFLAGS="-DU_USING_ICU_NAMESPACE=0" make -j4 VERBOSE=1 >> `pwd`/build.log 2>&1 if [ $? -ne 0 ];then return -2 fi @@ -108,7 +70,7 @@ prepare() { build() { cd $builddir/$ARCH-build - CXXFLAGS="$CXXFLAGS -std=c++11" ../icu4c/source/configure "$@" --host=$host --with-cross-build=`pwd`/../host-build > `pwd`/build.log 2>&1 + CXXFLAGS="$CXXFLAGS -std=c++11 -DU_USING_ICU_NAMESPACE=0" ../icu4c/source/configure "$@" --host=$host --with-cross-build=`pwd`/../host-build > `pwd`/build.log 2>&1 make -j4 VERBOSE=1 >> `pwd`/build.log 2>&1 ret=$? cd $OLDPWD -- Gitee From c728173826b4a401c666de6bff7016b356cc6b95 Mon Sep 17 00:00:00 2001 From: xuwenlong Date: Sat, 26 Aug 2023 20:47:52 +0800 Subject: [PATCH 12/15] =?UTF-8?q?=E5=8E=BB=E6=8E=89Namespace?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: xuwenlong --- thirdparty/icu/HPKBUILD | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/thirdparty/icu/HPKBUILD b/thirdparty/icu/HPKBUILD index 7e6d6e19..f7f7ab9b 100644 --- a/thirdparty/icu/HPKBUILD +++ b/thirdparty/icu/HPKBUILD @@ -47,7 +47,7 @@ prepare() { mkdir -p $builddir/host-build cd $builddir/host-build ../icu4c/source/configure > `pwd`/build.log 2>&1 - CXXFLAGS="-DU_USING_ICU_NAMESPACE=0" make -j4 VERBOSE=1 >> `pwd`/build.log 2>&1 + CXXFLAGS="-DU_USING_ICU_NAMESPACE=1" make -j4 VERBOSE=1 >> `pwd`/build.log 2>&1 if [ $? -ne 0 ];then return -2 fi @@ -70,7 +70,7 @@ prepare() { build() { cd $builddir/$ARCH-build - CXXFLAGS="$CXXFLAGS -std=c++11 -DU_USING_ICU_NAMESPACE=0" ../icu4c/source/configure "$@" --host=$host --with-cross-build=`pwd`/../host-build > `pwd`/build.log 2>&1 + CXXFLAGS="$CXXFLAGS -std=c++11 -DU_USING_ICU_NAMESPACE=1" ../icu4c/source/configure "$@" --host=$host --with-cross-build=`pwd`/../host-build > `pwd`/build.log 2>&1 make -j4 VERBOSE=1 >> `pwd`/build.log 2>&1 ret=$? cd $OLDPWD -- Gitee From 5ec3ea71c574e9d5de005f8d47436a23b2b478a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=9F=8Emeto?= Date: Sat, 26 Aug 2023 13:11:06 +0000 Subject: [PATCH 13/15] =?UTF-8?q?=E4=BF=AE=E6=94=B9=20cflags?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 城meto --- thirdparty/icu/HPKBUILD | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/thirdparty/icu/HPKBUILD b/thirdparty/icu/HPKBUILD index f7f7ab9b..171bcdc3 100644 --- a/thirdparty/icu/HPKBUILD +++ b/thirdparty/icu/HPKBUILD @@ -30,10 +30,6 @@ buildtools="configure" autounpack=true downloadpackage=true buildhost=true -libiconvbuild=true -prefixpath="" -oldlibpath=$LD_LIBRARY_PATH -oldpath=$PATH builddir=$pkgname-$pkgver packagename=$pkgname-$pkgver.zip @@ -47,7 +43,7 @@ prepare() { mkdir -p $builddir/host-build cd $builddir/host-build ../icu4c/source/configure > `pwd`/build.log 2>&1 - CXXFLAGS="-DU_USING_ICU_NAMESPACE=1" make -j4 VERBOSE=1 >> `pwd`/build.log 2>&1 + CPPFLAGS="-DU_USING_ICU_NAMESPACE=1" make -j4 VERBOSE=1 >> `pwd`/build.log 2>&1 if [ $? -ne 0 ];then return -2 fi @@ -70,7 +66,7 @@ prepare() { build() { cd $builddir/$ARCH-build - CXXFLAGS="$CXXFLAGS -std=c++11 -DU_USING_ICU_NAMESPACE=1" ../icu4c/source/configure "$@" --host=$host --with-cross-build=`pwd`/../host-build > `pwd`/build.log 2>&1 + CXXFLAGS="$CXXFLAGS -std=c++11" ../icu4c/source/configure "$@" --host=$host --with-cross-build=`pwd`/../host-build > `pwd`/build.log 2>&1 make -j4 VERBOSE=1 >> `pwd`/build.log 2>&1 ret=$? cd $OLDPWD @@ -81,8 +77,6 @@ package() { cd $builddir/$ARCH-build make install VERBOSE=1 >> `pwd`/build.log 2>&1 unset host - export LD_LIBRARY_PATH=$oldlibpath - export PATH=$oldpath cd $OLDPWD if [ $ARCH == "armeabi-v7a" ];then unsetarm32ENV -- Gitee From b548b2e0496837a76677caca28d77edfeb5d434f Mon Sep 17 00:00:00 2001 From: wlxuz Date: Sun, 27 Aug 2023 05:43:06 +0800 Subject: [PATCH 14/15] =?UTF-8?q?=E5=8E=BB=E6=8E=89host-build?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: wlxuz --- thirdparty/glib_with_host/HPKBUILD | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/thirdparty/glib_with_host/HPKBUILD b/thirdparty/glib_with_host/HPKBUILD index d2d2a339..db2e5920 100644 --- a/thirdparty/glib_with_host/HPKBUILD +++ b/thirdparty/glib_with_host/HPKBUILD @@ -46,16 +46,6 @@ prepare() { clonesrcflag=false fi - # 编译host版本,其他多个库需要使用 - if [ $buildhost == true ];then - mkdir -p $builddir/host-build - cd $builddir - meson setup host-build --prefix=$LYCIUM_ROOT/usr/$pkgname/$(uname -m) > `pwd`/host-build/build.log 2>&1 - ninja -j4 -C host-build -v >> `pwd`/host-build/build.log 2>&1 - cd $OLDPWD - buildhost=false - fi - # 依赖库加入 pkg_config_path 路径 for depend in ${depends[@]} do -- Gitee From 7ab666dec74f7c766fbed55a401c64f4a74d4d1d Mon Sep 17 00:00:00 2001 From: wlxuz Date: Sun, 27 Aug 2023 09:58:11 +0800 Subject: [PATCH 15/15] =?UTF-8?q?=E4=BF=AE=E6=94=B9glib=E4=B8=8B=E8=BD=BD?= =?UTF-8?q?=E8=B7=AF=E5=BE=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: wlxuz --- thirdparty/{glib_with_host => glib}/HPKBUILD | 55 +++++++++++-------- thirdparty/{glib_with_host => glib}/SHA512SUM | 0 .../arm64-v8a-cross-file.txt | 0 .../armeabi-v7a-cross-file.txt | 0 4 files changed, 33 insertions(+), 22 deletions(-) rename thirdparty/{glib_with_host => glib}/HPKBUILD (65%) rename thirdparty/{glib_with_host => glib}/SHA512SUM (100%) rename thirdparty/{glib_with_host => glib}/arm64-v8a-cross-file.txt (100%) rename thirdparty/{glib_with_host => glib}/armeabi-v7a-cross-file.txt (100%) diff --git a/thirdparty/glib_with_host/HPKBUILD b/thirdparty/glib/HPKBUILD similarity index 65% rename from thirdparty/glib_with_host/HPKBUILD rename to thirdparty/glib/HPKBUILD index db2e5920..de24320e 100644 --- a/thirdparty/glib_with_host/HPKBUILD +++ b/thirdparty/glib/HPKBUILD @@ -13,50 +13,61 @@ # Contributor: 城meto # Maintainer: 城meto -pkgname=glib_with_host +pkgname=glib pkgver=2.77.1 pkgrel=0 pkgdesc="GLib is a general-purpose, portable utility library, which provides many useful data types, macros, type conversions, string utilities, file utilities, a mainloop abstraction, and so on." url="https://docs.gtk.org/glib/" archs=("armeabi-v7a" "arm64-v8a") license=("Apache 2.0" "CC0-1.0" "GPL-2.0" "LGPL-2.1" "LLVM" "old-glib" "MIT") -depends=("libffi" "pcre2") # 将依赖库独立编译,两个库都比较大 +depends=("libffi" "pcre2") # 将依赖库独立编译 makedepends=("meson" "ninja") -source="https://github.com/GNOME/${pkgname:0:4}/archive/refs/tags/$pkgver.tar.gz" +# 原仓位置: https://github.com/GNOME/${pkgname}/archive/refs/tags/$pkgver.tar.gz, 因网络原因使用镜像 +source="https://gitee.com/lycium_pkg_mirror/glib.git" -downloadpackage=true -autounpack=true +downloadpackage=false +autounpack=false buildtools="meson" -builddir=${pkgname:0:4}-$pkgver -packagename=${pkgname:0:4}-$pkgver.tar.gz +builddir=$pkgname-$pkgver +packagename=$pkgname-$pkgver.tar.gz buildhost=true clonesrcflag=true -pkgconfigpath= +# pkgconfigpath= prepare() { # git clone对网络要求太高了,而且耗时长,这个版本使用压缩包 if $clonesrcflag then - cd $builddir - git clone https://github.com/GNOME/gvdb.git subprojects/gvdb + git clone -b $pkgver $source $builddir + if [ $? -ne 0 ];then + return -1 + fi + git clone https://github.com/GNOME/gvdb.git $builddir/subprojects/gvdb + cd $builddir/subprojects/gvdb + git checkout --detach 0854af0fdb6d527a8d1999835ac2c5059976c210 + ret=$? cd $OLDPWD + if [ $ret != 0 ] + then + return -2 + fi clonesrcflag=false fi # 依赖库加入 pkg_config_path 路径 - for depend in ${depends[@]} - do - dependpath=$LYCIUM_ROOT/usr/$depend/$ARCH/lib/pkgconfig - if [ ! -d ${dependpath} ] - then - continue - fi - pkgconfigpath=$pkgconfigpath"${dependpath}:" - done - pkgconfigpath=${pkgconfigpath%:*} + # for depend in ${depends[@]} + # do + # dependpath=$LYCIUM_ROOT/usr/$depend/$ARCH/lib/pkgconfig + # if [ ! -d ${dependpath} ] + # then + # continue + # fi + # pkgconfigpath=$pkgconfigpath"${dependpath}:" + # done + # pkgconfigpath=${pkgconfigpath%:*} cp $ARCH-cross-file.txt $builddir mkdir -p $builddir/$ARCH-build @@ -69,7 +80,7 @@ build() { # 需要设置pkg路径 meson setup $ARCH-build --cross-file $ARCH-cross-file.txt \ - --pkg-config-path $pkgconfigpath \ + --pkg-config-path=$pkgconfigpath \ --prefix=$LYCIUM_ROOT/usr/$pkgname/$ARCH > $ARCH-build/build.log 2>&1 ninja -C $ARCH-build -v >> $ARCH-build/build.log 2>&1 ret=$? @@ -81,7 +92,7 @@ package() { cd $builddir ninja -v -C $ARCH-build install >> build.log 2>&1 # 还原 - pkgconfigpath="" + unset pkgconfigpath cd $OLDPWD } diff --git a/thirdparty/glib_with_host/SHA512SUM b/thirdparty/glib/SHA512SUM similarity index 100% rename from thirdparty/glib_with_host/SHA512SUM rename to thirdparty/glib/SHA512SUM diff --git a/thirdparty/glib_with_host/arm64-v8a-cross-file.txt b/thirdparty/glib/arm64-v8a-cross-file.txt similarity index 100% rename from thirdparty/glib_with_host/arm64-v8a-cross-file.txt rename to thirdparty/glib/arm64-v8a-cross-file.txt diff --git a/thirdparty/glib_with_host/armeabi-v7a-cross-file.txt b/thirdparty/glib/armeabi-v7a-cross-file.txt similarity index 100% rename from thirdparty/glib_with_host/armeabi-v7a-cross-file.txt rename to thirdparty/glib/armeabi-v7a-cross-file.txt -- Gitee