versioning (WIP)

This commit is contained in:
2025-12-15 23:46:47 +03:00
parent a5d6503305
commit cd817446b0
3 changed files with 11 additions and 9 deletions

View File

@@ -13,6 +13,13 @@
]; ];
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";
semver =
if self ? rev
then "${baseVersion}+${toString self.revCount}.git.${builtins.substring 0 7 self.rev}"
else "${baseVersion}+dev"; # Accept that local builds show "+dev"
in in
{ {
packages = forAllSystems ( packages = forAllSystems (
@@ -21,7 +28,7 @@
pkgs = nixpkgsFor.${system}; pkgs = nixpkgsFor.${system};
in in
rec { rec {
clrsync = pkgs.callPackage ./package.nix { }; clrsync = pkgs.callPackage ./package.nix { inherit semver; };
default = clrsync; default = clrsync;
} }
); );

View File

@@ -16,18 +16,13 @@
zlib, zlib,
bzip2, bzip2,
wayland-scanner, wayland-scanner,
semver
}: }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "clrsync"; pname = "clrsync";
baseVersion = "0.1.4"; version = semver;
version =
if src ? rev then
"${baseVersion}+${toString src.revCount}.git.${lib.substring 0 7 src.rev}"
else
baseVersion;
src = lib.cleanSourceWith { src = lib.cleanSourceWith {
src = ./.; src = ./.;

View File

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