|
|
|
@ -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 = { |
|
|
|
|