File: make-version.sh

package info (click to toggle)
kshutdown 6.0-2
  • links: PTS
  • area: main
  • in suites: forky, sid
  • size: 1,992 kB
  • sloc: cpp: 8,349; sh: 477; makefile: 5
file content (52 lines) | stat: -rwxr-xr-x 1,484 bytes parent folder | download
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
#!/bin/bash

set -eu

if [ ! -d "src" ]; then
	echo "Usage: ./tools/$(basename "$0")"
	exit 1
fi

echo "Reading \"VERSION\" file..."

KS_APP_VERSION=$(sed 1!d VERSION)
KS_RELEASE_DATE=$(sed 2!d VERSION)
KS_QT_INT_VERSION=$(sed 3!d VERSION)
KS_QT_FULL_VERSION=$(sed 4!d VERSION)

echo "Generating \"src/version.h\" file..."

cat > "src/version.h" <<EOF
// Generated by $0, do not modify!
#pragma once

#include <QString>

const QString KS_APP_VERSION = "$KS_APP_VERSION";
const QString KS_RELEASE_DATE = "$KS_RELEASE_DATE";

const QString KS_CONTACT = "https://kshutdown.sourceforge.io/contact.html";
const QString KS_COPYRIGHT = "(C) 2003-3000 Konrad Twardowski";
const QString KS_HOME_PAGE = "https://kshutdown.sourceforge.io/";

#if QT_VERSION < $KS_QT_INT_VERSION
	#error "KShutdown $KS_APP_VERSION requires Qt $KS_QT_FULL_VERSION or newer"
#endif // QT_VERSION

#if defined(KS_KF5) && defined(KS_PURE_QT)
	#error "Please use only one -DKS_KF5 or -DKS_PURE_QT compiler option"
#endif

#if !defined(KS_KF5) && !defined(KS_PURE_QT)
	#error "Please use either -DKS_KF5 or -DKS_PURE_QT compiler option (see Setup*.sh)"
#endif

#ifdef KS_NATIVE_KDE
	#error "Please use KS_KF5 instead of KS_NATIVE_KDE"
#endif // KS_NATIVE_KDE
EOF

echo
echo "Application version (used in file names and UI): \"$KS_APP_VERSION\""
echo "Release date (updated manually)                : \"$KS_RELEASE_DATE\""
echo "Minimal required Qt version                    : $KS_QT_FULL_VERSION ($KS_QT_INT_VERSION)"