bookworm icon indicating copy to clipboard operation
bookworm copied to clipboard

Bookworm as AppImage : Arc-theme support and distro-agnosticism

Open baimafeima opened this issue 7 years ago • 63 comments

Bookworm looks extremely promising and I hope that it will quickly gain popularity beyond your main target operating system. I happen to prefer Solus instead of elementary OS. Is there any chance that you can look into making your application look great with the arc-theme and perhaps make it more distro-agnostic? See: https://github.com/horst3180/arc-theme

baimafeima avatar Apr 23 '17 06:04 baimafeima

Thanks for opening this issue...yes a few others have asked if it can be made distro agnostic...I will definitely try to do that once all the features and format support for Bookworm are done (will take me quite a while though)... I think the current code should work on all ubuntu based systems. Only the elementary granite and CSS will look different. Also the images/icon of elementary that I have used may not find equivalents on other distros...The workaround will be to put in a little code to include those icons with the code package so that it does not need to find them from the distro.... If you want you can try installing the PPA on Solus and add a screen shot here...that will give me some idea on how much work is needed for making Bookworm distro agnostic...hopefully the install will go fine...

sudo add-apt-repository ppa:bookworm-team/bookworm sudo apt-get update sudo apt-get install bookworm

babluboy avatar Apr 23 '17 12:04 babluboy

yes a few others have asked if it can be made distro agnostic...I will definitely try to do that once all the features and format support for Bookworm are done

This is great news. Thank you for being supportive to other operating systems.

If you want you can try installing the PPA on Solus and add a screen shot here...that will give me some idea on how much work is needed for making Bookworm distro agnostic

Solus is not Ubuntu-based but a completely independent operating system. The easiest for me (and for many others coming from non-Ubuntu distros) is probably if you add a Flatpak (http://flatpak.org/) or AppImage (http://appimage.org/) to your GitHub releases. This would significantly increase feedback to your application as users unable to compile from source will be able to report bugs and raise feature requests.

baimafeima avatar Apr 26 '17 02:04 baimafeima

@baimafeima thanks for the update. I have played around with snap for my other app (Nutty). Have not looked at Flatpak yet, will do so when I have a logical completion point in Bookworm

babluboy avatar Apr 26 '17 06:04 babluboy

Glad to see supporting Linux distributions other than eOS is on the way. There are, for example, more than 20 million Ubuntu desktop users, and I reckon a good % would love to be able to use this app because there's little else like it available.

With Ubuntu switching back to upstream GNOME it might be worth using cross-distro standards rather than those only available on Elementary.

Great work 👏

offensivelyaverage avatar May 07 '17 11:05 offensivelyaverage

Providing an AppImage would have, among others, these advantages:

  • Applications packaged as an AppImage can run on many distributions (including Ubuntu, Fedora, openSUSE, CentOS, elementaryOS, Linux Mint, and others)
  • One app = one file = super simple for users: just download one AppImage file, make it executable, and run
  • No unpacking or installation necessary
  • No root needed
  • No system libraries changed
  • Works out of the box, no installation of runtimes needed
  • Optional desktop integration with appimaged
  • Optional binary delta updates, e.g., for continuous builds (only download the binary diff) using AppImageUpdate
  • Can optionally GPG2-sign your AppImages (inside the file)
  • Works on Live ISOs
  • Can use the same AppImages when dual-booting multiple distributions

Here is an overview of projects that are already distributing upstream-provided, official AppImages.

probonopd avatar Jul 24 '17 01:07 probonopd

@probonopd Thanks for this suggestion...AppImage looks promising - will read up on the same to see how I can set it up for bookworm. Hopefully there is integration with GitHub to build automatically when updates are made or a release is made...

babluboy avatar Jul 24 '17 06:07 babluboy

Yes, it can be set up to build new AppImages on GitHub every time you git push. Many examples on how to do this are listed at https://github.com/probonopd/linuxdeployqt#projects-using-linuxdeployqt.

Alternatively you can use the Open Build Service, described at https://git.io/obs-ai. That way, your AppImage would get rebuilt even if one of its ingredient depdendencies gets updated.

probonopd avatar Jul 24 '17 15:07 probonopd

@probonopd I have got TravisCI working with this .travis.yml file.... Should I just add the additional content from the linuxdeployqt file in the example ?

babluboy avatar Sep 02 '17 16:09 babluboy

Yes, but make sure to replace APPNAME two times. Let me know how it goes. Alternatively, I can do it real quick for you.

probonopd avatar Sep 02 '17 16:09 probonopd

Thanks let me give it a go...will let you know how it went

babluboy avatar Sep 02 '17 16:09 babluboy

@probonopd I might have missed something, the travis build failed with: $ ./linuxdeployqt*.AppImage ./appdir/usr/share/applications/.desktop -bundle-non-qt-libs Desktop file as first argument: "./appdir/usr/share/applications/.desktop" desktopExecEntry: "r" desktopIconEntry: "r" ERROR: Could not determine the path to the executable based on the desktop file

babluboy avatar Sep 02 '17 16:09 babluboy

The real error must be earlier... yes: This application needs you to use cmake rather than qmake, that is

  - cmake . -DCMAKE_INSTALL_PREFIX=/usr
  - make -j$(nproc)
  - make DESTDIR=appdir install ; find appdir/

instead of

  - qmake PREFIX=/usr
  - make -j$(nproc)
  - make INSTALL_ROOT=appdir install ; find appdir/

probonopd avatar Sep 02 '17 17:09 probonopd

Also make sure that the DEPENDENCY_PACKAGES get installed (outside of the Docker containers if you are not using them for the AppImage) in .travis.yml.

probonopd avatar Sep 02 '17 17:09 probonopd

@probonopd many thanks for the pointers... I'm not sure how to represent the DEPENDENCY_PACKAGES outside of the docker container...these packages are used for building the app - so not sure if those packages are needed for the AppImage...

Also how do I represent the utilities like unrar, unzip, etc. which are required by bookworm to run...

babluboy avatar Sep 02 '17 17:09 babluboy

Since you are building the app for AppImage outside of the Docker container, you need to install the build dependencies outside of the Docker container, too.

Does the app really use the command line tools or just the libraries for the package formats? You would also have to bundle the unrar, unzip, etc. command line tools by copying them into the AppDir, along with their respective dependencies. There is currently no automated way to do this. In the latter case (if the app uses libraries rather than command line tools, as it probably should), linuxdeployqt will handle them automatically for you.

probonopd avatar Sep 02 '17 17:09 probonopd

@probonopd For installing dependencies outside of docker, do you have an example of how I should do it? The app uses the command line tools for unrar, unzip, etc rather than libraries of the same. For copying them to the AppDir, should I add something to the "after_success" ...i.e. "cp unzip appimage/"...where would the source be for these command line utilities...can do with your help here

babluboy avatar Sep 02 '17 17:09 babluboy

@babluboy can you or any of the core devs confirm that this app can be built on Ubuntu trusty 14.04? Then I will give it a try.

probonopd avatar Sep 02 '17 17:09 probonopd

@probonopd I'm the only dev for this app :-) ...I dont think it can be built on Ubuntu Trusty 14.04... Just started a build on Launchpad for Trusty here, will update back in a couple of minutes...

babluboy avatar Sep 02 '17 17:09 babluboy

@probonopd As expected the build failed on Trusty due to an issue with "libgranite-dev" E: Build-Depends dependency for bookworm cannot be satisfied because candidate version of package libgranite-dev can't satisfy version requirements Build log here

babluboy avatar Sep 02 '17 18:09 babluboy

Please ask the developers of libgranite-dev for a trusty ppa and use that for the build, or change the source code so that 0.1.0 (the version in trusty universe) is sufficient.

probonopd avatar Sep 02 '17 18:09 probonopd

@probonopd Since the app uses some granite widgets for look and feel and is primarily targeted at elementary OS, i would have to check if I can remove the granite dependency. I will also check if libgranite can be made available for Trusty....guess AppImage is dependent on the app being built successfully for Trusty...

babluboy avatar Sep 02 '17 18:09 babluboy

libgranite 0.1.0 is available for trusty. If you can make your app compile against that version, then it shall work.

probonopd avatar Sep 02 '17 18:09 probonopd

ok...will try to find a PPA for libgranite 0.1.0 and try a launchpad build...will update back here shortly...thanks a lot for your time and help...

babluboy avatar Sep 02 '17 18:09 babluboy

No ppa needed: https://packages.ubuntu.com/trusty/libdevel/libgranite-dev

probonopd avatar Sep 10 '17 05:09 probonopd

@probonopd Yes, I managed to get over the libgranite-dev issue, but got stuck with webkit. Trusty needs libwebkit2gtk-3.0-25 while Xenial needs libwebkit2gtk-4.0-37, so I tried the following in the debian control

libwebkit2gtk-3.0-25 | libwebkit2gtk-4.0-37,
libwebkit2gtk-3.0-dev | libwebkit2gtk-4.0-dev,

However, the build failed on Trusty as it is looking for the libwebkit2gtk-4.0 Not sure how to make libwebkit2gtk-4.0 optional in the debian control. Any ideas on how to progress ?

babluboy avatar Sep 10 '17 13:09 babluboy

Build fails with

-- checking for modules 'gtk+-3.0;gee-0.8;granite;webkit2gtk-4.0>=2.16.0;sqlite3>=3.5.9;poppler-glib'
--   package 'webkit2gtk-4.0>=2.16.0' not found
CMake Error at /usr/share/cmake-2.8/Modules/FindPkgConfig.cmake:283 (message):
  A required package was not found

So I guess that the CMakeLists.txt (and possibly, the source code) needs to be edited to allow for a lower version (not the debian control file).

probonopd avatar Sep 10 '17 15:09 probonopd

@probonopd You were right, the CMakeLists.txt was indeed the culprit and I did the following to get the application to compile: 1- Created a trusty VM and installed libwebkit2gtk-3.0-25, libwebkit2gtk-3.0-25 2- Updated the CMakeLists.txt to create conditional package lists for trusty and xenial (attached) 3- Added the webkitgtk-3.0.vapi (attached) to /usr/share/vala-0.22/vapi/ and added a vapidir to CmakeLists

The above allowed me to compile the application, but looks like gtk3 does not have the key API which bookworm uses:

error: The type name `WebKit.Settings' could not be found
error: The type name `WebKit.ContextMenuItem' could not be found
error: The type name `WebKit.NavigationPolicyDecision' could not be found
error: The type name `WebKit.NavigationAction' could not be found
error: The type name `WebKit.URIRequest' could not be found

I'm thinking that the vapi I picked up has not been compiled against webkit2 and hence the above errors. Will check further on how to create a vapi file against webkit2

Trusty CMakeLists_webkit3vapi.zip

babluboy avatar Sep 12 '17 11:09 babluboy

I was able to generate the vapi using:

sudo apt install gir1.2-webkit-3.0
vapigen --library webkitgtk-3.0 --pkg gio-2.0 --pkg gtk+-3.0 /usr/share/gir-1.0/WebKit2-3.0.gir

Using the vapi created above resolved most of the webkit errors but others like the below are still there (attached):

error: The type name `WebKit.NavigationAction' could not be found
error: The type name `Gtk.Popover' could not be found

At this point I'm giving up on trying to compile Bookworm on Trusty. Hopefully when AppImage can work on Xenial builds, I will be able to progress the issue.

cmake_errors.txt

Let me know if you see any other way forward.

babluboy avatar Sep 12 '17 12:09 babluboy

Sure, you can put into an AppImage whatever you like. But if you put in something that was built on Xenial, it will not run on distributions older than Xenial. Since Trusty is currently the oldest still-supported LTS version, that's what we currently recommend to target (and require for inclusion in the AppImageHub directory of available AppImages).

Generally speaking, i find it surprising that application developers frequently develop against the latest and greatest APIs and then seem surprised when applications don't work on any but the latest OSes...

probonopd avatar Sep 12 '17 16:09 probonopd

@probonopd Agree with your thoughts, however when I started with Bookworm I didnt have other distros in mind and used the version of elementary OS (Loki) as the base for the development. Probably I should have tried using older libraries for the design but then there is the danger of having the API deprecated as webkit 1 is pretty old now...so I started with webkit 2

Anyways, would you be able to assist me in correcting the dependencies in the current travis.yaml (DEPENDENCY_PACKAGES outside of the docker container) and how to add the utilities like unrar, unzip, etc. (which are required by bookworm to run) into the travis.yaml

babluboy avatar Sep 13 '17 12:09 babluboy