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-J2Z3oRkyiinIfywBQvnq1Q8Z5WuzQXOVTZTwN8oivf0=";
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 dontWrapQtApps = true;
26 # Detection script is broken
27 "-DQGLVIEWER_INCLUDE_DIR=${libqglviewer}/include/QGLViewer"
28 "-DG2O_BUILD_EXAMPLES=OFF"
29 ] ++ lib.optionals stdenv.isx86_64 [
30 "-DDO_SSE_AUTODETECT=OFF"
31 "-DDISABLE_SSE3=${ if stdenv.hostPlatform.sse3Support then "OFF" else "ON"}"
32 "-DDISABLE_SSE4_1=${if stdenv.hostPlatform.sse4_1Support then "OFF" else "ON"}"
33 "-DDISABLE_SSE4_2=${if stdenv.hostPlatform.sse4_2Support then "OFF" else "ON"}"
34 "-DDISABLE_SSE4_A=${if stdenv.hostPlatform.sse4_aSupport then "OFF" else "ON"}"
38 description = "A General Framework for Graph Optimization";
39 homepage = "https://github.com/RainerKuemmerle/g2o";
40 license = with licenses; [ bsd3 lgpl3 gpl3 ];
41 maintainers = with maintainers; [ lopsided98 ];
42 platforms = platforms.all;
43 # fatal error: 'qglviewer.h' file not found
44 broken = stdenv.isDarwin;