From 7cc39d475ce499d08187c3695b608650b80fc8b8 Mon Sep 17 00:00:00 2001 From: Boyuan Yang Date: Fri, 4 Jan 2019 01:06:18 -0500 Subject: [PATCH] Prepare new upload --- debian/changelog | 7 + debian/control | 2 +- debian/copyright | 4 +- .../0001-docs-add-document-for-DObject.patch | 221 ++++++++++++++++++ ...-buildQMAKEProject-test-function-for.patch | 55 +++++ ...ject-c-cxx-ld-flags-on-build-deepin-.patch | 33 +++ debian/patches/series | 3 + 7 files changed, 322 insertions(+), 3 deletions(-) create mode 100644 debian/patches/0001-docs-add-document-for-DObject.patch create mode 100644 debian/patches/0002-refactor-add-the-buildQMAKEProject-test-function-for.patch create mode 100644 debian/patches/0003-fix-use-main-project-c-cxx-ld-flags-on-build-deepin-.patch create mode 100644 debian/patches/series diff --git a/debian/changelog b/debian/changelog index 0ee9e1d..da9ed48 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +dtkcore (2.0.9.14-2) unstable; urgency=medium + + * debian/patches: Add patches from upstream to fix compatibility + with debhelper copmat v12. + + -- Boyuan Yang Sat, 05 Jan 2019 21:04:05 -0500 + dtkcore (2.0.9.14-1) unstable; urgency=medium * New upstream release 2.0.9.14. diff --git a/debian/control b/debian/control index 05f44b3..0c8a638 100644 --- a/debian/control +++ b/debian/control @@ -6,7 +6,7 @@ Uploaders: Boyuan Yang , Yanhao Mo , Build-Depends: - debhelper-compat (= 11), + debhelper-compat (= 12), libgsettings-qt-dev, pkg-config, pkg-kde-tools, diff --git a/debian/copyright b/debian/copyright index c8968ce..58f0aba 100644 --- a/debian/copyright +++ b/debian/copyright @@ -3,12 +3,12 @@ Upstream-Name: dtkcore Source: https://github.com/linuxdeepin/dtkcore Files: * -Copyright: 2010-2017, Deepin Technology Co., Ltd. +Copyright: 2010-2018, Deepin Technology Co., Ltd. License: GPL-3+ Files: debian/* Copyright: 2010-2017, Deepin Technology Co., Ltd. - 2017, Boyuan Yang <073plan@gmail.com> + 2017-2019, Boyuan Yang License: GPL-3+ Files: src/log/AbstractAppender.h diff --git a/debian/patches/0001-docs-add-document-for-DObject.patch b/debian/patches/0001-docs-add-document-for-DObject.patch new file mode 100644 index 0000000..a70cc33 --- /dev/null +++ b/debian/patches/0001-docs-add-document-for-DObject.patch @@ -0,0 +1,221 @@ +From: zccrs +Date: Wed, 2 Jan 2019 20:02:34 +0800 +Subject: docs: add document for DObject + +Change-Id: I47049e0951123bcaa4c016a2f8e95ef73db29fc5 +--- + src/base/dobject.cpp | 196 +++++++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 196 insertions(+) + +diff --git a/src/base/dobject.cpp b/src/base/dobject.cpp +index 5f3cd7f..ac93d73 100644 +--- a/src/base/dobject.cpp ++++ b/src/base/dobject.cpp +@@ -31,11 +31,207 @@ DObjectPrivate::~DObjectPrivate() + + } + ++/*! ++ * \~chinese \file dobject.h ++ * \~chinese \brief 一些宏的定义 ++*/ ++ ++/*! ++ * \~chinese \def D_DECLARE_PRIVATE(Class) ++ * ++ * \~chinese \brief 这个宏一定要放到类的私有区域,它定义了 d_func() 这个函数用于返回私有类的对象, ++ * \~chinese 这个对象只应该在类的内部使用,另外将私有类声明为公开类的友元类。 ++ * \~chinese \param Class 公开类的类名 ++ * \~chinese \sa D_DECLARE_PUBLIC D_D D_DC ++*/ ++ ++/*! ++ * \~chinese \def D_DECLARE_PUBLIC(Class) ++ * ++ * \~chinese \brief 这个宏用于私有类中,它定义了 q_func() 这个函数用于返回公开类的对象,另外将公开类 ++ * \~chinese 声明为私有类的友元类。 ++ * \~chinese \param Class 公开类的类名 ++ * \~chinese \sa D_DECLARE_PRIVATE D_Q D_QC ++*/ ++ ++/*! ++ * \~chinese \def D_D(Class) ++ * ++ * \~chinese \brief 这个宏用于公开类中,它定义了一个名字为 d 的变量存储 d_func() 的返回值。用于在公开 ++ * \~chinese 类中需要访问私有类的数据成员的函数中。 ++ * \~chinese \param Class 公开类的类名 ++ * \~chinese \sa D_DECLARE_PRVATE D_DC ++*/ ++ ++/*! ++ * \~chinese \def D_DC(Class) ++ * ++ * \~chinese \brief 同 D_D,用在公开类加了 const 修饰符的成员函数中。 ++ * \~chinese \param Class 公开类的类名 ++ * \~chinese \sa D_DECLARE_PRVATE D_D ++*/ ++ ++/*! ++ * \~chinese \def D_Q(Class) ++ * ++ * \~chinese \brief 这个宏用于私有类中,它定义了一个名字为 q 的变量存储 q_func() 的返回值。用于在私有 ++ * \~chinese 类中需要调用公开类的成员函数时。 ++ * \~chinese \param Class 公开类的类名 ++ * \~chinese \sa D_DECLARE_PUBLIC D_QC ++*/ ++ ++/*! ++ * \~chinese \def D_QC(Class) ++ * ++ * \~chinese \brief 同 D_Q,用在私有类加了 const 修饰符的成员函数中。 ++ * \~chinese \param Class 公开类的类名 ++ * \~chinese \sa D_DECLARE_PUBLIC D_Q ++*/ ++ ++/*! ++ * \~chinese \def D_PRIVATE_SLOT(Func) ++ * ++ * \~chinese \brief 同 Q_PRIVATE_SLOT,用在继承了 QObject 的公开类中,在公开类中定一个槽函数,且函数 ++ * \~chinese 必须在私有类中有实现。用这个方式定义的槽函数无法被直接调用,只能用于 QObject::connect ++ * \~chinese 使用 SIGNAL 和 SLOT 的方式连接信号,或者使用 QMetaObject::invokeMethod 调用。 ++ * \~chinese 一般来讲,这个槽函数应该只在类内部使用,外界不应该通过任何方式来调用它。 ++ * ++ * \~chinese 例子: ++ * ++ * \~chinese a.h ++ * \code ++ * class APrivate; ++ * class A : public DObject ++ * { ++ * D_DECLARE_PRIVATE(A) ++ * public: ++ * A(); ++ * ++ * protected: ++ * A(APrivate &dd, DObject *parent = nullptr); ++ * ++ * private: ++ * D_PRIVATE_SLOT(void _q_testSlot() const) ++ * }; ++ * \endcode ++ * \~chinese a.cpp ++ * \code ++ * class APrivate : public DObjectPrivate ++ * { ++ * public: ++ * D_DECLARE_PUBLIC(A) ++ * ++ * APrivate(A *qq) ++ * : DObjectPrivate(qq) ++ * { ++ * QTimer *timer = new QTimer(); ++ * QObject::connect(timer, SIGNAL(timeout()), qq, SLOT(_q_testSlot())); ++ * timer->start(1000); ++ * } ++ * ++ * void _q_testSlot() const ++ * { ++ * qDebug() << "slot"; ++ * } ++ * }; ++ * ++ * A::A() ++ * : DObject(*new APrivate(this)) ++ * { ++ * ++ * } ++ * ++ * A::A(APrivate &dd, DObject *parent) ++ * : DObject(dd, parent) ++ * { ++ * ++ * } ++ * ++ * #include "moc_a.cpp" ++ * \endcode ++ * \~chinese \param Func 槽函数的完整签名 ++ * \~chinese \note 添加或更新私有槽之后需要重新手动调用 qmake ++ * \~chinese \sa D_DECLARE_PUBLIC D_Q ++*/ ++ ++/*! ++ * \~chinese \class DObject ++ * \~chinese \brief deepin-tool-kit 中所有公开类的祖先类。 ++ * ++ * \~chinese 通过和 \ref D_DECLARE_PRIVATE 、\ref D_DECLARE_PUBLIC ++ * \~chinese 等宏的配合方便派生类中实现 D-Point 结构。虽然 QObject 中已经有了这样的实现结构,但是没有 ++ * \~chinese 办法在不使用 Qt 私有模块的情况下,在 DTK 库中达到同样的目的。D-Point 结构由“公共接口类” ++ * \~chinese 和“私有数据类”两部分组成,在 DTK 中,DObjectPrivate 是所有数据类的祖先类。在这种结构下, ++ * \~chinese 只有 DObject 这个基类中定了一个指向于私有数据类的对象指针,派生类中不会也不应该再定义任何 ++ * \~chinese 成员变量,派生类中需要添加数据成员时,可以继承 DObjectPrivate,将新的成员变量放到私有类中 ++ * ++ * \~chinese 例子: ++ * ++ * \~chinese a.h ++ * \code ++ * class APrivate; ++ * class A : public DObject ++ * { ++ * D_DECLARE_PRIVATE(A) ++ * public: ++ * A(); ++ * int test() const; ++ * ++ * protected: ++ * A(APrivate &dd, DObject *parent = nullptr); ++ * }; ++ * \endcode ++ * \~chinese a.cpp ++ * \code ++ * class APrivate : public DObjectPrivate ++ * { ++ * public: ++ * APrivate(A *qq) ++ * : DObjectPrivate(qq) ++ * { ++ * ++ * } ++ * ++ * D_DECLARE_PUBLIC(A) ++ * // 此处添加数据成员 ++ * int data; ++ * }; ++ * ++ * A::A() ++ * : DObject(*new APrivate(this)) ++ * { ++ * ++ * } ++ * ++ * int test() const ++ * { ++ * D_D(A); ++ * ++ * return d->data; ++ * } ++ * ++ * A::A(APrivate &dd, DObject *parent) ++ * : DObject(dd, parent) ++ * { ++ * ++ * } ++ * \endcode ++ * 一般来讲,DObject 只会用在 DTK 库中定义的类,对于使用 DTK 库的应用程序来说不用关心它的存在 ++ * \~chinese \sa \href{https://wiki.qt.io/D-Pointer/zh,类的 D-Point 结构} ++ */ ++ ++/*! ++ * \~chinese \brief 只有在不需要数据成员的派生类中才会使用 ++ */ + DObject::DObject(DObject * /*parent = nullptr*/) + { + + } + ++/*! ++ * \~chinese \brief 在派生类中比较常用的构造函数 ++ * \~chinese \param dd 私有类对象 ++ */ + DObject::DObject(DObjectPrivate &dd, DObject * /*parent = nullptr*/): + d_d_ptr(&dd) + { diff --git a/debian/patches/0002-refactor-add-the-buildQMAKEProject-test-function-for.patch b/debian/patches/0002-refactor-add-the-buildQMAKEProject-test-function-for.patch new file mode 100644 index 0000000..fcc7704 --- /dev/null +++ b/debian/patches/0002-refactor-add-the-buildQMAKEProject-test-function-for.patch @@ -0,0 +1,55 @@ +From: zccrs +Date: Fri, 4 Jan 2019 11:14:26 +0800 +Subject: refactor: add the "buildQMAKEProject" test function for dtk_qmake + +use the \"buildQMAKEProject\" build the deepin-os-release tool +Change-Id: Ib24e4ca13bd853d2618e7ea77a3d1672b61f3219 +--- + src/dtk_qmake.prf | 32 ++++++++++++++++++++++++++------ + 1 file changed, 26 insertions(+), 6 deletions(-) + +diff --git a/src/dtk_qmake.prf b/src/dtk_qmake.prf +index a32db43..0401b92 100644 +--- a/src/dtk_qmake.prf ++++ b/src/dtk_qmake.prf +@@ -1,14 +1,34 @@ + CONFIG += host_$$QMAKE_HOST.arch + DEFINES += Q_HOST_NAME=\\\"$$QMAKE_HOST.arch\\\" Q_HOST_$$upper($$QMAKE_HOST.arch) + +-isEqual(TARGET, dtkcore) { +- # build tools/deepin-os-release first +- QMAKE_CONFIG_TESTS_DIR_BAK=$$QMAKE_CONFIG_TESTS_DIR ++defineTest(buildQMAKEProject) { ++ pro_dir = $$1 ++ pro_out_dir = $$shadowed($$pro_dir) ++ pro_cmd_base = "$$QMAKE_CD $$system_quote($$system_path($$pro_out_dir)) &&" ++ mkpath($$pro_out_dir) ++ command = $$pro_cmd_base $$system_quote($$system_path($$QMAKE_QMAKE)) CONFIG=\"$$CONFIG\" -spec $$QMAKESPEC $$shell_quote($$pro_dir) ++ message($${command}:) ++ !equals(3, false): 1 = "( $$1 ) 2>&1" ++ output = $$system("$$command", lines, result) ++ !isEmpty(output): message($$output) ++ !equals(result, 0): return(false) + load(configure) +- QMAKE_CONFIG_TESTS_DIR=$$_PRO_FILE_PWD_/../tools +- qtCompileTest(deepin-os-release) ++ command = $$pro_cmd_base $$QMAKE_MAKE ++ message($${command}:) ++ !equals(3, false): 1 = "( $$1 ) 2>&1" ++ output = $$system("$$command", lines, result) ++ !isEmpty(output): message($$output) ++ !equals(result, 0): return(false) ++ return(true) ++} ++ ++isEqual(TARGET, dtkcore) { + DEEPIN_OS_RELEASE_TOOL=$$_PRO_FILE_PWD_/../bin/deepin-os-release +- QMAKE_CONFIG_TESTS_DIR=$$QMAKE_CONFIG_TESTS_DIR_BAK ++ ++ !exists($$DEEPIN_OS_RELEASE_TOOL) { ++ tools_dir = $$_PRO_FILE_PWD_/../tools/deepin-os-release ++ !buildQMAKEProject($$tools_dir): error(Failed on build deepin-os-release) ++ } + } else { + isEmpty(QT.dtkcore.tools): error(QT += dtkcore first) + DEEPIN_OS_RELEASE_TOOL=$${QT.dtkcore.tools}/deepin-os-release diff --git a/debian/patches/0003-fix-use-main-project-c-cxx-ld-flags-on-build-deepin-.patch b/debian/patches/0003-fix-use-main-project-c-cxx-ld-flags-on-build-deepin-.patch new file mode 100644 index 0000000..230ec36 --- /dev/null +++ b/debian/patches/0003-fix-use-main-project-c-cxx-ld-flags-on-build-deepin-.patch @@ -0,0 +1,33 @@ +From: zccrs +Date: Fri, 4 Jan 2019 13:52:00 +0800 +Subject: fix: use main project c/cxx/ld flags on build deepin-os-release + +Change-Id: Ie93492dcf150728e41ae103cc9388b4a3658517e +--- + src/dtk_qmake.prf | 13 ++++++++++++- + 1 file changed, 12 insertions(+), 1 deletion(-) + +diff --git a/src/dtk_qmake.prf b/src/dtk_qmake.prf +index 0401b92..8e8aad3 100644 +--- a/src/dtk_qmake.prf ++++ b/src/dtk_qmake.prf +@@ -6,7 +6,18 @@ defineTest(buildQMAKEProject) { + pro_out_dir = $$shadowed($$pro_dir) + pro_cmd_base = "$$QMAKE_CD $$system_quote($$system_path($$pro_out_dir)) &&" + mkpath($$pro_out_dir) +- command = $$pro_cmd_base $$system_quote($$system_path($$QMAKE_QMAKE)) CONFIG=\"$$CONFIG\" -spec $$QMAKESPEC $$shell_quote($$pro_dir) ++ command = $$pro_cmd_base $$system_quote($$system_path($$QMAKE_QMAKE)) ++ CONFIG(debug, debug|release) { ++ command += QMAKE_CFLAGS_DEBUG*=\"$$QMAKE_CFLAGS_DEBUG\" \ ++ QMAKE_CXXFLAGS_DEBUG*=\"$$QMAKE_CXXFLAGS_DEBUG\" \ ++ QMAKE_LFLAGS_DEBUG*=\"$$QMAKE_LFLAGS_DEBUG\" \ ++ CONFIG+=debug ++ } else { ++ command += QMAKE_CFLAGS_RELEASE*=\"$$QMAKE_CFLAGS_RELEASE\" \ ++ QMAKE_CXXFLAGS_RELEASE*=\"$$QMAKE_CXXFLAGS_RELEASE\" \ ++ QMAKE_LFLAGS_RELEASE*=\"$$QMAKE_LFLAGS_RELEASE\" ++ } ++ command += -spec $$QMAKESPEC $$shell_quote($$pro_dir) + message($${command}:) + !equals(3, false): 1 = "( $$1 ) 2>&1" + output = $$system("$$command", lines, result) diff --git a/debian/patches/series b/debian/patches/series new file mode 100644 index 0000000..2b04b34 --- /dev/null +++ b/debian/patches/series @@ -0,0 +1,3 @@ +0001-docs-add-document-for-DObject.patch +0002-refactor-add-the-buildQMAKEProject-test-function-for.patch +0003-fix-use-main-project-c-cxx-ld-flags-on-build-deepin-.patch -- 2.30.2