Skip to content

Commit

Permalink
paperwork: fix installing translations
Browse files Browse the repository at this point in the history
without this backport, paperwork is always in english
  • Loading branch information
symphorien committed Jan 2, 2025
1 parent 3da6bd3 commit 87f634b
Show file tree
Hide file tree
Showing 6 changed files with 45 additions and 19 deletions.
4 changes: 2 additions & 2 deletions pkgs/applications/office/paperwork/openpaperwork-core.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
buildPythonPackage,
lib,
fetchFromGitLab,
callPackage,

isPy3k,
isPyPy,
Expand All @@ -17,7 +17,7 @@

buildPythonPackage rec {
pname = "openpaperwork-core";
inherit (import ./src.nix { inherit fetchFromGitLab; }) version src;
inherit (callPackage ./src.nix {}) version src;
format = "pyproject";

sourceRoot = "${src.name}/openpaperwork-core";
Expand Down
4 changes: 2 additions & 2 deletions pkgs/applications/office/paperwork/openpaperwork-gtk.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
buildPythonPackage,
lib,
fetchFromGitLab,
callPackage,

isPy3k,
isPyPy,
Expand All @@ -17,7 +17,7 @@

buildPythonPackage rec {
pname = "openpaperwork-gtk";
inherit (import ./src.nix { inherit fetchFromGitLab; }) version src;
inherit (callPackage ./src.nix {}) version src;
format = "pyproject";

sourceRoot = "${src.name}/openpaperwork-gtk";
Expand Down
4 changes: 2 additions & 2 deletions pkgs/applications/office/paperwork/paperwork-backend.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
buildPythonPackage,
lib,
fetchFromGitLab,
callPackage,
pyenchant,
scikit-learn,
pypillowfight,
Expand All @@ -28,7 +28,7 @@

buildPythonPackage rec {
pname = "paperwork-backend";
inherit (import ./src.nix { inherit fetchFromGitLab; }) version src;
inherit (callPackage ./src.nix {}) version src;
format = "pyproject";

sourceRoot = "${src.name}/paperwork-backend";
Expand Down
4 changes: 2 additions & 2 deletions pkgs/applications/office/paperwork/paperwork-gtk.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
lib,
callPackage,
python3Packages,
gtk3,
cairo,
Expand All @@ -9,7 +10,6 @@
dbus,
libnotify,
wrapGAppsHook3,
fetchFromGitLab,
which,
gettext,
gobject-introspection,
Expand All @@ -32,7 +32,7 @@ let
imagemagick
perlPackages.Po4a
];
inherit (import ./src.nix { inherit fetchFromGitLab; }) version src sample_documents;
inherit (callPackage ./src.nix {}) version src sample_documents;
in

python3Packages.buildPythonApplication rec {
Expand Down
4 changes: 2 additions & 2 deletions pkgs/applications/office/paperwork/paperwork-shell.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
buildPythonPackage,
lib,
fetchFromGitLab,
callPackage,

isPy3k,
isPyPy,
Expand All @@ -21,7 +21,7 @@

buildPythonPackage rec {
pname = "paperwork-shell";
inherit (import ./src.nix { inherit fetchFromGitLab; }) version src;
inherit (callPackage ./src.nix {}) version src;
format = "pyproject";

sourceRoot = "${src.name}/paperwork-shell";
Expand Down
44 changes: 35 additions & 9 deletions pkgs/applications/office/paperwork/src.nix
Original file line number Diff line number Diff line change
@@ -1,14 +1,40 @@
{ fetchFromGitLab }:
{
fetchFromGitLab,
stdenv,
fetchpatch,
}:
rec {
version = "2.2.5";
src = fetchFromGitLab {
domain = "gitlab.gnome.org";
repo = "paperwork";
group = "World";
owner = "OpenPaperwork";
rev = version;
sha256 = "sha256-PRh0ohmPLwpM76qYfbExFqq4OK6Hm0fbdzrjXungSoY=";
};
src =
let
actual_src = fetchFromGitLab {
domain = "gitlab.gnome.org";
repo = "paperwork";
group = "World";
owner = "OpenPaperwork";
rev = version;
sha256 = "sha256-PRh0ohmPLwpM76qYfbExFqq4OK6Hm0fbdzrjXungSoY=";
};
in
stdenv.mkDerivation {
pname = "paperwork-patched-src";
inherit version;
src = actual_src;

patches = [
# fix installing translations
# remove on next release
(fetchpatch {
url = "https://gitlab.gnome.org/World/OpenPaperwork/paperwork/-/commit/b8e2633ace0f3d9d57e68c27db8f594b8a5ddd7e.patch";
hash = "sha256-VUT86kF0ZHLGK457ZrrIBMeiZqg/rPRpbkBA/ua9rU8=";
})
];

installPhase = ''
cp -r . $out
'';
};

sample_documents = fetchFromGitLab {
domain = "gitlab.gnome.org";
repo = "paperwork-test-documents";
Expand Down

0 comments on commit 87f634b

Please sign in to comment.