aperezdc / webkit2gtk-python-webextension-example

Example small C shim to load a Python script as a WebKit2 WebExtension
14 stars 4 forks source link

Does not build with python 3.8 #7

Open bellegarde-c opened 4 years ago

bellegarde-c commented 4 years ago

Since python 3.8 on ArchLinux, module does not work anymore: Error loading module '/home/gnumdk/Dev/webkit2gtk-python-webextension-example/pythonloader.so': /home/gnumdk/Dev/webkit2gtk-python-webextension-example/pythonloader.so: undefined symbol: PyCapsule_Type

MurdochRav commented 4 years ago

if before running In Arch linux I do export LD_PRELOAD=/usr/lib/libpython3.8.so.1.0 it will work. or else put it into the run.sh EG.

#! /bin/sh
#
# run.sh
# Copyright (C) 2015 Adrian Perez <aperez@igalia.com>
#
# Distributed under terms of the MIT license.
#
make -s
export LD_PRELOAD=/usr/lib/libpython3.8.so.1.0
export PYTHONPATH=$(pwd)
exec ./browse-with-extension "$@"

Probably what needs to be done is an update of the Make file. This seems to be a python3 issue. See https://bugs.python.org/issue36721 I t seems for subsequent versions of python, 3.8 and on. in the Makefile where it says

PYTHON ?= python3 PYTHON ?= python3-embed will be required.

Murdoch.