Skip to content
This repository has been archived by the owner on Apr 26, 2020. It is now read-only.

Commit

Permalink
fix: auto get version
Browse files Browse the repository at this point in the history
Change-Id: I42bd6d1641e53e22cf82dd1ded4de76fd93bc572
  • Loading branch information
Iceyer committed Oct 25, 2018
1 parent 1cbdaf9 commit 80eb312
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 5 deletions.
8 changes: 6 additions & 2 deletions debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,19 @@
export DH_VERBOSE=1
export QT_SELECT=qt5

VERSION = $(shell dpkg-parsechangelog -ldebian/changelog -SVersion | sed 's/.*.is.//g')
_PACK_VER = $(shell echo $(VERSION) | awk -F'[+_~-]' '{print $$1}')
CONFIG_VERSION = $(_PACK_VER)

%:
dh $@ --parallel

ifeq ($(DEB_BUILD_ARCH), amd64)
override_dh_auto_configure:
dh_auto_configure -- -DCMAKE_BUILD_TYPE=Release -DUSE_SYSTEM_RESOURCES=ON
dh_auto_configure -- -DCMAKE_BUILD_TYPE=Release -DUSE_SYSTEM_RESOURCES=ON -DCONFIG_VERSION=$(CONFIG_VERSION)
else
override_dh_auto_configure:
dh_auto_configure -- -DCMAKE_BUILD_TYPE=Release -DUSE_SYSTEM_RESOURCES=ON -DBUILD_WEB_RESOURCES=OFF
dh_auto_configure -- -DCMAKE_BUILD_TYPE=Release -DUSE_SYSTEM_RESOURCES=ON -DBUILD_WEB_RESOURCES=OFF -DCONFIG_VERSION=$(CONFIG_VERSION)
endif

override_dh_auto_build:
Expand Down
4 changes: 4 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ else()
-DSETTINGS_FILE="${CMAKE_CURRENT_SOURCE_DIR}/resources/settings.ini")
endif()

if (CONFIG_VERSION)
add_definitions(-DVERSION=${CONFIG_VERSION})
endif()

add_subdirectory(dbus)
add_subdirectory(resources)

Expand Down
2 changes: 1 addition & 1 deletion src/app/deepin_appstore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ int main(int argc, char** argv) {
app.setProductIcon(QIcon(dstore::kImageDeepinAppStore));
app.setOrganizationName("deepin");
app.setOrganizationDomain("deepin.org");
app.setApplicationVersion(dstore::kAppVersion);
app.setApplicationVersion(Dtk::Widget::DApplication::buildVersion("5.0.0.0"));
app.setApplicationName(dstore::kAppName);
app.loadTranslator();
app.setApplicationDisplayName(QObject::tr("Deepin Store"));
Expand Down
1 change: 0 additions & 1 deletion src/base/consts.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
namespace dstore {

const char kAppName[] = "deepin-appstore";
const char kAppVersion[] = "5.0.2.2";

#ifndef NDEBUG
const char kIndexPage[] = "http://localhost:4200";
Expand Down
1 change: 0 additions & 1 deletion src/base/consts.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
namespace dstore {

extern const char kAppName[];
extern const char kAppVersion[];
extern const char kIndexPage[];

// Get user cache directory.
Expand Down

0 comments on commit 80eb312

Please sign in to comment.