1 { lib, stdenv, fetchurl, unzip, sqlite, tcl, Foundation }:
4 archiveVersion = import ./archive-version.nix lib;
5 mkTool = { pname, makeTarget, description, homepage, mainProgram }: stdenv.mkDerivation rec {
9 # nixpkgs-update: no auto update
10 src = assert version == sqlite.version; fetchurl {
11 url = "https://sqlite.org/2023/sqlite-src-${archiveVersion version}.zip";
12 hash = "sha256-62ZRUj9XpccPJC/Ba8QWuB7QLVkmOb+34JnyAeL5otM=";
15 nativeBuildInputs = [ unzip ];
16 buildInputs = [ tcl ] ++ lib.optional stdenv.isDarwin Foundation;
18 makeFlags = [ makeTarget ];
20 installPhase = "install -Dt $out/bin ${makeTarget}";
23 inherit description homepage mainProgram;
24 downloadPage = "http://sqlite.org/download.html";
25 license = licenses.publicDomain;
26 maintainers = with maintainers; [ johnazoidberg ];
27 platforms = platforms.unix;
34 makeTarget = "sqldiff";
35 description = "A tool that displays the differences between SQLite databases";
36 homepage = "https://www.sqlite.org/sqldiff.html";
37 mainProgram = "sqldiff";
39 sqlite-analyzer = mkTool {
40 pname = "sqlite-analyzer";
41 makeTarget = "sqlite3_analyzer";
42 description = "A tool that shows statistics about SQLite databases";
43 homepage = "https://www.sqlite.org/sqlanalyze.html";
44 mainProgram = "sqlite3_analyzer";