diff --git a/pkgs/development/libraries/sqlite/analyzer.nix b/pkgs/development/libraries/sqlite/analyzer.nix index 4b35c457f126..a0b1220b217d 100644 --- a/pkgs/development/libraries/sqlite/analyzer.nix +++ b/pkgs/development/libraries/sqlite/analyzer.nix @@ -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"; }; diff --git a/pkgs/development/libraries/sqlite/archive-version.nix b/pkgs/development/libraries/sqlite/archive-version.nix new file mode 100644 index 000000000000..1f312ecef23a --- /dev/null +++ b/pkgs/development/libraries/sqlite/archive-version.nix @@ -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" diff --git a/pkgs/development/libraries/sqlite/default.nix b/pkgs/development/libraries/sqlite/default.nix index ce666dc9c93f..eaeafa741297 100644 --- a/pkgs/development/libraries/sqlite/default.nix +++ b/pkgs/development/libraries/sqlite/default.nix @@ -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"; };