nixpkgs/pkgs/development/libraries/sqlite/tools.nix

44 lines
1.3 KiB
Nix
Raw Normal View History

{ lib, stdenv, fetchurl, unzip, sqlite, tcl, Foundation }:
2019-09-19 18:58:50 +01:00
let
archiveVersion = import ./archive-version.nix lib;
2019-09-19 18:58:50 +01:00
mkTool = { pname, makeTarget, description, homepage }: stdenv.mkDerivation rec {
inherit pname;
2021-05-24 10:46:46 +01:00
version = "3.35.5";
2019-09-19 18:58:50 +01:00
src = assert version == sqlite.version; fetchurl {
url = "https://sqlite.org/2021/sqlite-src-${archiveVersion version}.zip";
sha256 = "049vdpk50sba786345ibmlxnkzk5zp4xj859658ancswb6jyrgpl";
2019-09-19 18:58:50 +01:00
};
nativeBuildInputs = [ unzip ];
buildInputs = [ tcl ] ++ lib.optional stdenv.isDarwin Foundation;
2019-09-19 18:58:50 +01:00
makeFlags = [ makeTarget ];
installPhase = "install -Dt $out/bin ${makeTarget}";
meta = with lib; {
2019-09-19 18:58:50 +01:00
inherit description homepage;
downloadPage = http://sqlite.org/download.html;
license = licenses.publicDomain;
maintainers = with maintainers; [ johnazoidberg ];
2019-09-19 18:58:50 +01:00
platforms = platforms.unix;
};
};
in
{
sqldiff = mkTool {
pname = "sqldiff";
makeTarget = "sqldiff";
description = "A tool that displays the differences between SQLite databases";
homepage = "https://www.sqlite.org/sqldiff.html";
};
sqlite-analyzer = mkTool {
pname = "sqlite-analyzer";
makeTarget = "sqlite3_analyzer";
description = "A tool that shows statistics about SQLite databases";
homepage = "https://www.sqlite.org/sqlanalyze.html";
};
}