firecat53 / urlscan

Mutt and terminal url selector (similar to urlview)
GNU General Public License v2.0
213 stars 37 forks source link

Add snap package #71

Closed ghost closed 4 years ago

firecat53 commented 6 years ago

Ugh, I'm struggling with this. I was able to build the snap for the failing version, but when I try to build it with your wrapper included, it either doesn't seem to include the wrapper, or it's not doing anything and I still get the locale error.

(In Vagrant 18.04 box). Only difference with your snapcraft.yaml file is:

grade: devel
confinement: devmode

Because I can't install the snap otherwise.

$ snapcraft cleanbuild
......
Staging urlscan-wrapper                           
Staging urlscan                                                                                                                        
Priming urlscan-wrapper 
Priming urlscan                                                                                                                        
Files from the build host were migrated into the snap to satisfy dependencies that would otherwise not be met. This feature will be remo
ved in a future release. If these libraries are needed in the final snap, ensure that the following are either satisfied by a stage-pack
ages entry or through a part:                                          
usr/lib/x86_64-linux-gnu/libdb-5.3.so                       
Determining the version from the project repo (version: git).                                                                          
The version has been set to '0.9.0+git1.ce600ae-dirty'
Snapping 'urlscan' -                                                                                                     
Snapped urlscan_git_amd64.snap
Retrieved urlscan_git_amd64.snap               
Stopping local:snapcraft-nicely-star-horse              
vagrant@ubuntu1804:~/snap/snap$ sudo snap install --devmode urlscan_git_amd64.snap
urlscan 0.9.0+git1.ce600ae-dirty installed
vagrant@ubuntu1804:~/snap/snap$ urlscan ~/test.txt
Traceback (most recent call last):                            
  File "/snap/urlscan/x2/bin/urlscan", line 187, in <module>
    main()                    
  File "/snap/urlscan/x2/bin/urlscan", line 172, in main
    msg = process_input(args.message)
  File "/snap/urlscan/x2/bin/urlscan", line 89, in process_input
    locale.setlocale(locale.LC_ALL, '')
  File "/snap/urlscan/x2/usr/lib/python3.5/locale.py", line 594, in setlocale
    return _setlocale(category, locale)
locale.Error: unsupported locale setting
firecat53 commented 6 years ago

I also found that the urlscan name was already registered through snapcraft? Was that you? I think if we get this figured out, I can enable automatic snap builds through github.

ghost commented 6 years ago

@firecat53 No, I did not register the urlscan name. Try the new snapcraft.yaml file:

$ snapcraft cleanbuild
$ sudo snap install urlscan_git_amd64.snap --dangerous --classic
firecat53 commented 6 years ago

Well, hmmmm. Any ideas?

vagrant@ubuntu1804:~/snap/snap$ snapcraft cleanbuild
Creating snapcraft-hugely-gentle-kodiak                                                                                                 
Starting snapcraft-hugely-gentle-kodiak                                                                               
Waiting for a network connection...                                                                                                     
Network connection established                                                                                                      
Hit:1 http://archive.ubuntu.com/ubuntu xenial InRelease                                                                                 
Get:2 http://security.ubuntu.com/ubuntu xenial-security InRelease [107 kB]
........
........
Copying urlscan.egg-info to /root/build_urlscan/parts/urlscan/install/lib/python3.5/site-packages/urlscan-0.9.0-py3.5.egg-info
running install_scripts                   
changing mode of /root/build_urlscan/parts/urlscan/install/bin/urlscan to 755
writing list of installed files to 'install.txt'
Staging urlscan 
Priming urlscan 
Determining the version from the project repo (version: git).
The version has been set to '0.9.0+git3.fca428d'
Snapping 'urlscan' /                                                                                                     
Snapped urlscan_git_amd64.snap
Retrieved urlscan_git_amd64.snap
Stopping local:snapcraft-hugely-gentle-kodiak
vagrant@ubuntu1804:~/snap/snap$ sudo snap install urlscan_git_amd64.snap --dangerous --classic
urlscan 0.9.0+git3.fca428d installed
vagrant@ubuntu1804:~/snap/snap$ which urlscan
/snap/bin/urlscan
vagrant@ubuntu1804:~/snap/snap$ urlscan -h
Traceback (most recent call last):
  File "/snap/urlscan/x1/bin/urlscan", line 30, in <module>
    from urlscan import urlchoose, urlscan
ModuleNotFoundError: No module named 'urlscan'
vagrant@ubuntu1804:~/snap/snap$ urlscan
Traceback (most recent call last):
  File "/snap/urlscan/x1/bin/urlscan", line 30, in <module>
    from urlscan import urlchoose, urlscan
ModuleNotFoundError: No module named 'urlscan'
ghost commented 6 years ago

I have no clue. I don't understand why it works on mine Ubuntu 18.04.1.

ghost commented 6 years ago

I have the same problem after installing urlscan in a Ubuntu 16.04 LXC container.

$ lxc exec test -- urlscan -h
Traceback (most recent call last):
  File "/snap/urlscan/x1/bin/urlscan", line 30, in <module>
    from urlscan import urlchoose, urlscan
ImportError: No module named 'urlscan'
ghost commented 6 years ago

Third time's a charm.

firecat53 commented 6 years ago

Cool. Now it builds, installs and runs, but I can't get it to open any urls. I installed elinks (text-only VM for now) and tried with BROWSER set and unset. Did it work for you?

firecat53 commented 4 years ago

I'm going to go ahead and close this. Very much later, sorry! I just don't feel like a utility this simple and with minimal dependencies is worth the trouble it's been to get it packaged. Thanks for the attempt, at least!