From 2c2c3635e7be6d1901f89e6be1a1dd3751483ff2 Mon Sep 17 00:00:00 2001 From: terrencetang Date: Tue, 22 Aug 2023 16:58:54 +0800 Subject: [PATCH] add DLib Signed-off-by: terrencetang --- thirdparty/DLib/DLib_oh_pkg.patch | 13 ++++++ thirdparty/DLib/HPKBUILD | 72 +++++++++++++++++++++++++++++++ thirdparty/DLib/SHA512SUM | 1 + 3 files changed, 86 insertions(+) create mode 100644 thirdparty/DLib/DLib_oh_pkg.patch create mode 100644 thirdparty/DLib/HPKBUILD create mode 100644 thirdparty/DLib/SHA512SUM diff --git a/thirdparty/DLib/DLib_oh_pkg.patch b/thirdparty/DLib/DLib_oh_pkg.patch new file mode 100644 index 00000000..fdbff839 --- /dev/null +++ b/thirdparty/DLib/DLib_oh_pkg.patch @@ -0,0 +1,13 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 975b55b..648ed61 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -62,7 +62,8 @@ if(BUILD_DVision) + src/DVision/PixelPointFile.cpp + ${SRCS}) + + find_package(Boost QUIET) # For dynamic_bitset ++ include_directories(${Boost_INCLUDE_DIR}) + if (Boost_FOUND) + set(HDRS include/DVision/BRIEF.h ${HDRS}) + set(SRCS src/DVision/BRIEF.cpp ${SRCS}) diff --git a/thirdparty/DLib/HPKBUILD b/thirdparty/DLib/HPKBUILD new file mode 100644 index 00000000..12feddc9 --- /dev/null +++ b/thirdparty/DLib/HPKBUILD @@ -0,0 +1,72 @@ +# 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: TangShaoteng , zhaoxu <357489213@qq.com> +# Maintainer: TangShaoteng + +pkgname=DLib +pkgver=v1.1-free +pkgrel=0 +pkgdesc="C++ library with several utilities" +url="https://github.com/dorian3d/DLib" +archs=("armeabi-v7a" "arm64-v8a") +license=("Copyright (c) 2015 Dorian Galvez-Lopez. http://doriangalvez.com All rights reserved.") +depends=("boost" "opencv_3.4.1") +makedepends=() +source="https://github.com/dorian3d/$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 + cd $builddir + + if $patchflag + then + # 添加boost依赖库头文件查询路径 + patch -p1 < ../DLib_oh_pkg.patch + # patch只需要打一次,关闭打patch + patchflag=false + fi + + cd $OLDPWD +} + +build() { + cd $builddir + ${OHOS_SDK}/native/build-tools/cmake/bin/cmake "$@" -DOHOS_ARCH=$ARCH -B$ARCH-build -S./ -L > `pwd`/$ARCH-build/build.log 2>&1 + make VERBOSE=1 -j4 -C $ARCH-build >> `pwd`/$ARCH-build/build.log 2>&1 + ret=$? + cd $OLDPWD + return $ret +} + +package() { + cd $builddir + make -C $ARCH-build install >> `pwd`/$ARCH-build/build.log 2>&1 + cd $OLDPWD +} + +check() { + echo "The test must be on an OpenHarmony device!" + # TODO +} + +cleanbuild() { + rm -rf ${PWD}/$builddir #${PWD}/$packageName +} diff --git a/thirdparty/DLib/SHA512SUM b/thirdparty/DLib/SHA512SUM new file mode 100644 index 00000000..7135fc8a --- /dev/null +++ b/thirdparty/DLib/SHA512SUM @@ -0,0 +1 @@ +eafe6366650b2c390640cd8498bc1c24d1255307409476e1b953c6532d91bbadebcbcc896c0040d9e124696acf06e7bdbd8fdda67a783e56d7a9f4e8a329fe92 DLib-1.1-free.tar.gz -- Gitee