22 ] ++ lib.optionals stdenv.hostPlatform.isLinux [
28 ps.buildPythonApplication rec {
33 disabled = ps.pythonOlder "3.9";
35 src = fetchFromGitHub {
38 rev = "refs/tags/v${version}";
39 hash = "sha256-iMlW8oEt4OSipJaQ2XzBZeBVqiZP/C1sM0f5LYjv7/A=";
53 ] ++ lib.optionals stdenv.hostPlatform.isDarwin [
68 "''${qtWrapperArgs[@]}"
69 --set QT_QPA_PLATFORM xcb
70 --prefix PATH : ${lib.makeBinPath wrapperDeps}
74 postInstall = lib.optionalString stdenv.hostPlatform.isLinux ''
75 mkdir -p $out/share/pixmaps
76 ln -s $out/${python3.sitePackages}/normcap/resources/icons/normcap.png $out/share/pixmaps/
79 nativeCheckInputs = wrapperDeps ++ [
85 ] ++ lib.optionals stdenv.hostPlatform.isLinux [
91 export HOME=$(mktemp -d)
92 '' + lib.optionalString stdenv.hostPlatform.isLinux ''
93 # setup a virtual x11 display
94 export DISPLAY=:$((2000 + $RANDOM % 1000))
95 Xvfb $DISPLAY -screen 5 1024x768x8 &
99 postCheck = lib.optionalString stdenv.hostPlatform.isLinux ''
100 # cleanup the virtual x11 display
106 # requires a wayland session (no xclip support)
108 # RuntimeError: Please destroy the QApplication singleton before creating a new QApplication instance
109 "test_get_application"
110 # times out, unknown why
111 "test_update_checker_triggers_checked_signal"
113 "test_urls_reachable"
115 "test_synchronized_capture"
117 "test_normcap_ocr_testcases"
118 ] ++ lib.optionals stdenv.hostPlatform.isDarwin [
120 "test_send_via_qt_tray"
122 # requires impure pbcopy
123 "test_get_copy_func_with_pbcopy"
124 "test_get_copy_func_without_pbcopy"
125 "test_perform_pbcopy"
128 # NSXPCSharedListener endpointForReply:withListenerName:replyErrorCode:
129 # while obtaining endpoint 'ClientCallsAuxiliary': Connection interrupted
131 "test_introduction_initialize_checkbox_state"
132 "test_introduction_checkbox_sets_return_code"
133 "test_introduction_toggle_checkbox_changes_return_code"
134 "test_show_introduction"
137 disabledTestPaths = [
139 "tests/tests_gui/test_downloader.py"
140 # fails to import, causes pytest to freeze
141 "tests/tests_gui/test_language_manager.py"
142 # RuntimeError("Internal C++ object (PySide6.QtGui.QHideEvent) already deleted.")
143 # AttributeError("'LoadingIndicator' object has no attribute 'timer'")
144 "tests/tests_gui/test_loading_indicator.py"
145 ] ++ lib.optionals stdenv.hostPlatform.isDarwin [
147 "tests/integration/test_normcap.py"
148 "tests/integration/test_tray_menu.py"
149 "tests/integration/test_settings_menu.py"
150 "tests/tests_clipboard/test_handlers/test_qtclipboard.py"
151 "tests/tests_gui/test_tray.py"
152 "tests/tests_gui/test_window.py"
153 "tests/tests_screengrab/"
154 # failure unknown, crashes in first test with `.show()`
155 "tests/tests_gui/test_loading_indicator.py"
156 "tests/tests_gui/test_menu_button.py"
157 "tests/tests_gui/test_resources.py"
158 "tests/tests_gui/test_update_check.py"
163 name = "com.github.dynobo.normcap";
164 desktopName = "NormCap";
165 genericName = "OCR powered screen-capture tool";
166 comment = "Extract text from an image directly into clipboard";
170 categories = ["Utility" "Office"];
171 keywords = ["Text" "Extraction" "OCR"];
176 description = "OCR powered screen-capture tool to capture information instead of images";
177 homepage = "https://dynobo.github.io/normcap/";
178 license = licenses.gpl3Plus;
179 maintainers = with maintainers; [ cafkafk pbsds ];
180 mainProgram = "normcap";