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

Add support for building snaps #390

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

popey
Copy link

@popey popey commented Nov 19, 2020

Attempt to build a snap of touchegg. Not currently working.

To build, on Ubuntu, locally:

Setup:

snap install snapcraft
snap install lxd
sudo lxd init --auto

Clone this repo, then from within it:
snapcraft --use-lxd

To build remotely in the ☁️

(requires launchpad.net account)
snap install snapcraft
Clone this repo then from within it:
snapcraft remote-build

Install the snap:

snap install touchegg_2.0.3-6-*_amd64.snap --dangerous

To check logs:

snap logs touchegg

Current issue:

$ snap logs touchegg 
2020-11-19T09:55:18Z touchegg.touchegg[1984594]: terminate called after throwing an instance of 'std::runtime_error'
2020-11-19T09:55:18Z touchegg.touchegg[1984594]:   what():  File /usr/share/touchegg/touchegg.conf not found.
2020-11-19T09:55:18Z touchegg.touchegg[1984594]: Reinstall Touchégg to solve this issue
2020-11-19T09:55:19Z systemd[1]: snap.touchegg.touchegg.service: Main process exited, code=dumped, status=6/ABRT
2020-11-19T09:55:19Z systemd[1]: snap.touchegg.touchegg.service: Failed with result 'core-dump'.
2020-11-19T09:55:19Z systemd[1]: snap.touchegg.touchegg.service: Scheduled restart job, restart counter is at 5.
2020-11-19T09:55:19Z systemd[1]: Stopped Service for snap application touchegg.touchegg.
2020-11-19T09:55:19Z systemd[1]: snap.touchegg.touchegg.service: Start request repeated too quickly.
2020-11-19T09:55:19Z systemd[1]: snap.touchegg.touchegg.service: Failed with result 'core-dump'.
2020-11-19T09:55:19Z systemd[1]: Failed to start Service for snap application touchegg.touchegg.

Other issues:
It would be nice to use the gnome-3-34 extension rather than bundle all the stage-packages but when I built with the extension (and omitted the entire stage-packages stanza) it fails to build with:

[ 94%] Building CXX object CMakeFiles/touchegg.dir/src/window-system/x11-cairo-surface.cpp.o                                                                                                                                                                             
[ 97%] Building CXX object CMakeFiles/touchegg.dir/src/window-system/x11.cpp.o                                                                                                                                                                                           
[100%] Linking CXX executable touchegg                                                                                                                                                                                                                                   
/snap/gnome-3-34-1804-sdk/current/usr/lib/x86_64-linux-gnu/libpangoft2-1.0.so.0: undefined reference to `hb_ot_layout_script_select_language'                                                                                                                            
/snap/gnome-3-34-1804-sdk/current/usr/lib/x86_64-linux-gnu/libpangoft2-1.0.so.0: undefined reference to `pango_font_get_hb_font'                                                                                                                                         
/snap/gnome-3-34-1804-sdk/current/usr/lib/x86_64-linux-gnu/libpangoft2-1.0.so.0: undefined reference to `pango_font_description_set_variations'                                                                                                                          
/snap/gnome-3-34-1804-sdk/current/usr/lib/x86_64-linux-gnu/libpangoft2-1.0.so.0: undefined reference to `hb_blob_create_from_file'                                                                                                                                       
/snap/gnome-3-34-1804-sdk/current/usr/lib/x86_64-linux-gnu/libatk-bridge-2.0.so.0: undefined reference to `atk_text_scroll_substring_to'                                                                                                                                 
/snap/gnome-3-34-1804-sdk/current/usr/lib/x86_64-linux-gnu/libpangoft2-1.0.so.0: undefined reference to `hb_ot_var_named_instance_get_design_coords'                                                                                                                     
/snap/gnome-3-34-1804-sdk/current/usr/lib/x86_64-linux-gnu/libpangoft2-1.0.so.0: undefined reference to `pango_coverage_get_type'                                                                                                                                        
/snap/gnome-3-34-1804-sdk/current/usr/lib/x86_64-linux-gnu/libpangoft2-1.0.so.0: undefined reference to `pango_font_description_get_variations'                                                                                                                          
/snap/gnome-3-34-1804-sdk/current/usr/lib/x86_64-linux-gnu/libatk-bridge-2.0.so.0: undefined reference to `atk_component_scroll_to'                                                                                                                                      
/snap/gnome-3-34-1804-sdk/current/usr/lib/x86_64-linux-gnu/libpangoft2-1.0.so.0: undefined reference to `hb_ot_tags_from_script_and_language'                                                                                                                            
/snap/gnome-3-34-1804-sdk/current/usr/lib/x86_64-linux-gnu/libatk-bridge-2.0.so.0: undefined reference to `atk_component_scroll_to_point'                                                                                                                                
/snap/gnome-3-34-1804-sdk/current/usr/lib/x86_64-linux-gnu/libatk-bridge-2.0.so.0: undefined reference to `atk_object_get_accessible_id'                                                                                                                                 
/snap/gnome-3-34-1804-sdk/current/usr/lib/x86_64-linux-gnu/libpangoft2-1.0.so.0: undefined reference to `hb_ot_var_get_axis_infos'                                                                                                                                       
/snap/gnome-3-34-1804-sdk/current/usr/lib/x86_64-linux-gnu/libatk-bridge-2.0.so.0: undefined reference to `atk_text_scroll_substring_to_point'                                                                                                                           
/snap/gnome-3-34-1804-sdk/current/usr/lib/x86_64-linux-gnu/libpangoft2-1.0.so.0: undefined reference to `hb_ot_metrics_get_position'                                                                                                                                     
collect2: error: ld returned 1 exit status                                                                                                                                                                                                                               
CMakeFiles/touchegg.dir/build.make:1004: recipe for target 'touchegg' failed                                                                                                                                                                                             
make[2]: *** [touchegg] Error 1                                                                                                                                                                                                                                          
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/touchegg.dir/all' failed                                                                                                                                                                                          
make[1]: *** [CMakeFiles/touchegg.dir/all] Error 2                                                                                                                                                                                                                       
Makefile:151: recipe for target 'all' failed                                                                                                                                                                                                                             
make: *** [all] Error 2    

@popey
Copy link
Author

popey commented Nov 19, 2020

Given the snap is confined, I think it's expected not to be able to get to the configuration in /usr/share/touchegg. It might be useful for touchegg to gain a --config option so we can point to /var/snap/touchegg/common for example in which to store the config and be writable.

@kenvandine
Copy link

Given the snap is confined, I think it's expected not to be able to get to the configuration in /usr/share/touchegg. It might be useful for touchegg to gain a --config option so we can point to /var/snap/touchegg/common for example in which to store the config and be writable.

You could probably use a layout to map $SNAP/usr/share/touchegg to /usr/share/touchegg

@popey
Copy link
Author

popey commented Nov 19, 2020

@kenvandine as per your suggestion, I removed all build-packages except - libpugixml-dev and added the extension back in, now it refuses to link..

Skipping pull gnome-3-34-extension (already ran)                                                                                                          
Skipping pull touchegg (already ran)                                                                                                                      
Skipping build gnome-3-34-extension (already ran)                                                                                                         
Building touchegg                                                                                                                                         
cmake /root/parts/touchegg/src -DCMAKE_INSTALL_PREFIX= -DCMAKE_BUILD_TYPE=Release                                                                         
-- Configuring done                                                                                                                                       
-- Generating done                                                                                                                                        
-- Build files have been written to: /root/parts/touchegg/build                                                                                           
cmake --build . -- -j8                                                                                                                                    
[  2%] Linking CXX executable touchegg                                                                                                                    
/snap/gnome-3-34-1804-sdk/current/usr/bin/ld: cannot find -ludev                                                                                          
/snap/gnome-3-34-1804-sdk/current/usr/bin/ld: cannot find -linput                                                                                         
/snap/gnome-3-34-1804-sdk/current/usr/bin/ld: cannot find -lcairo                                                                                         
/snap/gnome-3-34-1804-sdk/current/usr/bin/ld: cannot find -lX11                                                                                           
/snap/gnome-3-34-1804-sdk/current/usr/bin/ld: cannot find -lXtst                                                                                          
/snap/gnome-3-34-1804-sdk/current/usr/bin/ld: cannot find -lXrandr                                                                                                                                                                                                                                                   
/snap/gnome-3-34-1804-sdk/current/usr/bin/ld: cannot find -lXi                                                                                            
/snap/gnome-3-34-1804-sdk/current/usr/bin/ld: cannot find -lgtk-3                                                                                                                                                                                                                                                    
/snap/gnome-3-34-1804-sdk/current/usr/bin/ld: cannot find -lgdk-3                                                                                         
/snap/gnome-3-34-1804-sdk/current/usr/bin/ld: cannot find -lz                                                                                             
/snap/gnome-3-34-1804-sdk/current/usr/bin/ld: cannot find -lpangocairo-1.0                                                                                
/snap/gnome-3-34-1804-sdk/current/usr/bin/ld: cannot find -lpango-1.0                                                                                     
/snap/gnome-3-34-1804-sdk/current/usr/bin/ld: cannot find -lharfbuzz                                                                                      
/snap/gnome-3-34-1804-sdk/current/usr/bin/ld: cannot find -latk-1.0                                                                                       
/snap/gnome-3-34-1804-sdk/current/usr/bin/ld: cannot find -lcairo-gobject                                                                                 
/snap/gnome-3-34-1804-sdk/current/usr/bin/ld: cannot find -lcairo                                                                                                                                                                                                                                                    
/snap/gnome-3-34-1804-sdk/current/usr/bin/ld: cannot find -lgdk_pixbuf-2.0                                                                                                                                                                                                                                           
/snap/gnome-3-34-1804-sdk/current/usr/bin/ld: cannot find -lgio-2.0                                                                                       
/snap/gnome-3-34-1804-sdk/current/usr/bin/ld: cannot find -lgobject-2.0                                                                                                                                                                                                                                              
/snap/gnome-3-34-1804-sdk/current/usr/bin/ld: cannot find -lglib-2.0                                                                                      
/snap/gnome-3-34-1804-sdk/current/usr/bin/ld: cannot find -lX11                                                                                           
/snap/gnome-3-34-1804-sdk/current/usr/bin/ld: cannot find -lXtst                                                                                                                                                                                                                                                     
/snap/gnome-3-34-1804-sdk/current/usr/bin/ld: cannot find -lXrandr                                                                                                                                                                                                                                                   
/snap/gnome-3-34-1804-sdk/current/usr/bin/ld: cannot find -lXi                                                                                                                                                                                                                                                       
/snap/gnome-3-34-1804-sdk/current/usr/bin/ld: cannot find -lgtk-3                                                                                                                                                                                                                                                    
/snap/gnome-3-34-1804-sdk/current/usr/bin/ld: cannot find -lgdk-3                                                                                                                                                                                                                                                    
/snap/gnome-3-34-1804-sdk/current/usr/bin/ld: cannot find -lz                                                                                                                                                                                                                                                        
/snap/gnome-3-34-1804-sdk/current/usr/bin/ld: cannot find -lpangocairo-1.0                                                                                
/snap/gnome-3-34-1804-sdk/current/usr/bin/ld: cannot find -lpango-1.0                                                                                                                                                                                                                                                
/snap/gnome-3-34-1804-sdk/current/usr/bin/ld: cannot find -lharfbuzz                                                                                                                                                                                                                                                 
/snap/gnome-3-34-1804-sdk/current/usr/bin/ld: cannot find -latk-1.0                                                                                                                                                                                                                                                  
/snap/gnome-3-34-1804-sdk/current/usr/bin/ld: cannot find -lcairo-gobject                                                                                                                                                                                                                                            
/snap/gnome-3-34-1804-sdk/current/usr/bin/ld: cannot find -lgdk_pixbuf-2.0                                                                                                                                                                                                                                           
/snap/gnome-3-34-1804-sdk/current/usr/bin/ld: cannot find -lgio-2.0                                                                                                                                                                                                                                                  
/snap/gnome-3-34-1804-sdk/current/usr/bin/ld: cannot find -lgobject-2.0                                                                                                                                                                                                                                              
/snap/gnome-3-34-1804-sdk/current/usr/bin/ld: cannot find -lglib-2.0                                                                                                                                                                                                                                                 
collect2: error: ld returned 1 exit status                                                                                                                                                                                                                                                                           
CMakeFiles/touchegg.dir/build.make:1004: recipe for target 'touchegg' failed                                                                                                                                                                                                                                         
make[2]: *** [touchegg] Error 1                                                                                                                           
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/touchegg.dir/all' failed                                                                           
make[1]: *** [CMakeFiles/touchegg.dir/all] Error 2                                                                                                        
Makefile:151: recipe for target 'all' failed                                                                                                              
make: *** [all] Error 2                                                                                        

Any ideas?

@JoseExposito
Copy link
Owner

Thank you so much for the work you are putting in this PR @popey. This is going to make distributing updates so much easier 😄

Since I have a opportunity to chat with someone working at Canonical... Do you know who I can ping to update this as well?
https://launchpad.net/touchegg
Unfortunately the GEIS project is discontinued and the mailing list for MOTU and Kubuntu (the original maintainers) is inactive.

Cheers!

@popey
Copy link
Author

popey commented Nov 20, 2020

Sure, I have access to fix that. Want me to change the description to point at this project?

@JoseExposito
Copy link
Owner

Yes please, that'll be great!!!

It looks like the trunk branch is still trying to import code from Google Code. Once the code gets imported from GitHub, do I need to make any change upstream so the latest version gets publish in the universe repo?

Thanks a lot!

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

Successfully merging this pull request may close these issues.

None yet

3 participants