2022-11-21 17:40:18 +00:00
|
|
|
{
|
2023-05-24 13:37:59 +00:00
|
|
|
# gcc 11.2 suggested on 3.10.5.2.
|
2022-11-21 17:40:18 +00:00
|
|
|
# gcc 11.3.0 unsupported yet, investigate gcc support when upgrading
|
|
|
|
# See https://github.com/arangodb/arangodb/issues/17454
|
|
|
|
gcc10Stdenv
|
|
|
|
, git
|
|
|
|
, lib
|
|
|
|
, fetchFromGitHub
|
|
|
|
, openssl
|
|
|
|
, zlib
|
|
|
|
, cmake
|
|
|
|
, python3
|
|
|
|
, perl
|
|
|
|
, snappy
|
|
|
|
, lzo
|
|
|
|
, which
|
|
|
|
, targetArchitecture ? null
|
|
|
|
, asmOptimizations ? gcc10Stdenv.targetPlatform.isx86
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
let
|
2022-11-21 17:40:18 +00:00
|
|
|
defaultTargetArchitecture =
|
|
|
|
if gcc10Stdenv.targetPlatform.isx86
|
|
|
|
then "haswell"
|
|
|
|
else "core";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-11-21 17:40:18 +00:00
|
|
|
targetArch =
|
2023-03-24 00:07:29 +00:00
|
|
|
if targetArchitecture == null
|
2022-11-21 17:40:18 +00:00
|
|
|
then defaultTargetArchitecture
|
|
|
|
else targetArchitecture;
|
|
|
|
in
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-11-21 17:40:18 +00:00
|
|
|
gcc10Stdenv.mkDerivation rec {
|
|
|
|
pname = "arangodb";
|
2023-05-24 13:37:59 +00:00
|
|
|
version = "3.10.5.2";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-11-21 17:40:18 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
repo = "arangodb";
|
|
|
|
owner = "arangodb";
|
|
|
|
rev = "v${version}";
|
2023-05-24 13:37:59 +00:00
|
|
|
sha256 = "sha256-64iTxhG8qKTSrTlH/BWDJNnLf8VnaCteCKfQ9D2lGDQ=";
|
2022-11-21 17:40:18 +00:00
|
|
|
fetchSubmodules = true;
|
|
|
|
};
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-11-21 17:40:18 +00:00
|
|
|
nativeBuildInputs = [ cmake git perl python3 which ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-11-21 17:40:18 +00:00
|
|
|
buildInputs = [ openssl zlib snappy lzo ];
|
2022-04-15 01:41:22 +00:00
|
|
|
|
2022-11-21 17:40:18 +00:00
|
|
|
# prevent failing with "cmake-3.13.4/nix-support/setup-hook: line 10: ./3rdParty/rocksdb/RocksDBConfig.cmake.in: No such file or directory"
|
|
|
|
dontFixCmake = true;
|
2023-03-04 12:14:45 +00:00
|
|
|
env.NIX_CFLAGS_COMPILE = "-Wno-error";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-11-21 17:40:18 +00:00
|
|
|
postPatch = ''
|
|
|
|
sed -ie 's!/bin/echo!echo!' 3rdParty/V8/gypfiles/*.gypi
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-11-21 17:40:18 +00:00
|
|
|
# with nixpkgs, it has no sense to check for a version update
|
|
|
|
substituteInPlace js/client/client.js --replace "require('@arangodb').checkAvailableVersions();" ""
|
|
|
|
substituteInPlace js/server/server.js --replace "require('@arangodb').checkAvailableVersions();" ""
|
|
|
|
'';
|
|
|
|
|
|
|
|
preConfigure = ''
|
|
|
|
patchShebangs utils
|
|
|
|
'';
|
|
|
|
|
|
|
|
cmakeFlags = [
|
|
|
|
"-DUSE_MAINTAINER_MODE=OFF"
|
|
|
|
"-DUSE_GOOGLE_TESTS=OFF"
|
|
|
|
"-DCMAKE_BUILD_TYPE=RelWithDebInfo"
|
|
|
|
|
|
|
|
# avoid reading /proc/cpuinfo for feature detection
|
|
|
|
"-DTARGET_ARCHITECTURE=${targetArch}"
|
|
|
|
] ++ lib.optionals asmOptimizations [
|
|
|
|
"-DASM_OPTIMIZATIONS=ON"
|
|
|
|
"-DHAVE_SSE42=${if gcc10Stdenv.targetPlatform.sse4_2Support then "ON" else "OFF"}"
|
|
|
|
];
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
homepage = "https://www.arangodb.com";
|
|
|
|
description = "A native multi-model database with flexible data models for documents, graphs, and key-values";
|
|
|
|
license = licenses.asl20;
|
|
|
|
platforms = [ "x86_64-linux" ];
|
|
|
|
maintainers = with maintainers; [ flosse jsoo1 ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|