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
|
2024-02-29 20:09:43 +00:00
|
|
|
, python3
|
2022-02-20 05:27:41 +00:00
|
|
|
, 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";
|
2024-04-21 15:54:59 +00:00
|
|
|
versions = lib.importJSON ./versions.json;
|
2022-02-20 05:27:41 +00:00
|
|
|
in
|
2024-04-21 15:54:59 +00:00
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
2020-05-29 06:06:01 +00:00
|
|
|
pname = "duckdb";
|
2024-04-21 15:54:59 +00:00
|
|
|
inherit (versions) rev version;
|
2020-05-29 06:06:01 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2024-04-21 15:54:59 +00:00
|
|
|
# to update run:
|
|
|
|
# nix-shell maintainers/scripts/update.nix --argstr path duckdb
|
|
|
|
inherit (versions) hash;
|
|
|
|
owner = "duckdb";
|
|
|
|
repo = "duckdb";
|
|
|
|
rev = "refs/tags/v${finalAttrs.version}";
|
2020-05-29 06:06:01 +00:00
|
|
|
};
|
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
outputs = [ "out" "lib" "dev" ];
|
2022-02-20 05:27:41 +00:00
|
|
|
|
2024-02-29 20:09:43 +00:00
|
|
|
nativeBuildInputs = [ cmake ninja python3 ];
|
2023-02-22 10:55:15 +00:00
|
|
|
buildInputs = [ openssl ]
|
|
|
|
++ lib.optionals withJdbc [ openjdk11 ]
|
|
|
|
++ lib.optionals withOdbc [ unixODBC ];
|
|
|
|
|
2022-02-20 05:27:41 +00:00
|
|
|
cmakeFlags = [
|
2024-04-21 15:54:59 +00:00
|
|
|
"-DDUCKDB_EXTENSION_CONFIGS=${finalAttrs.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}"
|
2024-04-21 15:54:59 +00:00
|
|
|
"-DOVERRIDE_GIT_DESCRIBE=v${finalAttrs.version}-0-g${finalAttrs.rev}"
|
|
|
|
] ++ lib.optionals finalAttrs.doInstallCheck [
|
2023-02-22 10:55:15 +00:00
|
|
|
# development settings
|
|
|
|
"-DBUILD_UNITTESTS=ON"
|
2022-02-20 05:27:41 +00:00
|
|
|
];
|
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
postInstall = ''
|
|
|
|
mkdir -p $lib
|
|
|
|
mv $out/lib $lib
|
2022-04-27 09:35:20 +00:00
|
|
|
'';
|
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
doInstallCheck = true;
|
|
|
|
|
2022-04-27 09:35:20 +00:00
|
|
|
installCheckPhase =
|
|
|
|
let
|
2024-02-29 20:09:43 +00:00
|
|
|
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"
|
2024-02-29 20:09:43 +00:00
|
|
|
# test expects installed file timestamp to be > 2024
|
|
|
|
"test/sql/table_function/read_text_and_blob.test"
|
2024-04-21 15:54:59 +00:00
|
|
|
# fails with Out of Memory Error
|
|
|
|
"test/sql/copy/parquet/batched_write/batch_memory_usage.test"
|
|
|
|
# wants http connection
|
2024-05-15 15:35:15 +00:00
|
|
|
"test/sql/copy/csv/recursive_query_csv.test"
|
2024-04-21 15:54:59 +00:00
|
|
|
"test/sql/copy/csv/test_mixed_lines.test"
|
2024-09-26 11:04:55 +00:00
|
|
|
] ++ lib.optionals stdenv.hostPlatform.isAarch64 [
|
2022-04-27 09:35:20 +00:00
|
|
|
"test/sql/aggregate/aggregates/test_kurtosis.test"
|
|
|
|
"test/sql/aggregate/aggregates/test_skewness.test"
|
|
|
|
"test/sql/function/list/aggregates/skewness.test"
|
2024-02-29 20:09:43 +00:00
|
|
|
]);
|
2024-09-26 11:04:55 +00:00
|
|
|
LD_LIBRARY_PATH = lib.optionalString stdenv.hostPlatform.isDarwin "DY" + "LD_LIBRARY_PATH";
|
2022-04-27 09:35:20 +00:00
|
|
|
in
|
|
|
|
''
|
|
|
|
runHook preInstallCheck
|
2024-04-21 15:54:59 +00:00
|
|
|
(($(ulimit -n) < 1024)) && ulimit -n 1024
|
2022-04-27 09:35:20 +00:00
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
HOME="$(mktemp -d)" ${LD_LIBRARY_PATH}="$lib/lib" ./test/unittest ${toString excludes}
|
2022-04-27 09:35:20 +00:00
|
|
|
|
|
|
|
runHook postInstallCheck
|
|
|
|
'';
|
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
passthru.updateScript = ./update.sh;
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2024-04-21 15:54:59 +00:00
|
|
|
changelog = "https://github.com/duckdb/duckdb/releases/tag/v${finalAttrs.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
|
|
|
};
|
2024-04-21 15:54:59 +00:00
|
|
|
})
|