Lector icon indicating copy to clipboard operation
Lector copied to clipboard

please make an appimage of this

Open datamaskinen opened this issue 5 years ago • 27 comments

please make an appimage of this

https://github.com/AppImage/appimage.github.io#how-to-submit-appimages-to-the-catalog

datamaskinen avatar Dec 13 '18 07:12 datamaskinen

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.

probonopd avatar Jan 03 '19 18:01 probonopd

Oh super nice of you to help me here .... that makes my life a lot easier

datamaskinen avatar Jan 03 '19 19:01 datamaskinen

If @BasioMeusPuga is interested, we could make and upload official builds using Travis CI automatically.

probonopd avatar Jan 03 '19 19:01 probonopd

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

datamaskinen avatar Jan 03 '19 19:01 datamaskinen

Corrected above. Please refresh the page.

probonopd avatar Jan 03 '19 20:01 probonopd

Ok .... it works perfectly .... Wonderful ...

datamaskinen avatar Jan 03 '19 21:01 datamaskinen

Well, not that perfectly yet actually. But we are working on it. Thanks for your patience.

probonopd avatar Jan 03 '19 21:01 probonopd

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.

BasioMeusPuga avatar Jan 04 '19 12:01 BasioMeusPuga

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 ... )

datamaskinen avatar Jan 04 '19 12:01 datamaskinen

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...

probonopd avatar Jan 04 '19 12:01 probonopd

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:

  1. 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/ .
  1. 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?

  2. We still need to bundle python-poppler-qt5. We need out to find how to do this.

probonopd avatar Jan 04 '19 17:01 probonopd

Turns out that 1. and 2. seem to be fixed when using PyQt5 from PyPI directly. Thanks @TheAssassin for the hint.

probonopd avatar Jan 04 '19 17:01 probonopd

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

probonopd avatar Jan 04 '19 17:01 probonopd

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?

probonopd avatar Jan 04 '19 18:01 probonopd

You need the system package, I guess?

TheAssassin avatar Jan 05 '19 00:01 TheAssassin

System package of qmake? And why? Wouldn't that lead to an unhealthy mix of different Qt versions?

probonopd avatar Jan 05 '19 10:01 probonopd

I meant the poppler-qt5 package.

TheAssassin avatar Jan 05 '19 16:01 TheAssassin

As in sudo apt -y install python-poppler-qt5? Help me understand your line of thought...

probonopd avatar Jan 05 '19 16:01 probonopd

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.

TheAssassin avatar Jan 05 '19 16:01 TheAssassin

Ah, libpoppler-dev then. Makes sense 👍

probonopd avatar Jan 05 '19 16:01 probonopd

...

libpoppler-qt5-dev/bionic-updates,bionic-security 0.62.0-2ubuntu2.5 amd64 PDF rendering library -- development files (Qt 5 interface)

TheAssassin avatar Jan 05 '19 16:01 TheAssassin

 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.

probonopd avatar Jan 05 '19 17:01 probonopd

Try xenial. It's gooooood.

TheAssassin avatar Jan 05 '19 21:01 TheAssassin

Won't run on all still-supported releases of Ubuntu. Would have to wait until xenial is the oldest still-supported release.

probonopd avatar Jan 05 '19 21:01 probonopd

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.

BasioMeusPuga avatar Jan 26 '19 14:01 BasioMeusPuga

do we have the appimage script for this working now?

Can someone post the newest script to create it?

datamaskinen avatar Oct 05 '19 19:10 datamaskinen

xenial is now the oldest still-supported distribution, so we should be good to go.

probonopd avatar Oct 05 '19 19:10 probonopd