Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at python-updates 110 lines 2.1 kB view raw
1{ 2 lib, 3 stdenv, 4 fetchFromGitHub, 5 cmake, 6 pkg-config, 7 libuuid, 8 sane-backends, 9 podofo_0_10, 10 libjpeg, 11 djvulibre, 12 libxmlxx3, 13 libzip, 14 tesseract, 15 intltool, 16 poppler, 17 json-glib, 18 ninja, 19 python3, 20 doxygen, 21 enchant, 22 23 # Gtk deps 24 # upstream gImagereader supports Qt too 25 gobject-introspection, 26 wrapGAppsHook3, 27 gtkmm3, 28 gtksourceview3, 29 gtksourceviewmm, 30 gtkspell3, 31 gtkspellmm, 32 cairomm, 33 kdePackages, 34 qt6Packages, 35 withQt6 ? false, 36 wrapQtAppsHook ? null, 37}: 38 39let 40 pythonEnv = python3.withPackages (ps: with ps; [ pygobject3 ]); 41in 42stdenv.mkDerivation rec { 43 pname = "gImageReader"; 44 version = "5aff249fdc119caa1464af9405259799b4f69d8b"; 45 46 src = fetchFromGitHub { 47 owner = "manisandro"; 48 repo = "gImageReader"; 49 rev = "${version}"; 50 sha256 = "sha256-xS63iGY1yf0NEnGuss0sme1vSYd2L3sOUd/g8yyPn1k="; 51 }; 52 53 nativeBuildInputs = [ 54 cmake 55 ninja 56 intltool 57 pkg-config 58 pythonEnv 59 enchant 60 gobject-introspection 61 wrapGAppsHook3 62 ] 63 ++ lib.optionals withQt6 [ qt6Packages.wrapQtAppsHook ]; 64 65 buildInputs = [ 66 libxmlxx3 67 libzip 68 libuuid 69 sane-backends 70 podofo_0_10 71 libjpeg 72 djvulibre 73 tesseract 74 poppler 75 doxygen 76 cairomm 77 gtkmm3 78 gtksourceview3 79 gtksourceviewmm 80 gtkspell3 81 gtkspellmm 82 json-glib 83 ] 84 ++ lib.optionals withQt6 ( 85 with qt6Packages; 86 [ 87 kdePackages.poppler 88 qtbase 89 qtspell 90 qttools 91 quazip 92 ] 93 ); 94 95 # interface type can be where <type> is either gtk, qt6 96 cmakeFlags = [ 97 "-DINTERFACE_TYPE=gtk" 98 ] 99 ++ lib.optionals withQt6 [ "-DINTERFACE_TYPE=qt6 -DQT_VER=6" ]; 100 101 meta = with lib; { 102 description = "Simple Gtk/Qt front-end to tesseract-ocr"; 103 mainProgram = if withQt6 then "gImageReader-qt6" else "gImageReader"; 104 homepage = "https://github.com/manisandro/gImageReader"; 105 changelog = "https://github.com/manisandro/gImageReader/blob/${version}/NEWS"; 106 license = licenses.gpl3Plus; 107 maintainers = with maintainers; [ teto ]; 108 platforms = platforms.linux; 109 }; 110}