From 186a93ab0749225b7dcf8a0e354c4416fe3b6c92 Mon Sep 17 00:00:00 2001 From: Alan Brault Date: Sat, 10 Jan 2026 07:57:18 -0500 Subject: [PATCH] chore: change minimum cmake version from 4.x to 3.2x Signed-off-by: Alan Brault --- .github/workflows/ci.yml | 2 +- CMakeLists.txt | 2 +- README.md | 71 ++++++------------------------------- debian/README.md | 11 ++---- debian/build-ppa.sh | 12 +++++-- debian/changelog | 11 ------ debian/control | 2 +- debian/libcuid2-dev.install | 3 ++ man/man7/libcuid2.7 | 2 +- 9 files changed, 29 insertions(+), 87 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b089809..871725c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -47,7 +47,7 @@ jobs: - name: Setup build tools uses: lukka/get-cmake@9e07ecdcee1b12e5037e42f410b67f03e2f626e1 # v4.2.1 with: - cmakeVersion: '~4.2.0' + cmakeVersion: '~3.28.0' ninjaVersion: '^1.12.0' - name: Install Linux dependencies diff --git a/CMakeLists.txt b/CMakeLists.txt index 009f71e..7b5c079 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,7 @@ # ============================================================================== # Project Configuration # ============================================================================== -cmake_minimum_required(VERSION 4.0) +cmake_minimum_required(VERSION 3.22) project(libcuid2 VERSION 1.0.0 LANGUAGES CXX) set(CMAKE_CXX_STANDARD 20) diff --git a/README.md b/README.md index 144d357..8345ca9 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ A high-performance C++ implementation of the [Cuid2](https://github.com/parallel - [Features](#features) - [Quick Start](#quick-start) - [Installation](#installation) - - [CMake 4 Installation](#cmake-4-installation) + - [CMake Installation](#cmake-installation) - [Checking Your CMake Version](#checking-your-cmake-version) - [Ubuntu/Debian](#ubuntudebian) - [Fedora/RHEL](#fedorarhel) @@ -96,9 +96,9 @@ int main() { ## Installation -### CMake 4 Installation +### CMake Installation -This project requires **CMake 4.0+**. Many Linux distributions currently ship with CMake 3.x by default, so you may need to install CMake 4 manually. +This project requires **CMake 3.22+**. Most modern Linux distributions ship with CMake 3.22 or newer by default. #### Checking Your CMake Version ```bash @@ -107,99 +107,50 @@ cmake --version #### Ubuntu/Debian -Ubuntu 24.04 LTS and earlier Debian versions ship with CMake 3.x. You have two options: - -**Option 1: Install from Kitware APT Repository (Recommended)** ```bash -# Remove old CMake if installed -sudo apt-get remove --purge cmake - -# Install dependencies sudo apt-get update -sudo apt-get install -y software-properties-common lsb-release wget gnupg +sudo apt-get install cmake +``` + +Ubuntu 22.04 LTS and later include CMake 3.22+. For older versions, use the Kitware APT repository: +```bash # Add Kitware APT repository wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | sudo tee /etc/apt/trusted.gpg.d/kitware.gpg >/dev/null sudo apt-add-repository "deb https://apt.kitware.com/ubuntu/ $(lsb_release -cs) main" - -# Install CMake 4 sudo apt-get update sudo apt-get install cmake - -# Verify installation -cmake --version -``` - -**Option 2: Build from Source** -```bash -# Install build dependencies -sudo apt-get install -y build-essential libssl-dev - -# Download and build CMake 4 (adjust version as needed) -wget https://github.com/Kitware/CMake/releases/download/v4.0.0/cmake-4.0.0.tar.gz -tar -xzf cmake-4.0.0.tar.gz -cd cmake-4.0.0 -./bootstrap --prefix=/usr/local -make -j$(nproc) -sudo make install - -# Verify installation -cmake --version ``` #### Fedora/RHEL -Fedora 41+ includes CMake 4.x. For older versions: ```bash -# Fedora 41+ sudo dnf install cmake - -# For older Fedora/RHEL, build from source (see Ubuntu Option 2 above) -# Replace apt-get with dnf/yum for build dependencies: -sudo dnf install -y gcc-c++ make openssl-devel ``` #### Arch Linux ```bash -# Arch typically has latest CMake in official repos sudo pacman -S cmake ``` #### macOS ```bash -# Homebrew brew install cmake - -# Verify installation -cmake --version ``` #### FreeBSD ```bash -# CMake 4 may be available in ports/packages pkg install cmake - -# If not available, build from ports: -cd /usr/ports/devel/cmake && make install clean ``` #### OpenBSD/NetBSD ```bash -# Check available version -pkg_info -Q cmake # OpenBSD -pkgin search cmake # NetBSD - -# Install if CMake 4 is available pkg_add cmake # OpenBSD pkgin install cmake # NetBSD - -# Otherwise, build from source (see Ubuntu Option 2 above) ``` #### Windows -CMake 4 is available via the official installer: - **Option 1: Official Installer** - Download from https://cmake.org/download/ - Run the installer and add CMake to system PATH @@ -306,11 +257,11 @@ cmake --preset freebsd-arm64-debug ### Debian/Ubuntu Packages -**Note:** Building DEB packages requires CMake 4.0+. See [CMake 4 Installation](#cmake-4-installation) above if you don't have it installed. +**Note:** Building DEB packages requires CMake 3.22+. See [CMake Installation](#cmake-installation) above if you don't have it installed. Build DEB packages: ```bash -# Install build dependencies (assuming CMake 4 is already installed) +# Install build dependencies sudo apt-get install debhelper-compat pkg-config \ libssl-dev libboost-dev libfmt-dev @@ -487,7 +438,7 @@ ctest --preset macos-arm64-debug ## Requirements - **C++20** compiler (GCC 10+, Clang 11+, MSVC 2019+) -- **CMake** 4.0+ +- **CMake** 3.22+ - **OpenSSL** 3.x (NIST FIPS-202 SHA3-512, CSPRNG) - **Boost** (Endian, Multiprecision, Nowide, Test) - **fmt** (Modern formatting library) diff --git a/debian/README.md b/debian/README.md index 8d63d50..bb96419 100644 --- a/debian/README.md +++ b/debian/README.md @@ -97,7 +97,7 @@ sudo chroot /tmp/debian-test ### Build Dependencies - **debhelper-compat (= 13)** - Debian build helper tools -- **cmake (>= 4.0)** - Build system +- **cmake (>= 3.22)** - Build system - **pkg-config** - Dependency detection - **libssl-dev (>= 3.0)** - OpenSSL development files (SHA3-512, CSPRNG) - **libboost-dev (>= 1.74)** - Boost libraries (header-only components) @@ -216,7 +216,6 @@ Source packages are pre-configured for the following Ubuntu LTS releases: - **Ubuntu 24.04 LTS (Noble Numbat)** - Version suffix: `~noble1` - **Ubuntu 22.04 LTS (Jammy Jellyfish)** - Version suffix: `~jammy1` -- **Ubuntu 20.04 LTS (Focal Fossa)** - Version suffix: `~focal1` ### PPA Prerequisites @@ -259,7 +258,7 @@ cd /path/to/libcuid2 The script will: 1. Create the orig tarball from git -2. Build source packages for Noble, Jammy, and Focal +2. Build source packages for Noble and Jammy 3. Place all files in `../build-area/` #### Manual Build Process @@ -282,9 +281,6 @@ For additional releases, update debian/changelog and rebuild: ```bash # Build for Jammy debuild -S -sa -k - -# Build for Focal -debuild -S -sa -k ``` ### Uploading to Launchpad PPA @@ -311,7 +307,6 @@ EOF # Upload to your PPA (replace with your PPA name) dput ppa:YOUR_LAUNCHPAD_USERNAME/libcuid2 ../build-area/libcuid2_*~noble1_source.changes dput ppa:YOUR_LAUNCHPAD_USERNAME/libcuid2 ../build-area/libcuid2_*~jammy1_source.changes -dput ppa:YOUR_LAUNCHPAD_USERNAME/libcuid2 ../build-area/libcuid2_*~focal1_source.changes ``` Launchpad will automatically: @@ -359,12 +354,10 @@ sudo apt-get install pbuilder ubuntu-dev-tools # Create base environments pbuilder-dist noble create pbuilder-dist jammy create -pbuilder-dist focal create # Test build pbuilder-dist noble build ../build-area/libcuid2_*~noble1.dsc pbuilder-dist jammy build ../build-area/libcuid2_*~jammy1.dsc -pbuilder-dist focal build ../build-area/libcuid2_*~focal1.dsc ``` ### Version Management for PPAs diff --git a/debian/build-ppa.sh b/debian/build-ppa.sh index 658f850..033a6da 100755 --- a/debian/build-ppa.sh +++ b/debian/build-ppa.sh @@ -4,7 +4,7 @@ set -e PACKAGE_NAME="libcuid2" VERSION="1.0.0" REVISION="1ubuntu1" -RELEASES=("noble" "jammy" "focal") +RELEASES=("noble" "jammy") BUILD_AREA="../build-area" GPG_KEY="${GPG_KEY:-}" PPA_NAME="" @@ -87,6 +87,14 @@ build_for_release() { cp -r debian "$work_dir/" cd "$work_dir" + # Update changelog with release-specific version at the top + info "Updating changelog for ${release}..." + DEBFULLNAME="Visus Development Team" \ + DEBEMAIL="admin@projects.visus.io" \ + dch --force-distribution --distribution "${release}" \ + --newversion "${release_version}" \ + "Rebuild for Ubuntu ${release}" + info "Running debuild for ${release}..." if [ -n "$GPG_KEY" ]; then @@ -122,12 +130,10 @@ show_summary() { info "To upload to PPA:" echo " dput ppa:${PPA_NAME} ${BUILD_AREA}/${PACKAGE_NAME}_*~noble1_source.changes" echo " dput ppa:${PPA_NAME} ${BUILD_AREA}/${PACKAGE_NAME}_*~jammy1_source.changes" - echo " dput ppa:${PPA_NAME} ${BUILD_AREA}/${PACKAGE_NAME}_*~focal1_source.changes" else info "To upload to PPA (specify with -p option):" echo " dput ppa: ${BUILD_AREA}/${PACKAGE_NAME}_*~noble1_source.changes" echo " dput ppa: ${BUILD_AREA}/${PACKAGE_NAME}_*~jammy1_source.changes" - echo " dput ppa: ${BUILD_AREA}/${PACKAGE_NAME}_*~focal1_source.changes" fi } diff --git a/debian/changelog b/debian/changelog index bc08c9d..7c6535a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -19,14 +19,3 @@ libcuid2 (1.0.0-1ubuntu1~jammy1) jammy; urgency=medium * Cross-platform support (Linux, BSD, macOS, Windows) -- Visus Development Team Sun, 28 Dec 2025 12:00:00 +0000 - -libcuid2 (1.0.0-1ubuntu1~focal1) focal; urgency=medium - - * Initial release for Ubuntu 20.04 LTS (Focal Fossa) - * C++ implementation of Cuid2 identifier generation - * Thread-safe collision-resistant unique identifiers - * SHA3-512 cryptographic hashing (NIST FIPS-202) - * Configurable length (4-32 characters, default 24) - * Cross-platform support (Linux, BSD, macOS, Windows) - - -- Visus Development Team Sun, 28 Dec 2025 12:00:00 +0000 diff --git a/debian/control b/debian/control index 5157ec1..09c2619 100644 --- a/debian/control +++ b/debian/control @@ -3,7 +3,7 @@ Section: libs Priority: optional Maintainer: Visus Development Team Build-Depends: debhelper-compat (= 13), - cmake (>= 4.0), + cmake (>= 3.22), pkg-config, libssl-dev (>= 3.0), libboost-dev (>= 1.74), diff --git a/debian/libcuid2-dev.install b/debian/libcuid2-dev.install index 3344557..90fd49e 100644 --- a/debian/libcuid2-dev.install +++ b/debian/libcuid2-dev.install @@ -1,3 +1,6 @@ usr/include/* usr/lib/*/libcuid2.so usr/lib/*/cmake/cuid2/* +tests/* usr/src/libcuid2/ +src/*.cpp usr/src/libcuid2/src/ +src/*.hpp usr/src/libcuid2/src/ diff --git a/man/man7/libcuid2.7 b/man/man7/libcuid2.7 index 5b468e5..396b2ec 100644 --- a/man/man7/libcuid2.7 +++ b/man/man7/libcuid2.7 @@ -241,7 +241,7 @@ Exceptions for error handling .IP \(bu Inline namespace versioning (planned for future versions) .SH BUILD SYSTEM -libcuid2 uses CMake 4.0+ and vcpkg for dependency management: +libcuid2 uses CMake 3.22+ and vcpkg for dependency management: .SS "Dependencies" .TP .B OpenSSL 3.x