2022-02-20 05:27:41 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
2020-05-29 06:06:01 +00:00
|
|
|
, fetchFromGitHub
|
|
|
|
, cmake
|
2022-02-20 05:27:41 +00:00
|
|
|
, ninja
|
|
|
|
, openssl
|
|
|
|
, openjdk11
|
|
|
|
, unixODBC
|
|
|
|
, 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";
|
2024-01-02 11:29:13 +00:00
|
|
|
version = "0.9.2";
|
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}";
|
2024-01-02 11:29:13 +00:00
|
|
|
hash = "sha256-QFK8mEMcqQwALFNvAdD8yWixwMYHSbeo6xqx86PvejU=";
|
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}"
|
|
|
|
'';
|
|
|
|
|
2023-02-22 10:55:15 +00:00
|
|
|
nativeBuildInputs = [ cmake ninja ];
|
|
|
|
buildInputs = [ openssl ]
|
|
|
|
++ lib.optionals withJdbc [ openjdk11 ]
|
|
|
|
++ lib.optionals withOdbc [ unixODBC ];
|
|
|
|
|
2022-02-20 05:27:41 +00:00
|
|
|
cmakeFlags = [
|
2023-10-09 19:29:22 +00:00
|
|
|
"-DDUCKDB_EXTENSION_CONFIGS=${src}/.github/config/in_tree_extensions.cmake"
|
2023-02-22 10:55:15 +00:00
|
|
|
"-DBUILD_ODBC_DRIVER=${enableFeature withOdbc}"
|
2022-02-20 05:27:41 +00:00
|
|
|
"-DJDBC_DRIVER=${enableFeature withJdbc}"
|
2023-04-29 16:46:19 +00:00
|
|
|
] ++ lib.optionals doInstallCheck [
|
2023-02-22 10:55:15 +00:00
|
|
|
# development settings
|
|
|
|
"-DBUILD_UNITTESTS=ON"
|
2022-02-20 05:27:41 +00:00
|
|
|
];
|
|
|
|
|
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"
|
2023-10-09 19:29:22 +00:00
|
|
|
"Test using a remote optimizer pass in case thats important to someone"
|
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"
|
2023-02-22 10:55:15 +00:00
|
|
|
"test/sql/json/read_json_objects.test"
|
|
|
|
"test/sql/json/read_json.test"
|
2023-10-09 19:29:22 +00:00
|
|
|
"test/sql/json/table/read_json_objects.test"
|
|
|
|
"test/sql/json/table/read_json.test"
|
2023-02-22 10:55:15 +00:00
|
|
|
"test/sql/copy/parquet/parquet_5968.test"
|
|
|
|
"test/fuzzer/pedro/buffer_manager_out_of_memory.test"
|
2023-03-08 16:32:21 +00:00
|
|
|
"test/sql/storage/compression/bitpacking/bitpacking_size_calculation.test"
|
|
|
|
"test/sql/copy/parquet/delta_byte_array_length_mismatch.test"
|
2023-04-29 16:46:19 +00:00
|
|
|
"test/sql/function/timestamp/test_icu_strptime.test"
|
|
|
|
"test/sql/timezone/test_icu_timezone.test"
|
2023-07-15 17:15:38 +00:00
|
|
|
"test/sql/copy/parquet/snowflake_lineitem.test"
|
|
|
|
"test/sql/copy/parquet/test_parquet_force_download.test"
|
|
|
|
"test/sql/copy/parquet/delta_byte_array_multiple_pages.test"
|
|
|
|
"test/sql/copy/csv/test_csv_httpfs_prepared.test"
|
|
|
|
"test/sql/copy/csv/test_csv_httpfs.test"
|
2023-10-09 19:29:22 +00:00
|
|
|
"test/sql/settings/test_disabled_file_system_httpfs.test"
|
2023-07-15 17:15:38 +00:00
|
|
|
"test/sql/copy/csv/parallel/test_parallel_csv.test"
|
|
|
|
"test/sql/copy/csv/parallel/csv_parallel_httpfs.test"
|
|
|
|
"test/common/test_cast_struct.test"
|
|
|
|
# test is order sensitive
|
|
|
|
"test/sql/copy/parquet/parquet_glob.test"
|
2022-11-21 17:40:18 +00:00
|
|
|
# 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
|
|
|
|
'';
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2023-11-16 04:20:00 +00:00
|
|
|
changelog = "https://github.com/duckdb/duckdb/releases/tag/v${version}";
|
2020-11-03 02:18:15 +00:00
|
|
|
description = "Embeddable SQL OLAP Database Management System";
|
2023-11-16 04:20:00 +00:00
|
|
|
homepage = "https://duckdb.org/";
|
2020-05-29 06:06:01 +00:00
|
|
|
license = licenses.mit;
|
2023-11-16 04:20:00 +00:00
|
|
|
mainProgram = "duckdb";
|
2022-02-20 05:27:41 +00:00
|
|
|
maintainers = with maintainers; [ costrouc cpcloud ];
|
2023-11-16 04:20:00 +00:00
|
|
|
platforms = platforms.all;
|
2020-05-29 06:06:01 +00:00
|
|
|
};
|
|
|
|
}
|