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

59 lines
1.4 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
, withHttpFs ? true
, 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";
2022-02-11 09:43:44 +00:00
version = "0.3.2";
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}";
2022-02-11 09:43:44 +00:00
sha256 = "sha256-F5YOqDeY3rgcnuu5SNqOfUxhsaXgqvdJZTnD1unI0tc=";
2020-05-27 01:27:11 +00:00
};
2022-02-12 11:23:04 +00:00
patches = [ ./version.patch ];
postPatch = ''
substituteInPlace CMakeLists.txt --subst-var-by DUCKDB_VERSION "v${version}"
'';
2022-02-11 20:53:45 +00:00
cmakeFlags = [
2022-02-12 11:23:04 +00:00
"-DBUILD_FTS_EXTENSION=ON"
"-DBUILD_HTTPFS_EXTENSION=${enableFeature withHttpFs}"
"-DBUILD_ICU_EXTENSION=ON"
"-DBUILD_ODBC_DRIVER=${enableFeature withOdbc}"
"-DBUILD_PARQUET_EXTENSION=ON"
"-DBUILD_REST_EXTENSION=ON"
"-DBUILD_TPCDS_EXTENSION=ON"
"-DBUILD_TPCH_EXTENSION=ON"
"-DBUILD_VISUALIZER_EXTENSION=ON"
"-DJDBC_DRIVER=${enableFeature withJdbc}"
2022-02-11 20:53:45 +00:00
];
2022-02-12 11:23:04 +00:00
2022-02-11 20:53:27 +00:00
nativeBuildInputs = [ cmake ninja ];
2022-02-12 11:23:04 +00:00
buildInputs = lib.optionals withHttpFs [ openssl ]
++ lib.optionals withJdbc [ openjdk11 ]
++ lib.optionals withOdbc [ unixODBC ];
2020-05-27 01:27:11 +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
};
}