RajSolai / TextSnatcher

How to Copy Text from Images ? Answer is TextSnatcher !. Perform OCR operations in seconds on Linux Desktop.
https://textsnatcher.rf.gd/
GNU General Public License v3.0
1.27k stars 46 forks source link

libportal dependency in meson.build is it actually needed for a native Linux package #5

Closed SwampRabbit closed 2 years ago

SwampRabbit commented 2 years ago

Right now libportal is a dependency in meson.build, which causes compiling to fail when building a native package.

I'm not familiar with libportal, this is only needed for building flatpaks?

I also seem to have a possibly related build failure if libportal-dev is not installed and included as part of the build:

[6/17] valac -C --pkg gtk+-3.0 --pkg glib-2.0 --pkg gdk-pixbuf-2.0 --pkg libhandy-1 --pkg gobject-2.0 --pkg granite --color=always --directory com.github.rajsolai.textsnatcher.p --basedir ../ --gresources=../data/com.github.rajsolai.textsnatcher.gresource.xml ../src/Application.vala ../src/MainWindow.vala ../src/components/VerticalBox.vala ../src/components/HeaderBar.vala ../src/components/LanguageButton.vala ../src/components/AboutButton.vala ../src/components/AboutDialog.vala ../src/screens/MainScreen.vala ../src/services/LanguageService.vala ../src/services/TesseractTrigger.vala
FAILED: com.github.rajsolai.textsnatcher.p/src/Application.c com.github.rajsolai.textsnatcher.p/src/MainWindow.c com.github.rajsolai.textsnatcher.p/src/components/VerticalBox.c com.github.rajsolai.textsnatcher.p/src/components/HeaderBar.c com.github.rajsolai.textsnatcher.p/src/components/LanguageButton.c com.github.rajsolai.textsnatcher.p/src/components/AboutButton.c com.github.rajsolai.textsnatcher.p/src/components/AboutDialog.c com.github.rajsolai.textsnatcher.p/src/screens/MainScreen.c com.github.rajsolai.textsnatcher.p/src/services/LanguageService.c com.github.rajsolai.textsnatcher.p/src/services/TesseractTrigger.c 
valac -C --pkg gtk+-3.0 --pkg glib-2.0 --pkg gdk-pixbuf-2.0 --pkg libhandy-1 --pkg gobject-2.0 --pkg granite --color=always --directory com.github.rajsolai.textsnatcher.p --basedir ../ --gresources=../data/com.github.rajsolai.textsnatcher.gresource.xml ../src/Application.vala ../src/MainWindow.vala ../src/components/VerticalBox.vala ../src/components/HeaderBar.vala ../src/components/LanguageButton.vala ../src/components/AboutButton.vala ../src/components/AboutDialog.vala ../src/screens/MainScreen.vala ../src/services/LanguageService.vala ../src/services/TesseractTrigger.vala
../src/services/TesseractTrigger.vala:9.5-9.7: error: The symbol `Xdp' could not be found
    Xdp.Portal portal ;
    ^^^
Compilation failed: 1 error(s), 0 warning(s)
ninja: build stopped: subcommand failed.

If I build with libportal-dev, I can create a native package, and TextSnatcher runs, but seems to have some issues working. I can debug it a bit more and make a separate issue from this.

If TextSnatcher isn't made to be built as a native package right now, that's fine. If anything I can help update your Debian packaging a bit in the meantime.

RajSolai commented 2 years ago

Compile/Build time dependency

Issues

Yes libportal is a compile time dependency which unfortunately not shipped by most of the debian based distros.

Solution

Possible solution for the libportal dependency issues are,

Runtime Dependency

Issues

I want to install runtime dependencies via apt package manager using postinst script, unfortunately that leads to dpkg cache lock error.

SwampRabbit commented 2 years ago

@RajSolai thank you very much for the info.

I played around with it and built libportal without gtk-4 by excluding those at build time.

TextSnatcher builds and seems to run, but has some issues. I will open another issue when I get some time to mess with it.

Thanks again!