2019-05-18 03:54:08 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, cmake, eigen, suitesparse, libGLU, qt5
|
|
|
|
, libsForQt5, makeWrapper }:
|
2019-05-12 06:08:16 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "g2o";
|
|
|
|
version = "unstable-2019-04-07";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "RainerKuemmerle";
|
|
|
|
repo = pname;
|
|
|
|
rev = "9b41a4ea5ade8e1250b9c1b279f3a9c098811b5a";
|
|
|
|
sha256 = "1rgrz6zxiinrik3lgwgvsmlww1m2fnpjmvcx1mf62xi1s2ma5w2i";
|
|
|
|
};
|
|
|
|
|
2019-05-18 03:54:08 +00:00
|
|
|
# Removes a reference to gcc that is only used in a debug message
|
|
|
|
patches = [ ./remove-compiler-reference.patch ];
|
|
|
|
|
2019-06-07 22:10:44 +00:00
|
|
|
separateDebugInfo = true;
|
|
|
|
|
2019-05-18 03:54:08 +00:00
|
|
|
nativeBuildInputs = [ cmake makeWrapper ];
|
|
|
|
buildInputs = [ eigen suitesparse libGLU qt5.qtbase libsForQt5.libqglviewer ];
|
|
|
|
|
2020-04-15 23:48:24 +00:00
|
|
|
# Silence noisy warning
|
|
|
|
CXXFLAGS = "-Wno-deprecated-copy";
|
|
|
|
|
2019-05-18 03:54:08 +00:00
|
|
|
cmakeFlags = [
|
|
|
|
# Detection script is broken
|
|
|
|
"-DQGLVIEWER_INCLUDE_DIR=${libsForQt5.libqglviewer}/include/QGLViewer"
|
|
|
|
"-DG2O_BUILD_EXAMPLES=OFF"
|
|
|
|
] ++ lib.optionals stdenv.isx86_64 ([ "-DDO_SSE_AUTODETECT=OFF" ] ++ {
|
2019-08-13 21:52:01 +00:00
|
|
|
default = [ "-DDISABLE_SSE3=ON" "-DDISABLE_SSE4_1=ON" "-DDISABLE_SSE4_2=ON" "-DDISABLE_SSE4_A=ON" ];
|
|
|
|
westmere = [ "-DDISABLE_SSE4_A=ON" ];
|
|
|
|
sandybridge = [ "-DDISABLE_SSE4_A=ON" ];
|
|
|
|
ivybridge = [ "-DDISABLE_SSE4_A=ON" ];
|
|
|
|
haswell = [ "-DDISABLE_SSE4_A=ON" ];
|
|
|
|
broadwell = [ "-DDISABLE_SSE4_A=ON" ];
|
|
|
|
skylake = [ "-DDISABLE_SSE4_A=ON" ];
|
|
|
|
skylake-avx512 = [ "-DDISABLE_SSE4_A=ON" ];
|
2019-05-18 03:54:08 +00:00
|
|
|
}.${stdenv.hostPlatform.platform.gcc.arch or "default"});
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
wrapProgram $out/bin/g2o_viewer \
|
|
|
|
--prefix QT_PLUGIN_PATH : "${qt5.qtbase}/${qt5.qtbase.qtPluginPrefix}"
|
|
|
|
'';
|
2019-05-12 06:08:16 +00:00
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "A General Framework for Graph Optimization";
|
|
|
|
homepage = "https://github.com/RainerKuemmerle/g2o";
|
|
|
|
license = with lib.licenses; [ bsd3 lgpl3 gpl3 ];
|
|
|
|
maintainers = with lib.maintainers; [ lopsided98 ];
|
|
|
|
platforms = lib.platforms.all;
|
|
|
|
};
|
|
|
|
}
|