Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

please make an appimage of this #81

Open
datamaskinen opened this issue Dec 13, 2018 · 27 comments
Open

please make an appimage of this #81

datamaskinen opened this issue Dec 13, 2018 · 27 comments

Comments

@datamaskinen
Copy link

please make an appimage of this

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

@probonopd
Copy link

probonopd commented Jan 3, 2019

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.

@datamaskinen
Copy link
Author

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

@probonopd
Copy link

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

@datamaskinen datamaskinen reopened this Jan 3, 2019
@datamaskinen
Copy link
Author

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

@probonopd
Copy link

Corrected above. Please refresh the page.

@datamaskinen
Copy link
Author

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

@probonopd
Copy link

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

@BasioMeusPuga
Copy link
Owner

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.

@datamaskinen
Copy link
Author

datamaskinen commented Jan 4, 2019

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

@probonopd
Copy link

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
Copy link

probonopd commented Jan 4, 2019

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
Copy link

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

@probonopd
Copy link

probonopd commented Jan 4, 2019

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: frescobaldi/python-poppler-qt5#14

@probonopd
Copy link

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?

@TheAssassin
Copy link

You need the system package, I guess?

@probonopd
Copy link

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

@TheAssassin
Copy link

I meant the poppler-qt5 package.

@probonopd
Copy link

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

@TheAssassin
Copy link

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.

@probonopd
Copy link

Ah, libpoppler-dev then. Makes sense 👍

probonopd added a commit to probonopd/Lector that referenced this issue Jan 5, 2019
@TheAssassin
Copy link

...

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

probonopd added a commit to probonopd/Lector that referenced this issue Jan 5, 2019
@probonopd
Copy link

 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.

@TheAssassin
Copy link

Try xenial. It's gooooood.

@probonopd
Copy link

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

@BasioMeusPuga
Copy link
Owner

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.

@datamaskinen
Copy link
Author

do we have the appimage script for this working now?

Can someone post the newest script to create it?

@probonopd
Copy link

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

probonopd added a commit to probonopd/Lector that referenced this issue Oct 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants