nixpkgs/pkgs/development/tools/tora/default.nix

66 lines
1.7 KiB
Nix
Raw Normal View History

2017-05-17 20:26:11 +01:00
{ mkDerivation, lib, fetchFromGitHub, cmake, extra-cmake-modules, makeWrapper
2017-01-04 08:37:45 +00:00
, boost, doxygen, openssl, mysql, postgresql, graphviz, loki, qscintilla, qtbase }:
let
qscintillaLib = (qscintilla.override { withQt5 = true; });
2017-05-17 20:26:11 +01:00
in mkDerivation rec {
2017-01-04 08:37:45 +00:00
name = "tora-${version}";
version = "3.1";
src = fetchFromGitHub {
owner = "tora-tool";
repo = "tora";
rev = "v${version}";
sha256 = "0wninl10bcgiljf6wnhn2rv8kmzryw78x5qvbw8s2zfjlnxjsbn7";
};
2017-05-17 20:26:11 +01:00
nativeBuildInputs = [ cmake extra-cmake-modules makeWrapper ];
2017-01-04 08:37:45 +00:00
buildInputs = [
boost doxygen graphviz loki mysql openssl postgresql qscintillaLib qtbase
];
preConfigure = ''
sed -i \
's|defaultGvHome = "/usr/bin"|defaultGvHome = "${lib.getBin graphviz}/bin"|' \
src/widgets/toglobalsetting.cpp
sed -i \
's|/usr/bin/dot|${lib.getBin graphviz}/bin/dot|' \
extlibs/libermodel/dotgraph.cpp
'';
cmakeFlags = [
"-DWANT_INTERNAL_LOKI=0"
"-DWANT_INTERNAL_QSCINTILLA=0"
# cmake/modules/FindQScintilla.cmake looks in qtbase and for the wrong library name
"-DQSCINTILLA_INCLUDE_DIR=${qscintillaLib}/include"
"-DQSCINTILLA_LIBRARY=${qscintillaLib}/lib/libqscintilla2.so"
"-DENABLE_DB2=0"
"-DENABLE_ORACLE=0"
"-DENABLE_TERADATA=0"
"-DQT5_BUILD=1"
"-Wno-dev"
];
# these libraries are only searched for at runtime so we need to force-link them
NIX_LDFLAGS = [
"-lgvc"
"-lmysqlclient"
"-lecpg"
"-lssl"
];
postFixup = ''
2017-05-17 20:26:11 +01:00
wrapProgram $out/bin/tora \
2017-01-04 08:37:45 +00:00
--prefix PATH : ${lib.getBin graphviz}/bin
'';
2017-05-17 20:26:11 +01:00
meta = with lib; {
2017-01-04 08:37:45 +00:00
description = "Tora SQL tool";
maintainers = with maintainers; [ peterhoeg ];
platforms = platforms.linux;
license = licenses.asl20;
};
}