GTG

Run under flatpak

Bug #1832680 reported by Alberto Fanjul Alonso
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
GTG
Fix Released
Critical
Unassigned

Bug Description

Tentative manifest to run under flatpak.

To build:

    flatpak-builder --ccache --force-clean build org.gnome.Gtg.json

To run:

    flatpak-builder --run build org.gnome.Gtg.json gtg

Added file:

org.gnome.Gtg.json

```
{
  "app-id": "org.gnome.Gtg",
  "runtime": "org.gnome.Platform",
  "runtime-version": "3.28",
  "sdk": "org.gnome.Sdk",
  "command": "gtg",
  "cleanup": [
    "/include",
    "/lib/pkgconfig",
    "/share/pkgconfig",
    "/share/aclocal",
    "/man",
    "/share/man",
    "/share/gtk-doc",
    "/share/vala",
    "*.la",
    "*.a",
    "*.pyc",
    "*.pyo"
  ],
  "build-options": {
    "cflags": "-O2 -g",
    "cxxflags": "-O2 -g",
    "env": {
      "V": "1"
    }
  },
  "finish-args": [
    "--share=ipc",
    "--socket=x11",
    "--socket=wayland",
    "--filesystem=host",
    "--talk-name=ca.desrt.dconf",
    "--env=DCONF_USER_CONFIG_DIR=.config/dconf"
  ],
  "modules": [
    {
      "name": "python-dbus",
      "sources": [
        {
          "type": "archive",
          "url": "https://pypi.python.org/packages/ad/1b/76adc363212c642cabbf9329457a918308c0b9b5d38ce04d541a67255174/dbus-python-1.2.4.tar.gz",
          "sha256": "e2f1d6871f74fba23652e51d10873e54f71adab0525833c19bad9e99b1b2f9cc"
        }
      ],
      "build-options": {
        "env": {
          "PYTHON": "python3.5"
        }
      }
    },
    {
      "name": "liblarch",
      "no-autogen": true,
      "buildsystem": "simple",
      "build-commands": [
        "python3 setup.py build",
        "python3 setup.py install --prefix /app"
      ],
      "sources": [
        {
          "type": "git",
          "url": "https://github.com/getting-things-gnome/liblarch"
        }
      ]
    },
    {
      "name": "pyxdg",
      "no-autogen": true,
      "buildsystem": "simple",
      "build-commands": [
        "python3 setup.py build",
        "python3 setup.py install --prefix /app"
      ],
      "sources": [
        {
          "type": "git",
          "url": "https://gitlab.freedesktop.org/xdg/pyxdg"
        }
      ],
      "build-options": {
        "env": {
          "PYTHON": "python3.5"
        }
      }
    },
    {
      "name": "gtg",
      "no-autogen": true,
      "buildsystem": "simple",
      "build-commands": [
        "python3 setup.py build",
        "python3 setup.py install --prefix /app"
      ],
      "sources": [
        {
          "type": "git",
          "url": "https://github.com/getting-things-gnome/gtg"
        }
      ]
    }
  ]
}
```

it fails with:

```
$ flatpak-builder --run build org.gnome.Gtg.json gtg
/app/bin/gtg:54: PyGIWarning: Gdk was imported without specifying a version first. Use gi.require_version('Gdk', '3.0') before import to ensure that the right version gets loaded.
  from gi.repository.Gdk import Screen

(gtg:3): dbind-WARNING **: 08:58:10.314: Couldn't connect to accessibility bus: Failed to connect to socket /tmp/dbus-W9FZd9CTBT: Connection refused
/app/lib/python3.5/site-packages/GTG/gtk/manager.py:22: PyGIWarning: Gtk was imported without specifying a version first. Use gi.require_version('Gtk', '3.0') before import to ensure that the right version gets loaded.
  from gi.repository import GObject, Gtk
Traceback (most recent call last):
  File "<frozen importlib._bootstrap>", line 890, in _find_spec
AttributeError: 'DynamicImporter' object has no attribute 'find_spec'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/app/bin/gtg", line 62, in <module>
    from GTG.gtk.manager import Manager
  File "/app/lib/python3.5/site-packages/GTG/gtk/manager.py", line 26, in <module>
    from GTG.gtk.browser.browser import TaskBrowser
  File "/app/lib/python3.5/site-packages/GTG/gtk/browser/browser.py", line 34, in <module>
    from GTG.gtk.browser.custominfobar import CustomInfoBar
  File "/app/lib/python3.5/site-packages/GTG/gtk/browser/custominfobar.py", line 26, in <module>
    from GTG.tools.networkmanager import is_connection_up
  File "/app/lib/python3.5/site-packages/GTG/tools/networkmanager.py", line 23, in <module>
    from gi.repository import NetworkManager, NMClient
  File "/usr/lib/python3.5/site-packages/gi/importer.py", line 127, in find_module
    'introspection typelib not found' % namespace)
ImportError: cannot import name NetworkManager, introspection typelib not found
```

fork in https://github.com/albfan/gtg/tree/flatpak

issue: https://github.com/albfan/gtg/issues/1

Revision history for this message
Jeff Fortin Tam (kiddo) wrote :

For one thing, I'm not sure I recall GTG having migrated to Python3, quite possibly it's still a Python2 app and depending on the whole GTK2 + PyGTK stack, hence the PyGI errors, maybe. I don't know how the NetworkManager support is to be handled in a flatpak (or in this case in particular), on the other hand.

description: updated
Revision history for this message
Alberto Fanjul Alonso (albfan) wrote :

Seems gtg checks network conectivity for whatever reason. Last version of flatpak manifest https://github.com/albfan/gtg/commit/380242efc5d228ccd7b7bcb03ff3105d10e3e4aa should fix that but still there's an error:

```
$ flatpak-builder --ccache --force-clean build org.gnome.Gtg.json
$ flatpak-builder --run build org.gnome.Gtg.json gtg
Traceback (most recent call last):
  File "/app/bin/gtg", line 51, in <module>
    import dbus
  File "/app/lib/python3.7/site-packages/dbus_python-1.2.8-py3.7-linux-x86_64.egg/dbus/__init__.py", line 71, in <module>
  File "/app/lib/python3.7/site-packages/dbus_python-1.2.8-py3.7-linux-x86_64.egg/dbus/types.py", line 6, in <module>
    # Iterators in Python aren't a matter of type but of protocol. A large
ModuleNotFoundError: No module named '_dbus_bindings'
```

Revision history for this message
Jeff Fortin Tam (kiddo) wrote :
Changed in gtg:
importance: Undecided → Critical
milestone: none → 0.4
status: New → In Progress
Jeff Fortin Tam (kiddo)
Changed in gtg:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.