2018-03-19 02:03:18 +01:00
|
|
|
{ stdenv, lib, fetchurl, unzip
|
2017-01-03 06:33:42 +01:00
|
|
|
, qt4 ? null, qmake4Hook ? null
|
2018-03-19 02:03:18 +01:00
|
|
|
, withQt5 ? false, qtbase ? null, qtmacextras ? null, qmake ? null
|
2017-01-03 06:33:42 +01:00
|
|
|
}:
|
2014-08-21 00:41:41 +02:00
|
|
|
|
2018-03-13 10:47:08 +01:00
|
|
|
# Fix Xcode 8 compilation problem
|
|
|
|
let xcodePatch =
|
|
|
|
fetchurl { url = "https://raw.githubusercontent.com/Homebrew/formula-patches/a651d71/qscintilla2/xcode-8.patch";
|
|
|
|
sha256 = "1a88309fdfd421f4458550b710a562c622d72d6e6fdd697107e4a43161d69bc9"; };
|
|
|
|
in
|
2014-08-21 00:41:41 +02:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "qscintilla";
|
2018-03-18 17:33:24 +01:00
|
|
|
version = "2.10.3";
|
2014-08-21 00:41:41 +02:00
|
|
|
|
2017-01-03 06:33:42 +01:00
|
|
|
name = "${pname}-${if withQt5 then "qt5" else "qt4"}-${version}";
|
2014-08-21 00:41:41 +02:00
|
|
|
|
|
|
|
src = fetchurl {
|
2017-01-03 06:43:16 +01:00
|
|
|
url = "mirror://sourceforge/pyqt/QScintilla2/QScintilla-${version}/QScintilla_gpl-${version}.zip";
|
2018-03-18 17:33:24 +01:00
|
|
|
sha256 = "0rsx0b0iz5yf3x594kzhi0c2wpbmknv9b0a3rmx5w37bvmpd6qav";
|
2014-08-21 00:41:41 +02:00
|
|
|
};
|
|
|
|
|
2018-03-19 02:03:18 +01:00
|
|
|
buildInputs = [ (if withQt5 then qtbase else qt4) ]
|
|
|
|
++ lib.optional (withQt5 && stdenv.isDarwin) qtmacextras;
|
|
|
|
nativeBuildInputs = [ unzip ]
|
|
|
|
++ (if withQt5 then [ qmake ] else [ qmake4Hook ]);
|
2017-01-03 06:33:42 +01:00
|
|
|
|
2018-03-13 10:47:08 +01:00
|
|
|
|
|
|
|
patches = [] ++ lib.optional withQt5 [ xcodePatch ];
|
|
|
|
|
2017-01-03 06:33:42 +01:00
|
|
|
enableParallelBuilding = true;
|
2014-08-21 00:41:41 +02:00
|
|
|
|
|
|
|
preConfigure = ''
|
|
|
|
cd Qt4Qt5
|
2018-03-19 02:03:18 +01:00
|
|
|
sed -i qscintilla.pro \
|
|
|
|
-e "s,\$\$\\[QT_INSTALL_LIBS\\],$out/lib," \
|
|
|
|
-e "s,\$\$\\[QT_INSTALL_HEADERS\\],$out/include/," \
|
|
|
|
-e "s,\$\$\\[QT_INSTALL_TRANSLATIONS\\],$out/translations," \
|
|
|
|
${if withQt5 then ''
|
|
|
|
-e "s,\$\$\\[QT_HOST_DATA\\]/mkspecs,$out/mkspecs," \
|
|
|
|
-e "s,\$\$\\[QT_INSTALL_DATA\\]/mkspecs,$out/mkspecs," \
|
|
|
|
-e "s,\$\$\\[QT_INSTALL_DATA\\],$out/share,"
|
|
|
|
'' else ''
|
|
|
|
-e "s,\$\$\\[QT_INSTALL_DATA\\],$out/share/qt,"
|
2017-10-24 13:45:23 +02:00
|
|
|
''}
|
2014-08-21 00:41:41 +02:00
|
|
|
'';
|
|
|
|
|
2017-01-03 06:33:42 +01:00
|
|
|
meta = with stdenv.lib; {
|
2014-08-21 00:41:41 +02: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.
|
|
|
|
'';
|
|
|
|
homepage = http://www.riverbankcomputing.com/software/qscintilla/intro;
|
2017-01-03 06:33:42 +01:00
|
|
|
license = with licenses; [ gpl2 gpl3 ]; # and commercial
|
|
|
|
platforms = platforms.unix;
|
2017-01-03 06:43:16 +01:00
|
|
|
maintainers = with maintainers; [ peterhoeg ];
|
2014-08-21 00:41:41 +02:00
|
|
|
};
|
|
|
|
}
|