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

Upgrade to gtk4 #1497

Open
wants to merge 20 commits into
base: master
Choose a base branch
from
Open
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
3 changes: 2 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ jobs:
- name: Install Dependencies
run: |
apt update
apt install -y exuberant-ctags libeditorconfig-dev libgail-3-dev libgee-0.8-dev libgit2-glib-1.0-dev libgranite-dev libgtk-3-dev libgtksourceview-4-dev libgtkspell3-3-dev libhandy-1-dev libpeas-dev libsoup2.4-dev libvala-dev libvte-2.91-dev meson valac polkitd libpolkit-gobject-1-dev
apt install -y exuberant-ctags libeditorconfig-dev libgail-3-dev libgee-0.8-dev libgranite-7-dev libgtk-4-dev libgtksourceview-5-dev libgtkspell3-3-dev libadwaita-1-dev libpeas-2-dev libsoup2.4-dev libvala-dev libvte-2.91-gtk4-dev meson valac polkitd libpolkit-gobject-1-dev libgit2-glib-1.0-dev

- name: Build
env:
DESTDIR: out
Expand Down
11 changes: 5 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,13 @@ You'll need the following dependencies:
* libgail-3-dev
* libgee-0.8-dev
* libgit2-glib-1.0-dev
* libgtksourceview-4-dev
* libgtksourceview-5-dev
* libgtkspell3-3-dev
* libgranite-dev >= 6.0.0
* libhandy-1-dev >= 0.90.0
* libpeas-dev
* libgranite-7-dev >= 6.0.0
* libadwaita-1-dev >= 1.0.0
* libsoup2.4-dev
* libvala-0.48-dev (or higher)
* libvte-2.91-dev
* libvala-0.56-dev (or higher)
* libvte-2.91-gtk4-dev
* valac

Run `meson build` to configure the build environment. Change to the build directory and run `ninja test` to build
Expand Down
92 changes: 48 additions & 44 deletions io.elementary.code.yml
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
app-id: io.elementary.code
runtime: io.elementary.Sdk # The outline plugin requires libvala which is only in the SDK, not the runtime
runtime-version: '7.1'
runtime-version: 'daily'
sdk: io.elementary.Sdk
command: io.elementary.code
finish-args:
- '--filesystem=xdg-run/gvfsd'
- '--filesystem=host'
- "--filesystem=xdg-run/gvfsd"
- "--filesystem=host"

- '--share=ipc'
- '--socket=fallback-x11'
- '--socket=wayland'
- "--share=ipc"
- "--socket=fallback-x11"
- "--socket=wayland"

- '--talk-name=org.gtk.vfs.*'
- '--talk-name=org.gnome.SettingsDaemon'
- '--talk-name=org.elementary.Contractor'
- "--talk-name=org.gtk.vfs.*"
- "--talk-name=org.gnome.SettingsDaemon"
- "--talk-name=org.elementary.Contractor"

- '--metadata=X-DConf=migrate-path=/io/elementary/code/'
- "--metadata=X-DConf=migrate-path=/io/elementary/code/"
cleanup:
- '/include'
- '/lib/pkgconfig'
- '/lib/cmake'
- '/lib/girepository-1.0'
- '/share/gir-1.0'
- '/share/vala'
- '*.a'
- '*.la'
- "/include"
- "/lib/pkgconfig"
- "/lib/cmake"
- "/lib/girepository-1.0"
- "/share/gir-1.0"
- "/share/vala"
- "*.a"
- "*.la"
modules:
- name: gtksourceview
buildsystem: meson
Expand All @@ -33,22 +33,26 @@ modules:
url: https://gitlab.gnome.org/GNOME/gtksourceview.git
tag: '4.8.4'

- name: peas
- name: libpeas
buildsystem: meson
config-opts:
- '-Dgtk_doc=false'
- '-Ddemos=false'
- '-Dvapi=true'
- -Dlua51=false
- -Dgjs=false
sources:
- type: git
url: https://gitlab.gnome.org/GNOME/libpeas.git
tag: libpeas-1.34.0
- type: archive
url: https://download.gnome.org/sources/libpeas/2.0/libpeas-2.0.5.tar.xz
sha256: 376f2f73d731b54e13ddbab1d91b6382cf6a980524def44df62add15489de6dd
x-checker-data:
type: gnome
versions:
<: '2.0.6'
name: libpeas

- name: git2-glib
buildsystem: meson
builddir: true
config-opts:
- '-Dpython=false'
- "-Dpython=false"
sources:
- type: git
url: https://gitlab.gnome.org/GNOME/libgit2-glib.git
Expand All @@ -57,51 +61,51 @@ modules:
- name: ssh2
buildsystem: cmake-ninja
config-opts:
- '-DCMAKE_BUILD_TYPE=RelWithDebInfo'
- '-DBUILD_SHARED_LIBS:BOOL=ON'
- '-DBUILD_EXAMPLES:BOOL=OFF'
- '-DBUILD_TESTING:BOOL=OFF'
- '-DCMAKE_INSTALL_LIBDIR:PATH=/app/lib'
- "-DCMAKE_BUILD_TYPE=RelWithDebInfo"
- "-DBUILD_SHARED_LIBS:BOOL=ON"
- "-DBUILD_EXAMPLES:BOOL=OFF"
- "-DBUILD_TESTING:BOOL=OFF"
- "-DCMAKE_INSTALL_LIBDIR:PATH=/app/lib"
cleanup:
- '/share/man'
- '/share/doc'
- "/share/man"
- "/share/doc"
sources:
- type: git
url: https://github.com/libssh2/libssh2.git
tag: libssh2-1.10.0
- name: libgit2
buildsystem: cmake-ninja
config-opts:
- '-DCMAKE_BUILD_TYPE=RelWithDebInfo'
- "-DCMAKE_BUILD_TYPE=RelWithDebInfo"
sources:
- type: git
url: https://github.com/libgit2/libgit2.git
tag: 'v1.5.1'
tag: "v1.5.1"

- name: editorconfig
buildsystem: cmake-ninja
config-opts:
- '-DCMAKE_BUILD_TYPE=RelWithDebInfo'
- '-DBUILD_DOCUMENTATION:BOOL=OFF'
- "-DCMAKE_BUILD_TYPE=RelWithDebInfo"
- "-DBUILD_DOCUMENTATION:BOOL=OFF"
sources:
- type: git
url: https://github.com/editorconfig/editorconfig-core-c.git
tag: 'v0.12.6'
tag: "v0.12.6"
disable-submodules: true

- name: gtkspell
config-opts:
- '--disable-gtk-doc-html'
- "--disable-gtk-doc-html"
cleanup:
- '/share/gtk-doc' # for some reason, it still install the html folder.
- "/share/gtk-doc" # for some reason, it still install the html folder.
sources:
- type: archive
url: https://downloads.sourceforge.net/gtkspell/gtkspell3-3.0.10.tar.xz
sha256: b040f63836b347eb344f5542443dc254621805072f7141d49c067ecb5a375732
modules:
- name: intltool
cleanup:
- '*'
- "*"
sources:
- type: archive
url: https://launchpad.net/intltool/trunk/0.51.0/+download/intltool-0.51.0.tar.gz
Expand All @@ -110,11 +114,11 @@ modules:
- name: vte
buildsystem: meson
config-opts:
- '-Dbuildtype=debugoptimized'
- "-Dbuildtype=debugoptimized"
sources:
- type: git
url: https://gitlab.gnome.org/GNOME/vte.git
branch: '0.70.2'
branch: "0.70.2"

- name: universal-ctags
sources:
Expand All @@ -125,7 +129,7 @@ modules:
- name: code
buildsystem: meson
config-opts:
- '-Dhave_pkexec=false'
- "-Dhave_pkexec=false"
sources:
- type: dir
path: .
20 changes: 9 additions & 11 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ add_project_arguments([
)

add_project_arguments(
['--vapidir', meson.project_source_root() / 'vapi'],
['--vapidir', meson.global_source_root() / 'vapi'],
language: 'vala'
)

Expand All @@ -26,20 +26,19 @@ pluginsdir = get_option('prefix') / get_option('libdir') / meson.project_name()
gnome = import('gnome')
i18n = import('i18n')

glib_dep = dependency('glib-2.0', version: '>=2.30.0')
glib_dep = dependency('glib-2.0', version: '>=2.74.0')
gio_unix_dep = dependency('gio-unix-2.0', version: '>=2.20')
gee_dep = dependency('gee-0.8', version: '>=0.8.5')
gtk_dep = dependency('gtk+-3.0', version: '>=3.6.0')
granite_dep = dependency('granite', version: '>=6.0.0')
handy_dep = dependency('libhandy-1', version: '>=0.90.0')
gtksourceview_dep = dependency('gtksourceview-4')
peas_dep = dependency('libpeas-1.0')
peasgtk_dep = dependency('libpeas-gtk-1.0')
gtk_dep = dependency('gtk4', version: '>=4.14.2')
granite_dep = dependency('granite-7', version: '>=7.0.0')
adwaita_dep = dependency('libadwaita-1', version: '>=1.0.0')
gtksourceview_dep = dependency('gtksourceview-5')
peas_dep = dependency('libpeas-2')
git_dep = dependency('libgit2-glib-1.0')
fontconfig_dep = dependency('fontconfig')
pangofc_dep = dependency('pangoft2')
posix_dep = meson.get_compiler('vala').find_library('posix')
vte_dep = dependency('vte-2.91')
vte_dep = dependency('vte-2.91-gtk4', version: '>=0.76')

code_resources = gnome.compile_resources(
'code-resources', 'data/' + meson.project_name() + '.gresource.xml',
Expand All @@ -56,10 +55,9 @@ dependencies = [
gee_dep,
gtk_dep,
granite_dep,
handy_dep,
adwaita_dep,
gtksourceview_dep,
peas_dep,
peasgtk_dep,
git_dep,
fontconfig_dep,
pangofc_dep,
Expand Down
4 changes: 2 additions & 2 deletions plugins/brackets-completion/brackets-completion.vala
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
END LICENSE
***/

public class Scratch.Plugins.BracketsCompletion : Peas.ExtensionBase, Peas.Activatable {
public class Scratch.Plugins.BracketsCompletion : Peas.ExtensionBase, Scratch.Services.ActivatablePlugin {
Gee.HashMap<string, string> brackets;
Gee.HashMap<uint, string> keys;
const string[] VALID_NEXT_CHARS = {
Expand Down Expand Up @@ -278,6 +278,6 @@ public class Scratch.Plugins.BracketsCompletion : Peas.ExtensionBase, Peas.Activ
[ModuleInit]
public void peas_register_types (GLib.TypeModule module) {
var objmodule = module as Peas.ObjectModule;
objmodule.register_extension_type (typeof (Peas.Activatable),
objmodule.register_extension_type (typeof (Scratch.Services.ActivatablePlugin),
typeof (Scratch.Plugins.BracketsCompletion));
}
6 changes: 3 additions & 3 deletions plugins/detect-indent/detect-indent.vala
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
public class Scratch.Plugins.DetectIndent: Peas.ExtensionBase, Peas.Activatable {
public class Scratch.Plugins.DetectIndent: Peas.ExtensionBase, Scratch.Services.ActivatablePlugin {
const int MAX_LINES = 500;

Scratch.Services.Interface plugins;
Expand All @@ -17,7 +17,7 @@ public class Scratch.Plugins.DetectIndent: Peas.ExtensionBase, Peas.Activatable
return;
}

var source_buffer = (Gtk.SourceBuffer) view.buffer;
var source_buffer = (GtkSource.Buffer) view.buffer;
Gtk.TextIter it;
source_buffer.get_iter_at_line (out it, 0);

Expand Down Expand Up @@ -79,7 +79,7 @@ public class Scratch.Plugins.DetectIndent: Peas.ExtensionBase, Peas.Activatable
public void peas_register_types (GLib.TypeModule module) {
var objmodule = module as Peas.ObjectModule;
objmodule.register_extension_type (
typeof (Peas.Activatable),
typeof (Scratch.Services.ActivatablePlugin),
typeof (Scratch.Plugins.DetectIndent)
);
}
4 changes: 2 additions & 2 deletions plugins/editorconfig/editorconfig.vala
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* Boston, MA 02110-1301 USA
*/

public class Scratch.Plugins.EditorConfigPlugin: Peas.ExtensionBase, Peas.Activatable {
public class Scratch.Plugins.EditorConfigPlugin: Peas.ExtensionBase, Scratch.Services.ActivatablePlugin {
Scratch.Services.Interface plugins;
public Object object { owned get; construct; }
private Code.FormatBar format_bar;
Expand Down Expand Up @@ -91,5 +91,5 @@ public class Scratch.Plugins.EditorConfigPlugin: Peas.ExtensionBase, Peas.Activa
[ModuleInit]
public void peas_register_types (GLib.TypeModule module) {
var objmodule = module as Peas.ObjectModule;
objmodule.register_extension_type (typeof (Peas.Activatable), typeof (Scratch.Plugins.EditorConfigPlugin));
objmodule.register_extension_type (typeof (Scratch.Services.ActivatablePlugin), typeof (Scratch.Plugins.EditorConfigPlugin));
}
4 changes: 2 additions & 2 deletions plugins/fuzzy-search/fuzzy-search.vala
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/


public class Scratch.Plugins.FuzzySearch: Peas.ExtensionBase, Peas.Activatable {
public class Scratch.Plugins.FuzzySearch: Peas.ExtensionBase, Scratch.Services.ActivatablePlugin {
public Object object { owned get; construct; }
private const uint ACCEL_KEY = Gdk.Key.F;
private const Gdk.ModifierType ACCEL_MODTYPE = Gdk.ModifierType.MOD1_MASK;
Expand Down Expand Up @@ -158,7 +158,7 @@ public class Scratch.Plugins.FuzzySearch: Peas.ExtensionBase, Peas.Activatable {
public void peas_register_types (GLib.TypeModule module) {
var objmodule = module as Peas.ObjectModule;
objmodule.register_extension_type (
typeof (Peas.Activatable),
typeof (Scratch.Services.ActivatablePlugin),
typeof (Scratch.Plugins.FuzzySearch)
);
}
2 changes: 1 addition & 1 deletion plugins/fuzzy-search/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ custom_target(module_name + '.plugin_merge',
'--desktop',
'--keyword=Description',
'--keyword=Name',
'-d' + join_paths(meson.source_root (), 'po', 'plugins'),
'-d' + join_paths(meson.global_source_root (), 'po', 'plugins'),
'--template=@INPUT@',
'-o@OUTPUT@',
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
END LICENSE
***/

public class Scratch.Plugins.HighlightSelectedWords : Peas.ExtensionBase, Peas.Activatable {
public class Scratch.Plugins.HighlightSelectedWords : Peas.ExtensionBase, Scratch.Services.ActivatablePlugin {
Scratch.Widgets.SourceView current_source;
Scratch.MainWindow? main_window = null;
Gtk.SourceSearchContext? current_search_context = null;
Expand Down Expand Up @@ -58,7 +58,7 @@ public class Scratch.Plugins.HighlightSelectedWords : Peas.ExtensionBase, Peas.A
window_search_context.get_occurrences_count () == 0) {
// Perform plugin selection when there is no ongoing and successful search
current_search_context = new Gtk.SourceSearchContext (
(Gtk.SourceBuffer)current_source.buffer,
(GtkSource.Buffer)current_source.buffer,
null
);
current_search_context.settings.search_text = "";
Expand Down Expand Up @@ -151,6 +151,6 @@ public class Scratch.Plugins.HighlightSelectedWords : Peas.ExtensionBase, Peas.A
[ModuleInit]
public void peas_register_types (TypeModule module) {
var objmodule = module as Peas.ObjectModule;
objmodule.register_extension_type (typeof (Peas.Activatable),
objmodule.register_extension_type (typeof (Scratch.Services.ActivatablePlugin),
typeof (Scratch.Plugins.HighlightSelectedWords));
}
4 changes: 2 additions & 2 deletions plugins/markdown-actions/markdown-actions.vala
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
END LICENSE
***/

public class Code.Plugins.MarkdownActions : Peas.ExtensionBase, Peas.Activatable {
public class Code.Plugins.MarkdownActions : Peas.ExtensionBase, Scratch.Services.ActivatablePlugin {
Scratch.Widgets.SourceView current_source;
Scratch.Services.Interface plugins;

Expand Down Expand Up @@ -243,6 +243,6 @@ public class Code.Plugins.MarkdownActions : Peas.ExtensionBase, Peas.Activatable
[ModuleInit]
public void peas_register_types (TypeModule module) {
var objmodule = module as Peas.ObjectModule;
objmodule.register_extension_type (typeof (Peas.Activatable),
objmodule.register_extension_type (typeof (Scratch.Services.ActivatablePlugin),
typeof (Code.Plugins.MarkdownActions));
}
2 changes: 1 addition & 1 deletion plugins/pastebin/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module_files = [
'pastebin.vala'
]

soup_dep = dependency('libsoup-2.4')
soup_dep = dependency('libsoup-3.0')

module_deps = [
codecore_dep,
Expand Down
Loading
Loading