Unify version

This commit is contained in:
Mihai Fufezan 2023-09-06 20:47:36 +03:00 committed by Mihai Fufezan
parent cfd866ab66
commit 04d8fe8431
4 changed files with 11 additions and 3 deletions

View File

@ -1,8 +1,11 @@
cmake_minimum_required(VERSION 3.19)
file(READ ${CMAKE_CURRENT_SOURCE_DIR}/VERSION VER)
string(STRIP ${VER} VER)
project(xdg-desktop-portal-hyprland
DESCRIPTION "An XDG-Destop-Portal backend for Hyprland (and wlroots)"
VERSION "2.0"
VERSION ${VER}
)
set(CMAKE_MESSAGE_LOG_LEVEL "STATUS")

1
VERSION Normal file
View File

@ -0,0 +1 @@
1.0.0

View File

@ -1,5 +1,5 @@
project('xdg-desktop-portal-hyprland', 'cpp', 'c',
version: '2.0.0',
version: run_command('cat', files('VERSION'), check: true).stdout().strip(),
license: 'BSD-3-Clause',
meson_version: '>=0.63.0',
default_options: [

View File

@ -3,14 +3,18 @@
inputs,
lib,
}: let
ver = lib.removeSuffix "\n" (builtins.readFile ../VERSION);
mkJoinedOverlays = overlays: final: prev:
lib.foldl' (attrs: overlay: attrs // (overlay final prev)) {} overlays;
mkDate = longDate: (lib.concatStringsSep "-" [
(builtins.substring 0 4 longDate)
(builtins.substring 4 2 longDate)
(builtins.substring 6 2 longDate)
]);
version = "0.pre" + "+date=" + (mkDate (self.lastModifiedDate or "19700101")) + "_" + (self.shortRev or "dirty");
version = ver + "+date=" + (mkDate (self.lastModifiedDate or "19700101")) + "_" + (self.shortRev or "dirty");
in {
default = mkJoinedOverlays (with self.overlays; [
xdg-desktop-portal-hyprland