2018-03-19 01:03:18 +00:00
|
|
|
{ stdenv, lib, fetchurl, unzip
|
2017-01-03 05:33:42 +00:00
|
|
|
, qt4 ? null, qmake4Hook ? null
|
2018-03-19 01:03:18 +00:00
|
|
|
, withQt5 ? false, qtbase ? null, qtmacextras ? null, qmake ? null
|
2019-05-06 19:43:13 +01:00
|
|
|
, fixDarwinDylibNames
|
2017-01-03 05:33:42 +00:00
|
|
|
}:
|
2014-08-20 23:41:41 +01:00
|
|
|
|
2019-02-19 03:43:55 +00:00
|
|
|
let
|
|
|
|
pname = "qscintilla-qt${if withQt5 then "5" else "4"}";
|
|
|
|
version = "2.11.2";
|
2014-08-20 23:41:41 +01:00
|
|
|
|
2019-02-19 03:43:55 +00:00
|
|
|
in stdenv.mkDerivation rec {
|
|
|
|
inherit pname version;
|
2014-08-20 23:41:41 +01:00
|
|
|
|
|
|
|
src = fetchurl {
|
2019-02-19 03:43:55 +00:00
|
|
|
url = "https://www.riverbankcomputing.com/static/Downloads/QScintilla/${version}/QScintilla_gpl-${version}.tar.gz";
|
|
|
|
sha256 = "18glb2v07mwfz6p8qmwhzcaaczyc36x3gn9wx8ndm7q6d93xr6q2";
|
2014-08-20 23:41:41 +01:00
|
|
|
};
|
|
|
|
|
2019-02-19 03:43:55 +00:00
|
|
|
sourceRoot = "QScintilla_gpl-${version}/Qt4Qt5";
|
|
|
|
|
2019-05-05 19:07:49 +01:00
|
|
|
buildInputs = [ (if withQt5 then qtbase else qt4) ];
|
|
|
|
|
|
|
|
propagatedBuildInputs = lib.optional (withQt5 && stdenv.isDarwin) qtmacextras;
|
|
|
|
|
2018-03-19 01:03:18 +00:00
|
|
|
nativeBuildInputs = [ unzip ]
|
2019-05-06 19:43:13 +01:00
|
|
|
++ (if withQt5 then [ qmake ] else [ qmake4Hook ])
|
|
|
|
++ lib.optional stdenv.isDarwin fixDarwinDylibNames;
|
2017-01-03 05:33:42 +00:00
|
|
|
|
2020-05-24 00:34:06 +01:00
|
|
|
patches = lib.optional (!withQt5) ./fix-qt4-build.patch;
|
2018-03-13 09:47:08 +00:00
|
|
|
|
2019-09-09 18:40:15 +01:00
|
|
|
# Make sure that libqscintilla2.so is available in $out/lib since it is expected
|
|
|
|
# by some packages such as sqlitebrowser
|
|
|
|
postFixup = ''
|
|
|
|
ln -s $out/lib/libqscintilla2_qt?.so $out/lib/libqscintilla2.so
|
|
|
|
'';
|
|
|
|
|
2017-01-03 05:33:42 +00:00
|
|
|
enableParallelBuilding = true;
|
2014-08-20 23:41:41 +01:00
|
|
|
|
2019-02-19 03:43:55 +00:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace qscintilla.pro \
|
|
|
|
--replace '$$[QT_INSTALL_LIBS]' $out/lib \
|
|
|
|
--replace '$$[QT_INSTALL_HEADERS]' $out/include \
|
|
|
|
--replace '$$[QT_INSTALL_TRANSLATIONS]' $out/translations \
|
|
|
|
--replace '$$[QT_HOST_DATA]/mkspecs' $out/mkspecs \
|
|
|
|
--replace '$$[QT_INSTALL_DATA]/mkspecs' $out/mkspecs \
|
|
|
|
--replace '$$[QT_INSTALL_DATA]' $out/share${lib.optionalString (! withQt5) "/qt"}
|
2014-08-20 23:41:41 +01:00
|
|
|
'';
|
|
|
|
|
2017-01-03 05:33:42 +00:00
|
|
|
meta = with stdenv.lib; {
|
2014-08-20 23:41:41 +01:00
|
|
|
description = "A Qt port of the Scintilla text editing library";
|
|
|
|
longDescription = ''
|
|
|
|
QScintilla is a port to Qt of Neil Hodgson's Scintilla C++ editor
|
|
|
|
control.
|
|
|
|
|
|
|
|
As well as features found in standard text editing components,
|
|
|
|
QScintilla includes features especially useful when editing and
|
|
|
|
debugging source code. These include support for syntax styling,
|
|
|
|
error indicators, code completion and call tips. The selection
|
|
|
|
margin can contain markers like those used in debuggers to
|
|
|
|
indicate breakpoints and the current line. Styling choices are
|
|
|
|
more open than with many editors, allowing the use of
|
|
|
|
proportional fonts, bold and italics, multiple foreground and
|
|
|
|
background colours and multiple fonts.
|
|
|
|
'';
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "https://www.riverbankcomputing.com/software/qscintilla/intro";
|
2017-01-03 05:33:42 +00:00
|
|
|
license = with licenses; [ gpl2 gpl3 ]; # and commercial
|
2017-01-03 05:43:16 +00:00
|
|
|
maintainers = with maintainers; [ peterhoeg ];
|
2019-02-19 03:43:55 +00:00
|
|
|
platforms = platforms.unix;
|
2014-08-20 23:41:41 +01:00
|
|
|
};
|
|
|
|
}
|