nixpkgs/pkgs/development/libraries/g2o/default.nix
Silvan Mosberger 4f0dadbf38 treewide: format all inactive Nix files
After final improvements to the official formatter implementation,
this commit now performs the first treewide reformat of Nix files using it.
This is part of the implementation of RFC 166.

Only "inactive" files are reformatted, meaning only files that
aren't being touched by any PR with activity in the past 2 months.
This is to avoid conflicts for PRs that might soon be merged.
Later we can do a full treewide reformat to get the rest,
which should not cause as many conflicts.

A CI check has already been running for some time to ensure that new and
already-formatted files are formatted, so the files being reformatted here
should also stay formatted.

This commit was automatically created and can be verified using

    nix-build a08b3a4d19.tar.gz \
      --argstr baseRev b32a094368
    result/bin/apply-formatting $NIXPKGS_PATH
2024-12-10 20:26:33 +01:00

79 lines
1.7 KiB
Nix

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