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

46 lines
1.5 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"
"-DDISABLE_SSE3=${ if stdenv.hostPlatform.sse3Support then "OFF" else "ON"}"
"-DDISABLE_SSE4_1=${if stdenv.hostPlatform.sse4_1Support then "OFF" else "ON"}"
"-DDISABLE_SSE4_2=${if stdenv.hostPlatform.sse4_2Support then "OFF" else "ON"}"
"-DDISABLE_SSE4_A=${if stdenv.hostPlatform.sse4_aSupport then "OFF" else "ON"}"
];
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
};
}