Merge pull request #41128 from dtzWill/fix/sqlite-build-opts

Revert "sqlite{,-analyzer}: use the same src (#40945)"
This commit is contained in:
Yegor Timoshenko 2018-05-27 12:52:14 +03:00 committed by GitHub
commit dac633fc37
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 36 additions and 24 deletions

View File

@ -1,11 +1,23 @@
{ stdenv, tcl, sqlite }:
{ stdenv, fetchurl, unzip, sqlite, tcl }:
let
archiveVersion = import ./archive-version.nix stdenv.lib;
in
stdenv.mkDerivation rec {
name = "sqlite-analyzer-${version}";
inherit (sqlite) src version;
version = "3.23.1";
src = assert version == sqlite.version; fetchurl {
url = "https://sqlite.org/2018/sqlite-src-${archiveVersion version}.zip";
sha256 = "1z3xr8d8ds4l8ndkg34cii13d0w790nlxdkrw6virinqi7wmmd1d";
};
nativeBuildInputs = [ unzip ];
buildInputs = [ tcl ];
nativeBuildInputs = [ tcl ];
makeFlags = [ "sqlite3_analyzer" ];
installPhase = "install -Dt $out/bin sqlite3_analyzer";
meta = with stdenv.lib; {

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

@ -1,40 +1,29 @@
{ stdenv, fetchzip, tcl, zlib, interactive ? false, readline ? null, ncurses ? null }:
{ stdenv, fetchurl, zlib, interactive ? false, readline ? null, ncurses ? null }:
assert interactive -> readline != null && ncurses != null;
with stdenv.lib;
let
archiveVersion = version:
let
segments = splitString "." version;
major = head segments;
minor = concatMapStrings (fixedWidthNumber 2) (tail segments);
in
major + minor + "00";
archiveVersion = import ./archive-version.nix stdenv.lib;
in
stdenv.mkDerivation rec {
name = "sqlite-${version}";
version = "3.23.1";
src = fetchzip {
url = "https://sqlite.org/2018/sqlite-src-${archiveVersion version}.zip";
sha256 = "1dshxmiqdiympg1i2jsz3x543zmcgzhn78lpsjc0546rir0s0zk0";
# NB! Make sure to update analyzer.nix src (in the same directory).
src = fetchurl {
url = "https://sqlite.org/2018/sqlite-autoconf-${archiveVersion version}.tar.gz";
sha256 = "09ggapjhqjb2pzk0wkfczil77plijg3d77m2bpzlwx2y7ql2p14j";
};
outputs = [ "bin" "dev" "out" ];
separateDebugInfo = stdenv.isLinux;
nativeBuildInputs = [ tcl ];
buildInputs = [ zlib ]
++ optionals interactive [ readline ncurses ];
buildInputs = [ zlib ] ++ optionals interactive [ readline ncurses ];
configureFlags = [
# Disables libtclsqlite.so, tcl is still required for the build itself:
"--disable-tcl"
"--enable-threadsafe"
] ++ optional interactive "--enable-readline";
configureFlags = [ "--enable-threadsafe" ] ++ optional interactive "--enable-readline";
NIX_CFLAGS_COMPILE = [
"-DSQLITE_ENABLE_COLUMN_METADATA"
@ -72,9 +61,9 @@ stdenv.mkDerivation rec {
# Necessary for FTS5 on Linux
export NIX_LDFLAGS="$NIX_LDFLAGS -lm"
echo
echo ""
echo "NIX_CFLAGS_COMPILE = $NIX_CFLAGS_COMPILE"
echo
echo ""
'';
meta = {