Lector
Lector copied to clipboard
please make an appimage of this
please make an appimage of this
https://github.com/AppImage/appimage.github.io#how-to-submit-appimages-to-the-catalog
Until there is an official one from @BasioMeusPuga, you can make one yourself:
#! /bin/bash
sudo apt -y install git
export VERSION=$(wget -q "https://api.github.com/repos/BasioMeusPuga/Lector/commits?sha=master" -O - | grep sha | head -n 1 | cut -d '"' -f 4 | head -c 7
)
export APPNAME=lector
export PIP_REQUIREMENTS="-e git+https://github.com/BasioMeusPuga/Lector#egg=$APPNAME"
export CONDA_CHANNELS="conda-forge"
export CONDA_PACKAGES="pyqt;beautifulsoup4" # Only use this if the package is in a Conda channel (e.g., conda-forge); can also be used for dependencies if the main application has no depends.txt
wget -c "https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage"
wget -c "https://raw.githubusercontent.com/TheAssassin/linuxdeploy-plugin-conda/master/linuxdeploy-plugin-conda.sh"
chmod +x linuxdeploy-x86_64.AppImage linuxdeploy-plugin-conda.sh
rm -r AppDir || true
wget -c "https://github.com/BasioMeusPuga/Lector/raw/master/lector/resources/raw/lector.desktop"
sed -i -e 's|Icon=L|Icon=l|g' lector.desktop # FIXME
cat > AppRun <<\EOF
#!/bin/bash
HERE="$(dirname "$(readlink -f "${0}")")"
exec "$HERE/usr/conda/bin/python" "$HERE/usr/conda/bin/lector" "$@"
EOF
chmod +x AppRun
wget -c "https://raw.githubusercontent.com/BasioMeusPuga/Lector/ed5bc0b2b9b92a506d4eb2144e349075caf3a8c0/lector/resources/raw/Lector.png" -O app.png
convert app.png -resize 512x512 $APPNAME.png
./linuxdeploy-x86_64.AppImage --appdir AppDir --plugin conda -i $APPNAME.png -d $(readlink -f "$APPNAME.desktop") --custom-apprun AppRun --output appimage
It is not yet optimized for size but it launches for me on Xubuntu 18.04.
Oh super nice of you to help me here .... that makes my life a lot easier
If @BasioMeusPuga is interested, we could make and upload official builds using Travis CI automatically.
Hehe ... sorry ... acidently deleted my last input so i'll repost it :)
On Kubuntu 18.04 output for build
-- Deploying files into AppDir root directory -- Deploying custom AppRun: AppRun Deploying file AppRun to AppDir/AppRun Copying file AppRun to AppDir/AppRun Deploying desktop file: AppDir/usr/share/applications/lector.desktop Deploying desktop file to AppDir root: AppDir/usr/share/applications/lector.desktop Creating symlink for file AppDir/usr/share/applications/lector.desktop in/as AppDir ERROR: Could not find suitable icon for Icon entry: Lector
Corrected above. Please refresh the page.
Ok .... it works perfectly .... Wonderful ...
Well, not that perfectly yet actually. But we are working on it. Thanks for your patience.
So I have the following issues:
- For the moment, I'm afraid I can't get this to work this on my Arch machine. I'll try Ubuntu 18.10 shortly. Is the build process distro dependent while the end result universal?
- I tried making a Flatpak sometime back, but I couldn't figure out how to include
python-poppler-qt5
as a dependency. I'm not sure this recipe has that either.
That said, this is really great work. I'd love to be able to generate builds / submit them to AppImagehub. Please point me in the direction of what I'm expected to know. I'm afraid I'm totally ignorant of the packaging ritual.
python-poppler-qt5 is missing in this appimage as well .... I think it all comes down to a decision of what to include in the app image ....
(seems like the script uses apt ... )
For the moment, I'm afraid I can't get this to work this on my Arch machine.
Please run from the command line and post any output. There is a known issue at the moment which needs to be solved:
This application failed to start because it could not find or load the Qt platform plugin "xcb" in "".
Is the build process distro dependent while the end result universal?
Yes, once we have a well-built working version. Currently it is still a work-in-progress.
python-poppler-qt5 is missing in this appimage as well
I could not find it on https://anaconda.org/search?q=poppler so I postponed this topic for now, until we have something that starts to be usable.
That said, this is really great work. I'd love to be able to generate builds / submit them to AppImagehub. Please point me in the direction of what I'm expected to know. I'm afraid I'm totally ignorant of the packaging ritual.
Great! Right now, the post important point is to find out why this happens...
OK; we seem to be getting somewhere. The latest build at least launches, but there are a couple of issue that possibly need to be fixed/changed in the source code of the application:
- It is trying to access files from a build-time path (
/home/travis/...
) which is not available at runtime, can this be changed in the Lector source code?
xkbcommon: ERROR: failed to add default include path /home/travis/build/probonopd/Lector/AppDir/usr/conda/lib
Qt: Failed to create XKB context!
Use QT_XKB_CONFIG_ROOT environmental variable to provide an additional search path, add ':' as separator to provide several search paths and/or make sure that XKB configuration data directory contains recent enough contents, to update please see http://cgit.freedesktop.org/xkeyboard-config/ .
-
It is trying to load the icons for the buttons (only) from
/usr/...
rather than from a location relative to itself. Can this be changed in the Lector source code? -
We still need to bundle python-poppler-qt5. We need out to find how to do this.
Turns out that 1. and 2. seem to be fixed when using PyQt5 from PyPI directly. Thanks @TheAssassin for the hint.
Trying to address 3., running into
[conda/stdout] Downloading https://files.pythonhosted.org/packages/af/e7/aa451d4ca0910472c4442d8aa6ef44300852926d85ad033b029a22157027/python-poppler-qt5-0.24.2.tar.gz
[conda/stdout] Complete output from command python setup.py egg_info:
[conda/stdout] Traceback (most recent call last):
[conda/stdout] File "<string>", line 1, in <module>
[conda/stdout] File "/tmp/pip-install-u7l85tln/python-poppler-qt5/setup.py", line 42, in <module>
[conda/stdout] import sipdistutils
[conda/stdout] ModuleNotFoundError: No module named 'sipdistutils'
[conda/stdout]
[conda/stdout] ----------------------------------------
[conda/stderr] Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-u7l85tln/python-poppler-qt5/
ERROR: Failed to run plugin: conda (exit code: 1)
Seems to be a known issue: https://github.com/wbsoft/python-poppler-qt5/issues/14
Strange. WIth a workaround for the above and QT_SELECT=5
it does not compile,
[conda/stdout] Collecting PyQt5
[conda/stdout] Downloading https://files.pythonhosted.org/packages/d4/bf/d884da8e2f7096d201c891d515eb6813a8e85df5eb6f5e12e867bf1d831c/PyQt5-5.11.3-5.11.2-cp35.cp36.cp37.cp38-abi3-manylinux1_x86_64.whl (117.8MB)
[conda/stdout] Collecting python-poppler-qt5
[conda/stdout] Downloading https://files.pythonhosted.org/packages/af/e7/aa451d4ca0910472c4442d8aa6ef44300852926d85ad033b029a22157027/python-poppler-qt5-0.24.2.tar.gz
[conda/stdout] Complete output from command python setup.py egg_info:
[conda/stdout] Package poppler-qt5 was not found in the pkg-config search path.
[conda/stdout] Perhaps you should add the directory containing `poppler-qt5.pc'
[conda/stdout] to the PKG_CONFIG_PATH environment variable
[conda/stdout] No package 'poppler-qt5' found
[conda/stdout] running egg_info
[conda/stdout] creating pip-egg-info/python_poppler_qt5.egg-info
[conda/stdout] writing pip-egg-info/python_poppler_qt5.egg-info/PKG-INFO
[conda/stdout] writing dependency_links to pip-egg-info/python_poppler_qt5.egg-info/dependency_links.txt
[conda/stdout] writing top-level names to pip-egg-info/python_poppler_qt5.egg-info/top_level.txt
[conda/stdout] writing manifest file 'pip-egg-info/python_poppler_qt5.egg-info/SOURCES.txt'
[conda/stdout] qmake: could not find a Qt installation of '5'
[conda/stdout] Failed to determine Qt version (Command '['qmake', '-query', 'QT_VERSION']' returned non-zero exit status 1.).
[conda/stdout]
[conda/stdout] ----------------------------------------
[conda/stderr] Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-5jodmg78/python-poppler-qt5/
ERROR: Failed to run plugin: conda (exit code: 1)
Any ideas @TheAssassin?
You need the system package, I guess?
System package of qmake
? And why? Wouldn't that lead to an unhealthy mix of different Qt versions?
I meant the poppler-qt5
package.
As in sudo apt -y install python-poppler-qt5
? Help me understand your line of thought...
poppler is a C(++?) library.
[conda/stdout] Package poppler-qt5 was not found in the pkg-config search path. [conda/stdout] Perhaps you should add the directory containing `poppler-qt5.pc'
This implies you need to install a system library.
Ah, libpoppler-dev
then. Makes sense 👍
...
libpoppler-qt5-dev/bionic-updates,bionic-security 0.62.0-2ubuntu2.5 amd64 PDF rendering library -- development files (Qt 5 interface)
libpoppler-qt5-dev : Depends: libpoppler-qt5-1 (= 0.24.5-2ubuntu4.8) but it is not going to be installed
Depends: qtbase5-dev but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
Sigh.
Try xenial. It's gooooood.
Won't run on all still-supported releases of Ubuntu. Would have to wait until xenial is the oldest still-supported release.
I've removed python-poppler-qt5
as a dependency. I'm using pymupdf
instead. That's maintained, and it's available as a wheel, so we should be good.
do we have the appimage script for this working now?
Can someone post the newest script to create it?
xenial is now the oldest still-supported distribution, so we should be good to go.