Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Support libpeas based plugin system #501

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ jobs:
- name: Build
run: |
meson setup builddir -Dauto_features=enabled \
-Denhancers-loader=disabled \
-Dclapper-app=disabled -Dvapi=disabled -Ddoc=true \
-Dglimporter=auto -Dgluploader=auto -Drawimporter=auto
cd builddir
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ jobs:
mingw-w64-${{ matrix.arch }}-gst-plugins-bad
mingw-w64-${{ matrix.arch }}-gst-plugins-ugly
mingw-w64-${{ matrix.arch }}-gst-libav
mingw-w64-${{ matrix.arch }}-libpeas2
mingw-w64-${{ matrix.arch }}-libsoup3
mingw-w64-${{ matrix.arch }}-libmicrodns
mingw-w64-${{ matrix.arch }}-gtk4
Expand Down
7 changes: 7 additions & 0 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,11 @@ libadwaita_dep = dependency('libadwaita-1',
required: false,
)

# Optional
peas_dep = dependency('libpeas-2',
required: false,
)

cc = meson.get_compiler('c')
libm = cc.find_library('m', required: false)

Expand Down Expand Up @@ -146,6 +151,8 @@ summary('introspection', build_gir ? 'Yes' : 'No', section: 'Build')
summary('vapi', build_vapi ? 'Yes' : 'No', section: 'Build')
summary('doc', build_doc ? 'Yes' : 'No', section: 'Build')

summary('enhancers-loader', clapper_with_enhancers_loader ? 'Yes' : 'No', section: 'Functionalities')

if build_clapper
foreach name : clapper_possible_features
summary(name, clapper_available_features.contains(name) ? 'Yes' : 'No', section: 'Features')
Expand Down
7 changes: 7 additions & 0 deletions meson_options.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,13 @@ option('doc',
description: 'Build documentation'
)

# Functionalities
option('enhancers-loader',
type: 'feature',
value: 'enabled',
description: 'Ability to load libpeas based plugins that enhance functionalities'
)

# Features
option('discoverer',
type: 'feature',
Expand Down
6 changes: 4 additions & 2 deletions pkgs/flatpak/com.github.rafostar.Clapper.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@
"flathub/lib/uchardet.json",
"flathub/lib/libmicrodns.json",
"flathub/gstreamer-1.0/gstreamer.json",
"testing/gtuber.json",
"testing/yt-dlp.json",
"testing/libpeas.json",
{
"name": "clapper",
"buildsystem": "meson",
Expand All @@ -54,7 +55,8 @@
"path": "../../."
}
]
}
},
"testing/clapper-enhancers.json"
],
"cleanup-commands": [
"mkdir -p /app/lib/ffmpeg",
Expand Down
14 changes: 14 additions & 0 deletions pkgs/flatpak/testing/clapper-enhancers.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"name": "clapper-enhancers",
"buildsystem": "meson",
"config-opts": [
"-Dauto_features=enabled"
],
"sources": [
{
"type": "git",
"url": "https://github.com/Rafostar/clapper-enhancers.git",
"branch": "main"
}
]
}
20 changes: 0 additions & 20 deletions pkgs/flatpak/testing/gtuber.json

This file was deleted.

21 changes: 21 additions & 0 deletions pkgs/flatpak/testing/libpeas.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"name": "libpeas",
"buildsystem": "meson",
"config-opts": [
"--wrap-mode=nodownload",
"-Dgjs=false",
"-Dlua51=false",
"-Dintrospection=false"
],
"sources": [
{
"type": "archive",
"url": "https://download.gnome.org/sources/libpeas/2.0/libpeas-2.0.5.tar.xz",
"sha256": "376f2f73d731b54e13ddbab1d91b6382cf6a980524def44df62add15489de6dd",
"x-checker-data": {
"type": "gnome",
"name": "libpeas"
}
}
]
}
19 changes: 19 additions & 0 deletions pkgs/flatpak/testing/yt-dlp.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"name": "yt-dlp",
"buildsystem": "simple",
"build-commands": [
"pip3 install -v --root-user-action=ignore --no-deps --prefix=/app *.whl"
],
"sources": [
{
"type": "file",
"url": "https://files.pythonhosted.org/packages/bb/68/548f9819b41d53561d4f3d39588111cf39993c066b6e5300b4ae118eb2e6/yt_dlp-2024.10.22-py3-none-any.whl",
"sha256": "ba166602ebe22a220e4dc1ead45bf00eb469ed812b22f4fb8bb54734f9b02084",
"x-checker-data": {
"type": "pypi",
"name": "yt-dlp",
"packagetype": "bdist_wheel"
}
}
]
}
42 changes: 42 additions & 0 deletions src/lib/clapper/clapper-enhancers-loader-private.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/* Clapper Playback Library
* Copyright (C) 2024 Rafał Dzięgiel <[email protected]>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/

#pragma once

#include <glib.h>
#include <glib-object.h>

G_BEGIN_DECLS

G_GNUC_INTERNAL
void clapper_enhancers_loader_initialize (void);

G_GNUC_INTERNAL
gboolean clapper_enhancers_loader_has_enhancers (GType iface_type);

G_GNUC_INTERNAL
gchar ** clapper_enhancers_loader_get_schemes (GType iface_type);

G_GNUC_INTERNAL
gboolean clapper_enhancers_loader_check (GType iface_type, const gchar *scheme, const gchar *host, const gchar **name);

G_GNUC_INTERNAL
GObject * clapper_enhancers_loader_create_enhancer_for_uri (GType iface_type, GUri *uri);

G_END_DECLS
Loading