about summary refs log tree commit diff
path: root/pkgs/development/libraries/qscintilla/default.nix
blob: 69adf65643d02fb41d01f265bffd94dd0a1d7208 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
{ stdenv
, lib
, fetchurl
, unzip
, qtbase
, qtmacextras ? null
, qmake
, fixDarwinDylibNames
, darwin
}:

let
  stdenv' = if stdenv.isDarwin then
    darwin.apple_sdk_11_0.stdenv
  else
    stdenv
  ;
in stdenv'.mkDerivation rec {
  pname = "qscintilla-qt5";
  version = "2.13.2";

  src = fetchurl {
    url = "https://www.riverbankcomputing.com/static/Downloads/QScintilla/${version}/QScintilla_src-${version}.tar.gz";
    sha256 = "sha256-tsfl8ntR0l8J/mz4Sumn8Idq8NZdjMtVEQnm57JYhfQ=";
  };

  sourceRoot = "QScintilla_src-${version}/src";

  buildInputs = [ qtbase ];

  propagatedBuildInputs = lib.optionals stdenv.isDarwin [ qtmacextras ];

  nativeBuildInputs = [ unzip qmake ]
    ++ lib.optionals stdenv.isDarwin [ fixDarwinDylibNames ];

  # 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_qt5.so $out/lib/libqscintilla2.so
  '';

  dontWrapQtApps = true;

  preConfigure = ''
    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]'         $out/share
  '';

  meta = with lib; {
    description = "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 = "https://www.riverbankcomputing.com/software/qscintilla/intro";
    license = with licenses; [ gpl3 ]; # and commercial
    maintainers = with maintainers; [ peterhoeg ];
    platforms = platforms.unix;
    # ld: library not found for -lcups
    broken = stdenv.isDarwin && lib.versionAtLeast qtbase.version "6";
  };
}