diff --git a/0001-LSHW-returns-a-multi-element-array-when-querying-mem.patch b/0001-LSHW-returns-a-multi-element-array-when-querying-mem.patch new file mode 100644 index 0000000000000000000000000000000000000000..3878d3f556651e28d81514e5f28ef00de64e26fa --- /dev/null +++ b/0001-LSHW-returns-a-multi-element-array-when-querying-mem.patch @@ -0,0 +1,78 @@ +From c2a3fb6efb854a9e10804f67fef0764042c2d6c5 Mon Sep 17 00:00:00 2001 +From: liuzhilin +Date: Fri, 22 Dec 2023 16:54:15 +0800 +Subject: [PATCH] LSHW returns a multi-element array when querying memory size + +--- + src/dsysinfo.cpp | 36 +++++++++++++++++++++++++++++------- + 1 file changed, 29 insertions(+), 7 deletions(-) + +diff --git a/src/dsysinfo.cpp b/src/dsysinfo.cpp +index d3f137b..d8914cc 100644 +--- a/src/dsysinfo.cpp ++++ b/src/dsysinfo.cpp +@@ -17,6 +17,7 @@ + #include + #include + #include ++#include + #include + + #ifdef Q_OS_LINUX +@@ -33,6 +34,12 @@ + + DCORE_BEGIN_NAMESPACE + ++#ifdef QT_DEBUG ++Q_LOGGING_CATEGORY(logSysInfo, "dtk.dsysinfo") ++#else ++Q_LOGGING_CATEGORY(logSysInfo, "dtk.dsysinfo", QtInfoMsg) ++#endif ++ + class Q_DECL_HIDDEN DSysInfoPrivate + { + public: +@@ -1087,18 +1094,33 @@ qint64 DSysInfo::memoryInstalledSize() + } + + const QByteArray &lshwInfoJson = lshw.readAllStandardOutput(); +- QJsonArray lshwResultArray = QJsonDocument::fromJson(lshwInfoJson).array(); +- if (!lshwResultArray.isEmpty()) { +- QJsonValue memoryHwInfo = lshwResultArray.first(); +- QString id = memoryHwInfo.toObject().value("id").toString(); +- Q_ASSERT(id == "memory"); +- siGlobal->memoryInstalledSize = memoryHwInfo.toObject().value("size").toDouble(); // TODO: check "units" is "bytes" ? ++ QJsonParseError error; ++ auto doc = QJsonDocument::fromJson(lshwInfoJson, &error); ++ if (error.error != QJsonParseError::NoError) { ++ qCWarning(logSysInfo(), "parse failed, expect json doc from lshw command"); ++ return -1; ++ } ++ ++ if (!doc.isArray()) { ++ qCWarning(logSysInfo(), "parse failed, expect array"); ++ return -1; ++ } ++ ++ QJsonArray lshwResultArray = doc.array(); ++ for (const QJsonValue value : lshwResultArray) { ++ QJsonObject obj = value.toObject(); ++ if (obj.contains("id") && obj.value("id").toString() == "memory") { ++ siGlobal->memoryInstalledSize = obj.value("size").toDouble(); // TODO: check "units" is "bytes" ? ++ break; ++ } + } + } + ++ Q_ASSERT(siGlobal->memoryInstalledSize > 0); + return siGlobal->memoryInstalledSize; +-#endif ++#else + return -1; ++#endif + } + + /*! +-- +2.39.3 + diff --git a/README.en.md b/README.en.md deleted file mode 100644 index b3d509c2831a68fdc9a2273aca51ae56146f31bd..0000000000000000000000000000000000000000 --- a/README.en.md +++ /dev/null @@ -1,36 +0,0 @@ -# dtkcore - -#### Description -dtkcore - -#### Software Architecture -Software architecture description - -#### Installation - -1. xxxx -2. xxxx -3. xxxx - -#### Instructions - -1. xxxx -2. xxxx -3. xxxx - -#### Contribution - -1. Fork the repository -2. Create Feat_xxx branch -3. Commit your code -4. Create Pull Request - - -#### Gitee Feature - -1. You can use Readme\_XXX.md to support different languages, such as Readme\_en.md, Readme\_zh.md -2. Gitee blog [blog.gitee.com](https://blog.gitee.com) -3. Explore open source project [https://gitee.com/explore](https://gitee.com/explore) -4. The most valuable open source project [GVP](https://gitee.com/gvp) -5. The manual of Gitee [https://gitee.com/help](https://gitee.com/help) -6. The most popular members [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/) diff --git a/README.md b/README.md deleted file mode 100644 index cc231656e9f7fa530878a1cefdaee32d1a1099f8..0000000000000000000000000000000000000000 --- a/README.md +++ /dev/null @@ -1,37 +0,0 @@ -# dtkcore - -#### 介绍 -dtkcore - -#### 软件架构 -软件架构说明 - - -#### 安装教程 - -1. xxxx -2. xxxx -3. xxxx - -#### 使用说明 - -1. xxxx -2. xxxx -3. xxxx - -#### 参与贡献 - -1. Fork 本仓库 -2. 新建 Feat_xxx 分支 -3. 提交代码 -4. 新建 Pull Request - - -#### 码云特技 - -1. 使用 Readme\_XXX.md 来支持不同的语言,例如 Readme\_en.md, Readme\_zh.md -2. 码云官方博客 [blog.gitee.com](https://blog.gitee.com) -3. 你可以 [https://gitee.com/explore](https://gitee.com/explore) 这个地址来了解码云上的优秀开源项目 -4. [GVP](https://gitee.com/gvp) 全称是码云最有价值开源项目,是码云综合评定出的优秀开源项目 -5. 码云官方提供的使用手册 [https://gitee.com/help](https://gitee.com/help) -6. 码云封面人物是一档用来展示码云会员风采的栏目 [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/) diff --git a/dtkcore-5.5.35.tar.gz b/dtkcore-5.5.35.tar.gz deleted file mode 100644 index 9b3562483968414dafa7207d37fddcce65ac8f2b..0000000000000000000000000000000000000000 Binary files a/dtkcore-5.5.35.tar.gz and /dev/null differ diff --git a/dtkcore-5.6.8.2.tar.gz b/dtkcore-5.6.8.2.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..5294542c26c94d31f12acc2d496a6572f3054e48 Binary files /dev/null and b/dtkcore-5.6.8.2.tar.gz differ diff --git a/dtkcore.spec b/dtkcore.spec index 2f81fe6d34e31238a2a853fd1d0a310b0bf59548..b6a923d2611844a68e4cde8579b747372cca0417 100644 --- a/dtkcore.spec +++ b/dtkcore.spec @@ -1,10 +1,12 @@ Name: dtkcore -Version: 5.5.35 -Release: 1 +Version: 5.6.8.2 +Release: 2%{?dist}.01 Summary: Deepin tool kit core modules License: LGPLv3+ URL: https://github.com/linuxdeepin/dtkcore -Source0: %{name}-%{version}.tar.gz +Source0: %{url}/archive/%{version}/%{name}-%{version}.tar.gz + +Patch0001: 0001-LSHW-returns-a-multi-element-array-when-querying-mem.patch BuildRequires: gcc-c++ #BuildRequires: annobin @@ -14,14 +16,18 @@ BuildRequires: gtest-devel BuildRequires: qt5-qttools-devel BuildRequires: dtkcommon-devel BuildRequires: qt5-qtbase-private-devel -BuildRequires: make +BuildRequires: make cmake +BuildRequires: doxygen libicu-devel +BuildRequires: uchardet-devel +BuildRequires: cmake-rpm-macros + +Requires: dtkcommon # since f30 Obsoletes: deepin-tool-kit <= 0.3.3 Obsoletes: deepin-tool-kit-devel <= 0.3.3 Obsoletes: dtksettings <= 0.1.7 Obsoletes: dtksettings-devel <= 0.1.7 -Obsoletes: dtkcore2 %description Deepin tool kit core modules. @@ -36,16 +42,13 @@ Requires: qt5-qtbase-devel%{?_isa} Header files and libraries for %{name}. %prep -%autosetup -p1 +%autosetup -n %{name}-%{version} -p1 %build # help find (and prefer) qt5 utilities, e.g. qmake, lrelease export PATH=%{_qt5_bindir}:$PATH -%qmake_qt5 PREFIX=%{_prefix} \ - DTK_VERSION=%{version} \ - LIB_INSTALL_DIR=%{_libdir} \ - BIN_INSTALL_DIR=%{_libexecdir}/dtk5 \ - TOOL_INSTALL_DIR=%{_libexecdir}/dtk5 +%cmake + %make_build %install @@ -55,41 +58,43 @@ export PATH=%{_qt5_bindir}:$PATH %doc README.md %license LICENSE %{_libdir}/lib%{name}.so* -%dir %{_libexecdir}/dtk5/ -%{_libexecdir}/dtk5/dtk-settings -%{_libexecdir}/dtk5/dtk-license.py -%{_libexecdir}/dtk5/dtk-translate.py -%{_libexecdir}/dtk5/deepin-os-release -%{_bindir}/qdbusxml2cpp-fix +%{_bindir}/* %files devel -%doc doc/Specification.md -%{_includedir}/libdtk-*/ +%doc docs/Specification.md %{_qt5_archdatadir}/mkspecs/modules/*.pri %{_libdir}/cmake/DtkCore/ %{_libdir}/cmake/DtkCMake/ %{_libdir}/cmake/DtkTools/ %{_libdir}/pkgconfig/dtkcore.pc %{_libdir}/lib%{name}.so +%{_includedir}/dtk5/DCore/* +%{_usr}/lib/debug%{_libdir}/dtk5/DCore/bin/*.debug +%{_libdir}/cmake/DtkDConfig/DtkDConfigConfig.cmake +%{_libdir}/dtk5/DCore/bin/* +%{_libdir}/qt5/mkspecs/features/dtk_install_dconfig.prf +%{_datadir}/qt5/doc/dtkcore.qch + %changelog -* Mon Jul 24 2023 leeffo - 5.5.35-1 -- update: upgrade to version 5.5.35 +* Fri Dec 22 2023 liuzhilin - 5.6.8.2-2.01 +- fix: LSHW-returns-a-multi-element-array-when-querying-mem(bugid:228681) + +* Tue Oct 10 2023 liweigang - 5.6.8.2-2 +- spec: change Dcore path -* Wed Mar 22 2023 liweiganga - 5.5.19-1 -- update: update to 5.5.19 +* Mon Oct 09 2023 liweigang - 5.6.8.2-1 +- update: update to verison 5.6.8.2 -* Thu Jul 28 2022 liweiganga - 5.4.11.2-2 -- fix install conflict +* Sun Sep 03 2023 mahailiang - 5.6.8-2 +- spec: change Dcore path -* Tue Jul 19 2022 konglidong - 5.4.11.2-1 -- Update to 5.4.11.2 +* Wed Aug 16 2023 liuzhilin - 5.6.8-1 +- update: update to 5.6.8 -* Thu Jul 15 2021 weidong - 5.2.2.3-2 -- Format specfile. +* Fri Dec 23 2022 liweiganga - 5.5.35-1 +- update: update to 5.5.35 -* Mon Jul 12 2021 weidong - 5.2.2.3-1 -- Update 5.2.2.3 +* Mon Jun 13 2022 uoser - 5.5.19-1.02 +- update: update to 5.5.19-1.02 -* Thu Jul 30 2020 openEuler Buildteam - 5.2.1-1 -- Package init diff --git a/dtkcore.yaml b/dtkcore.yaml deleted file mode 100644 index 501413511db14e4807adf8bf065de5cb414957e3..0000000000000000000000000000000000000000 --- a/dtkcore.yaml +++ /dev/null @@ -1,4 +0,0 @@ -version_control: github -src_repo: linuxdeepin/dtkcore -tag_prefix: ^v -seperator: .