vadrian89 / cumulus-qt

Qt port for Cumulus
GNU General Public License v3.0
40 stars 10 forks source link

Appimage #6

Closed Ygarr closed 7 years ago

Ygarr commented 7 years ago

Appimage - As most suitable and convenient for most linux distributions

vadrian89 commented 7 years ago

Hi, sorry for not replying earlier but I am thinking on it. Will read more about it and will also probably try it, but at the sametime I am looking into snaps so it still early to say which will be the main package and which will be aditional.(I will be packaging in 2 versions for Linux, tough which will be those 2 final I am still deciding). Thanks for the feedback.

probonopd commented 7 years ago

Please see https://github.com/vadrian89/cumulus-qt/pull/10

probonopd commented 7 years ago

Now that the PR is merged, please consider uploading the AppImages to https://github.com/vadrian89/cumulus-qt/releases as well. https://github.com/probonopd/uploadtool can be used to automate this for each git push.

vadrian89 commented 7 years ago

I've made some changes to the structure of the app, most important the qml files are not in the qt resource system anymore. I was trying some stuff offline, but haven't pulled it off yet that's why I didn't mentioned anything yet.

vadrian89 commented 7 years ago

It built this time, but the qml files need to be deployed aswell.

probonopd commented 7 years ago

the qml files are not in the qt resource system anymore

Why have you changed it? It was working before.

The qml files are not in the qt resource system anymore.

Looking at it now.

probonopd commented 7 years ago

I could see 2 issues:

  1. The qml files are installed to usr/bin rather than usr/qml (which is where we set our QML_IMPORT_PATH/ QML2_IMPORT_PATH to)
  2. The code seems not to load them from QML_IMPORT_PATH/ QML2_IMPORT_PATH, but from the current working directory

Can you fix this?

References

vadrian89 commented 7 years ago

I have added the contents of the qt resource system back for the time being.
There is one issue though, it seems(to me) that the svg plugin doesn't get deployed, as I get the following issue:
qrc:/MenuButton.qml:35:9: QML Image: Error decoding: qrc:/icons/settings-white.svg: Unsupported image format

I will try later this day to test linuxdeployqt on a vm as I have an error on my machine(saying that it can't find qt 5_9 libraries and stuff).
Here is the link to transfer.sh file: https://transfer.sh/S3ekm/Cumulus-git.2483f1b-x86_64.AppImage

probonopd commented 7 years ago

Currently, the svg plugin gets deployed only if libQt5Svg.so.5 is deployed. Code is around here. Is that logic wrong?

vadrian89 commented 7 years ago

Seems to be okay by me, I'm on my phone though, I will try later to test in a virtual machine and see where the issue lied.

Pe 2 iul. 2017 12:46 p.m., "probonopd" notifications@github.com a scris:

Currently, the svg plugin gets deployed only if libQt5Svg.so.5 is deployed. Code is around here https://github.com/probonopd/linuxdeployqt/blob/4685e33a6efa8ad7f25b9138606b7bf1e1abbcf2/tools/linuxdeployqt/shared.cpp#L1118-L1123. Is that logic wrong?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/vadrian89/cumulus-qt/issues/6#issuecomment-312481205, or mute the thread https://github.com/notifications/unsubscribe-auth/AHzIhiq4vQeJOMpmYdN2qdG1hZqL5_irks5sJ2bogaJpZM4NUXG8 .

vadrian89 commented 7 years ago

So it seems the svg library doesn't get deployed at all. Can you let me know where do you search if svg module is required? The SVG library doesn't appear in ldd output, but exists in the project(.pro) file.

probonopd commented 7 years ago

Here: https://github.com/probonopd/linuxdeployqt/blob/4685e33a6efa8ad7f25b9138606b7bf1e1abbcf2/tools/linuxdeployqt/shared.cpp#L1118-L1123

vadrian89 commented 7 years ago

Yeah, like I mentioned before, the output of ldd doesn't show libQt5Svg so the module it isn't getting deployed.
I think we need an argument check for svg module and when that is argument is present the library should get deployed. Will try and do it myself and then I will make a pull request to your branch and you will decide if you want to merge it or just take the function adapt to your code.

vadrian89 commented 7 years ago

I have packaged Cumulus into an AppImage, most likely some issues might arise so feel free to let me know if they arise.
Sadly it does not have any auto-update way but every new version will also see an AppImage release.

probonopd commented 7 years ago

For start on login please set the executable file manually to your startup list, do not use the application's option as it will not work.

You can use the $APPIMAGE environment variable, it points to the AppImage. If it exists then we are running from an AppImage and this is what needs to be autostarted.

vadrian89 commented 7 years ago

Hy probonopd can you give me some info related to appimage?

  1. Why is there need for a desktop file inside usr/share/applications and root directory if the file run by the AppImage is the executable itself?
    Tried to add an argument to the desktop file only to find out after a lot of failed attempts and some digging that the AppImage calls the executable itself directly instead of the desktop file like I thought it would(asumption at it's best).
  2. How can I access deployed images in Qt/QML? Those which are not compiled into the executable?
    • tried deploying them in usr/share/applications and calling them with "file:" + imageName, but doesn't find them
    • tried deploying the same way and call them with "file:usr/share/pixmaps/" + imageName, but the same, cannot find them
    • without the "file:" prefix it tries to load from qrc but ofc it won't find them
    • also tried to use full path "file:" + pEnv.value("APPIMAGE") + "/usr/share/pixmaps/" + imageName, but still won't work
probonopd commented 7 years ago

Why is there need for a desktop file inside usr/share/applications and root directory if the file run by the AppImage is the executable itself?

The one in usr/share/applications is the one that gets installed my make install. Since there could be more than one, and since the AppImage format does not require you to have usr/share/applications at all, it is a convention that AppRun will look for a desktop file in the root of the AppDir. It is the main entry point used by AppRun.c. For all practicality, just copy the "main" .desktop file to the root directory of the AppDir.

Tried to add an argument to the desktop file only to find out after a lot of failed attempts and some digging that the AppImage calls the executable itself directly instead of the desktop file like I thought it would (asumption at it's best).

Pull requests welcome! But you mean "the AppRun.c", not "the AppImage", right?

How can I access deployed images in Qt/QML? Those which are not compiled into the executable?

Like you would normally do in Qt. The fact that your Qt application runs from an AppImage does not change the mechanisms used by Qt. Just do not hardcode paths, i.e., make all paths relative to the main executable, e.g. by using some of the Qt mechanisms such as QCoreApplication::applicationDirPath().

also tried to use full path "file:" + pEnv.value("APPIMAGE") + "/usr/share/pixmaps/" + imageName, but still won't work

$APPIMAGE is the path to the AppImage file on disk. You mean $APPDIR. But I don't recommend to do it this way, because it breaks when someone unpacks the AppImage and runs it from there.

vadrian89 commented 7 years ago

Pull requests welcome! But you mean "the AppRun.c", not "the AppImage", right?

I mean when I call ./Cumulus*.AppImage it calls Cumulus, I want it to call "Cumulus -i Cumulus-AppImage",
you can look here and hopefully it's clearer what I want.

Like you would normally do in Qt. The fact that your Qt application runs from an AppImage does not change the mechanisms used by Qt. Just make all paths relative to the main executable or use some of the Qt mechanisms such as QCoreApplication::applicationDirPath()

Ok, will look more into it tommorrow, thanks.

probonopd commented 7 years ago

Exactly. Arguments passed to the AppImage will be passed through to the payload app (so ./Cumulus.AppImage -i Cumulus-AppImage would work), but arguments in the .desktop file are currently ignored by AppRun.c. Note that you don't have to use AppRun.c, you could write your own AppRun script or executable, or even just link your main executable there (as linuxdeployqt does).

But, out of curiosity, why do you want to call Cumulus with an argument to the AppImage?

vadrian89 commented 7 years ago

Passing -i argument, would allow another independent instance of the application for those which would need. A fast workaround for multiple locations, as multiple locations isn't my top priority yet.

Pe 27 aug. 2017 9:06 p.m., "probonopd" notifications@github.com a scris:

Exactly. Arguments passed to the AppImage will be passed through to the payload app (so ./Cumulus.AppImage -i Cumulus-AppImage would work), but arguments in the .desktop file are currently ignored by AppRun.c.

But, out of curiosity, why do you want to call Cumulus with an argument to the AppImage?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/vadrian89/cumulus-qt/issues/6#issuecomment-325214496, or mute the thread https://github.com/notifications/unsubscribe-auth/AHzIhm8J0ya4B5FSybZ7I-pgkWx_SHgcks5scbBAgaJpZM4NUXG8 .

vadrian89 commented 7 years ago

Something is not right, the appImage starts without any icon any ideea why that might be?
I have tried with both PNG and SVG files but I am seeing the system-default binary icon.

probonopd commented 7 years ago

Can I download the one that has this error?

vadrian89 commented 7 years ago

Yeah you can check any of the last 2 releases, they both seem to have this issue https://github.com/vadrian89/cumulus-qt/releases

probonopd commented 7 years ago

Looks correct to me?

http://i.imgur.com/12uF0vT.png

vadrian89 commented 7 years ago

I am reffering to the application icon on the launcher/taskbars.

Pe 3 sept. 2017 10:17 p.m., "probonopd" notifications@github.com a scris:

Looks correct to me?

http://i.imgur.com/12uF0vT.png

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/vadrian89/cumulus-qt/issues/6#issuecomment-326825370, or mute the thread https://github.com/notifications/unsubscribe-auth/AHzIhnfH8OhwzOoUP9JvbepuAANfsdj7ks5sevtkgaJpZM4NUXG8 .

probonopd commented 7 years ago

Application icon is missing, e.g., in usr/share/icons/hicolor/256x256/apps/. At least appimaged would need these to display an icon there.

vadrian89 commented 7 years ago

Shouldn't it search in usr/share/pixmaps/?

The upper left is an instance from one version and the lower left is from another version from release.

captura de ecran_2017-09-04_14-32-07

probonopd commented 7 years ago

There is no per-user equivalent of usr/share/pixmaps. But appimaged runs per-user.

Some desktops need to have the icon in a directory with an explicit size in the path, e.g., 256x256 in $HOME/local/share/icons/hicolor/256x256/apps/. Details here.

So the pragmatic solution that works today is to (also) put an icon in usr/share/icons/hicolor/256x256/apps/ inside the AppDir.

vadrian89 commented 7 years ago

captura de ecran_2017-09-06_15-41-02

A similar build of the package can be found here(build #42).

I have tried the linked package in KDE-neon live image but still won't work.

probonopd commented 7 years ago

Do you have a usr/share/icons/hicolor/256x256/apps/cumulus.png inside the AppImage now?

vadrian89 commented 7 years ago

Yup

probonopd commented 7 years ago

Are you running the optional appimaged daemon?

vadrian89 commented 7 years ago

Nope

probonopd commented 7 years ago

Please do :)

probonopd commented 7 years ago

Alternatively, set the icon using setWindowIcon(const QIcon & icon) in Qt.

vadrian89 commented 7 years ago

Ok thanks, didn't tried it yet, but will try it in the near future, in the meantime will close this comment.
Will start working on the modifications for linuxdeployqt.