diff --git a/pkgs/by-name/py/pyglossary-gui/package.nix b/pkgs/by-name/py/pyglossary-gui/package.nix index b9f68d286190..71b74f9cb113 100644 --- a/pkgs/by-name/py/pyglossary-gui/package.nix +++ b/pkgs/by-name/py/pyglossary-gui/package.nix @@ -5,5 +5,6 @@ python3.pkgs.toPythonApplication ( python3.pkgs.pyglossary.override { enableGui = true; + enableCmd = true; } ) diff --git a/pkgs/by-name/py/pyglossary/package.nix b/pkgs/by-name/py/pyglossary/package.nix index 8c96c385d8a2..3f763dc617c0 100644 --- a/pkgs/by-name/py/pyglossary/package.nix +++ b/pkgs/by-name/py/pyglossary/package.nix @@ -2,4 +2,8 @@ python3, }: -python3.pkgs.toPythonApplication python3.pkgs.pyglossary +python3.pkgs.toPythonApplication ( + python3.pkgs.pyglossary.override { + enableCmd = true; + } +) diff --git a/pkgs/development/python-modules/pyglossary/default.nix b/pkgs/development/python-modules/pyglossary/default.nix index 9f9012c06d4a..6617af80e51d 100644 --- a/pkgs/development/python-modules/pyglossary/default.nix +++ b/pkgs/development/python-modules/pyglossary/default.nix @@ -21,6 +21,9 @@ # for GUI only pygobject3, gtk3, + enableCmd ? false, + prompt-toolkit, + tqdm, }: buildPythonPackage rec { @@ -58,6 +61,10 @@ buildPythonPackage rec { ] ++ lib.optionals enableGui [ pygobject3 + ] + ++ lib.optionals enableCmd [ + prompt-toolkit + tqdm ]; buildInputs = lib.optionals enableGui [ diff --git a/pkgs/development/python-modules/pyglossary/fix-install-issues.patch b/pkgs/development/python-modules/pyglossary/fix-install-issues.patch deleted file mode 100644 index d9e5db1a8111..000000000000 --- a/pkgs/development/python-modules/pyglossary/fix-install-issues.patch +++ /dev/null @@ -1,93 +0,0 @@ -diff --git c/pyproject.toml w/pyproject.toml -index abfb59ac..8f9c2121 100644 ---- c/pyproject.toml -+++ w/pyproject.toml -@@ -416,11 +416,10 @@ version = "5.1.1" - description = "A tool for converting dictionary files aka glossaries." - readme = "README.md" - authors = [{ name = "Saeed Rasooli", email = "saeed.gnu@gmail.com" }] --license = { text = "GPLv3+" } -+license = "GPL-3.0-or-later" - keywords = ["dictionary", "glossary"] - classifiers = [ - "Development Status :: 5 - Production/Stable", -- "License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)", - "Operating System :: OS Independent", - "Typing :: Typed", - "Programming Language :: Python :: 3.11", -@@ -430,6 +429,9 @@ classifiers = [ - requires-python = ">= 3.11" - dependencies = [] - -+[project.scripts] -+pyglossary = "pyglossary.ui.main:main" -+ - [project.optional-dependencies] - all = ["PyICU", "lxml", "beautifulsoup4"] - -diff --git c/setup.py w/setup.py -index fd38a060..19df9ee3 100755 ---- c/setup.py -+++ w/setup.py -@@ -8,8 +8,7 @@ import sys - from glob import glob - from os.path import dirname, exists, isdir, join - --from setuptools import setup --from setuptools.command.install import install -+from setuptools import setup, find_packages - - VERSION = "5.1.1" - log = logging.getLogger("root") -@@ -46,29 +45,6 @@ def getPipSafeVersion() -> str: - return VERSION - - --class my_install(install): -- def run(self) -> None: -- install.run(self) -- if os.sep == "/": -- binPath = join(self.install_scripts, "pyglossary") -- log.info(f"creating script file {binPath!r}") -- if not exists(self.install_scripts): -- os.makedirs(self.install_scripts) -- # let it fail on wrong permissions. -- elif not isdir(self.install_scripts): -- raise OSError( -- "installation path already exists " -- f"but is not a directory: {self.install_scripts}", -- ) -- open(binPath, "w", encoding="ascii").write("""#!/usr/bin/env -S python3 -O --import sys --from os.path import dirname --sys.path.insert(0, dirname(__file__)) --from pyglossary.ui.main import main --main()""") -- os.chmod(binPath, 0o755) -- -- - root_data_file_names = [ - "about", - "LICENSE", -@@ -146,19 +122,14 @@ setup( - name="pyglossary", - version=getPipSafeVersion(), - python_requires=">=3.10.0", -- cmdclass={ -- "install": my_install, -- }, - description="A tool for converting dictionary files aka glossaries.", - long_description_content_type="text/markdown", - long_description=long_description, - author="Saeed Rasooli", - author_email="saeed.gnu@gmail.com", -- license="GPLv3+", -+ license="GPL-3.0-or-later", - url="https://github.com/ilius/pyglossary", -- packages=[ -- "pyglossary", -- ], -+ packages=find_packages(), - entry_points={ - "console_scripts": [ - "pyglossary = pyglossary.ui.main:main",