Skip to content

Commit

Permalink
Unify version
Browse files Browse the repository at this point in the history
  • Loading branch information
fufexan committed Sep 6, 2023
1 parent b6e9a32 commit d4ea760
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
5 changes: 4 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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")
Expand Down
1 change: 1 addition & 0 deletions VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2.0.0
2 changes: 1 addition & 1 deletion meson.build
Original file line number Diff line number Diff line change
@@ -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: [
Expand Down
6 changes: 5 additions & 1 deletion nix/overlays.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d4ea760

Please sign in to comment.