LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Modem Manager on -current/14.0 (https://www.linuxquestions.org/questions/slackware-14/modem-manager-on-current-14-0-a-4175425197/)

D1ver 09-01-2012 06:46 PM

Modem Manager on -current/14.0
 
2 Attachment(s)
Edit: sigh.. Here is where I commit the 'grep -i' command to memory and skulk away with my tail between my legs. Modem manager is included by default and I am just bad a searching..





The slackbuild for Modem Manager for 13.37 (and using the -current git repo for Sbopkg) doesn't work on 14.0. It fails with the error
Code:

error: #error "Only <glib.h> can be included directly."
Which Pat himself says can be fixed by
Quote:

Find in the software that isn't compiling any #include <glib/*.h> and replace it with #include <glib.h> and you should be good to go.
So I went about trying to fix this. I don't have much experience with this sort of thing but hopefully it will help someone.

The patch for the source is as follows
Code:

diff -cr ModemManager-0.5/src/mm-at-serial-port.h ModemManager-0.5-patch/src/mm-at-serial-port.h
*** ModemManager-0.5/src/mm-at-serial-port.h        2010-03-16 04:27:14.000000000 +1100
--- ModemManager-0.5-patch/src/mm-at-serial-port.h        2012-09-02 08:45:38.135016688 +1000
***************
*** 18,24 ****
  #define MM_AT_SERIAL_PORT_H
 
  #include <glib.h>
! #include <glib/gtypes.h>
  #include <glib-object.h>
 
  #include "mm-serial-port.h"
--- 18,24 ----
  #define MM_AT_SERIAL_PORT_H
 
  #include <glib.h>
! //#include <glib/gtypes.h>
  #include <glib-object.h>
 
  #include "mm-serial-port.h"
diff -cr ModemManager-0.5/src/mm-manager.h ModemManager-0.5-patch/src/mm-manager.h
*** ModemManager-0.5/src/mm-manager.h        2010-03-23 09:32:31.000000000 +1100
--- ModemManager-0.5-patch/src/mm-manager.h        2012-09-02 08:46:15.027015531 +1000
***************
*** 17,23 ****
  #ifndef MM_MANAGER_H
  #define MM_MANAGER_H
 
! #include <glib/gtypes.h>
  #include <glib-object.h>
  #include <dbus/dbus-glib.h>
  #include "mm-modem.h"
--- 17,24 ----
  #ifndef MM_MANAGER_H
  #define MM_MANAGER_H
 
! //#include <glib/gtypes.h>
! #include <glib.h>
  #include <glib-object.h>
  #include <dbus/dbus-glib.h>
  #include "mm-modem.h"
diff -cr ModemManager-0.5/src/mm-modem-base.h ModemManager-0.5-patch/src/mm-modem-base.h
*** ModemManager-0.5/src/mm-modem-base.h        2011-08-03 12:58:44.000000000 +1000
--- ModemManager-0.5-patch/src/mm-modem-base.h        2012-09-02 08:46:36.453014859 +1000
***************
*** 18,24 ****
  #define MM_MODEM_BASE_H
 
  #include <glib.h>
! #include <glib/gtypes.h>
  #include <glib-object.h>
 
  #include "mm-port.h"
--- 18,24 ----
  #define MM_MODEM_BASE_H
 
  #include <glib.h>
! //#include <glib/gtypes.h>
  #include <glib-object.h>
 
  #include "mm-port.h"
diff -cr ModemManager-0.5/src/mm-plugin-base.h ModemManager-0.5-patch/src/mm-plugin-base.h
*** ModemManager-0.5/src/mm-plugin-base.h        2011-08-03 12:58:44.000000000 +1000
--- ModemManager-0.5-patch/src/mm-plugin-base.h        2012-09-02 08:46:54.722014286 +1000
***************
*** 17,23 ****
  #define MM_PLUGIN_BASE_H
 
  #include <glib.h>
! #include <glib/gtypes.h>
  #include <glib-object.h>
 
  #define G_UDEV_API_IS_SUBJECT_TO_CHANGE
--- 17,23 ----
  #define MM_PLUGIN_BASE_H
 
  #include <glib.h>
! //#include <glib/gtypes.h>
  #include <glib-object.h>
 
  #define G_UDEV_API_IS_SUBJECT_TO_CHANGE
diff -cr ModemManager-0.5/src/mm-port.h ModemManager-0.5-patch/src/mm-port.h
*** ModemManager-0.5/src/mm-port.h        2011-08-03 12:53:33.000000000 +1000
--- ModemManager-0.5-patch/src/mm-port.h        2012-09-02 08:47:11.871013748 +1000
***************
*** 17,23 ****
  #define MM_PORT_H
 
  #include <glib.h>
! #include <glib/gtypes.h>
  #include <glib-object.h>
 
  typedef enum {
--- 17,23 ----
  #define MM_PORT_H
 
  #include <glib.h>
! //#include <glib/gtypes.h>
  #include <glib-object.h>
 
  typedef enum {
diff -cr ModemManager-0.5/src/mm-qcdm-serial-port.h ModemManager-0.5-patch/src/mm-qcdm-serial-port.h
*** ModemManager-0.5/src/mm-qcdm-serial-port.h        2011-03-25 04:14:31.000000000 +1100
--- ModemManager-0.5-patch/src/mm-qcdm-serial-port.h        2012-09-02 08:47:34.040013053 +1000
***************
*** 18,24 ****
  #define MM_QCDM_SERIAL_PORT_H
 
  #include <glib.h>
! #include <glib/gtypes.h>
  #include <glib-object.h>
 
  #include "mm-serial-port.h"
--- 18,24 ----
  #define MM_QCDM_SERIAL_PORT_H
 
  #include <glib.h>
! //#include <glib/gtypes.h>
  #include <glib-object.h>
 
  #include "mm-serial-port.h"
diff -cr ModemManager-0.5/src/mm-serial-port.h ModemManager-0.5-patch/src/mm-serial-port.h
*** ModemManager-0.5/src/mm-serial-port.h        2011-08-03 12:58:44.000000000 +1000
--- ModemManager-0.5-patch/src/mm-serial-port.h        2012-09-02 08:47:56.746012341 +1000
***************
*** 18,24 ****
  #define MM_SERIAL_PORT_H
 
  #include <glib.h>
! #include <glib/gtypes.h>
  #include <glib-object.h>
 
  #include "mm-port.h"
--- 18,24 ----
  #define MM_SERIAL_PORT_H
 
  #include <glib.h>
! //#include <glib/gtypes.h>
  #include <glib-object.h>
 
  #include "mm-port.h"


And the patch for the slackbuild is
Code:

*** ModemManager.SlackBuild        2012-09-02 09:39:20.354960902 +1000
--- ModemManager.patched.Slackbuild        2012-09-02 09:39:10.225961329 +1000
***************
*** 61,66 ****
--- 61,67 ----
  cd $TMP
  rm -rf $PRGNAM-$VERSION
  tar xvf $CWD/$PRGNAM-$VERSION.tar.xz
+ patch -p0 < $CWD/mm-glib.patch
  cd $PRGNAM-$VERSION
  chown -R root:root .
  find . \

It now builds correctly, and seems to work. I don't know if this fix is of the quality to be included or submitted anywhere, but hopefully it helps someone. If changes need to be made I'm still learning and would like to hear about them :)

D1ver 09-01-2012 07:22 PM

My mistake.. I didn't ignore case on my search for ModemManager, so I missed the fact it's installed by default..


Doh. At least I learned how to make a patch for a slackbuild I suppose.


/embarrassed..


All times are GMT -5. The time now is 10:57 AM.