Guillaume Girol 2023-03-04 12:00:00 +00:00
parent 51d906d234
commit f32a622d3a
7 changed files with 57 additions and 32 deletions

View file

@ -347,6 +347,8 @@
- `services.outline` can now be configured to use local filesystem storage instead of S3 storage using [services.outline.storage.storageType](#opt-services.outline.storage.storageType).
- `paperwork` was updated to version 2.2. Documents scanned with this version will not be visible to previous versions if you downgrade. See the [upstream announcement](https://forum.openpaper.work/t/paperwork-2-2-testing-phase/316#important-switch-from-jpeg-to-png-for-new-pages-2) for details and workarounds.
- `buildGoModule` `go-modules` attrs have been renamed to `goModules`.
- The `fonts.fonts` and `fonts.enableDefaultFonts` options have been renamed to `fonts.packages` and `fonts.enableDefaultPackages` respectively.

View file

@ -1,8 +1,15 @@
{ buildPythonPackage, lib, fetchFromGitLab
{ buildPythonPackage
, lib
, fetchFromGitLab
, isPy3k, isPyPy
, isPy3k
, isPyPy
, distro, setuptools, psutil
, distro
, setuptools
, psutil
, certifi
, setuptools-scm
, pkgs
}:
@ -10,6 +17,7 @@
buildPythonPackage rec {
pname = "openpaperwork-core";
inherit (import ./src.nix { inherit fetchFromGitLab; }) version src;
format = "pyproject";
sourceRoot = "${src.name}/openpaperwork-core";
@ -17,23 +25,33 @@ buildPythonPackage rec {
disabled = !isPy3k && !isPyPy;
patchPhase = ''
echo 'version = "${version}"' > src/openpaperwork_core/_version.py
chmod a+w -R ..
patchShebangs ../tools
'';
env.SETUPTOOLS_SCM_PRETEND_VERSION = version;
propagatedBuildInputs = [
distro
setuptools
psutil
certifi
];
nativeBuildInputs = [ pkgs.gettext pkgs.which ];
nativeBuildInputs = [
pkgs.gettext
pkgs.which
setuptools-scm
];
preBuild = ''
make l10n_compile
'';
preCheck = ''
export HOME=$(mktemp -d)
'';
meta = {
description = "Backend part of Paperwork (Python API, no UI)";
homepage = "https://openpaper.work/";

View file

@ -9,6 +9,7 @@
, pillow
, pygobject3
, distro
, setuptools-scm
, pkgs
}:
@ -16,6 +17,7 @@
buildPythonPackage rec {
pname = "openpaperwork-gtk";
inherit (import ./src.nix { inherit fetchFromGitLab; }) version src;
format = "pyproject";
sourceRoot = "${src.name}/openpaperwork-gtk";
@ -23,12 +25,18 @@ buildPythonPackage rec {
disabled = !isPy3k && !isPyPy;
patchPhase = ''
echo 'version = "${version}"' > src/openpaperwork_gtk/_version.py
chmod a+w -R ..
patchShebangs ../tools
'';
nativeBuildInputs = [ pkgs.gettext pkgs.which ];
env.SETUPTOOLS_SCM_PRETEND_VERSION = version;
nativeBuildInputs = [
pkgs.gettext
pkgs.which
setuptools-scm
];
preBuild = ''
make l10n_compile
'';

View file

@ -1,6 +1,5 @@
{ buildPythonPackage
, lib
, fetchpatch
, fetchFromGitLab
, pyenchant
, scikit-learn
@ -8,7 +7,6 @@
, pycountry
, whoosh
, termcolor
, levenshtein
, pygobject3
, pyocr
, natsort
@ -24,34 +22,30 @@
, shared-mime-info
, libreoffice
, unittestCheckHook
, setuptools-scm
}:
buildPythonPackage rec {
pname = "paperwork-backend";
inherit (import ./src.nix { inherit fetchFromGitLab; }) version src;
format = "pyproject";
sourceRoot = "${src.name}/paperwork-backend";
patches = [
# disables a flaky test https://gitlab.gnome.org/World/OpenPaperwork/paperwork/-/issues/1035#note_1493700
./flaky_test.patch
(fetchpatch {
url = "https://gitlab.gnome.org/World/OpenPaperwork/paperwork/-/commit/0f5cf0fe7ef223000e02c28e4c7576f74a778fe6.patch";
hash = "sha256-NIK3j2TdydfeK3/udS/Pc+tJa/pPkfAmSPPeaYuaCq4=";
})
];
patchFlags = [ "-p2" ];
postPatch = ''
substituteInPlace setup.py \
--replace python-Levenshtein Levenshtein
echo 'version = "${version}"' > src/paperwork_backend/_version.py
chmod a+w -R ..
patchShebangs ../tools
'';
env.SETUPTOOLS_SCM_PRETEND_VERSION = version;
propagatedBuildInputs = [
distro
gtk3
@ -63,7 +57,6 @@ buildPythonPackage rec {
pygobject3
pyocr
pypillowfight
levenshtein
poppler_gi
scikit-learn
termcolor
@ -74,6 +67,7 @@ buildPythonPackage rec {
gettext
shared-mime-info
which
setuptools-scm
];
preBuild = ''

View file

@ -34,6 +34,7 @@ in
python3Packages.buildPythonApplication rec {
inherit src version;
pname = "paperwork";
format = "pyproject";
sample_docs = sample_documents // {
# a trick for the update script
@ -43,21 +44,13 @@ python3Packages.buildPythonApplication rec {
sourceRoot = "${src.name}/paperwork-gtk";
# Patch out a few paths that assume that we're using the FHS:
postPatch = ''
substituteInPlace setup.py \
--replace python-Levenshtein Levenshtein
env.SETUPTOOLS_SCM_PRETEND_VERSION = version;
postPatch = ''
chmod a+w -R ..
patchShebangs ../tools
export HOME=$(mktemp -d)
cat - ../AUTHORS.py > src/paperwork_gtk/_version.py <<EOF
# -*- coding: utf-8 -*-
version = "${version}"
authors_code=""
EOF
'';
preBuild = ''
@ -93,6 +86,7 @@ python3Packages.buildPythonApplication rec {
nativeBuildInputs = [
wrapGAppsHook
gobject-introspection
python3Packages.setuptools-scm
(lib.getBin gettext)
which
gdk-pixbuf # for the setup hook

View file

@ -9,9 +9,11 @@
, openpaperwork-gtk
, paperwork-backend
, fabulous
, rich
, getkey
, psutil
, shared-mime-info
, setuptools-scm
, pkgs
}:
@ -19,6 +21,7 @@
buildPythonPackage rec {
pname = "paperwork-shell";
inherit (import ./src.nix { inherit fetchFromGitLab; }) version src;
format = "pyproject";
sourceRoot = "${src.name}/paperwork-shell";
@ -26,10 +29,10 @@ buildPythonPackage rec {
disabled = !isPy3k && !isPyPy;
patchPhase = ''
echo 'version = "${version}"' > src/paperwork_shell/_version.py
chmod a+w -R ..
patchShebangs ../tools
'';
env.SETUPTOOLS_SCM_PRETEND_VERSION = version;
propagatedBuildInputs = [
openpaperwork-core
@ -37,6 +40,7 @@ buildPythonPackage rec {
fabulous
getkey
psutil
rich
];
nativeCheckInputs = [
@ -44,7 +48,12 @@ buildPythonPackage rec {
openpaperwork-gtk
];
nativeBuildInputs = [ pkgs.gettext pkgs.which ];
nativeBuildInputs = [
pkgs.gettext
pkgs.which
setuptools-scm
];
preBuild = ''
make l10n_compile
'';

View file

@ -1,13 +1,13 @@
{fetchFromGitLab}:
rec {
version = "2.1.2";
version = "2.2.0";
src = fetchFromGitLab {
domain = "gitlab.gnome.org";
repo = "paperwork";
group = "World";
owner = "OpenPaperwork";
rev = version;
sha256 = "/5k+zUtTE+Dr879xbHDCAYrqlEJLsbkcRSG3GbA/PCg=";
sha256 = "sha256-sxHhTeeG2rZztMwN7S2rywISkeXsuaUH3ZUU7IC8iB0=";
};
sample_documents = fetchFromGitLab {
domain = "gitlab.gnome.org";