Skip to content

Commit 76ad279

Browse files
committed
qscintilla: 2.9.4 -> 2.11.2
We strip the library suffix as we don't need it and it confuses various downstream consumers. Also replace calls to sed with substituteInPlace as the latter will complain in case it doesn't perform a substitution.
1 parent 3f4144c commit 76ad279

1 file changed

Lines changed: 31 additions & 27 deletions

File tree

pkgs/development/libraries/qscintilla/default.nix

Lines changed: 31 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,26 @@
44
, fixDarwinDylibNames
55
}:
66

7-
# Fix Xcode 8 compilation problem
8-
let xcodePatch =
9-
fetchurl { url = "https://raw.githubusercontent.com/Homebrew/formula-patches/a651d71/qscintilla2/xcode-8.patch";
10-
sha256 = "1a88309fdfd421f4458550b710a562c622d72d6e6fdd697107e4a43161d69bc9"; };
11-
in
12-
stdenv.mkDerivation rec {
13-
pname = "qscintilla";
14-
version = "2.9.4";
7+
let
8+
# Fix Xcode 8 compilation problem
9+
xcodePatch = fetchurl {
10+
url = "https://raw.githubusercontent.com/Homebrew/formula-patches/a651d71/qscintilla2/xcode-8.patch";
11+
sha256 = "1a88309fdfd421f4458550b710a562c622d72d6e6fdd697107e4a43161d69bc9";
12+
};
13+
14+
pname = "qscintilla-qt${if withQt5 then "5" else "4"}";
15+
version = "2.11.2";
1516

16-
name = "${pname}-${if withQt5 then "qt5" else "qt4"}-${version}";
17+
in stdenv.mkDerivation rec {
18+
inherit pname version;
1719

1820
src = fetchurl {
19-
url = "mirror://sourceforge/pyqt/QScintilla2/QScintilla-${version}/QScintilla_gpl-${version}.zip";
20-
sha256 = "04678skipydx68zf52vznsfmll2v9aahr66g50lcqbr6xsmgr1yi";
21+
url = "https://www.riverbankcomputing.com/static/Downloads/QScintilla/${version}/QScintilla_gpl-${version}.tar.gz";
22+
sha256 = "18glb2v07mwfz6p8qmwhzcaaczyc36x3gn9wx8ndm7q6d93xr6q2";
2123
};
2224

25+
sourceRoot = "QScintilla_gpl-${version}/Qt4Qt5";
26+
2327
buildInputs = [ (if withQt5 then qtbase else qt4) ];
2428

2529
propagatedBuildInputs = lib.optional (withQt5 && stdenv.isDarwin) qtmacextras;
@@ -28,24 +32,23 @@ stdenv.mkDerivation rec {
2832
++ (if withQt5 then [ qmake ] else [ qmake4Hook ])
2933
++ lib.optional stdenv.isDarwin fixDarwinDylibNames;
3034

31-
3235
patches = lib.optional (stdenv.isDarwin && withQt5) [ xcodePatch ];
3336

3437
enableParallelBuilding = true;
3538

36-
preConfigure = ''
37-
cd Qt4Qt5
38-
sed -i qscintilla.pro \
39-
-e "s,\$\$\\[QT_INSTALL_LIBS\\],$out/lib," \
40-
-e "s,\$\$\\[QT_INSTALL_HEADERS\\],$out/include/," \
41-
-e "s,\$\$\\[QT_INSTALL_TRANSLATIONS\\],$out/translations," \
42-
${if withQt5 then ''
43-
-e "s,\$\$\\[QT_HOST_DATA\\]/mkspecs,$out/mkspecs," \
44-
-e "s,\$\$\\[QT_INSTALL_DATA\\]/mkspecs,$out/mkspecs," \
45-
-e "s,\$\$\\[QT_INSTALL_DATA\\],$out/share,"
46-
'' else ''
47-
-e "s,\$\$\\[QT_INSTALL_DATA\\],$out/share/qt,"
48-
''}
39+
# By default qscintilla will name the library with a qt version suffix which
40+
# confuses the crap out of sqlitebrowser and possibly others so we simply
41+
# strip the suffix as we don't need it and the various FindQScintilla.cmake
42+
# files floating around *should* look for the un-suffixed version.
43+
postPatch = ''
44+
substituteInPlace qscintilla.pro \
45+
--replace '_qt$''${QT_MAJOR_VERSION}' "" \
46+
--replace '$$[QT_INSTALL_LIBS]' $out/lib \
47+
--replace '$$[QT_INSTALL_HEADERS]' $out/include \
48+
--replace '$$[QT_INSTALL_TRANSLATIONS]' $out/translations \
49+
--replace '$$[QT_HOST_DATA]/mkspecs' $out/mkspecs \
50+
--replace '$$[QT_INSTALL_DATA]/mkspecs' $out/mkspecs \
51+
--replace '$$[QT_INSTALL_DATA]' $out/share${lib.optionalString (! withQt5) "/qt"}
4952
'';
5053

5154
meta = with stdenv.lib; {
@@ -64,9 +67,10 @@ stdenv.mkDerivation rec {
6467
proportional fonts, bold and italics, multiple foreground and
6568
background colours and multiple fonts.
6669
'';
67-
homepage = http://www.riverbankcomputing.com/software/qscintilla/intro;
70+
homepage = https://www.riverbankcomputing.com/software/qscintilla/intro;
6871
license = with licenses; [ gpl2 gpl3 ]; # and commercial
69-
platforms = platforms.unix;
7072
maintainers = with maintainers; [ peterhoeg ];
73+
platforms = platforms.unix;
74+
broken = !withQt5;
7175
};
7276
}

0 commit comments

Comments
 (0)