sqlite{,-analyzer}: add archiveVersion function

This commit is contained in:
Yegor Timoshenko 2018-05-23 00:47:18 +03:00
parent 25ec13a4f0
commit 5580765158
3 changed files with 21 additions and 2 deletions

View File

@ -1,11 +1,15 @@
{ stdenv, fetchurl, unzip, sqlite, tcl }:
let
archiveVersion = import ./archive-version.nix stdenv.lib;
in
stdenv.mkDerivation rec {
name = "sqlite-analyzer-${version}";
version = "3.23.1";
src = assert version == sqlite.version; fetchurl {
url = https://sqlite.org/2018/sqlite-src-3230100.zip;
url = "https://sqlite.org/2018/sqlite-src-${archiveVersion version}.zip";
sha256 = "1z3xr8d8ds4l8ndkg34cii13d0w790nlxdkrw6virinqi7wmmd1d";
};

View File

@ -0,0 +1,11 @@
lib: version:
with lib;
let
fragments = splitString "." version;
major = head fragments;
minor = concatMapStrings (fixedWidthNumber 2) (tail fragments);
in
major + minor + "00"

View File

@ -4,13 +4,17 @@ assert interactive -> readline != null && ncurses != null;
with stdenv.lib;
let
archiveVersion = import ./archive-version.nix stdenv.lib;
in
stdenv.mkDerivation rec {
name = "sqlite-${version}";
version = "3.23.1";
# NB! Make sure to update analyzer.nix src (in the same directory).
src = fetchurl {
url = https://sqlite.org/2018/sqlite-autoconf-3230100.tar.gz;
url = "https://sqlite.org/2018/sqlite-autoconf-${archiveVersion version}.tar.gz";
sha256 = "09ggapjhqjb2pzk0wkfczil77plijg3d77m2bpzlwx2y7ql2p14j";
};