uboot: (firmwareOdroidC2/C4) don't invoke patch tool, use patches = [] instead
https://github.com/NixOS/nixpkgs/blob/master/pkgs/stdenv/generic/setup.sh#L948 this can do it nicely. Signed-off-by: Anton Arapov <anton@deadbeef.mx>
This commit is contained in:
commit
56de2bcd43
30691 changed files with 3076956 additions and 0 deletions
91
pkgs/development/libraries/duckdb/default.nix
Normal file
91
pkgs/development/libraries/duckdb/default.nix
Normal file
|
|
@ -0,0 +1,91 @@
|
|||
{ lib
|
||||
, stdenv
|
||||
, fetchFromGitHub
|
||||
, cmake
|
||||
, ninja
|
||||
, openssl
|
||||
, openjdk11
|
||||
, unixODBC
|
||||
, withHttpFs ? true
|
||||
, withJdbc ? false
|
||||
, withOdbc ? false
|
||||
}:
|
||||
|
||||
let
|
||||
enableFeature = yes: if yes then "ON" else "OFF";
|
||||
in
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "duckdb";
|
||||
version = "0.3.4";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = pname;
|
||||
repo = pname;
|
||||
rev = "v${version}";
|
||||
sha256 = "sha256-2PBc5qe2md87u2nvMTx/XZVzLsr8QrvUkw46/6VTlGs=";
|
||||
};
|
||||
|
||||
patches = [ ./version.patch ];
|
||||
postPatch = ''
|
||||
substituteInPlace CMakeLists.txt --subst-var-by DUCKDB_VERSION "v${version}"
|
||||
'';
|
||||
|
||||
cmakeFlags = [
|
||||
"-DBUILD_EXCEL_EXTENSION=ON"
|
||||
"-DBUILD_FTS_EXTENSION=ON"
|
||||
"-DBUILD_HTTPFS_EXTENSION=${enableFeature withHttpFs}"
|
||||
"-DBUILD_ICU_EXTENSION=ON"
|
||||
"-DBUILD_JSON_EXTENSION=ON"
|
||||
"-DBUILD_ODBC_DRIVER=${enableFeature withOdbc}"
|
||||
"-DBUILD_PARQUET_EXTENSION=ON"
|
||||
"-DBUILD_REST=ON"
|
||||
"-DBUILD_SUBSTRAIT_EXTENSION=ON"
|
||||
"-DBUILD_TPCDS_EXTENSION=ON"
|
||||
"-DBUILD_TPCE=ON"
|
||||
"-DBUILD_TPCH_EXTENSION=ON"
|
||||
"-DBUILD_VISUALIZER_EXTENSION=ON"
|
||||
"-DJDBC_DRIVER=${enableFeature withJdbc}"
|
||||
];
|
||||
|
||||
doInstallCheck = true;
|
||||
|
||||
preInstallCheck = lib.optionalString stdenv.isDarwin ''
|
||||
export DYLD_LIBRARY_PATH="$out/lib''${DYLD_LIBRARY_PATH:+:}''${DYLD_LIBRARY_PATH}"
|
||||
'';
|
||||
|
||||
installCheckPhase =
|
||||
let
|
||||
excludes = map (pattern: "exclude:'${pattern}'") [
|
||||
"*test_slow"
|
||||
"Test file buffers for reading/writing to file"
|
||||
"[test_slow]"
|
||||
"test/common/test_cast_hugeint.test"
|
||||
"test/sql/copy/csv/test_csv_remote.test"
|
||||
"test/sql/copy/parquet/test_parquet_remote.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
|
||||
|
||||
$PWD/test/unittest ${lib.concatStringsSep " " excludes}
|
||||
|
||||
runHook postInstallCheck
|
||||
'';
|
||||
|
||||
nativeBuildInputs = [ cmake ninja ];
|
||||
buildInputs = lib.optionals withHttpFs [ openssl ]
|
||||
++ lib.optionals withJdbc [ openjdk11 ]
|
||||
++ lib.optionals withOdbc [ unixODBC ];
|
||||
|
||||
meta = with lib; {
|
||||
homepage = "https://github.com/duckdb/duckdb";
|
||||
description = "Embeddable SQL OLAP Database Management System";
|
||||
license = licenses.mit;
|
||||
platforms = platforms.all;
|
||||
maintainers = with maintainers; [ costrouc cpcloud ];
|
||||
};
|
||||
}
|
||||
51
pkgs/development/libraries/duckdb/version.patch
Normal file
51
pkgs/development/libraries/duckdb/version.patch
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index 92c097228..5f51929f6 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -157,45 +157,7 @@ if(${CMAKE_SYSTEM_NAME} STREQUAL "SunOS")
|
||||
set(SUN TRUE)
|
||||
endif()
|
||||
|
||||
-execute_process(
|
||||
- COMMAND git log -1 --format=%h
|
||||
- WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
- RESULT_VARIABLE GIT_RESULT
|
||||
- OUTPUT_VARIABLE GIT_COMMIT_HASH
|
||||
- OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
-execute_process(
|
||||
- COMMAND git describe --tags --abbrev=0
|
||||
- WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
- OUTPUT_VARIABLE GIT_LAST_TAG
|
||||
- OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
-execute_process(
|
||||
- COMMAND git describe --tags --long
|
||||
- WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
- OUTPUT_VARIABLE GIT_ITERATION
|
||||
- OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
-
|
||||
-if(GIT_RESULT EQUAL "0")
|
||||
- string(REGEX REPLACE "v([0-9]+).[0-9]+.[0-9]+" "\\1" DUCKDB_MAJOR_VERSION "${GIT_LAST_TAG}")
|
||||
- string(REGEX REPLACE "v[0-9]+.([0-9]+).[0-9]+" "\\1" DUCKDB_MINOR_VERSION "${GIT_LAST_TAG}")
|
||||
- string(REGEX REPLACE "v[0-9]+.[0-9]+.([0-9]+)" "\\1" DUCKDB_PATCH_VERSION "${GIT_LAST_TAG}")
|
||||
- string(REGEX REPLACE ".*-([0-9]+)-.*" "\\1" DUCKDB_DEV_ITERATION "${GIT_ITERATION}")
|
||||
-
|
||||
- if(DUCKDB_DEV_ITERATION EQUAL 0)
|
||||
- # on a tag; directly use the version
|
||||
- set(DUCKDB_VERSION "${GIT_LAST_TAG}")
|
||||
- else()
|
||||
- # not on a tag, increment the patch version by one and add a -devX suffix
|
||||
- math(EXPR DUCKDB_PATCH_VERSION "${DUCKDB_PATCH_VERSION}+1")
|
||||
- set(DUCKDB_VERSION "v${DUCKDB_MAJOR_VERSION}.${DUCKDB_MINOR_VERSION}.${DUCKDB_PATCH_VERSION}-dev${DUCKDB_DEV_ITERATION}")
|
||||
- endif()
|
||||
-else()
|
||||
- # fallback for when building from tarball
|
||||
- set(DUCKDB_MAJOR_VERSION 0)
|
||||
- set(DUCKDB_MINOR_VERSION 0)
|
||||
- set(DUCKDB_PATCH_VERSION 1)
|
||||
- set(DUCKDB_DEV_ITERATION 0)
|
||||
- set(DUCKDB_VERSION "v${DUCKDB_MAJOR_VERSION}.${DUCKDB_MINOR_VERSION}.${DUCKDB_PATCH_VERSION}-dev${DUCKDB_DEV_ITERATION}")
|
||||
-endif()
|
||||
+set(DUCKDB_VERSION "@DUCKDB_VERSION@")
|
||||
|
||||
option(AMALGAMATION_BUILD
|
||||
"Build from the amalgamation files, rather than from the normal sources."
|
||||
Loading…
Add table
Add a link
Reference in a new issue