chore: set version with CMake

This commit is contained in:
2025-12-07 01:54:48 +03:00
parent 47630304b3
commit 0051fb6c47
5 changed files with 71 additions and 7 deletions

View File

@@ -11,6 +11,18 @@ set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
set(CMAKE_INSTALL_RPATH "$ORIGIN/../${CMAKE_INSTALL_LIBDIR}")
configure_file(
${CMAKE_SOURCE_DIR}/src/core/version.hpp.in
${CMAKE_SOURCE_DIR}/src/core/version.hpp
@ONLY
)
configure_file(
${CMAKE_SOURCE_DIR}/PKGBUILD.in
${CMAKE_SOURCE_DIR}/PKGBUILD
@ONLY
)
find_package(OpenGL REQUIRED)
if(WIN32)

View File

@@ -18,22 +18,20 @@ depends=(
libxinerama
libxcursor
)
makedepends=('cmake' 'git')
makedepends=('cmake')
source=("$pkgname-$pkgver.tar.gz::https://github.com/obsqrbtz/clrsync/archive/refs/tags/v$pkgver.tar.gz")
sha256sums=('SKIP')
build() {
cd "$pkgname-$pkgver"
cmake -B build -S . \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr
cmake --build build
}
package() {
cd "$pkgname-$pkgver"
DESTDIR="$pkgdir" cmake --install build
install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}

37
PKGBUILD.in Normal file
View File

@@ -0,0 +1,37 @@
# Maintainer: Daniel Dada <dan@binarygoose.dev>
pkgname=clrsync
pkgver=@PROJECT_VERSION@
pkgrel=1
pkgdesc="Color scheme manager"
arch=('x86_64')
url="https://github.com/obsqrbtz/clrsync"
license=('MIT')
depends=(
glfw-x11
freetype2
fontconfig
libx11
libxrandr
libxi
mesa
libglvnd
libxinerama
libxcursor
)
makedepends=('cmake')
source=("$pkgname-$pkgver.tar.gz::https://github.com/obsqrbtz/clrsync/archive/refs/tags/v$pkgver.tar.gz")
sha256sums=('SKIP')
build() {
cd "$pkgname-$pkgver"
cmake -B build -S . \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr
cmake --build build
}
package() {
cd "$pkgname-$pkgver"
DESTDIR="$pkgdir" cmake --install build
install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}

View File

@@ -8,8 +8,8 @@ namespace clrsync::core
{
constexpr uint8_t VERSION_MAJOR = 0;
constexpr uint8_t VERSION_MINOR = 0;
constexpr uint8_t VERSION_PATCH = 1;
constexpr uint8_t VERSION_MINOR = 1;
constexpr uint8_t VERSION_PATCH = 0;
const std::string version_string();
} // namespace clrsync::core

17
src/core/version.hpp.in Normal file
View File

@@ -0,0 +1,17 @@
#ifndef CLRSYNC_CORE_VERSION_HPP
#define CLRSYNC_CORE_VERSION_HPP
#include <cstdint>
#include <string>
namespace clrsync::core
{
constexpr uint8_t VERSION_MAJOR = @PROJECT_VERSION_MAJOR@;
constexpr uint8_t VERSION_MINOR = @PROJECT_VERSION_MINOR@;
constexpr uint8_t VERSION_PATCH = @PROJECT_VERSION_PATCH@;
const std::string version_string();
} // namespace clrsync::core
#endif // CLRSYNC_CORE_VERSION_HPP