sqlite: enable structuredAttrs, use finalAttrs

This commit is contained in:
Stefan Frijters
2026-08-03 22:55:24 +02:00
parent 7ffde03eb7
commit ccddc49b94

View File

@@ -26,18 +26,18 @@ let
archiveVersion = import ./archive-version.nix lib;
in
stdenv.mkDerivation rec {
stdenv.mkDerivation (finalAttrs: {
pname = "sqlite${lib.optionalString interactive "-interactive"}";
version = "3.53.3";
# nixpkgs-update: no auto update
# NB! Make sure to update ./tools.nix src (in the same directory).
src = fetchurl {
url = "https://sqlite.org/2026/sqlite-src-${archiveVersion version}.zip";
url = "https://sqlite.org/2026/sqlite-src-${archiveVersion finalAttrs.version}.zip";
hash = "sha256-u4C/ijv/wZJBzoq6WkvHTpw5gAE8sLXw8JdqmVFpQq8=";
};
docsrc = fetchurl {
url = "https://sqlite.org/2026/sqlite-doc-${archiveVersion version}.zip";
url = "https://sqlite.org/2026/sqlite-doc-${archiveVersion finalAttrs.version}.zip";
hash = "sha256-Fo+Zhph2vPTbjZPvoqSDqcgVNlN9AZAMWM110KZ8yic=";
};
@@ -130,7 +130,7 @@ stdenv.mkDerivation rec {
postInstall = ''
mkdir -p $doc/share/doc
unzip $docsrc
mv sqlite-doc-${archiveVersion version} $doc/share/doc/sqlite
mv sqlite-doc-${archiveVersion finalAttrs.version} $doc/share/doc/sqlite
'';
# SQLites tests are unreliable on Darwin. Sometimes they run successfully, but often they do not.
@@ -158,8 +158,12 @@ stdenv.mkDerivation rec {
};
};
__structuredAttrs = true;
meta = {
changelog = "https://www.sqlite.org/releaselog/${lib.replaceStrings [ "." ] [ "_" ] version}.html";
changelog = "https://www.sqlite.org/releaselog/${
lib.replaceStrings [ "." ] [ "_" ] finalAttrs.version
}.html";
description = "Self-contained, serverless, zero-configuration, transactional SQL database engine";
downloadPage = "https://sqlite.org/download.html";
homepage = "https://www.sqlite.org/";
@@ -169,6 +173,6 @@ stdenv.mkDerivation rec {
teams = [ lib.teams.security-review ];
platforms = lib.platforms.unix ++ lib.platforms.windows;
pkgConfigModules = [ "sqlite3" ];
identifiers.cpeParts = lib.meta.cpeFullVersionWithVendor "sqlite" version;
identifiers.cpeParts = lib.meta.cpeFullVersionWithVendor "sqlite" finalAttrs.version;
};
}
})