3
0
Fork 0
forked from mirrors/nixpkgs

Merge pull request #61655 from lopsided98/g2o-fixes

g2o: build g2o_viewer, libqglviewer: 2.6.3 -> 2.7.1
This commit is contained in:
Samuel Dionne-Riel 2019-08-18 00:00:01 -04:00 committed by GitHub
commit c2742295fb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 68 additions and 17 deletions

View file

@ -1,4 +1,5 @@
{ lib, stdenv, fetchFromGitHub, cmake, eigen, suitesparse }:
{ lib, stdenv, fetchFromGitHub, cmake, eigen, suitesparse, libGLU, qt5
, libsForQt5, makeWrapper }:
stdenv.mkDerivation rec {
pname = "g2o";
@ -11,8 +12,33 @@ stdenv.mkDerivation rec {
sha256 = "1rgrz6zxiinrik3lgwgvsmlww1m2fnpjmvcx1mf62xi1s2ma5w2i";
};
nativeBuildInputs = [ cmake ];
buildInputs = [ eigen suitesparse ];
# Removes a reference to gcc that is only used in a debug message
patches = [ ./remove-compiler-reference.patch ];
separateDebugInfo = true;
nativeBuildInputs = [ cmake makeWrapper ];
buildInputs = [ eigen suitesparse libGLU qt5.qtbase libsForQt5.libqglviewer ];
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" ] ++ {
"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" ];
}.${stdenv.hostPlatform.platform.gcc.arch or "default"});
postInstall = ''
wrapProgram $out/bin/g2o_viewer \
--prefix QT_PLUGIN_PATH : "${qt5.qtbase}/${qt5.qtbase.qtPluginPrefix}"
'';
meta = {
description = "A General Framework for Graph Optimization";

View file

@ -0,0 +1,25 @@
From b9bfed09e4e3c481b7eb36bee1ff4202ccf69dee Mon Sep 17 00:00:00 2001
From: Ben Wolsieffer <benwolsieffer@gmail.com>
Date: Fri, 17 May 2019 19:05:36 -0400
Subject: [PATCH] Remove reference to compiler.
---
CMakeLists.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index a3f66dd..bb05bd0 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -371,7 +371,7 @@ set(G2O_HAVE_CHOLMOD ${CHOLMOD_FOUND})
set(G2O_HAVE_CSPARSE ${CSPARSE_FOUND})
set(G2O_SHARED_LIBS ${BUILD_SHARED_LIBS})
set(G2O_LGPL_SHARED_LIBS ${BUILD_LGPL_SHARED_LIBS})
-set(G2O_CXX_COMPILER "${CMAKE_CXX_COMPILER_ID} ${CMAKE_CXX_COMPILER}")
+set(G2O_CXX_COMPILER "${CMAKE_CXX_COMPILER_ID} unknown")
configure_file(config.h.in "${PROJECT_BINARY_DIR}/g2o/config.h")
install(FILES ${PROJECT_BINARY_DIR}/g2o/config.h DESTINATION ${INCLUDES_DESTINATION}/g2o)
--
2.21.0

View file

@ -1,25 +1,25 @@
{ stdenv, fetchurl, qt4, qmake4Hook, AGL }:
{ stdenv, fetchurl, qmake, qtbase, libGLU, AGL }:
stdenv.mkDerivation rec {
name = "libqglviewer-2.6.3";
version = "2.6.3";
pname = "libqglviewer";
version = "2.7.1";
src = fetchurl {
url = "http://www.libqglviewer.com/src/libQGLViewer-${version}.tar.gz";
sha256 = "00jdkyk4wg1356c3ar6nk3hyp494ya3yvshq9m57kfmqpn3inqdy";
sha256 = "08f10yk22kjdsvrqhd063gqa8nxnl749c20mwhaxij4f7rzdkixz";
};
buildInputs = [ qt4 qmake4Hook ]
nativeBuildInputs = [ qmake ];
buildInputs = [ qtbase libGLU ]
++ stdenv.lib.optional stdenv.isDarwin AGL;
postPatch =
''
cd QGLViewer
'';
postPatch = ''
cd QGLViewer
'';
meta = with stdenv.lib; {
description = "C++ library based on Qt that eases the creation of OpenGL 3D viewers";
homepage = http://libqglviewer.com/;
homepage = "http://libqglviewer.com";
license = licenses.gpl2;
platforms = platforms.all;
};

View file

@ -11924,10 +11924,6 @@ in
libplist = callPackage ../development/libraries/libplist { };
libqglviewer = callPackage ../development/libraries/libqglviewer {
inherit (darwin.apple_sdk.frameworks) AGL;
};
libre = callPackage ../development/libraries/libre {};
librem = callPackage ../development/libraries/librem {};
@ -13147,6 +13143,10 @@ in
libopenshot-audio = callPackage ../applications/video/openshot-qt/libopenshot-audio.nix { };
libqglviewer = callPackage ../development/libraries/libqglviewer {
inherit (darwin.apple_sdk.frameworks) AGL;
};
libqtav = callPackage ../development/libraries/libqtav { };
kpmcore = callPackage ../development/libraries/kpmcore { };