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

build: Add meson support #240

Merged
merged 5 commits into from
May 30, 2024
Merged

build: Add meson support #240

merged 5 commits into from
May 30, 2024

Conversation

bobby285271
Copy link
Contributor

ref: https://github.com/orgs/linuxmint/discussions/416

What about the tests?

Ugh, I am not able to run the test with the autotools build. I think it is broken for at least seven years with 3a125b2. Applying the following patch makes it compiles:

diff --git a/tests/Makefile.am b/tests/Makefile.am
index 0317383..0affe51 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -22,7 +22,6 @@ slick_greeter_test_SOURCES = \
 	../src/fixes.vapi \
 	../src/cairo-utils.vala \
 	../src/animate-timer.vala \
-	../src/indicator.vapi \
 	../src/fadable.vala \
 	../src/fadable-box.vala \
 	../src/dash-box.vala \
diff --git a/tests/menubar.vala b/tests/menubar.vala
index f222957..e177c4e 100644
--- a/tests/menubar.vala
+++ b/tests/menubar.vala
@@ -21,11 +21,16 @@ public class MenuBar : Gtk.MenuBar
     public const int HEIGHT = 32;
     public bool high_contrast { get; private set; default = false; }
 
-    public MenuBar (Background bg, Gtk.AccelGroup ag)
+    public MenuBar (Background bg, Gtk.AccelGroup ag, MainWindow mw)
     {
+        Object ();
     }
 
     public void set_keyboard_state ()
     {
     }
+
+    public void cleanup ()
+    {
+    }
 }
diff --git a/tests/slick-greeter.vala b/tests/slick-greeter.vala
index a6630cc..6bc5a4c 100644
--- a/tests/slick-greeter.vala
+++ b/tests/slick-greeter.vala
@@ -126,4 +126,19 @@ public class SlickGreeter
         var ctx = widget.get_style_context ();
         ctx.add_class ("lightdm");
     }
+
+    public bool is_live_session (out string live_username, out string live_realname)
+    {
+        return false;
+    }
+
+    public static string validate_session (string? session)
+    {
+        return session;
+    }
+
+    public static string? get_default_session ()
+    {
+        return "cinnamon";
+    }
 }
diff --git a/tests/test.vala b/tests/test.vala
index d9c858a..78a89d6 100644
--- a/tests/test.vala
+++ b/tests/test.vala
@@ -109,7 +109,7 @@ public class Test
         }
     }
 
-    private static void inject_key (Gtk.Widget w, int keyval)
+    private static void inject_key (Gtk.Widget w, uint keyval)
     {
         // Make sure everything is flushed
         process_events ();

Though the test still does not pass for me...

not ok /Simple Navigation - FATAL-CRITICAL: dash_box_push: assertion '_tmp1_ != NULL' failed

Let me know if it is not okay to require meson 0.57 for gnome.post_install(). Also the meson build raises the gtk3 requirement to 3.20.0 and carries HAVE_GTK_3_20_0 by default since gtk3 3.20.10 is also seven years old...

@mtwebster
Copy link
Member

Would it be a big deal to keep compatibility to meson .53? Ubuntu 20.04 uses that, and it's still under support (for about another year).

It's not likely that we'd need to backport this, but if it's doable (assuming you'd use meson.add_install_script instead) I'd prefer to keep it compatible for now.

For tests, up to you - that patch looks reasonable, you could add it and convert tests to meson, but leave it disabled.. or, just remove the makefiles in that folder and ignore it.

@mtwebster
Copy link
Member

Looks good - just a couple of things:

  • The slick-greeter binary needs to go in /usr/sbin, not bin (see code comment).

  • Also, can you modify debian/rules to:

dh $@ --without=autoreconf --buildsystem=meson

Thanks!

This FTBFS since 3a125b2. Note that the test still fails
and the next commit disables the test.

not ok /Simple Navigation - FATAL-CRITICAL:
dash_box_push: assertion '_tmp1_ != NULL' failed
This still fails with "not ok /Simple Navigation - FATAL-CRITICAL:
dash_box_push: assertion '_tmp1_ != NULL' failed".
Ubuntu 20.04 has meson 0.53.2. "/ with string arguments" requires meson 0.49.0.
@mtwebster mtwebster merged commit 962f34a into linuxmint:master May 30, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants