2021-02-18 01:06:34 +00:00
|
|
|
{ lib, stdenv, mkDerivation, fetchFromGitHub, cmake, eigen, suitesparse, blas
|
|
|
|
, lapack, 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";
|
2021-02-18 01:59:21 +00:00
|
|
|
version = "20201223";
|
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";
|
2021-02-18 01:59:21 +00:00
|
|
|
sha256 = "sha256-Ik6uBz4Z4rc5+mPNdT8vlNZSBom4Tvt8Y6myBC/s0m8=";
|
2019-05-12 07:08:16 +01:00
|
|
|
};
|
|
|
|
|
2019-05-18 04:54:08 +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;
|
|
|
|
|
2019-05-18 04:54:08 +01:00
|
|
|
nativeBuildInputs = [ cmake makeWrapper ];
|
2021-02-18 01:06:34 +00:00
|
|
|
buildInputs = [ eigen suitesparse blas lapack libGLU qtbase libqglviewer ];
|
2019-05-18 04:54:08 +01:00
|
|
|
|
2020-04-16 00:48:24 +01:00
|
|
|
# Silence noisy warning
|
|
|
|
CXXFLAGS = "-Wno-deprecated-copy";
|
|
|
|
|
2021-01-12 11:50:23 +00:00
|
|
|
dontWrapQtApps = true;
|
|
|
|
|
2019-05-18 04:54:08 +01:00
|
|
|
cmakeFlags = [
|
|
|
|
# Detection script is broken
|
2020-04-16 00:50:50 +01:00
|
|
|
"-DQGLVIEWER_INCLUDE_DIR=${libqglviewer}/include/QGLViewer"
|
2019-05-18 04:54:08 +01:00
|
|
|
"-DG2O_BUILD_EXAMPLES=OFF"
|
2020-08-05 03:32:41 +01:00
|
|
|
] ++ 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"}"
|
|
|
|
];
|
2019-05-18 04:54:08 +01:00
|
|
|
|
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;
|
2021-02-18 11:53:18 +00:00
|
|
|
# fatal error: 'qglviewer.h' file not found
|
|
|
|
broken = stdenv.isDarwin;
|
2019-05-12 07:08:16 +01:00
|
|
|
};
|
|
|
|
}
|