2022-02-20 05:27:41 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
2020-05-29 06:06:01 +00:00
|
|
|
, fetchFromGitHub
|
2022-06-26 10:26:21 +00:00
|
|
|
, fetchpatch
|
2020-05-29 06:06:01 +00:00
|
|
|
, cmake
|
2022-02-20 05:27:41 +00:00
|
|
|
, ninja
|
|
|
|
, openssl
|
|
|
|
, openjdk11
|
|
|
|
, unixODBC
|
|
|
|
, withHttpFs ? true
|
|
|
|
, withJdbc ? false
|
|
|
|
, withOdbc ? false
|
2020-05-29 06:06:01 +00:00
|
|
|
}:
|
|
|
|
|
2022-02-20 05:27:41 +00:00
|
|
|
let
|
|
|
|
enableFeature = yes: if yes then "ON" else "OFF";
|
|
|
|
in
|
2020-05-29 06:06:01 +00:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "duckdb";
|
2022-12-28 21:21:41 +00:00
|
|
|
version = "0.6.1";
|
2020-05-29 06:06:01 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2021-10-28 06:52:43 +00:00
|
|
|
owner = pname;
|
|
|
|
repo = pname;
|
2020-05-29 06:06:01 +00:00
|
|
|
rev = "v${version}";
|
2022-12-28 21:21:41 +00:00
|
|
|
sha256 = "sha256-no4fcukEpzKmh2i41sdXGDljGhEDkzk3rYBATqlq6Gw=";
|
2020-05-29 06:06:01 +00:00
|
|
|
};
|
|
|
|
|
2022-11-21 17:40:18 +00:00
|
|
|
patches = [ ./version.patch ];
|
|
|
|
|
2022-02-20 05:27:41 +00:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace CMakeLists.txt --subst-var-by DUCKDB_VERSION "v${version}"
|
|
|
|
'';
|
|
|
|
|
|
|
|
cmakeFlags = [
|
2022-04-27 09:35:20 +00:00
|
|
|
"-DBUILD_EXCEL_EXTENSION=ON"
|
2022-02-20 05:27:41 +00:00
|
|
|
"-DBUILD_FTS_EXTENSION=ON"
|
|
|
|
"-DBUILD_HTTPFS_EXTENSION=${enableFeature withHttpFs}"
|
|
|
|
"-DBUILD_ICU_EXTENSION=ON"
|
2022-04-27 09:35:20 +00:00
|
|
|
"-DBUILD_JSON_EXTENSION=ON"
|
2022-02-20 05:27:41 +00:00
|
|
|
"-DBUILD_ODBC_DRIVER=${enableFeature withOdbc}"
|
|
|
|
"-DBUILD_PARQUET_EXTENSION=ON"
|
|
|
|
"-DBUILD_TPCDS_EXTENSION=ON"
|
2022-04-27 09:35:20 +00:00
|
|
|
"-DBUILD_TPCE=ON"
|
2022-02-20 05:27:41 +00:00
|
|
|
"-DBUILD_TPCH_EXTENSION=ON"
|
|
|
|
"-DBUILD_VISUALIZER_EXTENSION=ON"
|
2022-11-21 17:40:18 +00:00
|
|
|
"-DBUILD_INET_EXTENSION=ON"
|
2022-02-20 05:27:41 +00:00
|
|
|
"-DJDBC_DRIVER=${enableFeature withJdbc}"
|
|
|
|
];
|
|
|
|
|
2022-04-27 09:35:20 +00:00
|
|
|
doInstallCheck = true;
|
|
|
|
|
2022-09-22 12:36:57 +00:00
|
|
|
preInstallCheck = ''
|
|
|
|
export HOME="$(mktemp -d)"
|
|
|
|
'' + lib.optionalString stdenv.isDarwin ''
|
2022-04-27 09:35:20 +00:00
|
|
|
export DYLD_LIBRARY_PATH="$out/lib''${DYLD_LIBRARY_PATH:+:}''${DYLD_LIBRARY_PATH}"
|
|
|
|
'';
|
|
|
|
|
|
|
|
installCheckPhase =
|
|
|
|
let
|
|
|
|
excludes = map (pattern: "exclude:'${pattern}'") [
|
2022-11-21 17:40:18 +00:00
|
|
|
"[s3]"
|
|
|
|
"Test closing database during long running query"
|
2022-04-27 09:35:20 +00:00
|
|
|
"test/common/test_cast_hugeint.test"
|
|
|
|
"test/sql/copy/csv/test_csv_remote.test"
|
|
|
|
"test/sql/copy/parquet/test_parquet_remote.test"
|
2022-06-26 10:26:21 +00:00
|
|
|
"test/sql/copy/parquet/test_parquet_remote_foreign_files.test"
|
2022-11-21 17:40:18 +00:00
|
|
|
"test/sql/storage/compression/chimp/chimp_read.test"
|
|
|
|
"test/sql/storage/compression/chimp/chimp_read_float.test"
|
|
|
|
"test/sql/storage/compression/patas/patas_compression_ratio.test_coverage"
|
|
|
|
"test/sql/storage/compression/patas/patas_read.test"
|
|
|
|
# these are only hidden if no filters are passed in
|
|
|
|
"[!hide]"
|
|
|
|
# this test apparently never terminates
|
|
|
|
"test/sql/copy/csv/auto/test_csv_auto.test"
|
2022-04-27 09:35:20 +00:00
|
|
|
] ++ lib.optionals stdenv.isAarch64 [
|
|
|
|
"test/sql/aggregate/aggregates/test_kurtosis.test"
|
|
|
|
"test/sql/aggregate/aggregates/test_skewness.test"
|
|
|
|
"test/sql/function/list/aggregates/skewness.test"
|
|
|
|
];
|
|
|
|
in
|
|
|
|
''
|
|
|
|
runHook preInstallCheck
|
|
|
|
|
|
|
|
$PWD/test/unittest ${lib.concatStringsSep " " excludes}
|
|
|
|
|
|
|
|
runHook postInstallCheck
|
|
|
|
'';
|
|
|
|
|
2022-02-20 05:27:41 +00:00
|
|
|
nativeBuildInputs = [ cmake ninja ];
|
|
|
|
buildInputs = lib.optionals withHttpFs [ openssl ]
|
|
|
|
++ lib.optionals withJdbc [ openjdk11 ]
|
|
|
|
++ lib.optionals withOdbc [ unixODBC ];
|
2020-05-29 06:06:01 +00:00
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2021-10-28 06:52:43 +00:00
|
|
|
homepage = "https://github.com/duckdb/duckdb";
|
2020-11-03 02:18:15 +00:00
|
|
|
description = "Embeddable SQL OLAP Database Management System";
|
2020-05-29 06:06:01 +00:00
|
|
|
license = licenses.mit;
|
|
|
|
platforms = platforms.all;
|
2022-02-20 05:27:41 +00:00
|
|
|
maintainers = with maintainers; [ costrouc cpcloud ];
|
2020-05-29 06:06:01 +00:00
|
|
|
};
|
|
|
|
}
|