1 { lib, stdenv, mkDerivation, fetchFromGitHub, cmake, eigen, suitesparse, blas
2 , lapack, libGLU, qtbase, libqglviewer, makeWrapper }:
8 src = fetchFromGitHub {
9 owner = "RainerKuemmerle";
11 rev = "${version}_git";
12 sha256 = "sha256-Ik6uBz4Z4rc5+mPNdT8vlNZSBom4Tvt8Y6myBC/s0m8=";
15 # Removes a reference to gcc that is only used in a debug message
16 patches = [ ./remove-compiler-reference.patch ];
18 separateDebugInfo = true;
20 nativeBuildInputs = [ cmake makeWrapper ];
21 buildInputs = [ eigen suitesparse blas lapack libGLU qtbase libqglviewer ];
23 # Silence noisy warning
24 CXXFLAGS = "-Wno-deprecated-copy";
26 dontWrapQtApps = true;
29 # Detection script is broken
30 "-DQGLVIEWER_INCLUDE_DIR=${libqglviewer}/include/QGLViewer"
31 "-DG2O_BUILD_EXAMPLES=OFF"
32 ] ++ lib.optionals stdenv.isx86_64 [
33 "-DDO_SSE_AUTODETECT=OFF"
34 "-DDISABLE_SSE3=${ if stdenv.hostPlatform.sse3Support then "OFF" else "ON"}"
35 "-DDISABLE_SSE4_1=${if stdenv.hostPlatform.sse4_1Support then "OFF" else "ON"}"
36 "-DDISABLE_SSE4_2=${if stdenv.hostPlatform.sse4_2Support then "OFF" else "ON"}"
37 "-DDISABLE_SSE4_A=${if stdenv.hostPlatform.sse4_aSupport then "OFF" else "ON"}"
41 description = "A General Framework for Graph Optimization";
42 homepage = "https://github.com/RainerKuemmerle/g2o";
43 license = with licenses; [ bsd3 lgpl3 gpl3 ];
44 maintainers = with maintainers; [ lopsided98 ];
45 platforms = platforms.all;
46 # fatal error: 'qglviewer.h' file not found
47 broken = stdenv.isDarwin;