diff options
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/qmltermwidget')
-rw-r--r-- | nixpkgs/pkgs/development/libraries/qmltermwidget/default.nix | 67 | ||||
-rw-r--r-- | nixpkgs/pkgs/development/libraries/qmltermwidget/do-not-copy-artifacts-twice.patch | 10 |
2 files changed, 77 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/libraries/qmltermwidget/default.nix b/nixpkgs/pkgs/development/libraries/qmltermwidget/default.nix new file mode 100644 index 000000000000..863d5f25d286 --- /dev/null +++ b/nixpkgs/pkgs/development/libraries/qmltermwidget/default.nix @@ -0,0 +1,67 @@ +{ lib +, stdenv +, fetchFromGitHub +, fetchpatch +, qmake +, qtbase +, qtmultimedia +, utmp +}: + +stdenv.mkDerivation { + pname = "qmltermwidget"; + version = "unstable-2022-01-09"; + + src = fetchFromGitHub { + owner = "Swordfish90"; + repo = "qmltermwidget"; + rev = "63228027e1f97c24abb907550b22ee91836929c5"; + hash = "sha256-aVaiRpkYvuyomdkQYAgjIfi6a3wG2a6hNH1CfkA2WKQ="; + }; + + nativeBuildInputs = [ + qmake + ]; + + buildInputs = [ + qtbase + qtmultimedia + ] ++ lib.optional stdenv.isDarwin utmp; + + patches = [ + # Changes required to make it compatible with lomiri-terminal-app + # QML-exposed colorscheme, scrollbar & clipboard functionality + # Remove when https://github.com/Swordfish90/qmltermwidget/pull/39 merged + (fetchpatch { + name = "0001-qmltermwidget-lomiri-submissions.patch"; + url = "https://github.com/Swordfish90/qmltermwidget/compare/63228027e1f97c24abb907550b22ee91836929c5..ffc6b2b2a20ca785f93300eca93c25c4b74ece17.patch"; + hash = "sha256-1GjC2mdfP3NpePDWZaT8zvIq3vwWIZs+iQ9o01iQtD4="; + }) + + # A fix to the above series of patches, to fix a crash in lomiri-terminal-app + # Remove (and update the above fetchpatch) when https://github.com/gber/qmltermwidget/pull/1 merged + (fetchpatch { + name = "0002-qmltermwidget-Mark-ColorSchemeManager-singleton-as-C++-owned.patch"; + url = "https://github.com/gber/qmltermwidget/commit/f3050bda066575eebdcff70fc1c3a393799e1d6d.patch"; + hash = "sha256-O8fEpVLYMze6q4ps7RDGbNukRmZZBjLwqmvRqpp+H+Y="; + }) + + # Some files are copied twice to the output which makes the build fails + ./do-not-copy-artifacts-twice.patch + ]; + + postPatch = '' + substituteInPlace qmltermwidget.pro \ + --replace '$$[QT_INSTALL_QML]' '$$PREFIX/${qtbase.qtQmlPrefix}/' + ''; + + dontWrapQtApps = true; + + meta = { + description = "A QML port of qtermwidget"; + homepage = "https://github.com/Swordfish90/qmltermwidget"; + license = lib.licenses.gpl2Plus; + platforms = with lib.platforms; linux ++ darwin; + maintainers = with lib.maintainers; [ OPNA2608 ]; + }; +} diff --git a/nixpkgs/pkgs/development/libraries/qmltermwidget/do-not-copy-artifacts-twice.patch b/nixpkgs/pkgs/development/libraries/qmltermwidget/do-not-copy-artifacts-twice.patch new file mode 100644 index 000000000000..a10c4b16055a --- /dev/null +++ b/nixpkgs/pkgs/development/libraries/qmltermwidget/do-not-copy-artifacts-twice.patch @@ -0,0 +1,10 @@ +diff --git a/qmltermwidget.pro b/qmltermwidget.pro +index c9594a9..aa1a804 100644 +--- a/qmltermwidget.pro ++++ b/qmltermwidget.pro +@@ -62,4 +62,4 @@ kblayouts2.path = $$INSTALL_DIR/$$PLUGIN_IMPORT_PATH/kb-layouts/historic + scrollbar.files = $$PWD/src/QMLTermScrollbar.qml + scrollbar.path = $$INSTALL_DIR/$$PLUGIN_IMPORT_PATH + +-INSTALLS += target qmldir assets colorschemes colorschemes2 kblayouts kblayouts2 scrollbar ++INSTALLS += target qmldir assets |