nixpkgs/pkgs/development/libraries/g2o/default.nix

50 lines
1.6 KiB
Nix
Raw Normal View History

{ lib, stdenv, mkDerivation, fetchFromGitHub, cmake, eigen, suitesparse, blas
, lapack, libGLU, qtbase, libqglviewer, makeWrapper }:
2019-05-12 06:08:16 +00:00
2020-04-15 23:50:50 +00:00
mkDerivation rec {
2019-05-12 06:08:16 +00:00
pname = "g2o";
2021-02-18 01:59:21 +00:00
version = "20201223";
2019-05-12 06:08:16 +00:00
src = fetchFromGitHub {
owner = "RainerKuemmerle";
repo = pname;
2020-04-15 23:50:50 +00:00
rev = "${version}_git";
2021-02-18 01:59:21 +00:00
sha256 = "sha256-Ik6uBz4Z4rc5+mPNdT8vlNZSBom4Tvt8Y6myBC/s0m8=";
2019-05-12 06:08:16 +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;
nativeBuildInputs = [ cmake makeWrapper ];
buildInputs = [ eigen suitesparse blas lapack libGLU qtbase libqglviewer ];
# Silence noisy warning
CXXFLAGS = "-Wno-deprecated-copy";
dontWrapQtApps = true;
cmakeFlags = [
# Detection script is broken
2020-04-15 23:50:50 +00:00
"-DQGLVIEWER_INCLUDE_DIR=${libqglviewer}/include/QGLViewer"
"-DG2O_BUILD_EXAMPLES=OFF"
] ++ 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-15 23:50:50 +00:00
meta = with lib; {
2019-05-12 06:08:16 +00:00
description = "A General Framework for Graph Optimization";
homepage = "https://github.com/RainerKuemmerle/g2o";
2020-04-15 23:50:50 +00: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 06:08:16 +00:00
};
}