From 27b365b2e5f1538b432906a963de9bd61e8db943 Mon Sep 17 00:00:00 2001 From: xuwenlong Date: Fri, 25 Aug 2023 10:32:09 +0800 Subject: [PATCH 1/3] add cairo Signed-off-by: xuwenlong --- thirdparty/cairo/HPKBUILD | 84 +++++++++++++++++++++ thirdparty/cairo/SHA512SUM | 1 + thirdparty/cairo/arm64-v8a-cross-file.txt | 26 +++++++ thirdparty/cairo/armeabi-v7a-cross-file.txt | 26 +++++++ 4 files changed, 137 insertions(+) create mode 100644 thirdparty/cairo/HPKBUILD create mode 100644 thirdparty/cairo/SHA512SUM create mode 100644 thirdparty/cairo/arm64-v8a-cross-file.txt create mode 100644 thirdparty/cairo/armeabi-v7a-cross-file.txt diff --git a/thirdparty/cairo/HPKBUILD b/thirdparty/cairo/HPKBUILD new file mode 100644 index 00000000..5df22c97 --- /dev/null +++ b/thirdparty/cairo/HPKBUILD @@ -0,0 +1,84 @@ +# 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=cairo +pkgver=1.17.8 +pkgrel=0 +pkgdesc="Cairo is a 2D graphics library with support for multiple output devices." +url="https://gitlab.freedesktop.org/cairo/cairo" +archs=("armeabi-v7a" "arm64-v8a") +license=("LGPL-2.1" "MPL 1.1") +depends=("glib_with_host" "freetype2" "fontconfig" "libpng" "zlib" "pixman" "libxml2" "libffi" "pcre2") +makedepends=("meson" "ninja") + +source="https://gitlab.freedesktop.org/cairo/$pkgname/-/archive/$pkgver/$pkgname-$pkgver.tar.gz" + +downloadpackage=true +autounpack=true +buildtools="meson" + +builddir=$pkgname-$pkgver +packagename=$pkgname-$pkgver.tar.gz + +pkgconfigpath= + +prepare() { + # 依赖库单独编译,meson 自动下载老是失败 + echo "depends: ${#depends[@]}" + 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%:*} + + mkdir -p $builddir/$ARCH-build + cp $ARCH-cross-file.txt ./$builddir +} + +build() { + cd $builddir + ohos_sdk_path=${OHOS_SDK//\//\\\/} + sed -i 's/ohos_sdk/'"$ohos_sdk_path"'/g' $ARCH-cross-file.txt + + 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 -v -C $ARCH-build >> $ARCH-build/build.log 2>&1 + ret=$? + cd $OLDPWD + return $ret +} + +package() { + cd $builddir + ninja -v -C $ARCH-build install >> $ARCH-build/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/cairo/SHA512SUM b/thirdparty/cairo/SHA512SUM new file mode 100644 index 00000000..8f60c306 --- /dev/null +++ b/thirdparty/cairo/SHA512SUM @@ -0,0 +1 @@ +e12f4b05326c1ac7d930e18d95398dc9c65f3af9745d7fd301ef1663dd378feeb43acc47de17fd082d0acf96e9fc60310557c24e3fe8af06d17931590c7759c6 cairo-1.17.8.tar.gz diff --git a/thirdparty/cairo/arm64-v8a-cross-file.txt b/thirdparty/cairo/arm64-v8a-cross-file.txt new file mode 100644 index 00000000..34ad3f25 --- /dev/null +++ b/thirdparty/cairo/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/cairo/armeabi-v7a-cross-file.txt b/thirdparty/cairo/armeabi-v7a-cross-file.txt new file mode 100644 index 00000000..2b6e25f2 --- /dev/null +++ b/thirdparty/cairo/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 913a488afb5c9a118433d9b80d6127f91511b329 Mon Sep 17 00:00:00 2001 From: wlxuz Date: Sun, 27 Aug 2023 22:06:33 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=8B=E8=BD=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: wlxuz --- thirdparty/cairo/HPKBUILD | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/thirdparty/cairo/HPKBUILD b/thirdparty/cairo/HPKBUILD index 5df22c97..ca9d395a 100644 --- a/thirdparty/cairo/HPKBUILD +++ b/thirdparty/cairo/HPKBUILD @@ -20,14 +20,16 @@ pkgdesc="Cairo is a 2D graphics library with support for multiple output devices url="https://gitlab.freedesktop.org/cairo/cairo" archs=("armeabi-v7a" "arm64-v8a") license=("LGPL-2.1" "MPL 1.1") -depends=("glib_with_host" "freetype2" "fontconfig" "libpng" "zlib" "pixman" "libxml2" "libffi" "pcre2") +depends=("glib" "freetype2" "fontconfig" "libpng" "zlib" "pixman" "libxml2" "libffi" "pcre2") makedepends=("meson" "ninja") -source="https://gitlab.freedesktop.org/cairo/$pkgname/-/archive/$pkgver/$pkgname-$pkgver.tar.gz" +# 原仓地址: https://gitlab.freedesktop.org/cairo/$pkgname/-/archive/$pkgver/$pkgname-$pkgver.tar.gz ,因网络原因使用镜像 +source="https://gitee.com/mirrors/cairo.git" -downloadpackage=true -autounpack=true buildtools="meson" +downloadpackage=false +autounpack=false +clonesrcflag=true builddir=$pkgname-$pkgver packagename=$pkgname-$pkgver.tar.gz @@ -35,8 +37,16 @@ packagename=$pkgname-$pkgver.tar.gz pkgconfigpath= prepare() { - # 依赖库单独编译,meson 自动下载老是失败 - echo "depends: ${#depends[@]}" + # 下载 + if [ $clonesrcflag == true ];then + git clone -b $pkgver $source $builddir + if [ $? -ne 0 ];then + return -1 + fi + clonesrcflag=false + fi + + # meson 编译没有配置pkgconfigpath,需自己配置 for depend in ${depends[@]} do dependpath=$LYCIUM_ROOT/usr/$depend/$ARCH/lib/pkgconfig -- Gitee From e08e05035c8e07446f636ab2e96775b6b334b9ab Mon Sep 17 00:00:00 2001 From: wlxuz Date: Mon, 28 Aug 2023 06:19:07 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=95=9C=E5=83=8F?= =?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/cairo/HPKBUILD | 23 +++++++---------------- thirdparty/cairo/SHA512SUM | 2 +- thirdparty/fontconfig/HPKBUILD | 21 ++++++++++++++++++--- thirdparty/fontconfig/SHA512SUM | 2 +- thirdparty/libpng/HPKBUILD | 22 +++++++++++++++++++--- thirdparty/libpng/SHA512SUM | 2 +- thirdparty/libxml2/HPKBUILD | 23 +++++++++++++++++++---- thirdparty/libxml2/SHA512SUM | 2 +- 8 files changed, 67 insertions(+), 30 deletions(-) diff --git a/thirdparty/cairo/HPKBUILD b/thirdparty/cairo/HPKBUILD index ca9d395a..3f8ab78f 100644 --- a/thirdparty/cairo/HPKBUILD +++ b/thirdparty/cairo/HPKBUILD @@ -13,6 +13,7 @@ # Contributor: 城meto # Maintainer: 城meto + pkgname=cairo pkgver=1.17.8 pkgrel=0 @@ -24,28 +25,18 @@ depends=("glib" "freetype2" "fontconfig" "libpng" "zlib" "pixman" "libxml2" "lib makedepends=("meson" "ninja") # 原仓地址: https://gitlab.freedesktop.org/cairo/$pkgname/-/archive/$pkgver/$pkgname-$pkgver.tar.gz ,因网络原因使用镜像 -source="https://gitee.com/mirrors/cairo.git" +source="https://gitee.com/mirrors/$pkgname/repository/archive/$pkgver.zip" buildtools="meson" -downloadpackage=false -autounpack=false -clonesrcflag=true +downloadpackage=true +autounpack=true builddir=$pkgname-$pkgver -packagename=$pkgname-$pkgver.tar.gz +packagename=$pkgname-$pkgver.zip pkgconfigpath= prepare() { - # 下载 - if [ $clonesrcflag == true ];then - git clone -b $pkgver $source $builddir - if [ $? -ne 0 ];then - return -1 - fi - clonesrcflag=false - fi - # meson 编译没有配置pkgconfigpath,需自己配置 for depend in ${depends[@]} do @@ -68,7 +59,7 @@ build() { sed -i 's/ohos_sdk/'"$ohos_sdk_path"'/g' $ARCH-cross-file.txt 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 -v -C $ARCH-build >> $ARCH-build/build.log 2>&1 ret=$? @@ -79,7 +70,7 @@ build() { package() { cd $builddir ninja -v -C $ARCH-build install >> $ARCH-build/build.log 2>&1 - pkgconfigpath="" + unset pkgconfigpath cd $OLDPWD } diff --git a/thirdparty/cairo/SHA512SUM b/thirdparty/cairo/SHA512SUM index 8f60c306..e94f290b 100644 --- a/thirdparty/cairo/SHA512SUM +++ b/thirdparty/cairo/SHA512SUM @@ -1 +1 @@ -e12f4b05326c1ac7d930e18d95398dc9c65f3af9745d7fd301ef1663dd378feeb43acc47de17fd082d0acf96e9fc60310557c24e3fe8af06d17931590c7759c6 cairo-1.17.8.tar.gz +7dca5536b57e7569084ce848b881f81efbe2a58b3fee951894808b6d6c142571741651040d2d16ca773778ec0b98890c9f32cfa1b448f45ed0a0c62d945e14ca cairo-1.17.8.zip diff --git a/thirdparty/fontconfig/HPKBUILD b/thirdparty/fontconfig/HPKBUILD index 8b5d7ab7..94f2d4e3 100644 --- a/thirdparty/fontconfig/HPKBUILD +++ b/thirdparty/fontconfig/HPKBUILD @@ -1,4 +1,17 @@ -# Contributor: 小肉头君 +# 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: 小肉头君 pkgname=fontconfig @@ -10,14 +23,16 @@ archs=("armeabi-v7a" "arm64-v8a") license=("MIT License") depends=("freetype2" "libxml2" "libpng" "json-c") makedepends=("gperf" "gettextize" "autopoint" "libtool") -source="https://gitlab.freedesktop.org/fontconfig/${pkgname}/-/archive/2.14.2/${pkgname}-${pkgver}.tar.gz" + +# 原仓地址: https://gitlab.freedesktop.org/fontconfig/${pkgname}/-/archive/2.14.2/${pkgname}-${pkgver}.tar.gz, 因网络原因使用镜像 +source="https://gitee.com/mirrors_community_gitlab_freedesktop/$pkgname/repository/archive/$pkgver.zip" autounpack=true downloadpackage=true buildtools="configure" builddir=$pkgname-$pkgver -packagename=$builddir.tar.gz +packagename=$builddir.zip autogenflag=true testpatch=true diff --git a/thirdparty/fontconfig/SHA512SUM b/thirdparty/fontconfig/SHA512SUM index 0a94efda..5399c75f 100644 --- a/thirdparty/fontconfig/SHA512SUM +++ b/thirdparty/fontconfig/SHA512SUM @@ -1 +1 @@ -b6cbb4ad7db224dabfb8a96c1d0743bab5bbe8f403e49d9b9a44effd161fd97062a2f7205a700308a1f805655038538ba2fb1b65169faa2d69ea88e477230849 fontconfig-2.14.2.tar.gz +55442bc402e4f2ae14de11c3c9671cbca555aad13a3acaf2aad927b897db765ac3848e8d4172ccf98ffe85a7737a19d80224c6acb5590bc7b5cc174db3ec8368 fontconfig-2.14.2.zip diff --git a/thirdparty/libpng/HPKBUILD b/thirdparty/libpng/HPKBUILD index 42361994..1efc266e 100644 --- a/thirdparty/libpng/HPKBUILD +++ b/thirdparty/libpng/HPKBUILD @@ -1,5 +1,19 @@ +# 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: Jeff Han # Maintainer: Jeff Han + pkgname=libpng pkgver=1.6.39 pkgrel=0 @@ -10,14 +24,16 @@ license=("PNG Reference Library License version 2") depends=() makedepends=() install= -source="https://sourceforge.net/projects/$pkgname/files/libpng16/$pkgver/$pkgname-$pkgver.tar.xz" + +# 原仓地址: https://sourceforge.net/projects/$pkgname/files/libpng16/$pkgver/$pkgname-$pkgver.tar.xz, 因网络原因使用镜像 +source="https://gitee.com/mirrors/$pkgname/repository/archive/v$pkgver.zip" autounpack=true downloadpackage=true buildtools="configure" -builddir=$pkgname-${pkgver} -packagename=$builddir.tar.xz +builddir=$pkgname-v$pkgver +packagename=$builddir.zip source envset.sh host= diff --git a/thirdparty/libpng/SHA512SUM b/thirdparty/libpng/SHA512SUM index 3335a8fa..18118aa1 100644 --- a/thirdparty/libpng/SHA512SUM +++ b/thirdparty/libpng/SHA512SUM @@ -1 +1 @@ -ce233bb58d70b391b7dc858a132a8f9f66a9e30f5b387426317fdd5e76e8395e00ec36324e5e2caec8fda49a3f2b13fe27594a3466fdf2020ec7520e79a608c9 libpng-1.6.39.tar.xz +f37af87d972edf218867f4592959bdcd6bd79d22e8bc52ded30bd5555c02793fb8f4f4ca169edfa4917b89bc28ed3fe895f510ae51f1e228fa0532a65b78aed4 libpng-1.6.39.zip diff --git a/thirdparty/libxml2/HPKBUILD b/thirdparty/libxml2/HPKBUILD index 52ae17ac..5f9c323b 100644 --- a/thirdparty/libxml2/HPKBUILD +++ b/thirdparty/libxml2/HPKBUILD @@ -1,5 +1,19 @@ -# Contributor: Jeff Han +# 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: Jeff Han , 城meto # Maintainer: Jeff Han + pkgname=libxml2 pkgver=v2.11.3 pkgrel=0 @@ -10,13 +24,14 @@ license=("MIT") depends=("xz" "zlib") makedepends=() -source="https://github.com/GNOME/$pkgname/archive/refs/tags/$pkgver.tar.gz" +# 原仓地址: https://github.com/GNOME/$pkgname/archive/refs/tags/$pkgver.tar.gz, 因网络原因使用镜像 +source="https://gitee.com/lycium_pkg_mirror/$pkgname/repository/archive/$pkgver.zip" autounpack=true downloadpackage=true -builddir=$pkgname-${pkgver:1} -packagename=$builddir.tar.gz +builddir=$pkgname-$pkgver +packagename=$builddir.zip prepare() { mkdir -p $builddir/$ARCH-build diff --git a/thirdparty/libxml2/SHA512SUM b/thirdparty/libxml2/SHA512SUM index 4871c704..89e9d0ee 100644 --- a/thirdparty/libxml2/SHA512SUM +++ b/thirdparty/libxml2/SHA512SUM @@ -1 +1 @@ -ddf4388d4286e9e9fffbf9a2d2b9533cd9a4e3c1d6b2595a1d6fad11f02c0a4d501a5994e743348f9f861a73baef2f8ad091fefa77b2df36b4f4d2d8fcf2ee60 libxml2-2.11.3.tar.gz +2a7f52ca623e99741f09a10a6059f4eb653c9077f3dc05bebb9f640eb7aff1ea58a06b9907e8fba5b5ff5b57ac548243a3fff762ab5d5906d57391171f5496b2 libxml2-2.11.3.zip -- Gitee