3
0
Fork 0
forked from mirrors/nixpkgs

arangodb: parameterize target architecture

If -DTARGET_ARCHITECTURE is supplied arango's cmake configuration will
not use /proc/cpuinfo for feature detection. However, `generic` and
`none` options both fail when building the vendored v8.

This workaround provides some defaults, but warns if no override is
provided.
This commit is contained in:
John Soo 2022-10-27 12:38:56 -07:00
parent 1e1711061e
commit b594ac0d72
No known key found for this signature in database
GPG key ID: D8A148F8CE4DDBC2

View file

@ -14,10 +14,30 @@
, snappy
, lzo
, which
, targetArchitecture ? null
}:
gcc10Stdenv.mkDerivation rec {
let
pname = "arangodb";
default_arch =
if gcc10Stdenv.isx86_64
then "haswell"
else if gcc10Stdenv.isAarch64
then "zen"
else "none";
target_arch =
if isNull targetArchitecture
then
lib.warn
"${pname} target architecture not specified, choosing ${default_arch}"
default_arch
else targetArchitecture;
in
gcc10Stdenv.mkDerivation rec {
inherit pname;
version = "3.10.0";
src = fetchFromGitHub {
@ -51,7 +71,7 @@ gcc10Stdenv.mkDerivation rec {
"-DCMAKE_BUILD_TYPE=RelWithDebInfo"
# avoid reading /proc/cpuinfo for feature detection
"-DTARGET_ARCHITECTURE=generic"
"-DTARGET_ARCHITECTURE=${target_arch}"
];
meta = with lib; {