From 0319376a895fd51f43036944b81c96c7ce68fb99 Mon Sep 17 00:00:00 2001 From: EnumDev Date: Wed, 10 Sep 2025 19:21:49 +0300 Subject: [PATCH] Update package version to 1.15.3 --- check-version.sh | 12 ++++++++++++ pkg.info | 3 +-- source-files/fix-test-segfault.patch | 23 ++++++++++++++++++++++ source.sh | 29 ++++++++++++++-------------- 4 files changed, 51 insertions(+), 16 deletions(-) create mode 100644 check-version.sh create mode 100644 source-files/fix-test-segfault.patch diff --git a/check-version.sh b/check-version.sh new file mode 100644 index 0000000..990f256 --- /dev/null +++ b/check-version.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +# Github repository +REPO="gabime/spdlog" + +# Get tag name using Github Rest API +TAG_NAME=$(curl -s -L -H "X-GitHub-Api-Version: 2022-11-28" -H "Authorization: token ${GITHUB_API_TOKEN}" https://api.github.com/repos/"$REPO"/releases/latest | jq -r '.tag_name') + +# Trim 'v' character in TAG_NAME variable +VERSION=$(echo "$TAG_NAME" | tr -d 'v') + +echo "$VERSION" diff --git a/pkg.info b/pkg.info index 093d988..72541cb 100644 --- a/pkg.info +++ b/pkg.info @@ -1,7 +1,6 @@ name: spdlog description: Fast C++ logging library -version: 1.14.1 -revision: 2 +version: 1.15.3 url: https://github.com/gabime/spdlog license: MIT architecture: any diff --git a/source-files/fix-test-segfault.patch b/source-files/fix-test-segfault.patch new file mode 100644 index 0000000..96dd203 --- /dev/null +++ b/source-files/fix-test-segfault.patch @@ -0,0 +1,23 @@ +From b77a2cab5b1e6710ec55e6a4484f43278fc0036b Mon Sep 17 00:00:00 2001 +From: Vitaly +Date: Wed, 30 Jul 2025 11:59:03 +0200 +Subject: [PATCH] Run tests in the order they are declared in the source file. + +Fixes an issue with running tests in random order in Catch2 3.9.0+. +--- + tests/CMakeLists.txt | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt +index 457504c313..5ba2a106a7 100644 +--- a/tests/CMakeLists.txt ++++ b/tests/CMakeLists.txt +@@ -75,7 +75,7 @@ function(spdlog_prepare_test test_target spdlog_lib) + elseif(SPDLOG_SANITIZE_THREAD) + spdlog_enable_thread_sanitizer(${test_target}) + endif() +- add_test(NAME ${test_target} COMMAND ${test_target}) ++ add_test(NAME ${test_target} COMMAND ${test_target} --order decl) + set_tests_properties(${test_target} PROPERTIES RUN_SERIAL ON) + endfunction() + diff --git a/source.sh b/source.sh index be23289..ea6e229 100644 --- a/source.sh +++ b/source.sh @@ -10,36 +10,37 @@ FILENAME="${DOWNLOAD##*/}" prepare() { wget "$DOWNLOAD" tar -xvf "$FILENAME" --strip-components=1 -C "$BPM_SOURCE" + + cd "$BPM_SOURCE" + # Fix segfault during tests + patch -Np1 -i "$BPM_WORKDIR"/fix-test-segfault.patch } # The build function is executed in the source directory # This function is used to compile the source code build() { - mkdir build - cd build - - cmake -DSPDLOG_BUILD_BENCH=OFF \ - -DSPDLOG_FMT_EXTERNAL=ON \ - -DSPDLOG_BUILD_SHARED=ON \ - -DSPDLOG_BUILD_TESTS=ON \ - -DCMAKE_BUILD_TYPE=None \ + cmake -B build \ + -DSPDLOG_BUILD_BENCH=OFF \ + -DSPDLOG_FMT_EXTERNAL=ON \ + -DSPDLOG_BUILD_SHARED=ON \ + -DSPDLOG_BUILD_TESTS=ON \ + -DCMAKE_BUILD_TYPE=None \ -DCMAKE_INSTALL_PREFIX=/usr \ - -DCMAKE_INSTALL_LIBDIR=lib .. - make + -DCMAKE_INSTALL_LIBDIR=lib + cmake --build build } # The check function is executed in the source directory # This function is used to run tests to verify the package has been compiled correctly check() { - cd build - make check + ctest --test-dir build } # The package function is executed in the source directory # This function is used to move the compiled files into the output directory package() { - cd build - make DESTDIR="$BPM_OUTPUT" install + DESTDIR="$BPM_OUTPUT" cmake --install build + # Install package license install -Dm644 "$BPM_SOURCE"/LICENSE "$BPM_OUTPUT"/usr/share/licenses/spdlog/LICENSE }