mate-desktop / mate-power-manager

Power management tool for the MATE desktop
https://mate-desktop.org
GNU General Public License v2.0
59 stars 51 forks source link

Fix building 1.24 branch #362

Closed raveit65 closed 3 years ago

raveit65 commented 3 years ago

Fix building 1.24 branch + update travic (CI) config.

raveit65 commented 3 years ago

fixes

/usr/bin/ld: mate_power_preferences-gpm-prefs-core.o: in function `prefs_setup_battery':

gpm-prefs-core.c:(.text+0x16c5): undefined reference to `GET_WIDGET'

collect2: error: ld returned 1 exit status

make[3]: *** [Makefile:1194: mate-power-preferences] Error 1

https://travis-ci.org/github/mate-desktop/mate-power-manager/jobs/762016193#L1720

@rbuj I hope my fix is OK?

rbuj commented 3 years ago

It's because of cherry-picking the commit https://github.com/mate-desktop/mate-power-manager/commit/d879a18a09e9cbdd43050365e08afd9f9bee72bd to 1.24 brach.

There is no GET_WIDGET macro on 1.24 branch:

https://github.com/mate-desktop/mate-power-manager/blob/50df11895cba8aac8f0d0bd52b97c835a2a4afc0/src/gpm-prefs-core.c#L43

just add the macro as follows:

diff --git a/src/gpm-prefs-core.c b/src/gpm-prefs-core.c
index 018a75d..0a25db6 100644
--- a/src/gpm-prefs-core.c
+++ b/src/gpm-prefs-core.c
@@ -41,6 +41,8 @@
 #include "gpm-icon-names.h"
 #include "gpm-brightness.h"

+#define GET_WIDGET(x) (GTK_WIDGET (gtk_builder_get_object (prefs->priv->builder, (x))))
+
 static void gpm_prefs_finalize (GObject *object);

 struct GpmPrefsPrivate
raveit65 commented 3 years ago

Yes, i saw the commit where you added #define GET_WIDGET(x) (GTK_WIDGET (gtk_builder_get_object (prefs->priv->builder, (x))))

So i think my fix is OK?