Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
71 changes: 11 additions & 60 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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)
Expand Down
11 changes: 2 additions & 9 deletions debian/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand All @@ -282,9 +281,6 @@ For additional releases, update debian/changelog and rebuild:
```bash
# Build for Jammy
debuild -S -sa -k<YOUR_GPG_KEY_ID>

# Build for Focal
debuild -S -sa -k<YOUR_GPG_KEY_ID>
```

### Uploading to Launchpad PPA
Expand All @@ -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:
Expand Down Expand Up @@ -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
Expand Down
12 changes: 9 additions & 3 deletions debian/build-ppa.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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=""
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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:<your-ppa-name> ${BUILD_AREA}/${PACKAGE_NAME}_*~noble1_source.changes"
echo " dput ppa:<your-ppa-name> ${BUILD_AREA}/${PACKAGE_NAME}_*~jammy1_source.changes"
echo " dput ppa:<your-ppa-name> ${BUILD_AREA}/${PACKAGE_NAME}_*~focal1_source.changes"
fi
}

Expand Down
11 changes: 0 additions & 11 deletions debian/changelog
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,3 @@ libcuid2 (1.0.0-1ubuntu1~jammy1) jammy; urgency=medium
* Cross-platform support (Linux, BSD, macOS, Windows)

-- Visus Development Team <admin@projects.visus.io> 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 <admin@projects.visus.io> Sun, 28 Dec 2025 12:00:00 +0000
2 changes: 1 addition & 1 deletion debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Section: libs
Priority: optional
Maintainer: Visus Development Team <admin@projects.visus.io>
Build-Depends: debhelper-compat (= 13),
cmake (>= 4.0),
cmake (>= 3.22),
pkg-config,
libssl-dev (>= 3.0),
libboost-dev (>= 1.74),
Expand Down
3 changes: 3 additions & 0 deletions debian/libcuid2-dev.install
Original file line number Diff line number Diff line change
@@ -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/
2 changes: 1 addition & 1 deletion man/man7/libcuid2.7
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading