summarylogtreecommitdiffstats
path: root/0001-Fixed-broken-Linux-Makefile-based-build.patch
blob: 7ddd73a2498b366f5efb2ab241eee5bd8d0666d4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
From eea4ef611110f34f184b8d49d1832beb2e0f5cec Mon Sep 17 00:00:00 2001
From: ronys <ronys@pwsafe.org>
Date: Tue, 8 Mar 2016 22:11:35 +0200
Subject: [PATCH] Fixed broken Linux Makefile-based build

Which required supporting point revisions correctly.
---
 Makefile.linux                 |  3 ++-
 src/ui/wxWidgets/Makefile      | 10 +++++++---
 src/ui/wxWidgets/about.cpp     |  2 +-
 src/ui/wxWidgets/pwsafeapp.cpp |  2 --
 src/ui/wxWidgets/version.cpp   | 18 ++++++++++++------
 5 files changed, 22 insertions(+), 13 deletions(-)

diff --git a/Makefile.linux b/Makefile.linux
index 5762a47..6acf069 100644
--- a/Makefile.linux
+++ b/Makefile.linux
@@ -2,7 +2,8 @@
 # Toplevel Makefile for Linux build of PasswordSafe
 
 export VER_MAJOR := 0
-export VER_MINOR := 98.1
+export VER_MINOR := 98
+export VER_REV := 1
 export VER_SPECIAL := BETA
 
 # Since we use wxWidgets 3.x, while many distros still provide 2.8
diff --git a/src/ui/wxWidgets/Makefile b/src/ui/wxWidgets/Makefile
index b8e4ed5..9bd3cd8 100644
--- a/src/ui/wxWidgets/Makefile
+++ b/src/ui/wxWidgets/Makefile
@@ -240,9 +240,13 @@ $(DEPDIR)/%.d: %.cpp version.h
 	$(RM) $@.$$$$
 
 version.h: always
-	@../../../Misc/mkversion.pl MAJOR=$(VER_MAJOR) MINOR=$(VER_MINOR) SPECIAL=$(VER_SPECIAL) \
-     version.in $@
-
+ifdef VER_REV
+	@../../../Misc/mkversion.pl MAJOR=$(VER_MAJOR) MINOR=$(VER_MINOR) REV=$(VER_REV) \
+															SPECIAL=$(VER_SPECIAL) version.in $@
+else
+	@../../../Misc/mkversion.pl MAJOR=$(VER_MAJOR) MINOR=$(VER_MINOR) \
+															SPECIAL=$(VER_SPECIAL) version.in $@
+endif
 -include $(SOURCES:%.cpp=$(DEPDIR)/%.d)
 
 
diff --git a/src/ui/wxWidgets/about.cpp b/src/ui/wxWidgets/about.cpp
index 6742a39..a101136 100644
--- a/src/ui/wxWidgets/about.cpp
+++ b/src/ui/wxWidgets/about.cpp
@@ -328,7 +328,7 @@ void CAbout::CheckNewVersion()
   }
   stringT latest;
   if (status == CheckVersion::UP2DATE) {
-    CheckVersion cv(MAJORVERSION, MINORVERSION, 0);
+    CheckVersion cv(MAJORVERSION, MINORVERSION, REVISION);
     status = cv.CheckLatestVersion(latest_xml, latest);
   }
   m_newVerStatus->Clear();
diff --git a/src/ui/wxWidgets/pwsafeapp.cpp b/src/ui/wxWidgets/pwsafeapp.cpp
index fcf17f4..27c9e95 100644
--- a/src/ui/wxWidgets/pwsafeapp.cpp
+++ b/src/ui/wxWidgets/pwsafeapp.cpp
@@ -274,8 +274,6 @@ bool PwsafeApp::OnInit()
   wxFileSystem::AddHandler(new wxArchiveFSHandler);
 
   SetAppName(pwsafeAppName);
-  m_core.SetApplicationNameAndVersion(tostdstring(pwsafeAppName),
-                                      DWORD((MINORVERSION << 16) | MAJORVERSION));
   PWSprefs::SetReporter(&aReporter);
   PWScore::SetReporter(&aReporter);
   PWScore::SetAsker(&anAsker);
diff --git a/src/ui/wxWidgets/version.cpp b/src/ui/wxWidgets/version.cpp
index cc9e726..d3af576 100644
--- a/src/ui/wxWidgets/version.cpp
+++ b/src/ui/wxWidgets/version.cpp
@@ -17,12 +17,18 @@
 #endif
 
 const wxString pwsafeAppName(APPNAME);
-#ifndef _DEBUG
-const wxString pwsafeVersionString = wxString::Format(wxString(_T("v%d.%d (%ls) %ls")),
-                                                      MAJORVERSION, MINORVERSION,
-                                                      _T(VCS_VERSION), SPECIALBUILD);
+#ifdef _DEBUG
+const wchar_t *debstr = L"[debug] ";
+#else
+const wchar_t *debstr = L"";
+#endif
+
+#if defined(REVISION) && (REVISION != 0)
+const wxString pwsafeVersionString = wxString::Format(wxString(_T("v%d.%d.%d (%ls) %ls%ls")),
+                                                      MAJORVERSION, MINORVERSION, REVISION,
+                                                      _T(VCS_VERSION), debstr, SPECIALBUILD);
 #else
-const wxString pwsafeVersionString = wxString::Format(wxString(_T("v%d.%d (%ls) [debug] %ls")),
+const wxString pwsafeVersionString = wxString::Format(wxString(_T("v%d.%d (%ls) %ls%ls")),
                                                       MAJORVERSION, MINORVERSION,
-                                                      _T(VCS_VERSION), SPECIALBUILD);
+                                                      _T(VCS_VERSION), debstr, SPECIALBUILD);
 #endif
-- 
2.7.2