1{ lib
2, stdenv
3, fetchFromGitHub
4, fetchpatch
5, qmake
6, qtbase
7, qtmultimedia
8, utmp
9}:
10
11stdenv.mkDerivation {
12 pname = "qmltermwidget";
13 version = "unstable-2022-01-09";
14
15 src = fetchFromGitHub {
16 owner = "Swordfish90";
17 repo = "qmltermwidget";
18 rev = "63228027e1f97c24abb907550b22ee91836929c5";
19 hash = "sha256-aVaiRpkYvuyomdkQYAgjIfi6a3wG2a6hNH1CfkA2WKQ=";
20 };
21
22 nativeBuildInputs = [
23 qmake
24 ];
25
26 buildInputs = [
27 qtbase
28 qtmultimedia
29 ] ++ lib.optional stdenv.isDarwin utmp;
30
31 patches = [
32 # Changes required to make it compatible with lomiri-terminal-app
33 # QML-exposed colorscheme, scrollbar & clipboard functionality
34 # Remove when https://github.com/Swordfish90/qmltermwidget/pull/39 merged
35 (fetchpatch {
36 name = "0001-qmltermwidget-lomiri-submissions.patch";
37 url = "https://github.com/Swordfish90/qmltermwidget/compare/63228027e1f97c24abb907550b22ee91836929c5..ffc6b2b2a20ca785f93300eca93c25c4b74ece17.patch";
38 hash = "sha256-1GjC2mdfP3NpePDWZaT8zvIq3vwWIZs+iQ9o01iQtD4=";
39 })
40
41 # Some files are copied twice to the output which makes the build fails
42 ./do-not-copy-artifacts-twice.patch
43 ];
44
45 postPatch = ''
46 substituteInPlace qmltermwidget.pro \
47 --replace '$$[QT_INSTALL_QML]' '$$PREFIX/${qtbase.qtQmlPrefix}/'
48 '';
49
50 dontWrapQtApps = true;
51
52 meta = {
53 description = "A QML port of qtermwidget";
54 homepage = "https://github.com/Swordfish90/qmltermwidget";
55 license = lib.licenses.gpl2Plus;
56 platforms = with lib.platforms; linux ++ darwin;
57 maintainers = with lib.maintainers; [ OPNA2608 ];
58 };
59}