Error creating snap for XGate


#1

Hi All,

I’m brand-new to creating snaps and I’m looking to create a snap for a program called XGate. I use it for email over satellite phones. It has a bunch of old i386 library dependencies which are causing packaging conflicts on my system - a perfect candidate for a snap!

Global Marine Net (the company that makes XGate) have installation instructions here:
http://www.globalmarinenet.com/wp-content/uploads/2015/02/xgate_installation_guide_mac_linux_windows_ios_android-1.pdf

They seem to have removed the .deb from their website, but I have a copy on my Nextcloud server here:
https://drive.met-connect.com/index.php/s/tPEtaDMiHLjN6oG/download

I’m running Pop!_OS 18.10 and have followed the Quick Start Guide for Pre-built binaries here:
https://docs.snapcraft.io/t/pre-built-apps/6739

I’ve created a snapcraft.yaml file:

name: xgate
version: '0.1'
summary: Satellite Email
description: |

  Email on satellite connections

confinement: devmode
base: core18

parts:
  xgate:
    plugin: dump
    source: /home/iscott/xgate-snap/xgate-i386.deb
    source-type: deb
apps:
  xgate:
    command: xgate

But when I run the “snapcraft” command, get the following error:

$ snapcraft --debug
Using 'snapcraft.yaml': Project assets will be searched for from the 'snap' directory.
Launching a VM.
launch failed: timed out waiting for instance to respond                        
An error occurred with the instance when trying to launch with 'multipass': returned exit code 2.
Ensure that 'multipass' is setup correctly and try again.

I read another post on the same issue and ran:

$multipass launch

and after a minute received

Launched: lustrous-carinal

I’m rather out of my depth with this. Any pointers would be greatly appreciated.
thanks,
Iain


#2

Try run multipass launch --name snapcraft-xgate instead.


#3

Nice, good luck on that! Remember about the architecture field, you want to specify that the snap will be i386-only.


#4

Thanks for the suggestions.
I ran multipass launch --name snapcraft-xgate and got

launch failed: instance "snapcraft-xgate" already exists

Bear in mind, I’m a seasoned Linux user but completely new to creating snaps and my only exposure so far is trying to follow the Pre-built binary quick start documentation when I’ve run into this issue.

@zyga - where/how do I specify the architecture?

My system has the necessary libraries installed to make XGate work, but if multipass is starting a VM to build the snap in, how do I ensure these old non-standard libraries are referenced?

Here’s my notes on how I got X-Gate to work on my system (Pop!_OS 18.10 x64):

sudo dpkg --add-architecture i386
sudo apt update
sudo apt-get -f install ppp:i386 libice6:i386 libtiff5:i386 libjpeg62:i386
sudo dpkg -i xgate_i386.deb

# now x11 has an issue in apt, do following to install gtk2-x11
sudo apt --fix-broken install
sudo ln -s /usr/lib/i386-linux-gnu/libtiff.so.5 /usr/lib/i386-linux-gnu/libtiff.so.4
sudo ln -s /usr/lib/i386-linux-gnu/libpng16.so.16 /usr/lib/i386-linux-gnu/libpng12.so.0

#copy library file
cp libpng12.so.0.54.0 /usr/lib/i386-linux-gnu/
sudo ln -s /usr/lib/i386-linux-gnu/libpng12.so.0.54.0 /usr/lib/i386-linux-gnu/libpng12.so.0

The shared dependencies are:

iscott@galago76:/usr/share/xgate$ ldd wxxgate 
	linux-gate.so.1 (0xf7f94000)
	libgtk-x11-2.0.so.0 => /usr/lib/i386-linux-gnu/libgtk-x11-2.0.so.0 (0xf7a6e000)
	libgdk-x11-2.0.so.0 => /usr/lib/i386-linux-gnu/libgdk-x11-2.0.so.0 (0xf79ab000)
	libatk-1.0.so.0 => /usr/lib/i386-linux-gnu/libatk-1.0.so.0 (0xf7982000)
	libgdk_pixbuf-2.0.so.0 => /usr/lib/i386-linux-gnu/libgdk_pixbuf-2.0.so.0 (0xf7955000)
	libfontconfig.so.1 => /usr/lib/i386-linux-gnu/libfontconfig.so.1 (0xf790a000)
	libXext.so.6 => /usr/lib/i386-linux-gnu/libXext.so.6 (0xf78f5000)
	libXrender.so.1 => /usr/lib/i386-linux-gnu/libXrender.so.1 (0xf78e9000)
	libXinerama.so.1 => /usr/lib/i386-linux-gnu/libXinerama.so.1 (0xf78e4000)
	libXi.so.6 => /usr/lib/i386-linux-gnu/libXi.so.6 (0xf78d1000)
	libXrandr.so.2 => /usr/lib/i386-linux-gnu/libXrandr.so.2 (0xf78c4000)
	libXcursor.so.1 => /usr/lib/i386-linux-gnu/libXcursor.so.1 (0xf78b6000)
	libXfixes.so.3 => /usr/lib/i386-linux-gnu/libXfixes.so.3 (0xf78af000)
	libpango-1.0.so.0 => /usr/lib/i386-linux-gnu/libpango-1.0.so.0 (0xf7860000)
	libX11.so.6 => /usr/lib/i386-linux-gnu/libX11.so.6 (0xf7714000)
	libgobject-2.0.so.0 => /usr/lib/i386-linux-gnu/libgobject-2.0.so.0 (0xf76b0000)
	libgmodule-2.0.so.0 => /usr/lib/i386-linux-gnu/libgmodule-2.0.so.0 (0xf76aa000)
	libdl.so.2 => /lib/i386-linux-gnu/libdl.so.2 (0xf76a4000)
	libgthread-2.0.so.0 => /usr/lib/i386-linux-gnu/libgthread-2.0.so.0 (0xf769f000)
	libglib-2.0.so.0 => /usr/lib/i386-linux-gnu/libglib-2.0.so.0 (0xf7567000)
	libSM.so.6 => /usr/lib/i386-linux-gnu/libSM.so.6 (0xf755e000)
	libpng12.so.0 => /usr/lib/i386-linux-gnu/libpng12.so.0 (0xf7533000)
	libz.so.1 => /lib/i386-linux-gnu/libz.so.1 (0xf7512000)
	libjpeg.so.62 => /usr/lib/i386-linux-gnu/libjpeg.so.62 (0xf74ec000)
	libtiff.so.4 => /usr/lib/i386-linux-gnu/libtiff.so.4 (0xf746b000)
	libm.so.6 => /lib/i386-linux-gnu/libm.so.6 (0xf7365000)
	libstdc++.so.6 => /usr/lib/i386-linux-gnu/libstdc++.so.6 (0xf71de000)
	libgcc_s.so.1 => /lib/i386-linux-gnu/libgcc_s.so.1 (0xf71c0000)
	libpthread.so.0 => /lib/i386-linux-gnu/libpthread.so.0 (0xf719e000)
	libc.so.6 => /lib/i386-linux-gnu/libc.so.6 (0xf6fbd000)
	libpangocairo-1.0.so.0 => /usr/lib/i386-linux-gnu/libpangocairo-1.0.so.0 (0xf6fad000)
	libcairo.so.2 => /usr/lib/i386-linux-gnu/libcairo.so.2 (0xf6e5c000)
	libgio-2.0.so.0 => /usr/lib/i386-linux-gnu/libgio-2.0.so.0 (0xf6c70000)
	libpangoft2-1.0.so.0 => /usr/lib/i386-linux-gnu/libpangoft2-1.0.so.0 (0xf6c55000)
	libXcomposite.so.1 => /usr/lib/i386-linux-gnu/libXcomposite.so.1 (0xf6c51000)
	libXdamage.so.1 => /usr/lib/i386-linux-gnu/libXdamage.so.1 (0xf6c4d000)
	libfreetype.so.6 => /usr/lib/i386-linux-gnu/libfreetype.so.6 (0xf6b90000)
	libexpat.so.1 => /lib/i386-linux-gnu/libexpat.so.1 (0xf6b55000)
	libuuid.so.1 => /lib/i386-linux-gnu/libuuid.so.1 (0xf6b4b000)
	libthai.so.0 => /usr/lib/i386-linux-gnu/libthai.so.0 (0xf6b3f000)
	libfribidi.so.0 => /usr/lib/i386-linux-gnu/libfribidi.so.0 (0xf6b23000)
	libxcb.so.1 => /usr/lib/i386-linux-gnu/libxcb.so.1 (0xf6af5000)
	libffi.so.6 => /usr/lib/i386-linux-gnu/libffi.so.6 (0xf6aea000)
	/lib/ld-linux.so.2 (0xf7f96000)
	libpcre.so.3 => /lib/i386-linux-gnu/libpcre.so.3 (0xf6a71000)
	libICE.so.6 => /usr/lib/i386-linux-gnu/libICE.so.6 (0xf6a55000)
	liblzma.so.5 => /lib/i386-linux-gnu/liblzma.so.5 (0xf6a29000)
	libjbig.so.0 => /usr/lib/i386-linux-gnu/libjbig.so.0 (0xf6a1a000)
	libjpeg.so.8 => /usr/lib/i386-linux-gnu/libjpeg.so.8 (0xf698f000)
	libpixman-1.so.0 => /usr/lib/i386-linux-gnu/libpixman-1.so.0 (0xf68e0000)
	libpng16.so.16 => /usr/lib/i386-linux-gnu/libpng16.so.16 (0xf68a6000)
	libxcb-shm.so.0 => /usr/lib/i386-linux-gnu/libxcb-shm.so.0 (0xf68a1000)
	libxcb-render.so.0 => /usr/lib/i386-linux-gnu/libxcb-render.so.0 (0xf6892000)
	librt.so.1 => /lib/i386-linux-gnu/librt.so.1 (0xf6885000)
	libselinux.so.1 => /lib/i386-linux-gnu/libselinux.so.1 (0xf6859000)
	libresolv.so.2 => /lib/i386-linux-gnu/libresolv.so.2 (0xf683f000)
	libmount.so.1 => /lib/i386-linux-gnu/libmount.so.1 (0xf67d8000)
	libharfbuzz.so.0 => /usr/lib/i386-linux-gnu/libharfbuzz.so.0 (0xf6715000)
	libdatrie.so.1 => /usr/lib/i386-linux-gnu/libdatrie.so.1 (0xf670c000)
	libXau.so.6 => /usr/lib/i386-linux-gnu/libXau.so.6 (0xf6708000)
	libXdmcp.so.6 => /usr/lib/i386-linux-gnu/libXdmcp.so.6 (0xf6701000)
	libbsd.so.0 => /lib/i386-linux-gnu/libbsd.so.0 (0xf66e3000)
	libblkid.so.1 => /lib/i386-linux-gnu/libblkid.so.1 (0xf6686000)
	libgraphite2.so.3 => /usr/lib/i386-linux-gnu/libgraphite2.so.3 (0xf6658000)

What’s the mechanism for me to make sure these libraries are included when I build the snap?
Sorry if this is a stupid question, I’m trying to get my head around this since it’s new to me.

If anyone has a minute to give building this snap a go, feel free! The link to the .deb is in my first post.

Thanks again for your help, Iain