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

49 lines
2.1 KiB
Nix
Raw Normal View History

2020-04-16 00:50:50 +01:00
{ lib, stdenv, mkDerivation, fetchFromGitHub, cmake, eigen, suitesparse, libGLU
, qtbase, libqglviewer, makeWrapper }:
2019-05-12 07:08:16 +01:00
2020-04-16 00:50:50 +01:00
mkDerivation rec {
2019-05-12 07:08:16 +01:00
pname = "g2o";
2020-04-16 00:50:50 +01:00
version = "20200410";
2019-05-12 07:08:16 +01:00
src = fetchFromGitHub {
owner = "RainerKuemmerle";
repo = pname;
2020-04-16 00:50:50 +01:00
rev = "${version}_git";
sha256 = "11rgj2g9mmwajlr69pjkjvxjyn88afa0r4bchjyvmxswjccizlg2";
2019-05-12 07:08:16 +01:00
};
# Removes a reference to gcc that is only used in a debug message
patches = [ ./remove-compiler-reference.patch ];
2019-06-07 23:10:44 +01:00
separateDebugInfo = true;
nativeBuildInputs = [ cmake makeWrapper ];
2020-04-16 00:50:50 +01:00
buildInputs = [ eigen suitesparse libGLU qtbase libqglviewer ];
# Silence noisy warning
CXXFLAGS = "-Wno-deprecated-copy";
cmakeFlags = [
# Detection script is broken
2020-04-16 00:50:50 +01:00
"-DQGLVIEWER_INCLUDE_DIR=${libqglviewer}/include/QGLViewer"
"-DG2O_BUILD_EXAMPLES=OFF"
] ++ lib.optionals stdenv.isx86_64 ([ "-DDO_SSE_AUTODETECT=OFF" ] ++ {
2019-08-13 22:52:01 +01:00
default = [ "-DDISABLE_SSE3=ON" "-DDISABLE_SSE4_1=ON" "-DDISABLE_SSE4_2=ON" "-DDISABLE_SSE4_A=ON" ];
westmere = [ "-DDISABLE_SSE4_A=ON" ];
sandybridge = [ "-DDISABLE_SSE4_A=ON" ];
ivybridge = [ "-DDISABLE_SSE4_A=ON" ];
haswell = [ "-DDISABLE_SSE4_A=ON" ];
broadwell = [ "-DDISABLE_SSE4_A=ON" ];
skylake = [ "-DDISABLE_SSE4_A=ON" ];
skylake-avx512 = [ "-DDISABLE_SSE4_A=ON" ];
}.${stdenv.hostPlatform.platform.gcc.arch or "default"});
2020-04-16 00:50:50 +01:00
meta = with lib; {
2019-05-12 07:08:16 +01:00
description = "A General Framework for Graph Optimization";
homepage = "https://github.com/RainerKuemmerle/g2o";
2020-04-16 00:50:50 +01:00
license = with licenses; [ bsd3 lgpl3 gpl3 ];
maintainers = with maintainers; [ lopsided98 ];
platforms = platforms.all;
2019-05-12 07:08:16 +01:00
};
}