File: version-string

package info (click to toggle)
limesuite 23.11.0%2Bdfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 17,228 kB
  • sloc: cpp: 157,511; ansic: 6,852; python: 197; sh: 56; xml: 21; makefile: 19
file content (53 lines) | stat: -rw-r--r-- 2,228 bytes parent folder | download | duplicates (4)
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
Description: Allow overriding version string
 Add an override option for the version string in CMakeLists.txt. The
 original tries to combine its own string and EXTVER, so to make this
 the Debian package version we would have to filter out the version
 number from the changelog version.
 .
 Using the override we can simply pass the whole Debian version in
 without using complex sed or awk filtering.
Author: Andreas Bombe <aeb@debian.org>
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
Index: git/CMakeLists.txt
===================================================================
--- git.orig/CMakeLists.txt	2020-12-19 02:42:45.264584601 +0100
+++ git/CMakeLists.txt	2020-12-19 02:42:45.260584590 +0100
@@ -46,20 +46,25 @@
 # number if there are changes within the major.minor release series
 set(LIME_SUITE_SOVER "${VERSION_MAJOR}.${VERSION_MINOR}-1")
 
-# packagers may specify -DLIME_SUITE_EXTVER="foo" to replace the git hash
-if (NOT LIME_SUITE_EXTVER)
-    include(${PROJECT_SOURCE_DIR}/cmake/GetGitRevisionDescription.cmake)
-    get_git_head_revision(GITREFSPEC GITHASH)
-    if (GITHASH)
-        string(SUBSTRING "${GITHASH}" 0 8 GITHASH)
-        set(LIME_SUITE_EXTVER "g${GITHASH}")
-    else (GITHASH)
-        set(LIME_SUITE_EXTVER "unknown")
-    endif (GITHASH)
-endif()
+if (NOT OVERRIDE_LIME_SUITE_VERSION)
+    # packagers may specify -DLIME_SUITE_EXTVER="foo" to replace the git hash
+    if (NOT LIME_SUITE_EXTVER)
+	include(${PROJECT_SOURCE_DIR}/cmake/GetGitRevisionDescription.cmake)
+	get_git_head_revision(GITREFSPEC GITHASH)
+	if (GITHASH)
+	    string(SUBSTRING "${GITHASH}" 0 8 GITHASH)
+	    set(LIME_SUITE_EXTVER "g${GITHASH}")
+	else (GITHASH)
+	    set(LIME_SUITE_EXTVER "unknown")
+	endif (GITHASH)
+    endif()
+
+    set(LIME_SUITE_VERSION "${LIME_SUITE_LIBVER}-${LIME_SUITE_EXTVER}")
+else (NOT OVERRIDE_LIME_SUITE_VERSION)
+    set(LIME_SUITE_VERSION "${OVERRIDE_LIME_SUITE_VERSION}")
+endif (NOT OVERRIDE_LIME_SUITE_VERSION)
 
 set(LIME_SUITE_LIBVER "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}")
-set(LIME_SUITE_VERSION "${LIME_SUITE_LIBVER}-${LIME_SUITE_EXTVER}")
 
 if (NOT $ENV{SOURCE_DATE_EPOCH})
     message(FATAL_ERROR "SOURCE_DATE_EPOCH not set")