From 3ebc7956f1f9d36d926ce571f1c5e29ee3ca9ef3 Mon Sep 17 00:00:00 2001 From: Iceyer Date: Mon, 22 Jan 2018 16:10:31 +0800 Subject: [PATCH] refactor: split tool to libdtkcore-bin Change-Id: Ide59c0f11faea6592b2801daa41816336358ad85 --- debian/control | 8 ++++++++ debian/libdtkcore-bin.install | 1 + debian/libdtkcore-dev.install | 1 - dtkcore.pro | 2 +- .../script/dtk-license.py | 0 tools/script/dtk-translate.py | 18 ++++++++++++++++++ {tool => tools}/settings/main.cpp | 0 {tool => tools}/settings/settings.pro | 11 +++++++---- tool/tool.pro => tools/tools.pro | 0 9 files changed, 35 insertions(+), 6 deletions(-) create mode 100644 debian/libdtkcore-bin.install rename tool/license/license-updater.py => tools/script/dtk-license.py (100%) create mode 100644 tools/script/dtk-translate.py rename {tool => tools}/settings/main.cpp (100%) rename {tool => tools}/settings/settings.pro (70%) rename tool/tool.pro => tools/tools.pro (100%) diff --git a/debian/control b/debian/control index 92f6430..910fc9b 100644 --- a/debian/control +++ b/debian/control @@ -15,6 +15,14 @@ Description: Deepin Tool Kit Core library . This package contains the shared libraries. +Package: libdtkcore-bin +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends}, libdtkcore2( =${binary:Version}) +Description: Deepin Tool Kit Core Utilities + DtkCore is base devel library of Deepin Qt/C++ applications. + . + This package contains the utilities of DtkCore + Package: libdtkcore-dev Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends}, libdtkcore2( =${binary:Version}) diff --git a/debian/libdtkcore-bin.install b/debian/libdtkcore-bin.install new file mode 100644 index 0000000..b808e55 --- /dev/null +++ b/debian/libdtkcore-bin.install @@ -0,0 +1 @@ +usr/lib/dtk2/* diff --git a/debian/libdtkcore-dev.install b/debian/libdtkcore-dev.install index df188d8..60e21e3 100644 --- a/debian/libdtkcore-dev.install +++ b/debian/libdtkcore-dev.install @@ -1,6 +1,5 @@ usr/lib/*/lib*.so usr/include usr/lib/*/pkgconfig/*.pc -usr/lib/dtk2/* usr/lib/*/cmake/*/*.cmake usr/lib/*/libdtk/modules/* diff --git a/dtkcore.pro b/dtkcore.pro index c776e70..370c5fd 100644 --- a/dtkcore.pro +++ b/dtkcore.pro @@ -6,4 +6,4 @@ SUBDIRS += \ src \ tests -!mac:!win*: SUBDIRS += tool +!mac:!win*: SUBDIRS += tools diff --git a/tool/license/license-updater.py b/tools/script/dtk-license.py similarity index 100% rename from tool/license/license-updater.py rename to tools/script/dtk-license.py diff --git a/tools/script/dtk-translate.py b/tools/script/dtk-translate.py new file mode 100644 index 0000000..9cb06f8 --- /dev/null +++ b/tools/script/dtk-translate.py @@ -0,0 +1,18 @@ +#!env python + +import sys,os,fnmatch +from subprocess import call + +translations_dir = os.getcwd() + "/translations" +if (len(sys.argv) == 2): + translations_dir = sys.argv[1] + "/translations" + +print("set translations dir:", translations_dir) + +tslist = fnmatch.filter(os.listdir(translations_dir), '*.ts') + +# This would print all the files and directories +for tsfile in tslist: + tspath = translations_dir + "/" + tsfile + print ("process", tspath) + call(["lrelease", tspath]) diff --git a/tool/settings/main.cpp b/tools/settings/main.cpp similarity index 100% rename from tool/settings/main.cpp rename to tools/settings/main.cpp diff --git a/tool/settings/settings.pro b/tools/settings/settings.pro similarity index 70% rename from tool/settings/settings.pro rename to tools/settings/settings.pro index 8dcb34c..e973d88 100644 --- a/tool/settings/settings.pro +++ b/tools/settings/settings.pro @@ -3,7 +3,7 @@ QT -= gui CONFIG += c++11 -TARGET = dtk-settings-tool +TARGET = dtk-settings CONFIG += console link_pkgconfig CONFIG -= app_bundle PKGCONFIG += gsettings-qt @@ -16,10 +16,13 @@ isEmpty(PREFIX){ PREFIX = /usr } -binary.files += $${OUT_PWD}/dtk-settings-tool -binary.path = $${PREFIX}/lib/dtk2 +binary.files += $${OUT_PWD}/dtk-settings +binary.path = $${PREFIX}/lib/dtk2/libexec -INSTALLS += binary +script.files += $${PWD}/../script/*.py +script.path = $${PREFIX}/lib/dtk2 + +INSTALLS += binary script win32:CONFIG(release, debug|release): LIBS += -L$$OUT_PWD/../../src/release/ -ldtkcore else:win32:CONFIG(debug, debug|release): LIBS += -L$$OUT_PWD/../../src/debug/ -ldtkcore diff --git a/tool/tool.pro b/tools/tools.pro similarity index 100% rename from tool/tool.pro rename to tools/tools.pro -- 2.30.2