2021-02-19 19:06:45 +00:00
|
|
|
{ lib, stdenv, mkDerivation, fetchFromGitHub, cmake, eigen, suitesparse, blas
|
2024-01-02 11:29:13 +00:00
|
|
|
, lapack, libGLU, qtbase, libqglviewer, spdlog }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
mkDerivation rec {
|
|
|
|
pname = "g2o";
|
2024-01-02 11:29:13 +00:00
|
|
|
version = "20230806";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "RainerKuemmerle";
|
|
|
|
repo = pname;
|
|
|
|
rev = "${version}_git";
|
2024-01-02 11:29:13 +00:00
|
|
|
hash = "sha256-9u1FFRWe7qvDhzSKdGTduuGBXmmgzcSriGFb/oCJjNA=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
# Removes a reference to gcc that is only used in a debug message
|
|
|
|
patches = [ ./remove-compiler-reference.patch ];
|
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
outputs = [ "out" "dev" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
separateDebugInfo = true;
|
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
nativeBuildInputs = [ cmake ];
|
2021-02-19 19:06:45 +00:00
|
|
|
buildInputs = [ eigen suitesparse blas lapack libGLU qtbase libqglviewer ];
|
2024-01-02 11:29:13 +00:00
|
|
|
propagatedBuildInputs = [ spdlog ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-02-19 19:06:45 +00:00
|
|
|
dontWrapQtApps = true;
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
cmakeFlags = [
|
|
|
|
# Detection script is broken
|
|
|
|
"-DQGLVIEWER_INCLUDE_DIR=${libqglviewer}/include/QGLViewer"
|
|
|
|
"-DG2O_BUILD_EXAMPLES=OFF"
|
2020-09-25 04:45:31 +00: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"}"
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "A General Framework for Graph Optimization";
|
|
|
|
homepage = "https://github.com/RainerKuemmerle/g2o";
|
|
|
|
license = with licenses; [ bsd3 lgpl3 gpl3 ];
|
|
|
|
maintainers = with maintainers; [ lopsided98 ];
|
|
|
|
platforms = platforms.all;
|
2021-02-19 19:06:45 +00:00
|
|
|
# fatal error: 'qglviewer.h' file not found
|
|
|
|
broken = stdenv.isDarwin;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|