From 1e8a85f136a9e90fd5a739f707f93a426d314de3 Mon Sep 17 00:00:00 2001 From: zendo Date: Sat, 15 Oct 2022 18:43:51 +0800 Subject: [PATCH] retext: 7.2.3 -> 8.0.0 --- pkgs/applications/editors/retext/default.nix | 40 ++++++++++++++----- .../editors/retext/remove-wheel-check.patch | 28 +++++++++++++ pkgs/top-level/all-packages.nix | 2 +- 3 files changed, 60 insertions(+), 10 deletions(-) create mode 100644 pkgs/applications/editors/retext/remove-wheel-check.patch diff --git a/pkgs/applications/editors/retext/default.nix b/pkgs/applications/editors/retext/default.nix index afb48ad65f4f..574d83f1be97 100644 --- a/pkgs/applications/editors/retext/default.nix +++ b/pkgs/applications/editors/retext/default.nix @@ -1,7 +1,11 @@ { lib , python3 +, fetchzip , fetchFromGitHub , wrapQtAppsHook +, qtbase +, qttools +, qtsvg , buildEnv , aspellDicts # Use `lib.collect lib.isDerivation aspellDicts;` to make all dictionaries @@ -11,18 +15,29 @@ python3.pkgs.buildPythonApplication rec { pname = "retext"; - version = "7.2.3"; + version = "8.0.0"; format = "setuptools"; src = fetchFromGitHub { owner = "retext-project"; - repo = "retext"; + repo = pname; rev = version; - hash = "sha256-EwaJFODnkZGbqVw1oQrTrx2ME4vRttVW4CMPkWvMtHA="; + hash = "sha256-22yqNwIehgTfeElqhN5Jzye7LbcAiseTeoMgenpmsL0="; + }; + + toolbarIcons = fetchzip { + url = "https://github.com/retext-project/retext/archive/icons.zip"; + hash = "sha256-LQtSFCGWcKvXis9pFDmPqAMd1m6QieHQiz2yykeTdnI="; }; nativeBuildInputs = [ wrapQtAppsHook + qttools.dev + ]; + + buildInputs = [ + qtbase + qtsvg ]; propagatedBuildInputs = with python3.pkgs; [ @@ -32,14 +47,19 @@ python3.pkgs.buildPythonApplication rec { markups pyenchant pygments - pyqt5 + pyqt6 + pyqt6-webengine ]; - postPatch = '' - # Remove wheel check - sed -i -e '31,36d' setup.py + patches = [ ./remove-wheel-check.patch ]; + + preConfigure = '' + lrelease ReText/locale/*.ts ''; + # prevent double wrapping + dontWrapQtApps = true; + postInstall = '' makeWrapperArgs+=("''${qtWrapperArgs[@]}") makeWrapperArgs+=( @@ -49,9 +69,11 @@ python3.pkgs.buildPythonApplication rec { }}" ) + cp ${toolbarIcons}/* $out/${python3.pkgs.python.sitePackages}/ReText/icons + substituteInPlace $out/share/applications/me.mitya57.ReText.desktop \ --replace "Exec=ReText-${version}.data/scripts/retext %F" "Exec=$out/bin/retext %F" \ - --replace "Icon=ReText-${version}.data/data/share/retext/icons/retext.svg" "Icon=$out/share/retext/icons/retext.svg" + --replace "Icon=ReText/icons/retext.svg" "Icon=retext" ''; doCheck = false; @@ -63,7 +85,7 @@ python3.pkgs.buildPythonApplication rec { meta = with lib; { description = "Editor for Markdown and reStructuredText"; homepage = "https://github.com/retext-project/retext/"; - license = licenses.gpl2Plus; + license = licenses.gpl3Plus; maintainers = with maintainers; [ klntsky ]; platforms = platforms.unix; }; diff --git a/pkgs/applications/editors/retext/remove-wheel-check.patch b/pkgs/applications/editors/retext/remove-wheel-check.patch new file mode 100644 index 000000000000..d736a3c3ccc9 --- /dev/null +++ b/pkgs/applications/editors/retext/remove-wheel-check.patch @@ -0,0 +1,28 @@ +From f07d08d3056c46f62674f65eabae0efa2b65d681 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= +Date: Sat, 15 Oct 2022 16:53:27 +0200 +Subject: [PATCH] disable wheel check +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Signed-off-by: Jörg Thalheim +--- + setup.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/setup.py b/setup.py +index a9cae37..e0e1e5b 100755 +--- a/setup.py ++++ b/setup.py +@@ -101,7 +101,7 @@ def run(self): + + desktop_file_path = join(self.install_data, 'share', 'applications', + 'me.mitya57.ReText.desktop') +- if self.root and self.root.endswith('/wheel'): ++ if False and self.root and self.root.endswith('/wheel'): + # Desktop files don't allow relative paths, and we don't know the + # absolute path when building a wheel. + log.info('removing the .desktop file from the wheel') +-- +2.37.3 diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 247919e6f400..72b3ec75178c 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -10701,7 +10701,7 @@ with pkgs; reredirect = callPackage ../tools/misc/reredirect { }; - retext = libsForQt5.callPackage ../applications/editors/retext { }; + retext = qt6Packages.callPackage ../applications/editors/retext { }; inherit (callPackage ../tools/security/rekor { }) rekor-cli