Files
nixpkgs/pkgs/by-name/sq/sqlite-modern-cpp/package.nix
Anton Tetov Johansson 0b5b80956a sqlite_modern_cpp: init at 3.2-unstable-2023-12-03
Adding header only library sqlite_modern_cpp with the ultimate goal to
replace the vendored headers in pkgs/by-name/li/libdjinterop.

CMake builds tests and could be skipped.

Tested with libdjinterop in https://github.com/NixOS/nixpkgs/pull/536693
2026-06-30 17:24:53 +02:00

71 lines
1.6 KiB
Nix

{
lib,
stdenv,
fetchFromGitHub,
catch2,
cmake,
sqlite,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "sqlite-modern-cpp";
version = "3.2-unstable-2023-12-03";
__structuredAttrs = true;
src = fetchFromGitHub {
owner = "SqliteModernCpp";
repo = "sqlite_modern_cpp";
rev = "6e3009973025e0016d5573529067714201338c80";
hash = "sha256-DD1EV3rBWe813TEHpa8nCnwHQjUizB5NOx5uGep5tJc=";
};
nativeBuildInputs = [
cmake
];
buildInputs = [
catch2
sqlite
];
strictDeps = true;
cmakeFlags = [
(lib.cmakeFeature "CMAKE_POLICY_VERSION_MINIMUM" "3.5")
(lib.cmakeBool "HUNTER_ENABLED" false)
];
doCheck = true;
dontUseCmakeInstall = true;
preConfigure = ''
substituteInPlace CMakeLists.txt \
--replace-fail 'find_package(sqlite3 CONFIG REQUIRED)' \
'find_package(SQLite3 REQUIRED)' \
--replace-fail 'sqlite3::sqlite3' 'SQLite::SQLite3'
'';
installPhase = ''
runHook preInstall
mkdir -p $out/include
cp -r $src/hdr/. $out/include/
runHook postInstall
'';
meta = {
description = "Lightweight C++ wrapper around sqlite3 C api";
homepage = "https://github.com/SqliteModernCpp/sqlite_modern_cpp";
# no changelog for unstable version, change to
# https://github.com/SqliteModernCpp/sqlite_modern_cpp/releases/tag/v${finalAttrs.version}
# if there are new releases in the future
changelog = "https://github.com/SqliteModernCpp/sqlite_modern_cpp/releases";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ tetov ];
};
})