diff options
author | Symphorien Gibol <symphorien+git@xlumurb.eu> | 2020-10-31 12:00:00 +0000 |
---|---|---|
committer | Symphorien Gibol <symphorien+git@xlumurb.eu> | 2020-11-15 15:46:53 +0100 |
commit | 74b9066a3949f673f37d6a39bafabff707c121d0 (patch) | |
tree | 52d8432cc50a22f88333c0c05efe936a2db45dff /pkgs/applications/office | |
parent | f269e315ec6587b2a151a6908926df21e145b9f5 (diff) |
paperwork: 1.3.1 -> 2.0
Diffstat (limited to 'pkgs/applications/office')
-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 |
7 files changed, 273 insertions, 76 deletions
diff --git a/pkgs/applications/office/paperwork/backend.nix b/pkgs/applications/office/paperwork/backend.nix deleted file mode 100644 index af0d4c4305903..0000000000000 --- 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 0000000000000..cae55ae95f1c3 --- /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 0000000000000..5dae745ce2eb3 --- /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 0000000000000..a033bd695db6c --- /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 102c3cd2564c5..c493421dd11be 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 0000000000000..1be6f329e3cfd --- /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 0000000000000..d77e8bc043e70 --- /dev/null +++ b/pkgs/applications/office/paperwork/src.nix @@ -0,0 +1,12 @@ +{fetchFromGitLab}: +rec { + version = "2.0"; + src = fetchFromGitLab { + domain = "gitlab.gnome.org"; + repo = "paperwork"; + group = "World"; + owner = "OpenPaperwork"; + rev = version; + sha256 = "0879wvl3hk74kwnaa64q6prfg2kjaa7nrzahaw2zcipdpf5h2mkm"; + }; +} |