versioning

This commit is contained in:
2025-12-16 00:37:18 +03:00
parent cd817446b0
commit 659c5f28e5
5 changed files with 29 additions and 21 deletions

View File

@@ -44,11 +44,11 @@ else()
if(GIT_DESCRIBE MATCHES "^[vV]?[0-9]+\\.[0-9]+\\.[0-9]+-[0-9]+-g[0-9a-f]+") if(GIT_DESCRIBE MATCHES "^[vV]?[0-9]+\\.[0-9]+\\.[0-9]+-[0-9]+-g[0-9a-f]+")
string(REGEX REPLACE string(REGEX REPLACE
"^[vV]?([0-9]+\\.[0-9]+\\.[0-9]+)-([0-9]+)-g([0-9a-f]+)" "^[vV]?([0-9]+\\.[0-9]+\\.[0-9]+)-([0-9]+)-g([0-9a-f]+)"
"\\1+\\2.git.g\\3" "\\1+git.g\\3"
SEMVER "${GIT_DESCRIBE}" SEMVER "${GIT_DESCRIBE}"
) )
elseif(GIT_DESCRIBE) elseif(GIT_DESCRIBE)
set(SEMVER "${PROJECT_VERSION}+0.git.${GIT_DESCRIBE}") set(SEMVER "${PROJECT_VERSION}.git.${GIT_DESCRIBE}")
else() else()
set(SEMVER "${PROJECT_VERSION}") set(SEMVER "${PROJECT_VERSION}")
endif() endif()
@@ -62,6 +62,12 @@ configure_file(
@ONLY @ONLY
) )
configure_file(
${CMAKE_SOURCE_DIR}/VERSION.in
${CMAKE_SOURCE_DIR}/VERSION
@ONLY
)
configure_file( configure_file(
${CMAKE_SOURCE_DIR}/AUR/PKGBUILD.in ${CMAKE_SOURCE_DIR}/AUR/PKGBUILD.in
${CMAKE_SOURCE_DIR}/AUR/PKGBUILD ${CMAKE_SOURCE_DIR}/AUR/PKGBUILD

1
VERSION Normal file
View File

@@ -0,0 +1 @@
0.1.4

1
VERSION.in Normal file
View File

@@ -0,0 +1 @@
@PROJECT_VERSION@

View File

@@ -14,12 +14,12 @@
forAllSystems = nixpkgs.lib.genAttrs supportedSystems; forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
nixpkgsFor = forAllSystems (system: import nixpkgs { inherit system; }); nixpkgsFor = forAllSystems (system: import nixpkgs { inherit system; });
baseVersion = "0.1.4"; baseVersion = nixpkgs.lib.removeSuffix "\n" (builtins.readFile ./VERSION);
semver = semver =
if self ? rev if self ? rev
then "${baseVersion}+${toString self.revCount}.git.${builtins.substring 0 7 self.rev}" then "${baseVersion}+git.${builtins.substring 0 7 self.rev}"
else "${baseVersion}+dev"; # Accept that local builds show "+dev" else "${baseVersion}+dev";
in in
{ {
packages = forAllSystems ( packages = forAllSystems (

View File

@@ -7,7 +7,7 @@
namespace clrsync::core namespace clrsync::core
{ {
const std::string GIT_SEMVER = "0.1.4+4.git.ga5d6503"; const std::string GIT_SEMVER = "0.1.4+git.gcd81744";
const std::string version_string(); const std::string version_string();
} // namespace clrsync::core } // namespace clrsync::core