diff --git a/thirdparty/stb/HPKBUILD b/thirdparty/stb/HPKBUILD new file mode 100755 index 0000000000000000000000000000000000000000..320e4540572e8acb56d0a1577c29abe249058d39 --- /dev/null +++ b/thirdparty/stb/HPKBUILD @@ -0,0 +1,85 @@ +# Contributor: 小肉头君 +# Maintainer: 小肉头君 + +pkgname=stb +pkgver=master +pkgrel=0 +pkgdesc="stb single-file public domain libraries for C/C++" +url="https://github.com/nothings/stb" +archs=("armeabi-v7a" "arm64-v8a") +license=("MIT license") +source="https://github.com/nothings/$pkgname.git" +commitid=5736b15f7ea0ffb08dd38af21067c314d6a3aae9 + +autounpack=false +downloadpackage=false +buildtools="make" + +builddir=$pkgname-${commitid} +packagename=$builddir.zip +source envset.sh +host= +cloneflag=true + +prepare() { + if [ $cloneflag == true ] + then + git clone -b $pkgver $source $builddir + cd $builddir + git reset --hard $commitid + cd .. + cloneflag=false + fi + cp -rf $builddir $pkgname-$ARCH-build + if [ $ARCH == "armeabi-v7a" ] + then + setarm32ENV + host=arm-linux + fi + if [ $ARCH == "arm64-v8a" ] + then + setarm64ENV + host=aarch64-linux + fi +} + +build() { + # 头文件库不需要编译 + return 0 +} + +# 安装打包 +package() { + cd $pkgname-$ARCH-build + mkdir -p $LYCIUM_ROOT/usr/$pkgname/$ARCH/include/ + cp *.h $LYCIUM_ROOT/usr/$pkgname/$ARCH/include/ + cd $OLDPWD +} + +# 测试,需要在 ohos 设备上进行 +check() { + cd $pkgname-$ARCH-build + # 用sed的原因是Makefile中想要生成一个可执行文件,但是那个源文件是没有main函数的,编译会报错,所以注释掉这一行 + sed 's/$(CC) $(INCLUDES) $(CPPFLAGS)/#$(CC) $(INCLUDES) $(CPPFLAGS)/1' tests/Makefile > tests/tmp_Makefile + mv tests/tmp_Makefile tests/Makefile + make -C tests > `pwd`/build.log + mkdir -p output + cd $OLDPWD + if [ $ARCH == "armeabi-v7a" ] + then + unsetarm32ENV + fi + if [ $ARCH == "arm64-v8a" ] + then + unsetarm64ENV + fi + unset host + echo "The test must be on an OpenHarmony device!" + # real test CMD,会在output目录生成图片文件 + # ./tests/image_write_test +} + +# 清理环境 +cleanbuild() { + rm -rf ${PWD}/$builddir #${PWD}/$packagename +} \ No newline at end of file diff --git a/thirdparty/stb/OAT.xml b/thirdparty/stb/OAT.xml new file mode 100755 index 0000000000000000000000000000000000000000..96937ea08644b79312d0ced7c0b3eb1e845108ee --- /dev/null +++ b/thirdparty/stb/OAT.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/thirdparty/stb/README.OpenSource b/thirdparty/stb/README.OpenSource new file mode 100755 index 0000000000000000000000000000000000000000..5d94f82bdcb4a60a210b66160966c210ebfa6ea3 --- /dev/null +++ b/thirdparty/stb/README.OpenSource @@ -0,0 +1,11 @@ +[ + { + "Name": "stb", + "License": "MIT License", + "License File": "LICENSES", + "Version Number": "master", + "Owner": "xuchenci@isoftstone.com", + "Upstream URL": "https://github.com/nothings/stb/archive/refs/heads/master.zip", + "Description": "Used image data needs to be loaded into the village, or when scaling or saving images" + } +] \ No newline at end of file diff --git a/thirdparty/stb/README_zh.md b/thirdparty/stb/README_zh.md new file mode 100755 index 0000000000000000000000000000000000000000..692683837e516dd20bc8da143a86dd98d99bdc9f --- /dev/null +++ b/thirdparty/stb/README_zh.md @@ -0,0 +1,12 @@ +# stb三方库说明 +## 功能简介 +stb是一个图像读写库 +## 使用约束 +- IDE版本:DevEco Studio 3.1 Beta2 +- SDK版本:ohos_sdk_public 3.2.11.9 (API Version 9 Release) +- 三方库版本:master +- 当前适配的功能:图像加载、写出、缩放等功能 +- [MIT License](https://github.com/nothings/stb/blob/master/LICENSE) + +## 集成方式 ++ [应用hap包集成](docs/hap_integrate.md) \ No newline at end of file diff --git a/thirdparty/stb/SHA512SUM b/thirdparty/stb/SHA512SUM new file mode 100755 index 0000000000000000000000000000000000000000..a061408f0cbf7a1e9390ef1d985e5605b199219c --- /dev/null +++ b/thirdparty/stb/SHA512SUM @@ -0,0 +1 @@ +a983be551a79dd566debf265d730e8dcbeeae678e04981828448682dbde47a1c0d04decb213cebea57db57ab2c258c0081fe4c9bb875369a94842eccd12af793 stb-master.zip diff --git a/thirdparty/stb/docs/hap_integrate.md b/thirdparty/stb/docs/hap_integrate.md new file mode 100755 index 0000000000000000000000000000000000000000..6fa6fdf8e82267849661f4a39e7404c81ed0e128 --- /dev/null +++ b/thirdparty/stb/docs/hap_integrate.md @@ -0,0 +1,91 @@ +# stb集成到应用hap + +本库是在RK3568开发板上基于OpenHarmony3.2 Release版本的镜像验证的,如果是从未使用过RK3568,可以先查看[润和RK3568开发板标准系统快速上手](https://gitee.com/openharmony-sig/knowledge_demo_temp/tree/master/docs/rk3568_helloworld)。 + +## 开发环境 + +- ubuntu20.04 +- [OpenHarmony3.2Release镜像](https://gitee.com/link?target=https%3A%2F%2Frepo.huaweicloud.com%2Fopenharmony%2Fos%2F3.2-Release%2Fdayu200_standard_arm32.tar.gz) +- [ohos_sdk_public 3.2.11.9 (API Version 9 Release)](https://gitee.com/link?target=https%3A%2F%2Frepo.huaweicloud.com%2Fopenharmony%2Fos%2F3.2-Release%2Fohos-sdk-windows_linux-public.tar.gz) +- [DevEco Studio 3.1 Beta2](https://gitee.com/link?target=https%3A%2F%2Fcontentcenter-vali-drcn.dbankcdn.cn%2Fpvt_2%2FDeveloperAlliance_package_901_9%2Ff3%2Fv3%2FuJyuq3syQ2ak4hE1QZmAug%2Fdevecostudio-windows-3.1.0.400.zip%3FHW-CC-KV%3DV1%26HW-CC-Date%3D20230408T013335Z%26HW-CC-Expire%3D315360000%26HW-CC-Sign%3D96262721EDC9B34E6F62E66884AB7AE2A94C2A7B8C28D6F7FC891F46EB211A70) +- [准备三方库构建环境](../../../tools/README.md#编译环境准备) +- [准备三方库测试环境](../../../tools/README.md#ci环境准备) + +## 编译三方库 + +- 下载本仓库 + + ```shell + git clone https://gitee.com/openharmony-sig/tpc_c_cplusplus.git --depth=1 + ``` + +- 三方库目录结构 + + ```shell + tpc_c_cplusplus/thirdparty/stb #三方库stb的目录结构如下 + ├── docs #三方库相关文档的文件夹 + + + + ├── HPKBUILD #构建脚本 + ├── SHA512SUM #三方库校验文件 + ├── README.OpenSource #说明三方库源码的下载地址,版本,license等信息 + ├── README_zh.md + ``` + +- 将stb拷贝至tools/main目录下 + + ```shell + cd tpc_c_cplusplus + cp thirdparty/stb tools/main -rf + ``` + +- 在tools目录下编译三方库 + + 编译环境的搭建参考[准备三方库构建环境](../../../tools/README.md#编译环境准备) + + ```shell + cd tools + ./build.sh stb + ``` + +- 三方库头文件及生成的库 + + 在tools目录下会生成usr目录,该目录下存在已编译完成的32位和64位三方库 + + ```shell + stb/arm64-v8a stb/armeabi-v7a + ``` +- [测试三方库](#测试三方库) + +## 应用中使用三方库 + +- 在IDE的cpp目录下新增thirdparty目录,将编译生成的库拷贝到该目录下,如下图所示 +   + + ![thirdparty_install_dir](pic/stb_install_dir.png) + +- 在最外层(cpp目录下)CMakeLists.txt中添加如下语句 + + ```shell + #将三方库的头文件加入工程中 + target_include_directories(entry PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/stb/${OHOS_ARCH}/include) + ``` + + ![stb_usage](pic/stb_usage.png) + +## 测试三方库 + +三方库的测试使用原库自带的测试用例来做测试,[准备三方库测试环境](../../../tools/README.md#ci环境准备) + +进入到构建目录,执行如下命令ctest(arm64-v8a-build为构建64位的目录,armeabi-v7a-build为构建32位的目录) + + + ![stb_test](pic/stb_test.png) + +## 参考资料 + +- [润和RK3568开发板标准系统快速上手](https://gitee.com/openharmony-sig/knowledge_demo_temp/tree/master/docs/rk3568_helloworld) +- [OpenHarmony三方库地址](https://gitee.com/openharmony-tpc) +- [OpenHarmony知识体系](https://gitee.com/openharmony-sig/knowledge) +- [通过DevEco Studio开发一个NAPI工程](https://gitee.com/openharmony-sig/knowledge_demo_temp/blob/master/docs/napi_study/docs/hello_napi.md) diff --git a/thirdparty/stb/docs/pic/stb_install_dir.png b/thirdparty/stb/docs/pic/stb_install_dir.png new file mode 100755 index 0000000000000000000000000000000000000000..67fca1b5250138e70b732e596906df42ce49281f Binary files /dev/null and b/thirdparty/stb/docs/pic/stb_install_dir.png differ diff --git a/thirdparty/stb/docs/pic/stb_test.png b/thirdparty/stb/docs/pic/stb_test.png new file mode 100755 index 0000000000000000000000000000000000000000..4dbae86d1f46066599507dba077c5e960e314260 Binary files /dev/null and b/thirdparty/stb/docs/pic/stb_test.png differ diff --git a/thirdparty/stb/docs/pic/stb_usage.png b/thirdparty/stb/docs/pic/stb_usage.png new file mode 100755 index 0000000000000000000000000000000000000000..4c1352b68b9b579d725883494a07a5b46f4c85af Binary files /dev/null and b/thirdparty/stb/docs/pic/stb_usage.png differ diff --git a/thirdparty/stb/single/PlainReport_stb.txt b/thirdparty/stb/single/PlainReport_stb.txt new file mode 100644 index 0000000000000000000000000000000000000000..b212024c6514dfca6e0f708c1595b6d90aa7fd64 --- /dev/null +++ b/thirdparty/stb/single/PlainReport_stb.txt @@ -0,0 +1,19 @@ + +Invalid File Type Total Count: 0 + +License Not Compatible Total Count: 0 + +License Header Invalid Total Count: 0 + +Copyright Header Invalid Total Count: 0 + +No License File Total Count: 1 +Name: No License File Content: Line: 0 Project: stb File: /home/chenxu/env/stb + +No Readme.OpenSource Total Count: 0 + +No Readme Total Count: 0 + +Import Invalid Total Count: 0 + +Redundant License File Total Count: 0 diff --git a/thirdparty/stb/single/PlainReport_stb_Detail.txt b/thirdparty/stb/single/PlainReport_stb_Detail.txt new file mode 100644 index 0000000000000000000000000000000000000000..be5068239a9464a11617daa970478ee2506c9810 --- /dev/null +++ b/thirdparty/stb/single/PlainReport_stb_Detail.txt @@ -0,0 +1,117 @@ +========Report Basic Information======== + +Report User: null +Report Time: 2023-06-20T10:43:07Z +Report Tool: OAT +Report Tool Version: 2.0.0-beta.2 +Report Notes: Generated by OAT,If you have any questions or concerns, please create issue at https://gitee.com/openharmony-sig/tools_oat/issues +Report Command: java -jar ohos_ossaudittool-2.0.0-beta.2.jar -mode s -s /home/chenxu/env/stb -r /home/chenxu/env/stb -n stb + +========Report Project List======== + +Report Project Count: 1 +Project Begin 1/1: + +========Project Basic Information======== + +Project Name: stb +Project Home Page: stb +Project Branch: +Project Commit Id: +Project Version: +Project Main License: + +========Project Summary Information======== + +Project File Count: 15 +Project Normal File Count: 10 +Project Filtered File Count: 5 +Project Filtered By Header File Count: 0 + +Policy Filtered-FileName Count: 0 +Policy Filtered-FileType Count: 3 +Policy Filtered-LicenseHeader Count: 3 +Policy Filtered-Compatibility Count: 0 +Policy Filtered-Copyright Count: 3 + +Project License Count: 2 +Project Normal License Count: 2 +Project Abnormal License Count: 0 +Project Compatible License Count: 1 +Project Not Compatible License Count: 0 +Project Copyright Count: 1 +Project Normal Copyright Count: 1 +Project Abnormal Copyright Count: 0 + +Policy Not Passed-FileType Count: 0 +Policy Not Passed-Compatibility Count: 0 +Policy Not Passed-WrongLicenseHeader Count: 0 +Policy Not Passed-NoLicenseHeader Count: 0 +Policy Not Passed-WrongCopyright Count: 0 +Policy Not Passed-NoCopyright Count: 0 +Project License File: FALSE +Project README: TRUE +Project README.OpenSource: TRUE + +========Project Filtered File Information======== + +Project Filtered File txt /home/chenxu/env/stb/single/PlainReport_stb_Detail.txt FileNameFilter:[OAT*.xml, zunit, signature, Makefile, MANIFEST.MF, Kconfig, *.crt, *.markdown, *.git, .mk, .ld, .gitkeep, .gitignore, .gitattributes, .config, *.txt, *.te, *.json, *.svg, *.swp, *.sandbox, *.rslp, *.rc, *.pydeps, *.properties, *.pluginmeta, *.php, *.sgml, .adoc, NEWS, *.patch, *.p7b, *.md, *.log, *.ini, *.html, *.htm, *.hml, *.hcs, __init__.py, MANIFEST.in, *.hcb, *.gradle, *.gen, *.dic, *.d, *.css, *.cmake, *.cer, *.build, *.aff, *.err, *.pro, *.clang-format, *.ld, *.babelrc, *.editorconfig, *.eslintignore, *.prettierrc, *.eslintrc.js, *.template, *.tmpl, *.vcproj, *.def, *.sln, *_contexts, *.vcxproj, *.vcxproj.filters, *.vcxproj.user, *visual_studio.sln, *.bundle, CERTIFICATE, SIGNATURE, *.lds, SConscript, *.pod, *.arb, *.repo, *.map, *.yml, *.config, *.cfg, *.conf, *.in] +Project Filtered File md /home/chenxu/env/stb/README_zh.md FileNameFilter:[OAT*.xml, zunit, signature, Makefile, MANIFEST.MF, Kconfig, *.crt, *.markdown, *.git, .mk, .ld, .gitkeep, .gitignore, .gitattributes, .config, *.txt, *.te, *.json, *.svg, *.swp, *.sandbox, *.rslp, *.rc, *.pydeps, *.properties, *.pluginmeta, *.php, *.sgml, .adoc, NEWS, *.patch, *.p7b, *.md, *.log, *.ini, *.html, *.htm, *.hml, *.hcs, __init__.py, MANIFEST.in, *.hcb, *.gradle, *.gen, *.dic, *.d, *.css, *.cmake, *.cer, *.build, *.aff, *.err, *.pro, *.clang-format, *.ld, *.babelrc, *.editorconfig, *.eslintignore, *.prettierrc, *.eslintrc.js, *.template, *.tmpl, *.vcproj, *.def, *.sln, *_contexts, *.vcxproj, *.vcxproj.filters, *.vcxproj.user, *visual_studio.sln, *.bundle, CERTIFICATE, SIGNATURE, *.lds, SConscript, *.pod, *.arb, *.repo, *.map, *.yml, *.config, *.cfg, *.conf, *.in] +Project Filtered File xml /home/chenxu/env/stb/OAT.xml FileNameFilter:[OAT*.xml, zunit, signature, Makefile, MANIFEST.MF, Kconfig, *.crt, *.markdown, *.git, .mk, .ld, .gitkeep, .gitignore, .gitattributes, .config, *.txt, *.te, *.json, *.svg, *.swp, *.sandbox, *.rslp, *.rc, *.pydeps, *.properties, *.pluginmeta, *.php, *.sgml, .adoc, NEWS, *.patch, *.p7b, *.md, *.log, *.ini, *.html, *.htm, *.hml, *.hcs, __init__.py, MANIFEST.in, *.hcb, *.gradle, *.gen, *.dic, *.d, *.css, *.cmake, *.cer, *.build, *.aff, *.err, *.pro, *.clang-format, *.ld, *.babelrc, *.editorconfig, *.eslintignore, *.prettierrc, *.eslintrc.js, *.template, *.tmpl, *.vcproj, *.def, *.sln, *_contexts, *.vcxproj, *.vcxproj.filters, *.vcxproj.user, *visual_studio.sln, *.bundle, CERTIFICATE, SIGNATURE, *.lds, SConscript, *.pod, *.arb, *.repo, *.map, *.yml, *.config, *.cfg, *.conf, *.in] +Project Filtered File txt /home/chenxu/env/stb/single/PlainReport_stb.txt FileNameFilter:[OAT*.xml, zunit, signature, Makefile, MANIFEST.MF, Kconfig, *.crt, *.markdown, *.git, .mk, .ld, .gitkeep, .gitignore, .gitattributes, .config, *.txt, *.te, *.json, *.svg, *.swp, *.sandbox, *.rslp, *.rc, *.pydeps, *.properties, *.pluginmeta, *.php, *.sgml, .adoc, NEWS, *.patch, *.p7b, *.md, *.log, *.ini, *.html, *.htm, *.hml, *.hcs, __init__.py, MANIFEST.in, *.hcb, *.gradle, *.gen, *.dic, *.d, *.css, *.cmake, *.cer, *.build, *.aff, *.err, *.pro, *.clang-format, *.ld, *.babelrc, *.editorconfig, *.eslintignore, *.prettierrc, *.eslintrc.js, *.template, *.tmpl, *.vcproj, *.def, *.sln, *_contexts, *.vcxproj, *.vcxproj.filters, *.vcxproj.user, *visual_studio.sln, *.bundle, CERTIFICATE, SIGNATURE, *.lds, SConscript, *.pod, *.arb, *.repo, *.map, *.yml, *.config, *.cfg, *.conf, *.in] +Project Filtered File md /home/chenxu/env/stb/docs/hap_integrate.md FileNameFilter:[OAT*.xml, zunit, signature, Makefile, MANIFEST.MF, Kconfig, *.crt, *.markdown, *.git, .mk, .ld, .gitkeep, .gitignore, .gitattributes, .config, *.txt, *.te, *.json, *.svg, *.swp, *.sandbox, *.rslp, *.rc, *.pydeps, *.properties, *.pluginmeta, *.php, *.sgml, .adoc, NEWS, *.patch, *.p7b, *.md, *.log, *.ini, *.html, *.htm, *.hml, *.hcs, __init__.py, MANIFEST.in, *.hcb, *.gradle, *.gen, *.dic, *.d, *.css, *.cmake, *.cer, *.build, *.aff, *.err, *.pro, *.clang-format, *.ld, *.babelrc, *.editorconfig, *.eslintignore, *.prettierrc, *.eslintrc.js, *.template, *.tmpl, *.vcproj, *.def, *.sln, *_contexts, *.vcxproj, *.vcxproj.filters, *.vcxproj.user, *visual_studio.sln, *.bundle, CERTIFICATE, SIGNATURE, *.lds, SConscript, *.pod, *.arb, *.repo, *.map, *.yml, *.config, *.cfg, *.conf, *.in] + +========Project Filtered Policy Information======== + +Policy Filtered-FileType-!archive binary /home/chenxu/env/stb/docs/pic/stb_install_dir.png stb/*.png +Policy Filtered-FileType-!archive binary /home/chenxu/env/stb/docs/pic/stb_test.png stb/*.png +Policy Filtered-FileType-!archive binary /home/chenxu/env/stb/docs/pic/stb_usage.png stb/*.png + +Policy Filtered-LicenseHeader MIT /home/chenxu/env/stb/HPKBUILD stb/HPKBUILD +Policy Filtered-LicenseHeader MIT /home/chenxu/env/stb/README.OpenSource README.OpenSource +Policy Filtered-LicenseHeader NoLicenseHeader /home/chenxu/env/stb/SHA512SUM stb/SHA512SUM + +Policy Filtered-Copyright NULL /home/chenxu/env/stb/HPKBUILD stb/HPKBUILD +Policy Filtered-Copyright NULL /home/chenxu/env/stb/README.OpenSource README.OpenSource +Policy Filtered-Copyright NULL /home/chenxu/env/stb/SHA512SUM stb/SHA512SUM + +========Project License Information======== + +Project Normal License MIT +Project Normal License NoLicenseHeader + +Project Compatible License MIT + +========Project Copyright Information======== + +Project Normal Copyright NULL + + +XXXXXXXXX Policy Not Passed Begin XXXXXXXXX + +XXXXXXXXX Policy Not Passed End XXXXXXXXX + +========Project OAT.xml======== +Project Config: + + + + + + + + + + + + + + + + + + + + + +Project End 1/1: