diff options
-rw-r--r-- | nixos/doc/manual/release-notes/rl-2103.xml | 7 | ||||
-rw-r--r-- | pkgs/applications/office/paperwork/backend.nix | 48 | ||||
-rw-r--r-- | pkgs/applications/office/paperwork/openpaperwork-core.nix | 42 | ||||
-rw-r--r-- | pkgs/applications/office/paperwork/openpaperwork-gtk.nix | 52 | ||||
-rw-r--r-- | pkgs/applications/office/paperwork/paperwork-backend.nix | 77 | ||||
-rw-r--r-- | pkgs/applications/office/paperwork/paperwork-gtk.nix (renamed from pkgs/applications/office/paperwork/default.nix) | 59 | ||||
-rw-r--r-- | pkgs/applications/office/paperwork/paperwork-shell.nix | 59 | ||||
-rw-r--r-- | pkgs/applications/office/paperwork/src.nix | 12 | ||||
-rw-r--r-- | pkgs/development/python-modules/fabulous/default.nix | 39 | ||||
-rw-r--r-- | pkgs/development/python-modules/fabulous/relative_import.patch | 27 | ||||
-rw-r--r-- | pkgs/development/python-modules/getkey/default.nix | 34 | ||||
-rw-r--r-- | pkgs/top-level/all-packages.nix | 2 | ||||
-rw-r--r-- | pkgs/top-level/python-packages.nix | 9 |
13 files changed, 389 insertions, 78 deletions
diff --git a/nixos/doc/manual/release-notes/rl-2103.xml b/nixos/doc/manual/release-notes/rl-2103.xml index da4f083d01ac..10d5cda77464 100644 --- a/nixos/doc/manual/release-notes/rl-2103.xml +++ b/nixos/doc/manual/release-notes/rl-2103.xml @@ -128,6 +128,13 @@ </listitem> <listitem> <para> + Paperwork was updated to version 2. The on-disk format slightly changed, + and it is not possible to downgrade from Paperwork 2 back to Paperwork + 1.3. Back your documents up before upgrading. See <link xlink:href="https://forum.openpaper.work/t/paperwork-2-0/112/5">this thread</link> for more details. + </para> + </listitem> + <listitem> + <para> PowerDNS has been updated from <literal>4.2.x</literal> to <literal>4.3.x</literal>. Please be sure to review the <link xlink:href="https://doc.powerdns.com/authoritative/upgrading.html#x-to-4-3-0">Upgrade Notes</link> provided by upstream before upgrading. Worth specifically noting is that the service now runs diff --git a/pkgs/applications/office/paperwork/backend.nix b/pkgs/applications/office/paperwork/backend.nix deleted file mode 100644 index af0d4c430590..000000000000 --- a/pkgs/applications/office/paperwork/backend.nix +++ /dev/null @@ -1,48 +0,0 @@ -{ buildPythonPackage, lib, fetchFromGitLab - -, isPy3k, isPyPy - -, pyenchant, simplebayes, pillow, pycountry, whoosh, termcolor -, python-Levenshtein, pygobject3, pyocr, natsort, libinsane -, distro - -, pkgs -}: - -buildPythonPackage rec { - pname = "paperwork-backend"; - version = "1.3.1"; - - src = fetchFromGitLab { - domain = "gitlab.gnome.org"; - repo = "paperwork"; - group = "World"; - owner = "OpenPaperwork"; - rev = version; - sha256 = "1219yz8z4r1yn6miq8zc2z1m1lnhf3dmkhwfw23n05bg842nvg65"; - }; - - sourceRoot = "source/paperwork-backend"; - - # Python 2.x is not supported. - disabled = !isPy3k && !isPyPy; - - patchPhase = '' - echo 'version = "${version}"' > paperwork_backend/_version.py - ''; - - preCheck = "\"$out/bin/paperwork-shell\" chkdeps paperwork_backend"; - - propagatedBuildInputs = [ - pyenchant simplebayes pillow pycountry whoosh termcolor - python-Levenshtein libinsane pygobject3 pyocr natsort - pkgs.poppler_gi pkgs.gtk3 distro - ]; - - meta = { - description = "Backend part of Paperwork (Python API, no UI)"; - homepage = "https://openpaper.work/"; - license = lib.licenses.gpl3Plus; - maintainers = with lib.maintainers; [ aszlig symphorien ]; - }; -} diff --git a/pkgs/applications/office/paperwork/openpaperwork-core.nix b/pkgs/applications/office/paperwork/openpaperwork-core.nix new file mode 100644 index 000000000000..cae55ae95f1c --- /dev/null +++ b/pkgs/applications/office/paperwork/openpaperwork-core.nix @@ -0,0 +1,42 @@ +{ buildPythonPackage, lib, fetchFromGitLab + +, isPy3k, isPyPy + +, distro, setuptools + +, pkgs +}: + +buildPythonPackage rec { + pname = "openpaperwork-core"; + inherit (import ./src.nix { inherit fetchFromGitLab; }) version src; + + sourceRoot = "source/openpaperwork-core"; + + # Python 2.x is not supported. + disabled = !isPy3k && !isPyPy; + + patchPhase = '' + echo 'version = "${version}"' > src/openpaperwork_core/_version.py + chmod a+w -R .. + patchShebangs ../tools + ''; + + propagatedBuildInputs = [ + distro + setuptools + ]; + + nativeBuildInputs = [ pkgs.gettext pkgs.which ]; + + preBuild = '' + make l10n_compile + ''; + + meta = { + description = "Backend part of Paperwork (Python API, no UI)"; + homepage = "https://openpaper.work/"; + license = lib.licenses.gpl3Plus; + maintainers = with lib.maintainers; [ aszlig symphorien ]; + }; +} diff --git a/pkgs/applications/office/paperwork/openpaperwork-gtk.nix b/pkgs/applications/office/paperwork/openpaperwork-gtk.nix new file mode 100644 index 000000000000..5dae745ce2eb --- /dev/null +++ b/pkgs/applications/office/paperwork/openpaperwork-gtk.nix @@ -0,0 +1,52 @@ +{ buildPythonPackage +, lib +, fetchFromGitLab + +, isPy3k +, isPyPy + +, openpaperwork-core +, pillow +, pygobject3 +, distro + +, pkgs +}: + +buildPythonPackage rec { + pname = "openpaperwork-gtk"; + inherit (import ./src.nix { inherit fetchFromGitLab; }) version src; + + sourceRoot = "source/openpaperwork-gtk"; + + # Python 2.x is not supported. + disabled = !isPy3k && !isPyPy; + + patchPhase = '' + echo 'version = "${version}"' > src/openpaperwork_gtk/_version.py + chmod a+w -R .. + patchShebangs ../tools + ''; + + nativeBuildInputs = [ pkgs.gettext pkgs.which ]; + preBuild = '' + make l10n_compile + ''; + + propagatedBuildInputs = [ + pillow + pygobject3 + pkgs.poppler_gi + pkgs.gtk3 + distro + pkgs.pango + openpaperwork-core + ]; + + meta = { + description = "Reusable GTK components of Paperwork"; + homepage = "https://openpaper.work/"; + license = lib.licenses.gpl3Plus; + maintainers = with lib.maintainers; [ aszlig symphorien ]; + }; +} diff --git a/pkgs/applications/office/paperwork/paperwork-backend.nix b/pkgs/applications/office/paperwork/paperwork-backend.nix new file mode 100644 index 000000000000..a033bd695db6 --- /dev/null +++ b/pkgs/applications/office/paperwork/paperwork-backend.nix @@ -0,0 +1,77 @@ +{ buildPythonPackage +, lib +, fetchFromGitLab + +, isPy3k +, isPyPy + +, pyenchant +, simplebayes +, pypillowfight +, pycountry +, whoosh +, termcolor +, python-Levenshtein +, pygobject3 +, pyocr +, natsort +, libinsane +, distro +, openpaperwork-core +, openpaperwork-gtk +, psutil + +, pkgs +}: + +buildPythonPackage rec { + pname = "paperwork-backend"; + inherit (import ./src.nix { inherit fetchFromGitLab; }) version src; + + sourceRoot = "source/paperwork-backend"; + + # Python 2.x is not supported. + disabled = !isPy3k && !isPyPy; + + patchPhase = '' + echo 'version = "${version}"' > src/paperwork_backend/_version.py + chmod a+w -R .. + patchShebangs ../tools + ''; + + propagatedBuildInputs = [ + pyenchant + simplebayes + pypillowfight + pycountry + whoosh + termcolor + python-Levenshtein + libinsane + pygobject3 + pyocr + natsort + pkgs.poppler_gi + pkgs.gtk3 + distro + openpaperwork-core + ]; + + preCheck = '' + export HOME=$(mktemp -d) + ''; + + nativeBuildInputs = [ pkgs.gettext pkgs.which ]; + preBuild = '' + make l10n_compile + ''; + + checkInputs = [ openpaperwork-gtk psutil ]; + + meta = { + description = "Backend part of Paperwork (Python API, no UI)"; + homepage = "https://openpaper.work/"; + license = lib.licenses.gpl3Plus; + maintainers = with lib.maintainers; [ aszlig symphorien ]; + }; +} diff --git a/pkgs/applications/office/paperwork/default.nix b/pkgs/applications/office/paperwork/paperwork-gtk.nix index 102c3cd2564c..c493421dd11b 100644 --- a/pkgs/applications/office/paperwork/default.nix +++ b/pkgs/applications/office/paperwork/paperwork-gtk.nix @@ -10,45 +10,36 @@ , dbus , libnotify , wrapGAppsHook +, fetchFromGitLab +, which +, gettext +, gobject-introspection }: python3Packages.buildPythonApplication rec { - inherit (python3Packages.paperwork-backend) version src; + inherit (import ./src.nix { inherit fetchFromGitLab; }) version src; pname = "paperwork"; sourceRoot = "source/paperwork-gtk"; # Patch out a few paths that assume that we're using the FHS: postPatch = '' - themeDir="$(echo "${gnome3.adwaita-icon-theme}/share/icons/"*)" - sed -i -e "s,/usr/share/icons/gnome,$themeDir," src/paperwork/deps.py + chmod a+w -R .. + patchShebangs ../tools - sed -i -e 's,sys\.prefix,"",g' \ - src/paperwork/frontend/aboutdialog/__init__.py \ - src/paperwork/frontend/mainwindow/__init__.py \ - setup.py + export HOME=$(mktemp -d) - sed -i -e '/^UI_FILES_DIRS = \[/,/^\]$/ { - c UI_FILES_DIRS = ["'"$out/share/paperwork"'"] - }' src/paperwork/frontend/util/__init__.py - - sed -i -e '/^LOCALE_PATHS = \[/,/^\]$/ { - c LOCALE_PATHS = ["'"$out/share"'"] - }' src/paperwork/paperwork.py - - sed -i -e 's/"icon"/"icon-name"/g' \ - src/paperwork/frontend/mainwindow/mainwindow.glade - - sed -i -e 's/"logo"/"logo-icon-name"/g' \ - src/paperwork/frontend/aboutdialog/aboutdialog.glade - - cat - ../AUTHORS.py > src/paperwork/_version.py <<EOF + cat - ../AUTHORS.py > src/paperwork_gtk/_version.py <<EOF # -*- coding: utf-8 -*- version = "${version}" authors_code="" EOF ''; + preBuild = '' + make l10n_compile + ''; + ASPELL_CONF = "dict-dir ${buildEnv { name = "aspell-all-dicts"; paths = lib.collect lib.isDerivation aspellDicts; @@ -56,37 +47,49 @@ python3Packages.buildPythonApplication rec { postInstall = '' # paperwork-shell needs to be re-wrapped with access to paperwork - cp ${python3Packages.paperwork-backend}/bin/.paperwork-shell-wrapped $out/bin/paperwork-shell + cp ${python3Packages.paperwork-shell}/bin/.paperwork-cli-wrapped $out/bin/paperwork-cli # install desktop files and icons - XDG_DATA_HOME=$out/share $out/bin/paperwork-shell install + XDG_DATA_HOME=$out/share $out/bin/paperwork-gtk install --user ''; - checkInputs = [ xvfb_run dbus.daemon ] ++ (with python3Packages; [ paperwork-backend ]); + checkInputs = [ xvfb_run dbus.daemon ]; nativeBuildInputs = [ wrapGAppsHook + gobject-introspection + (lib.getBin gettext) + which ]; buildInputs = [ gnome3.adwaita-icon-theme libnotify librsvg + gtk3 + cairo ]; + dontWrapGApps = true; + + preFixup = '' + makeWrapperArgs+=("''${gappsWrapperArgs[@]}") + ''; + # A few parts of chkdeps need to have a display and a dbus session, so we not # only need to run a virtual X server + dbus but also have a large enough # resolution, because the Cairo test tries to draw a 200x200 window. preCheck = '' xvfb-run -s '-screen 0 800x600x24' dbus-run-session \ --config-file=${dbus.daemon}/share/dbus-1/session.conf \ - paperwork-shell chkdeps paperwork + $out/bin/paperwork-gtk chkdeps ''; propagatedBuildInputs = with python3Packages; [ paperwork-backend + paperwork-shell + openpaperwork-gtk + openpaperwork-core pypillowfight - gtk3 - cairo pyxdg dateutil setuptools diff --git a/pkgs/applications/office/paperwork/paperwork-shell.nix b/pkgs/applications/office/paperwork/paperwork-shell.nix new file mode 100644 index 000000000000..1be6f329e3cf --- /dev/null +++ b/pkgs/applications/office/paperwork/paperwork-shell.nix @@ -0,0 +1,59 @@ +{ buildPythonPackage +, lib +, fetchFromGitLab + +, isPy3k +, isPyPy + +, openpaperwork-core +, openpaperwork-gtk +, paperwork-backend +, fabulous +, getkey + +, pkgs +}: + +buildPythonPackage rec { + pname = "paperwork-shell"; + inherit (import ./src.nix { inherit fetchFromGitLab; }) version src; + + sourceRoot = "source/paperwork-shell"; + + # Python 2.x is not supported. + disabled = !isPy3k && !isPyPy; + + patchPhase = '' + echo 'version = "${version}"' > src/paperwork_shell/_version.py + chmod a+w -R .. + patchShebangs ../tools + ''; + + propagatedBuildInputs = [ + openpaperwork-core + paperwork-backend + fabulous + getkey + ]; + + checkInputs = [ + openpaperwork-gtk + ]; + + nativeBuildInputs = [ pkgs.gettext pkgs.which ]; + preBuild = '' + make l10n_compile + ''; + + preCheck = '' + export HOME=$(mktemp -d) + "$out/bin/paperwork-cli" chkdeps + ''; + + meta = { + description = "CLI for Paperwork"; + homepage = "https://openpaper.work/"; + license = lib.licenses.gpl3Plus; + maintainers = with lib.maintainers; [ aszlig symphorien ]; + }; +} diff --git a/pkgs/applications/office/paperwork/src.nix b/pkgs/applications/office/paperwork/src.nix new file mode 100644 index 000000000000..70770676edde --- /dev/null +++ b/pkgs/applications/office/paperwork/src.nix @@ -0,0 +1,12 @@ +{fetchFromGitLab}: +rec { + version = "2.0.1"; + src = fetchFromGitLab { + domain = "gitlab.gnome.org"; + repo = "paperwork"; + group = "World"; + owner = "OpenPaperwork"; + rev = version; + sha256 = "16pc4drwpjl4937wdavs6wk0j1qs474b072wplhs8ywxfgqip1h4"; + }; +} diff --git a/pkgs/development/python-modules/fabulous/default.nix b/pkgs/development/python-modules/fabulous/default.nix new file mode 100644 index 000000000000..6079f22020a2 --- /dev/null +++ b/pkgs/development/python-modules/fabulous/default.nix @@ -0,0 +1,39 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub +, pillow +, python +}: + +buildPythonPackage rec { + pname = "fabulous"; + version = "0.3.0"; + + src = fetchFromGitHub { + owner = "jart"; + repo = pname; + rev = version; + sha256 = "0yxdaz6yayp1a57kdb2i8q7kwwdlwy4a3d0lr012h2ji9m89c8q7"; + }; + + patches = [ + ./relative_import.patch + ]; + + propagatedBuildInputs = [ + pillow + ]; + + checkPhase = '' + for i in tests/*.py; do + ${python.interpreter} $i + done + ''; + + meta = with lib; { + description = "Make the output of terminal applications look fabulous"; + homepage = "https://jart.github.io/fabulous"; + license = licenses.asl20; + maintainers = [ maintainers.symphorien ]; + }; +} diff --git a/pkgs/development/python-modules/fabulous/relative_import.patch b/pkgs/development/python-modules/fabulous/relative_import.patch new file mode 100644 index 000000000000..b12e3d9a7863 --- /dev/null +++ b/pkgs/development/python-modules/fabulous/relative_import.patch @@ -0,0 +1,27 @@ +diff --git a/fabulous/prompt.py b/fabulous/prompt.py +index 531176f..e395ab4 100644 +--- a/fabulous/prompt.py ++++ b/fabulous/prompt.py +@@ -18,8 +18,7 @@ + import sys + import os + import os.path +-import term +-from term import stdout, stderr, display ++from .term import stdout, stderr, display + + __all__ = ["input_object","query","file_chooser"] + +diff --git a/fabulous/widget.py b/fabulous/widget.py +index 31a2547..7ad889a 100644 +--- a/fabulous/widget.py ++++ b/fabulous/widget.py +@@ -24,7 +24,7 @@ import os + import math + from datetime import datetime + # import textwrap +-from term import stdout, display ++from .term import stdout, display + + class ProgressBar(object): + """A 3-line progress bar, which looks like:: diff --git a/pkgs/development/python-modules/getkey/default.nix b/pkgs/development/python-modules/getkey/default.nix new file mode 100644 index 000000000000..c0cbec29145a --- /dev/null +++ b/pkgs/development/python-modules/getkey/default.nix @@ -0,0 +1,34 @@ +{ lib +, buildPythonPackage +, fetchPypi +, pytestCheckHook +, flake8 +}: + +buildPythonPackage rec { + pname = "getkey"; + version = "0.6.5"; + + src = fetchPypi { + inherit pname version; + sha256 = "0ng0ihfagh9g8hral0bq5nhjlp3csqghyv3z8b7ylkdkqc1cgiv8"; + }; + + # disable coverage, because we don't care and python-coveralls is not in nixpkgs + postPatch = '' + sed -e '/python-coveralls/d' -e '/pytest-cov/d' -i setup.py + rm setup.cfg + ''; + + checkInputs = [ + flake8 + pytestCheckHook + ]; + + meta = with lib; { + description = "Read single characters and key-strokes"; + homepage = "https://github.com/kcsaff/getkey"; + license = licenses.mit; + maintainers = [ maintainers.symphorien ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index d520ab046d12..252877cf234a 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -6299,7 +6299,7 @@ in paperless = callPackage ../applications/office/paperless { }; - paperwork = callPackage ../applications/office/paperwork { }; + paperwork = callPackage ../applications/office/paperwork/paperwork-gtk.nix { }; papertrail = callPackage ../tools/text/papertrail { }; diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 540d5a8974ef..f2dcb3e7971b 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -1989,6 +1989,8 @@ in { Fabric = callPackage ../development/python-modules/Fabric { }; + fabulous = callPackage ../development/python-modules/fabulous { }; + facebook-sdk = callPackage ../development/python-modules/facebook-sdk { }; face = callPackage ../development/python-modules/face { }; @@ -2369,6 +2371,8 @@ in { getmac = callPackage ../development/python-modules/getmac { }; + getkey = callPackage ../development/python-modules/getkey { }; + gevent = callPackage ../development/python-modules/gevent { }; geventhttpclient = callPackage ../development/python-modules/geventhttpclient { }; @@ -4356,7 +4360,10 @@ in { paperspace = callPackage ../development/python-modules/paperspace { }; - paperwork-backend = callPackage ../applications/office/paperwork/backend.nix { }; + openpaperwork-core = callPackage ../applications/office/paperwork/openpaperwork-core.nix { }; + openpaperwork-gtk = callPackage ../applications/office/paperwork/openpaperwork-gtk.nix { }; + paperwork-backend = callPackage ../applications/office/paperwork/paperwork-backend.nix { }; + paperwork-shell = callPackage ../applications/office/paperwork/paperwork-shell.nix { }; papis = callPackage ../development/python-modules/papis { }; |