sqlite{,-analyzer}: use the same src (#40945)
This commit is contained in:
parent
11fe14b2aa
commit
e28a586f94
@ -1,23 +1,11 @@
|
|||||||
{ stdenv, fetchurl, unzip, sqlite, tcl }:
|
{ stdenv, tcl, sqlite }:
|
||||||
|
|
||||||
let
|
|
||||||
archiveVersion = import ./archive-version.nix stdenv.lib;
|
|
||||||
in
|
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
name = "sqlite-analyzer-${version}";
|
name = "sqlite-analyzer-${version}";
|
||||||
version = "3.23.1";
|
inherit (sqlite) src version;
|
||||||
|
|
||||||
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" ];
|
makeFlags = [ "sqlite3_analyzer" ];
|
||||||
|
|
||||||
installPhase = "install -Dt $out/bin sqlite3_analyzer";
|
installPhase = "install -Dt $out/bin sqlite3_analyzer";
|
||||||
|
|
||||||
meta = with stdenv.lib; {
|
meta = with stdenv.lib; {
|
||||||
|
@ -1,11 +0,0 @@
|
|||||||
lib: version:
|
|
||||||
|
|
||||||
with lib;
|
|
||||||
|
|
||||||
let
|
|
||||||
fragments = splitString "." version;
|
|
||||||
major = head fragments;
|
|
||||||
minor = concatMapStrings (fixedWidthNumber 2) (tail fragments);
|
|
||||||
in
|
|
||||||
|
|
||||||
major + minor + "00"
|
|
@ -1,29 +1,40 @@
|
|||||||
{ stdenv, fetchurl, zlib, interactive ? false, readline ? null, ncurses ? null }:
|
{ stdenv, fetchzip, tcl, zlib, interactive ? false, readline ? null, ncurses ? null }:
|
||||||
|
|
||||||
assert interactive -> readline != null && ncurses != null;
|
assert interactive -> readline != null && ncurses != null;
|
||||||
|
|
||||||
with stdenv.lib;
|
with stdenv.lib;
|
||||||
|
|
||||||
let
|
let
|
||||||
archiveVersion = import ./archive-version.nix stdenv.lib;
|
archiveVersion = version:
|
||||||
|
let
|
||||||
|
segments = splitString "." version;
|
||||||
|
major = head segments;
|
||||||
|
minor = concatMapStrings (fixedWidthNumber 2) (tail segments);
|
||||||
|
in
|
||||||
|
major + minor + "00";
|
||||||
in
|
in
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
name = "sqlite-${version}";
|
name = "sqlite-${version}";
|
||||||
version = "3.23.1";
|
version = "3.23.1";
|
||||||
|
|
||||||
# NB! Make sure to update analyzer.nix src (in the same directory).
|
src = fetchzip {
|
||||||
src = fetchurl {
|
url = "https://sqlite.org/2018/sqlite-src-${archiveVersion version}.zip";
|
||||||
url = "https://sqlite.org/2018/sqlite-autoconf-${archiveVersion version}.tar.gz";
|
sha256 = "1dshxmiqdiympg1i2jsz3x543zmcgzhn78lpsjc0546rir0s0zk0";
|
||||||
sha256 = "09ggapjhqjb2pzk0wkfczil77plijg3d77m2bpzlwx2y7ql2p14j";
|
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = [ "bin" "dev" "out" ];
|
outputs = [ "bin" "dev" "out" ];
|
||||||
separateDebugInfo = stdenv.isLinux;
|
separateDebugInfo = stdenv.isLinux;
|
||||||
|
|
||||||
buildInputs = [ zlib ] ++ optionals interactive [ readline ncurses ];
|
nativeBuildInputs = [ tcl ];
|
||||||
|
buildInputs = [ zlib ]
|
||||||
|
++ optionals interactive [ readline ncurses ];
|
||||||
|
|
||||||
configureFlags = [ "--enable-threadsafe" ] ++ optional interactive "--enable-readline";
|
configureFlags = [
|
||||||
|
# Disables libtclsqlite.so, tcl is still required for the build itself:
|
||||||
|
"--disable-tcl"
|
||||||
|
"--enable-threadsafe"
|
||||||
|
] ++ optional interactive "--enable-readline";
|
||||||
|
|
||||||
NIX_CFLAGS_COMPILE = [
|
NIX_CFLAGS_COMPILE = [
|
||||||
"-DSQLITE_ENABLE_COLUMN_METADATA"
|
"-DSQLITE_ENABLE_COLUMN_METADATA"
|
||||||
@ -61,9 +72,9 @@ stdenv.mkDerivation rec {
|
|||||||
# Necessary for FTS5 on Linux
|
# Necessary for FTS5 on Linux
|
||||||
export NIX_LDFLAGS="$NIX_LDFLAGS -lm"
|
export NIX_LDFLAGS="$NIX_LDFLAGS -lm"
|
||||||
|
|
||||||
echo ""
|
echo
|
||||||
echo "NIX_CFLAGS_COMPILE = $NIX_CFLAGS_COMPILE"
|
echo "NIX_CFLAGS_COMPILE = $NIX_CFLAGS_COMPILE"
|
||||||
echo ""
|
echo
|
||||||
'';
|
'';
|
||||||
|
|
||||||
meta = {
|
meta = {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user