当前仓库属于关闭状态,部分功能使用受限,详情请查阅 仓库状态说明
31 Star 197 Fork 199

OpenHarmony-SIG/tpc_c_cplusplus
关闭

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
HPKBUILD 2.87 KB
一键复制 编辑 原始数据 按行查看 历史
# 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: liulihong <llh_01129@163.com> modify : lpzhong <278527840@qq.com>
# Maintainer: liulihong <llh_01129@163.com>
pkgname=openjpeg
pkgver=v2.5.0
pkgrel=0
pkgdesc="OpenJPEG is an open-source JPEG 2000 codec written in C language."
url="https://github.com/uclouvain/openjpeg"
archs=("armeabi-v7a" "arm64-v8a")
license=("BSD")
depends=("libpng" "lcms2" "tiff" "zlib")
makedepends=()
# 官方下载地址https://github.com/uclouvain/$pkgname/archive/refs/tags/$pkgver.tar.gz受网络影响可能存在下载失败的情况,现使用gitee镜像可以与官方仓库保持同步
source="https://gitee.com/mirrors/$pkgname/repository/archive/$pkgver.zip"
test_source="https://gitee.com/lycium_pkg_mirror/openjpeg-data/repository/archive/master.zip"
autounpack=true
downloadpackage=true
builddir=$pkgname-${pkgver}
packagename=$builddir.zip
test_data=openjpeg-data
test_ver=master
prepare() {
mkdir -p $builddir/$ARCH-build
}
build() {
cd $builddir
# -DCMAKE_C_FLAGS="-ffp-contract=off" 禁用 floating-point expression contraction.否则会因为浮点精度问题造成测试用例失败。
PKG_CONFIG_LIBDIR="" ${OHOS_SDK}/native/build-tools/cmake/bin/cmake "$@" -DBUILD_UNIT_TESTS=ON -DBUILD_TESTING=ON \
-DOPJ_DATA_ROOT=${PKGBUILD_ROOT}/openjpeg-data -DCMAKE_C_FLAGS="-ffp-contract=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 -C $ARCH-build install >> $buildlog 2>&1
cd $OLDPWD
}
check() {
# 下载测试数据
if [ ! -f "$test_data.zip" ]
then
curl -f -L $test_source --output $test_data.zip
if [ $? -ne 0 ]
then
rm -f $test_data.zip
echo "download openjpeg data failed!"
return 1
fi
unzip -q $test_data.zip
mv ${test_data}-${test_ver} ${test_data}
fi
# 删除测试中cmake的路径
cd $builddir/$ARCH-build
grep -rn "\".*\/cmake\"" | while read line;
do
{
name=${line%%:*}
sed -i "s/\".*\/cmake\"/\"cmake\"/g" $name
}
done
cd $OLDPWD
echo "The test must be on an OpenHarmony device!"
# real test CMD
# TODO
# ctest
}
# 清理环境
cleanbuild(){
rm -rf ${PWD}/$builddir #${PWD}/$packagename
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/openharmony-sig/tpc_c_cplusplus.git
git@gitee.com:openharmony-sig/tpc_c_cplusplus.git
openharmony-sig
tpc_c_cplusplus
tpc_c_cplusplus
master

搜索帮助