build: set -DOFFICIAL_BUILD

This commit is contained in:
tobtoht
2025-02-21 10:07:59 +01:00
parent 8adbf7eaad
commit 13daf73c03
9 changed files with 49 additions and 29 deletions
+3 -1
View File
@@ -446,8 +446,10 @@ EOF
${ADDITIONAL_GUIX_COMMON_FLAGS} ${ADDITIONAL_GUIX_ENVIRONMENT_FLAGS} \
-- env HOST="$HOST" \
DISTNAME="$DISTNAME" \
RELEASE="$RELEASE" \
JOBS="$JOBS" \
VERSION="$VERSION" \
COMMIT="$COMMIT" \
TAG="$TAG" \
COMMIT_TIMESTAMP="${COMMIT_TIMESTAMP:?unable to determine value}" \
${V:+V=1} \
${SOURCES_PATH:+SOURCES_PATH="$SOURCES_PATH"} \
+15 -7
View File
@@ -35,7 +35,8 @@ cat << EOF
Required environment variables as seen inside the container:
DIST_ARCHIVE_BASE: ${DIST_ARCHIVE_BASE:?not set}
DISTNAME: ${DISTNAME:?not set}
RELEASE: ${RELEASE:?not set}
VERSION: ${VERSION:?not set}
COMMIT: ${COMMIT:?not set}
HOST: ${HOST:?not set}
COMMIT_TIMESTAMP: ${COMMIT_TIMESTAMP:?not set}
JOBS: ${JOBS:?not set}
@@ -293,6 +294,11 @@ export PATH="${BASEPREFIX}/${HOST}/native/bin:${PATH}"
# Set appropriate CMake options for build type
CMAKEVARS="-DWITH_SCANNER=On -DCHECK_UPDATES=On -DSELF_CONTAINED=On -DDONATE_BEG=On -DFEATHER_TARGET_TRIPLET=${HOST} -DWITH_PLUGIN_REDDIT=Off"
if [[ -n "${TAG}" ]]; then
CMAKEVARS+=" -DOFFICIAL_BUILD=On"
fi
ANONDIST=""
case "$HOST" in
*mingw32)
@@ -415,12 +421,14 @@ export PATH="${BASEPREFIX}/${HOST}/native/bin:${PATH}"
esac
# Code-signing
if [ "$RELEASE" -ne 0 ]; then
case "$HOST" in
*darwin*)
signapple apply Feather.app "/distsrc/external/feather-codesigning/signatures/${HOST}/Feather.app"
;;
esac
if [[ -n "${TAG}" ]]; then
if [[ "${TAG}" != *"-rc"* ]]; then
case "$HOST" in
*darwin*)
signapple apply Feather.app "/distsrc/external/feather-codesigning/signatures/${HOST}/Feather.app"
;;
esac
fi
fi
# Finally, deterministically produce {non-,}debug binary tarballs ready
+10 -2
View File
@@ -65,9 +65,17 @@ time-machine() {
# Set common variables
################
VERSION="${FORCE_VERSION:-$(git_head_version)}"
COMMIT="$(git_head_commit)"
TAG="$(git_head_tag)"
if [[ -n "${TAG}" ]]; then
VERSION="${TAG}"
else
VERSION="${COMMIT}"
fi
VERSION="${FORCE_VERSION:-${VERSION}}"
DISTNAME="${DISTNAME:-feather-${VERSION}}"
RELEASE="$(is_release)"
VERSION_BASE_DIR="${VERSION_BASE_DIR:-${PWD}}"
version_base_prefix="${VERSION_BASE_DIR}/guix/guix-build-"
+4 -17
View File
@@ -4,23 +4,10 @@ git_root() {
git rev-parse --show-toplevel 2> /dev/null
}
git_head_version() {
local recent_tag
if recent_tag="$(git describe --exact-match HEAD 2> /dev/null)"; then
echo "${recent_tag%-rc}"
else
git rev-parse --short=12 HEAD
fi
git_head_commit() {
git rev-parse --short=12 HEAD
}
is_release() {
local recent_tag
if recent_tag="$(git describe --exact-match HEAD 2> /dev/null)"; then
if [[ "$recent_tag" == *"-rc" ]]; then
echo -n "0"
fi
echo -n "1"
else
echo -n "0"
fi
git_head_tag() {
echo -n $(git describe --exact-match HEAD 2> /dev/null)
}
+4
View File
@@ -229,6 +229,10 @@ if(STATIC)
target_compile_definitions(feather PRIVATE STATIC=1)
endif()
if(OFFICIAL_BUILD)
target_compile_definitions(feather PRIVATE OFFICIAL_BUILD=1)
endif()
if (NOT CMAKE_BUILD_TYPE STREQUAL "Debug")
target_compile_definitions(feather PRIVATE QT_NO_DEBUG=1)
endif()
+1 -1
View File
@@ -20,7 +20,7 @@ AboutDialog::AboutDialog(QWidget *parent)
ui->aboutImage->setPixmap(p.scaled(128, 128, Qt::KeepAspectRatio, Qt::SmoothTransformation));
auto about = Utils::fileOpenQRC(":assets/about.txt");
auto about_text = Utils::barrayToString(about);
about_text = about_text.replace("<feather_version>", FEATHER_VERSION);
about_text = about_text.replace("<feather_version>", Utils::getVersion());
ui->copyrightText->setPlainText(about_text);
auto ack = Utils::fileOpenQRC(":assets/ack.txt");
+1 -1
View File
@@ -48,7 +48,7 @@ void DebugInfoDialog::updateInfo() {
else
torStatus = "Unknown";
ui->label_featherVersion->setText(QString("%1").arg(FEATHER_VERSION));
ui->label_featherVersion->setText(Utils::getVersion());
ui->label_walletHeight->setText(QString::number(m_wallet->blockChainHeight()));
ui->label_daemonHeight->setText(QString::number(m_wallet->daemonBlockChainHeight()));
+9
View File
@@ -18,6 +18,7 @@
#include <QStandardPaths>
#include <QProcess>
#include "config-feather.h"
#include "constants.h"
#include "networktype.h"
#include "utils/ColorScheme.h"
@@ -693,4 +694,12 @@ QString formatSyncStatus(quint64 height, quint64 target, bool daemonSync) {
return "Synchronized";
}
QString getVersion() {
QString version = QString("%1").arg(FEATHER_VERSION);
#ifdef OFFICIAL_BUILD
version += " (release)";
#endif
return version;
}
}
+2
View File
@@ -119,6 +119,8 @@ namespace Utils
void clearLayout(QLayout *layout, bool deleteWidgets = true);
QString formatSyncStatus(quint64 height, quint64 target, bool daemonSync = false);
QString getVersion();
}
#endif //FEATHER_UTILS_H