1{
2 stdenv,
3 lib,
4 lazarus,
5 qmake,
6 qtbase,
7 # Not in Qt6 anymore
8 qtx11extras ? null,
9}:
10
11let
12 qtVersion = lib.versions.major qtbase.version;
13in
14stdenv.mkDerivation {
15 pname = "libqtpas";
16 inherit (lazarus) version src;
17
18 sourceRoot = "lazarus/lcl/interfaces/qt${qtVersion}/cbindings";
19
20 postPatch = ''
21 substituteInPlace Qt${qtVersion}Pas.pro \
22 --replace 'target.path = $$[QT_INSTALL_LIBS]' "target.path = $out/lib"
23 '';
24
25 nativeBuildInputs = [ qmake ];
26
27 buildInputs =
28 [
29 qtbase
30 ]
31 ++ lib.optionals (qtVersion == "5") [
32 qtx11extras
33 ];
34
35 dontWrapQtApps = true;
36
37 meta = with lib; {
38 description = "Free Pascal Qt${qtVersion} binding library";
39 homepage =
40 "https://wiki.freepascal.org/Qt${qtVersion}_Interface"
41 + lib.optionalString (qtVersion == "5") "#libqt5pas";
42 maintainers = with maintainers; [ sikmir ];
43 inherit (lazarus.meta) license platforms;
44 };
45}