nixpkgs/pkgs/development/libraries/duckdb/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

124 lines
4.0 KiB
Nix
Raw Normal View History

2022-02-12 11:23:04 +00:00
{ lib
, stdenv
2020-05-27 01:27:11 +00:00
, fetchFromGitHub
, cmake
2022-02-11 20:53:27 +00:00
, ninja
2022-02-12 11:23:04 +00:00
, openssl
, openjdk11
, unixODBC
, withJdbc ? false
, withOdbc ? false
2020-05-27 01:27:11 +00:00
}:
2022-02-12 11:23:04 +00:00
let
enableFeature = yes: if yes then "ON" else "OFF";
in
2020-05-27 01:27:11 +00:00
stdenv.mkDerivation rec {
pname = "duckdb";
version = "0.8.1";
2020-05-27 01:27:11 +00:00
src = fetchFromGitHub {
2021-10-22 08:42:51 +00:00
owner = pname;
repo = pname;
2020-05-27 01:27:11 +00:00
rev = "v${version}";
hash = "sha256-LEv9yURkYvONObTbIA4CS+umwCRMH8gRQaDtzbCzID4=";
2020-05-27 01:27:11 +00:00
};
patches = [ ./version.patch ];
2022-11-14 20:58:01 +00:00
2022-02-12 11:23:04 +00:00
postPatch = ''
substituteInPlace CMakeLists.txt --subst-var-by DUCKDB_VERSION "v${version}"
'';
2023-02-14 15:16:13 +00:00
nativeBuildInputs = [ cmake ninja ];
buildInputs = [ openssl ]
2023-02-14 15:16:13 +00:00
++ lib.optionals withJdbc [ openjdk11 ]
++ lib.optionals withOdbc [ unixODBC ];
2022-02-11 20:53:45 +00:00
cmakeFlags = [
"-DBUILD_AUTOCOMPLETE_EXTENSION=ON"
2022-02-12 11:23:04 +00:00
"-DBUILD_ICU_EXTENSION=ON"
"-DBUILD_PARQUET_EXTENSION=ON"
"-DBUILD_TPCH_EXTENSION=ON"
"-DBUILD_TPCDS_EXTENSION=ON"
"-DBUILD_FTS_EXTENSION=ON"
"-DBUILD_HTTPFS_EXTENSION=ON"
2022-02-12 11:23:04 +00:00
"-DBUILD_VISUALIZER_EXTENSION=ON"
"-DBUILD_JSON_EXTENSION=ON"
"-DBUILD_JEMALLOC_EXTENSION=ON"
"-DBUILD_EXCEL_EXTENSION=ON"
2022-11-14 20:58:01 +00:00
"-DBUILD_INET_EXTENSION=ON"
"-DBUILD_TPCE=ON"
"-DBUILD_ODBC_DRIVER=${enableFeature withOdbc}"
2022-02-12 11:23:04 +00:00
"-DJDBC_DRIVER=${enableFeature withJdbc}"
] ++ lib.optionals doInstallCheck [
# development settings
"-DBUILD_UNITTESTS=ON"
2022-02-11 20:53:45 +00:00
];
2022-02-12 11:23:04 +00:00
2022-05-01 14:19:26 +00:00
doInstallCheck = true;
2022-09-06 10:21:25 +00:00
preInstallCheck = ''
export HOME="$(mktemp -d)"
'' + lib.optionalString stdenv.isDarwin ''
export DYLD_LIBRARY_PATH="$out/lib''${DYLD_LIBRARY_PATH:+:}''${DYLD_LIBRARY_PATH}"
'';
installCheckPhase =
let
excludes = map (pattern: "exclude:'${pattern}'") [
2022-11-14 20:58:01 +00:00
"[s3]"
"Test closing database during long running query"
"test/common/test_cast_hugeint.test"
"test/sql/copy/csv/test_csv_remote.test"
"test/sql/copy/parquet/test_parquet_remote.test"
2022-06-21 14:10:52 +00:00
"test/sql/copy/parquet/test_parquet_remote_foreign_files.test"
2022-11-14 20:58:01 +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-14 15:16:13 +00:00
"test/sql/json/read_json_objects.test"
"test/sql/json/read_json.test"
"test/sql/copy/parquet/parquet_5968.test"
"test/fuzzer/pedro/buffer_manager_out_of_memory.test"
2023-03-06 08:52:57 +00:00
"test/sql/storage/compression/bitpacking/bitpacking_size_calculation.test"
"test/sql/copy/parquet/delta_byte_array_length_mismatch.test"
"test/sql/function/timestamp/test_icu_strptime.test"
"test/sql/timezone/test_icu_timezone.test"
2023-06-06 13:33:50 +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"
"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-14 20:58:01 +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"
] ++ 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
2022-05-01 14:19:26 +00:00
$PWD/test/unittest ${lib.concatStringsSep " " excludes}
2022-05-01 14:19:26 +00:00
runHook postInstallCheck
'';
2022-05-01 14:19:26 +00:00
meta = with lib; {
2021-10-22 08:42:51 +00:00
homepage = "https://github.com/duckdb/duckdb";
description = "Embeddable SQL OLAP Database Management System";
2020-05-27 01:27:11 +00:00
license = licenses.mit;
platforms = platforms.all;
2022-02-11 20:54:00 +00:00
maintainers = with maintainers; [ costrouc cpcloud ];
2020-05-27 01:27:11 +00:00
};
}