GTK: XApps is having issues with Vapigen

This is the snap file. Trying to get XApps to build as a part. Xed right now is incomplete.

I get two different errors when I try to build through the snap vs using the container prompt directly.

With the snap build I get:

error: Package `glib-2.0’ not found in specified Vala API directories or GObject-Introspection GIR directories

error: Package `gobject-2.0’ not found in specified Vala API directories or GObject-Introspection GIR directories

Building through the container prompt:

/root/parts/xapps/install/usr/bin/vapigen: error while loading shared libraries: libvala-0.40.so.0: cannot open shared object file: No such file or directory

I believe I have all the needed packages. The fact that I get two different errors from the same build commands makes me feel it could be something else.

Heya! Took a look at this and got it working with a few edits. Let me know if you have any questions. Here it is running on my 19.10 laptop.

Here’s the yaml.

name: xed-unofficial
adopt-info: xed-unofficial
version: "master"
base: core18
confinement: strict
grade: stable

apps:
  xed-unofficial:
    command: usr/bin/xed
    extensions: [gnome-3-28]
    plugs:
      - gsettings # For desktop theme detection under Wayland session
      - home
    slots:
      - dbus-daemon
    common-id: xed.desktop
    desktop: usr/share/applications/com.github.linuxmint.xed.desktop
    environment:
      LD_LIBRARY_PATH: $SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/xed:$LD_LIBRARY_PATH

parts:
  xapps:
    source: https://github.com/linuxmint/xapps.git
    source-type: git
    source-tag: '1.6.8'
    meson-parameters: ["--prefix=/usr"]
    plugin: meson
    build-packages:
      - libgtksourceview-3.0-dev
      - libvala-0.40-dev
      - libvalapanel-dev
      - libgirepository1.0-dev
      - libgspell-1-dev
      - cmake
      - build-essential
      - pkg-config
      - libgnomekbd-dev
      - valac
      - python-gi-dev
      - libgtk-3-dev
      - intltool
      - itstool
      - libpoppler-glib-dev
      - libgee-0.8-dev
      - gjs
      - gir1.2-webkit2-4.0
      - libpeas-dev
      - gobject-introspection
      - gir1.2-glib-2.0
      - libglib2.0-dev
      - libxml2-dev

  xed-unofficial:
    after: [xapps]
    plugin: meson
    source: https://github.com/linuxmint/xed.git
    build-environment:
      - CFLAGS: "$CFLAGS -I$SNAPCRAFT_STAGE/usr/include"
      - LDFLAGS: "$LDFLAGS -L$SNAPCRAFT_STAGE/usr/lib"
    source-tag: 'master.mint19'
    meson-parameters: [--prefix=/usr]
    build-packages:
      - libgjs-dev
      - gettext
      - libx11-dev
      - libxkbfile-dev
    stage-packages:
      - libgnomekbd8
      - libxkbfile1
      - libxklavier16
      - libenchant1c2a
      - libgirepository-1.0-1
      - libgspell-1-1
      - libgtksourceview-3.0-1
      - libpeas-1.0-0

    parse-info: [usr/share/metainfo/xed.appdata.xml]

slots:
  dbus-daemon:
    interface: dbus
    bus: session
    name: org.x.editor


Thank you Popey.

I was able to build it and install. The entry for the application does not seem to come up. You can call it from the command line as xed-unofficial, but it does not show up as an application in Ubuntu 18.04 when you type xed in the gui (GNOME). How do I add it?

Excellent.
Take a look at these docs and let me know if you get a problem. https://snapcraft.io/docs/desktop-menu-icon-support

I followed the instructions in those docs to have the desktop and icon files in a ‘gui/’ directory. I got this warning:

The 'snap' directory is meant specifically for snapcraft, but it contains the following non-snapcraft-related paths, which is unsupported and will cause unexpected behavior:
- gui/xed.ico

If you must store these files within the 'snap' directory, move them to 'snap/local', which is ignored by snapcraft.

I had to switch my ‘desktop:’ entry to the default in snap .desktop xed generates. ( usr/share/applications/xed.desktop ) It now shows an empty icon in the menu but you can now start xed-unofficial from the menu on ubuntu.

The snapcraft tool complained about the snap/gui directory and ignored it. Should the folder be in the snap/snap/gui directory?

Here is my directory structure for xed-unofficial

├── build.sh
├── clean.sh
├── install.sh
├── notes
├── snap
│ ├── gui
│ │ ├── xed.ico
│ │ └── xed-unofficial.desktop
│ └── snapcraft.yaml
├── snapcraft-old-broken.yaml
└── xed-unofficial_master_amd64.snap

I suppose I could just use override-pull: to override the default .desktop name but I would like to see if I can make specifying my own .desktop and icon file work.

Are those docs out of date or should the snap/gui/ folder be used by snapcraft?

I also tried ‘snap/snap/gui’. It was ignored as well.