From 2cfeb653cf95e5044c2fb49827f9ace1b601e6ca Mon Sep 17 00:00:00 2001 From: liulihong Date: Wed, 27 Dec 2023 15:40:24 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E6=8F=90=E4=BA=A4webkit=E5=BA=93=E7=BC=96?= =?UTF-8?q?=E8=AF=91=E7=9B=B8=E5=85=B3=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: liulihong --- thirdparty/JavaScriptCore/HPKBUILD | 74 +++++++++++++++++++ .../JavaScriptCore_oh_pkg.patch | 18 +++++ thirdparty/JavaScriptCore/SHA512SUM | 2 + 3 files changed, 94 insertions(+) create mode 100644 thirdparty/JavaScriptCore/HPKBUILD create mode 100644 thirdparty/JavaScriptCore/JavaScriptCore_oh_pkg.patch create mode 100644 thirdparty/JavaScriptCore/SHA512SUM diff --git a/thirdparty/JavaScriptCore/HPKBUILD b/thirdparty/JavaScriptCore/HPKBUILD new file mode 100644 index 00000000..5de2e3c4 --- /dev/null +++ b/thirdparty/JavaScriptCore/HPKBUILD @@ -0,0 +1,74 @@ +# 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=JavaScriptCore # 项目源码为WebKit, 但是只移植了JavaScriptCore能力 +pkgver=webkitgtk-2.41.90 +pkgrel=0 +pkgdesc="Home of the WebKit project, the browser engine used by Safari, Mail, App Store and many other applications on macOS, iOS and Linux." +url="https://github.com/WebKit/WebKit" +archs=("arm64-v8a") # armeabi-v7a 会导致编译器bug +license=("MIT") +depends=("icu") +makedepends=() + +source="https://github.com/WebKit/WebKit/archive/refs/tags/$pkgver.tar.gz" + +autounpack=true +downloadpackage=true +patchflag=true + +builddir=WebKit-${pkgver} +packagename=$builddir.tar.gz + +prepare() { + if $patchflag + then + cd $builddir + # 添加系统识别 + patch -p1 < `pwd`/../JavaScriptCore_oh_pkg.patch + # patch只需要打一次,关闭打patch + patchflag=false + cd $OLDPWD + fi + mkdir -p $builddir/$ARCH-build +} + +build() { + cd $builddir + ${OHOS_SDK}/native/build-tools/cmake/bin/cmake "$@" -B$ARCH-build -S./ \ + -DCMAKE_CXX_FLAGS="-I$PKGBUILD_ROOT/$builddir/Source/WTF/" -DENABLE_WEBCORE=OFF \ + -DENABLE_WEBKIT=OFF -DPORT="JSCOnly" -DENABLE_STATIC_JSC=ON -DCMAKE_BUILD_TYPE="Release" \ + -DSHOULD_INSTALL_JS_SHELL=ON > $buildlog 2>&1 + $MAKE VERBOSE=1 -C $ARCH-build >> $buildlog 2>&1 + ret=$? + cd $OLDPWD + return $ret +} + +package() { + cd $builddir + $MAKE -C $ARCH-build install >> $buildlog 2>&1 + cd $OLDPWD +} + +check() { + echo "The test must be on an OpenHarmony device!" +} + +# 清理环境 +cleanbuild() { + rm -rf ${PWD}/$builddir #${PWD}/$packagename +} diff --git a/thirdparty/JavaScriptCore/JavaScriptCore_oh_pkg.patch b/thirdparty/JavaScriptCore/JavaScriptCore_oh_pkg.patch new file mode 100644 index 00000000..16fd1947 --- /dev/null +++ b/thirdparty/JavaScriptCore/JavaScriptCore_oh_pkg.patch @@ -0,0 +1,18 @@ +diff -rupN WebKit-webkitgtk-2.41.90/Source/WTF/wtf/PlatformJSCOnly.cmake WebKit-webkitgtk-2.41.90_patched/Source/WTF/wtf/PlatformJSCOnly.cmake +--- WebKit-webkitgtk-2.41.90/Source/WTF/wtf/PlatformJSCOnly.cmake 2023-08-18 14:55:39.118994293 +0800 ++++ WebKit-webkitgtk-2.41.90_patched/Source/WTF/wtf/PlatformJSCOnly.cmake 2023-08-18 15:07:32.164508099 +0800 +@@ -105,6 +105,14 @@ elseif (CMAKE_SYSTEM_NAME MATCHES "Linux + + unix/MemoryPressureHandlerUnix.cpp + ) ++elseif (CMAKE_SYSTEM_NAME MATCHES "OHOS") ++ list(APPEND WTF_SOURCES ++ linux/CurrentProcessMemoryStatus.cpp ++ linux/MemoryFootprintLinux.cpp ++ linux/RealTimeThreads.cpp ++ ++ unix/MemoryPressureHandlerUnix.cpp ++ ) + list(APPEND WTF_PUBLIC_HEADERS + linux/ProcessMemoryFootprint.h + linux/CurrentProcessMemoryStatus.h diff --git a/thirdparty/JavaScriptCore/SHA512SUM b/thirdparty/JavaScriptCore/SHA512SUM new file mode 100644 index 00000000..dac0cf1a --- /dev/null +++ b/thirdparty/JavaScriptCore/SHA512SUM @@ -0,0 +1,2 @@ +45ba6ef7acf391da9bd8925c68488af880e53a5603396e6f1ddc186c739f911810316b0cf9d6dead32836db44b212a6b1992c85d024cd20fdc5368f074149ba0 WebKit-webkitgtk-2.41.90.tar.gz +3d0be46a0e323b311a853cb102b956e35c2b4f0630e651018ec22c882b263b6d758366d7c6d907da5db5a61d0329a44abb37b5cda5810fc181551a39bd67ad89 JavaScriptCore_oh_pkg.patch -- Gitee From 95ce7f8c28353f85ff0162a6d0409601ca12c05b Mon Sep 17 00:00:00 2001 From: liulihong Date: Wed, 27 Dec 2023 16:14:03 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E6=8F=90=E4=BA=A4yoga=E5=BA=93=E7=BC=96?= =?UTF-8?q?=E8=AF=91=E7=9B=B8=E5=85=B3=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: liulihong --- thirdparty/yoga/HPKBUILD | 71 +++++++++++++++++++++++++++++++++++++++ thirdparty/yoga/SHA512SUM | 1 + 2 files changed, 72 insertions(+) create mode 100644 thirdparty/yoga/HPKBUILD create mode 100644 thirdparty/yoga/SHA512SUM diff --git a/thirdparty/yoga/HPKBUILD b/thirdparty/yoga/HPKBUILD new file mode 100644 index 00000000..e33ad06e --- /dev/null +++ b/thirdparty/yoga/HPKBUILD @@ -0,0 +1,71 @@ +# 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: leehom +# Maintainer: leehom + +pkgname=yoga +pkgver=v2.0.1 +pkgrel=0 +pkgdesc="" +url="https://github.com/facebook/yoga" +archs=("armeabi-v7a" "arm64-v8a") +license=("MIT License") +depends=() +makedepends=() + +source="https://github.com/facebook/$pkgname/archive/refs/tags/$pkgver.tar.gz" + +autounpack=true +downloadpackage=true +buildtools="cmake" + +builddir=$pkgname-${pkgver:1} +packagename=$builddir.tar.gz + +prepare() { + mkdir -p $builddir/$ARCH-build + +} + +build () { + cd $builddir + # 需要下载至少3.26版本以上的cmake + cmake "$@" -DCMAKE_C_FLAGS="-Wno-error=unused-command-line-argument" \ + -DCMAKE_CXX_FLAGS="-Wno-error=unused-command-line-argument" -DCMAKE_GTEST_DISCOVER_TESTS_DISCOVERY_MODE="PRE_TEST" -B$ARCH-build -S./ > $buildlog 2>&1 + $MAKE VERBOSE=1 -C $ARCH-build >> $buildlog 2>&1 + ret=$? + cd $OLDPWD + return $ret + +} + +package() { + cd $builddir + $MAKE VERBOSE=1 -C $ARCH-build install >> $buildlog 2>&1 + cd $OLDPWD + + +} + +check() { + echo "The test must be on an OpenHarmony device!" + # 测试方式 + # 进入构建目录下tests目录 + # 执行: ./yogatest +} + +# 清理环境 +cleanbuild(){ + rm -rf ${PWD}/$builddir #${PWD}/$packagename +} diff --git a/thirdparty/yoga/SHA512SUM b/thirdparty/yoga/SHA512SUM new file mode 100644 index 00000000..99bb8dba --- /dev/null +++ b/thirdparty/yoga/SHA512SUM @@ -0,0 +1 @@ +54ec9d4cee822d7480bb10f973769b3bc4c408720bfbaf9b8247747ae64ca75dca62b2d53dd4cb29addc9ec99d135d090c0e3e831108ac36e34863bf814448eb yoga-2.0.1.tar.gz -- Gitee From 005f2e3c886c88a35976abd45a925008228b9344 Mon Sep 17 00:00:00 2001 From: liulihong Date: Wed, 27 Dec 2023 16:45:16 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E6=B7=BB=E5=8A=A0libde265=E5=BA=93?= =?UTF-8?q?=E7=BC=96=E8=AF=91=E7=9B=B8=E5=85=B3=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: liulihong --- thirdparty/libde265/HPKBUILD | 69 +++++++++++++++++++++++++++++++++++ thirdparty/libde265/SHA512SUM | 1 + 2 files changed, 70 insertions(+) create mode 100644 thirdparty/libde265/HPKBUILD create mode 100644 thirdparty/libde265/SHA512SUM diff --git a/thirdparty/libde265/HPKBUILD b/thirdparty/libde265/HPKBUILD new file mode 100644 index 00000000..254bc0e8 --- /dev/null +++ b/thirdparty/libde265/HPKBUILD @@ -0,0 +1,69 @@ +# 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: leehom +# Maintainer: leehom + +pkgname=libde265 +pkgver=v1.0.14 +pkgrel=0 +pkgdesc="" +url="https://github.com/strukturag/libde265" +archs=("armeabi-v7a" "arm64-v8a") +license=("GPL-3.0" "LGPL-2.1") +depends=() +makedepends=() + +source="https://github.com/strukturag/$pkgname/archive/refs/tags/$pkgver.tar.gz" + +autounpack=true +downloadpackage=true +buildtools="cmake" +patchflag=true + +builddir=$pkgname-${pkgver:1} +packagename=$builddir.tar.gz + +prepare() { + mkdir -p $builddir/$ARCH-build +} + +build() { + cd $builddir + ${OHOS_SDK}/native/build-tools/cmake/bin/cmake "$@" -DENABLE_ENCODER=ON -DENABLE_SDL=OFF -B$ARCH-build -S./ > $buildlog 2>&1 + $MAKE VERBOSE=1 -C $ARCH-build >> $buildlog 2>&1 + ret=$? + cd $OLDPWD + return $ret + +} + +package() { + cd $builddir + $MAKE VERBOSE=1 -C $ARCH-build install >> $buildlog 2>&1 + cd $OLDPWD + + +} + +check() { + echo "The test must be on an OpenHarmony device!" + # 测试方式 + # 进入构建目录 + # 执行: ./dec265 +} + +# 清理环境 +cleanbuild(){ + rm -rf ${PWD}/$builddir #${PWD}/$packagename +} diff --git a/thirdparty/libde265/SHA512SUM b/thirdparty/libde265/SHA512SUM new file mode 100644 index 00000000..1510b2ad --- /dev/null +++ b/thirdparty/libde265/SHA512SUM @@ -0,0 +1 @@ +670482a5304635847d338eb49af18732a71bcc72eb52d77ca558f1f60e1fc6caabd293a02a700badc211cac7b5e14715d6c7810d766fa1f132dd0b4dfc22059a libde265-1.0.14.tar.gz -- Gitee From ecb58963e6559929bdfed59fbdbe29c549b89aa1 Mon Sep 17 00:00:00 2001 From: liulihong Date: Wed, 27 Dec 2023 16:49:58 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E6=8F=90=E4=BA=A4libhevc=E5=BA=93=E7=BC=96?= =?UTF-8?q?=E8=AF=91=E7=9B=B8=E5=85=B3=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: liulihong --- thirdparty/libhevc/HPKBUILD | 94 +++++++++++++++++++++++ thirdparty/libhevc/SHA512SUM | 1 + thirdparty/libhevc/libhevc_ohos_pkg.patch | 27 +++++++ 3 files changed, 122 insertions(+) create mode 100644 thirdparty/libhevc/HPKBUILD create mode 100644 thirdparty/libhevc/SHA512SUM create mode 100644 thirdparty/libhevc/libhevc_ohos_pkg.patch diff --git a/thirdparty/libhevc/HPKBUILD b/thirdparty/libhevc/HPKBUILD new file mode 100644 index 00000000..d0cd1dbe --- /dev/null +++ b/thirdparty/libhevc/HPKBUILD @@ -0,0 +1,94 @@ +# 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: leehom +# Maintainer: leehom + +pkgname=libhevc +pkgver=ae47a49ef45d20ee475c2b4fe1af482b18096c77 +pkgrel=0 +pkgdesc="" +url="https://android.googlesource.com/platform/external/libhevc" +archs=("armeabi-v7a" "arm64-v8a") +license=("Apache License 2.0") +depends=() +makedepends=() + +source="https://android.googlesource.com/platform/external/$pkgname/+archive/$pkgver.tar.gz" +# 自动解压文件会分散,不自动解压,需手动解压到文件夹中 +autounpack=false +downloadpackage=true +buildtools="cmake" +patchflag=true + +builddir=$pkgname-$pkgver +packagename=$builddir.tar.gz +systempro= + +prepare() { + if [ "$patchflag" == true ] + then + # 需要手动解压 + mkdir $builddir + tar -xzf $packagename -C ./$builddir + cd $builddir + patch -p1 < ../libhevc_ohos_pkg.patch + cd $OLDPWD + patchflag=false + fi + if [ $ARCH == "armeabi-v7a" ] + then + systempro="aarch32" + elif [ $ARCH == "arm64-v8a" ] + then + systempro="aarch64" + else + echo "${ARCH} not support" + return -1 + fi + mkdir -p $builddir/$ARCH-build + +} + +build() { + cd $builddir + ${OHOS_SDK}/native/build-tools/cmake/bin/cmake -DCMAKE_TOOLCHAIN_FILE=${OHOS_SDK}/native/build/cmake/ohos.toolchain.cmake \ + -DCMAKE_SYSTEM_PROCESSOR=$systempro -DCMAKE_C_FLAGS="-DENABLE_NEON" -DCMAKE_CXX_FLAGS="-DENABLE_NEON" -B$ARCH-build -S ./ > $buildlog 2>&1 + $MAKE VERBOSE=1 -C $ARCH-build >> $buildlog 2>&1 + ret=$? + cd $OLDPWD + return $ret + +} + +package() { + # 不能make install 需要手动拷贝静态库文件 + cd $builddir/$ARCH-build + mkdir -p $LYCIUM_ROOT/usr/$pkgname/$ARCH/lib/ + cp *.a $LYCIUM_ROOT/usr/$pkgname/$ARCH/lib/ + ret=$? + cd $OLDPWD + return $ret + + +} + +check() { + echo "The test must be on an OpenHarmony device!" + # 测试方式 暂时没有编译可执行测试程序 +} + +# 清理环境 +cleanbuild(){ + rm -rf ${PWD}/$builddir #${PWD}/$packagename +} diff --git a/thirdparty/libhevc/SHA512SUM b/thirdparty/libhevc/SHA512SUM new file mode 100644 index 00000000..9b22f69f --- /dev/null +++ b/thirdparty/libhevc/SHA512SUM @@ -0,0 +1 @@ +4f1f496644aef5d50eca46a4f3082ae78d14ee968d3fcc5292a2a156d833bfbbb7101af13e078df2f802ca38b3bd9ac5be90f62a1ab543f8306b6c18c707f82b libhevc-ae47a49ef45d20ee475c2b4fe1af482b18096c77.tar.gz diff --git a/thirdparty/libhevc/libhevc_ohos_pkg.patch b/thirdparty/libhevc/libhevc_ohos_pkg.patch new file mode 100644 index 00000000..640e102d --- /dev/null +++ b/thirdparty/libhevc/libhevc_ohos_pkg.patch @@ -0,0 +1,27 @@ +diff -Naur libhevc-ae47a49ef45d20ee475c2b4fe1af482b18096c77/CMakeLists.txt libhevc-ae47a49ef45d20ee475c2b4fe1af482b18096c77_new/CMakeLists.txt +--- libhevc-ae47a49ef45d20ee475c2b4fe1af482b18096c77/CMakeLists.txt 2023-12-22 11:31:37.133000000 +0800 ++++ libhevc-ae47a49ef45d20ee475c2b4fe1af482b18096c77_new/CMakeLists.txt 2023-12-25 20:25:47.427510447 +0800 +@@ -38,8 +38,8 @@ + include("${HEVC_ROOT}/decoder/libhevcdec.cmake") + include("${HEVC_ROOT}/encoder/libhevcenc.cmake") + +-include("${HEVC_ROOT}/test/decoder/hevcdec.cmake") +-include("${HEVC_ROOT}/test/encoder/hevcenc.cmake") ++#include("${HEVC_ROOT}/test/decoder/hevcdec.cmake") ++#include("${HEVC_ROOT}/test/encoder/hevcenc.cmake") + +-include("${HEVC_ROOT}/fuzzer/hevc_dec_fuzzer.cmake") +-include("${HEVC_ROOT}/fuzzer/hevc_enc_fuzzer.cmake") ++#include("${HEVC_ROOT}/fuzzer/hevc_dec_fuzzer.cmake") ++#include("${HEVC_ROOT}/fuzzer/hevc_enc_fuzzer.cmake") +diff -Naur libhevc-ae47a49ef45d20ee475c2b4fe1af482b18096c77/common/common.cmake libhevc-ae47a49ef45d20ee475c2b4fe1af482b18096c77_new/common/common.cmake +--- libhevc-ae47a49ef45d20ee475c2b4fe1af482b18096c77/common/common.cmake 2023-12-22 11:31:37.268000000 +0800 ++++ libhevc-ae47a49ef45d20ee475c2b4fe1af482b18096c77_new/common/common.cmake 2023-12-25 20:27:33.288392305 +0800 +@@ -60,6 +60,7 @@ + "${HEVC_ROOT}/common/ihevc_weighted_pred.c") + + include_directories(${HEVC_ROOT}/common) ++ include_directories(${HEVC_ROOT}/common/arm) + + # arm/x86 sources + if("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "aarch64") -- Gitee