Skip to content

Commit

Permalink
Merge pull request NixOS#196122 from zendo/update-retext
Browse files Browse the repository at this point in the history
  • Loading branch information
SuperSandro2000 authored Nov 28, 2022
2 parents 1befba0 + 1e8a85f commit c67f886
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 10 deletions.
40 changes: 31 additions & 9 deletions pkgs/applications/editors/retext/default.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
{ lib
, python3
, fetchzip
, fetchFromGitHub
, wrapQtAppsHook
, qtbase
, qttools
, qtsvg
, buildEnv
, aspellDicts
# Use `lib.collect lib.isDerivation aspellDicts;` to make all dictionaries
Expand All @@ -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; [
Expand All @@ -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+=(
Expand All @@ -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;
Expand All @@ -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;
};
Expand Down
28 changes: 28 additions & 0 deletions pkgs/applications/editors/retext/remove-wheel-check.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
From f07d08d3056c46f62674f65eabae0efa2b65d681 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= <[email protected]>
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 <[email protected]>
---
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
2 changes: 1 addition & 1 deletion pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10942,7 +10942,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
Expand Down

0 comments on commit c67f886

Please sign in to comment.