2022-08-12 12:06:08 +00:00
|
|
|
{ stdenv
|
|
|
|
, lib
|
|
|
|
, fetchFromGitHub
|
|
|
|
, python3Packages
|
|
|
|
, wrapGAppsHook4
|
|
|
|
, gtk4
|
|
|
|
, meson
|
|
|
|
, ninja
|
|
|
|
, pkg-config
|
|
|
|
, appstream-glib
|
|
|
|
, desktop-file-utils
|
|
|
|
, glib
|
|
|
|
, gobject-introspection
|
2023-10-09 19:29:22 +00:00
|
|
|
, blueprint-compiler
|
|
|
|
, libxml2
|
2022-08-12 12:06:08 +00:00
|
|
|
, libnotify
|
|
|
|
, libadwaita
|
|
|
|
, libportal
|
|
|
|
, gettext
|
|
|
|
, librsvg
|
|
|
|
, tesseract5
|
|
|
|
, zbar
|
2023-10-09 19:29:22 +00:00
|
|
|
, gst_all_1
|
2022-08-12 12:06:08 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
python3Packages.buildPythonApplication rec {
|
|
|
|
pname = "gnome-frog";
|
2024-05-15 15:35:15 +00:00
|
|
|
version = "1.5.1";
|
2022-08-12 12:06:08 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "TenderOwl";
|
|
|
|
repo = "Frog";
|
2022-09-09 14:08:57 +00:00
|
|
|
rev = "refs/tags/${version}";
|
2024-05-15 15:35:15 +00:00
|
|
|
sha256 = "sha256-zL6zuqHF1pTXT3l1mAFx2EL+0ThzjXfst/nEyNVorZg=";
|
2022-08-12 12:06:08 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
format = "other";
|
|
|
|
|
|
|
|
patches = [ ./update-compatible-with-non-flatpak-env.patch ];
|
|
|
|
postPatch = ''
|
|
|
|
chmod +x ./build-aux/meson/postinstall.py
|
|
|
|
patchShebangs ./build-aux/meson/postinstall.py
|
|
|
|
substituteInPlace ./build-aux/meson/postinstall.py \
|
|
|
|
--replace "gtk-update-icon-cache" "gtk4-update-icon-cache"
|
|
|
|
substituteInPlace ./frog/language_manager.py --subst-var out
|
|
|
|
'';
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
appstream-glib
|
|
|
|
desktop-file-utils
|
|
|
|
gettext
|
|
|
|
meson
|
|
|
|
ninja
|
|
|
|
pkg-config
|
|
|
|
glib
|
|
|
|
wrapGAppsHook4
|
2022-09-09 14:08:57 +00:00
|
|
|
gobject-introspection
|
2023-10-09 19:29:22 +00:00
|
|
|
blueprint-compiler
|
|
|
|
libxml2
|
2022-08-12 12:06:08 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
librsvg
|
|
|
|
libnotify
|
|
|
|
libadwaita
|
|
|
|
libportal
|
|
|
|
zbar
|
|
|
|
tesseract5
|
2023-10-09 19:29:22 +00:00
|
|
|
gst_all_1.gstreamer
|
2022-08-12 12:06:08 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
propagatedBuildInputs = with python3Packages; [
|
2024-05-15 15:35:15 +00:00
|
|
|
loguru
|
|
|
|
nanoid
|
|
|
|
posthog
|
2022-08-12 12:06:08 +00:00
|
|
|
pygobject3
|
2024-05-15 15:35:15 +00:00
|
|
|
python-dateutil
|
2022-08-12 12:06:08 +00:00
|
|
|
pillow
|
|
|
|
pytesseract
|
|
|
|
pyzbar
|
2023-10-09 19:29:22 +00:00
|
|
|
gtts
|
2022-08-12 12:06:08 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
# This is to prevent double-wrapping the package. We'll let
|
|
|
|
# Python do it by adding certain arguments inside of the
|
|
|
|
# wrapper instead.
|
|
|
|
dontWrapGApps = true;
|
|
|
|
preFixup = ''
|
|
|
|
makeWrapperArgs+=("''${gappsWrapperArgs[@]}")
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
homepage = "https://getfrog.app/";
|
|
|
|
description =
|
|
|
|
"Intuitive text extraction tool (OCR) for GNOME desktop";
|
|
|
|
license = licenses.mit;
|
2023-10-09 19:29:22 +00:00
|
|
|
mainProgram = "frog";
|
2022-08-12 12:06:08 +00:00
|
|
|
maintainers = with maintainers; [ foo-dogsquared ];
|
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
|
|
|
}
|