1 #!/usr/bin/bash
   2 #
   3 # CDDL HEADER START
   4 #
   5 # The contents of this file are subject to the terms of the
   6 # Common Development and Distribution License, Version 1.0 only
   7 # (the "License").  You may not use this file except in compliance
   8 # with the License.
   9 #
  10 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
  11 # or http://www.opensolaris.org/os/licensing.
  12 # See the License for the specific language governing permissions
  13 # and limitations under the License.
  14 #
  15 # When distributing Covered Code, include this CDDL HEADER in each
  16 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  17 # If applicable, add the following below this CDDL HEADER, with the
  18 # fields enclosed by brackets "[]" replaced with your own identifying
  19 # information: Portions Copyright [yyyy] [name of copyright owner]
  20 #
  21 # CDDL HEADER END
  22 #
  23 #
  24 # Copyright 2011-2012 OmniTI Computer Consulting, Inc.  All rights reserved.
  25 # Use is subject to license terms.
  26 #
  27 # Load support functions
  28 . ../../lib/functions.sh
  29 
  30 PROG=dbus-glib
  31 VER=0.100
  32 PKG=system/library/libdbus-glib
  33 SUMMARY="$PROG - GNOME GLib DBUS integration library"
  34 DESC="$SUMMARY"
  35 
  36 DEPENDS_IPS="system/library/libdbus library/glib2 library/zlib system/library system/library/gcc-5-runtime"
  37 
  38 CONFIGURE_OPTS="--disable-fam --disable-dtrace --disable-tests"
  39 GLIB_GENMARSHAL=/usr/bin/glib-genmarshal
  40 export GLIB_GENMARSHAL
  41 
  42 save_function configure32 configure32_orig
  43 save_function configure64 configure64_orig
  44 configure32() {
  45     DBUS_LIBS=-ldbus-1
  46     export DBUS_LIBS
  47     DBUS_CFLAGS="-I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include"
  48     export DBUS_CFLAGS
  49     DBUS_GLIB_CFLAGS="-I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include"
  50     export DBUS_GLIB_CFLAGS
  51     DBUS_GLIB_LIBS="-lglib-2.0 -lgobject-2.0 -lgio-2.0"
  52     export DBUS_GLIB_LIBS
  53     configure32_orig
  54     logcmd mv config.status config.status.old || logerr "status backup failed"
  55     sed -e 's/S\["GLIB_GENMARSHAL"\]=""/S["GLIB_GENMARSHAL"]="glib-genmarshal"/' < config.status.old > config.status || logerr "sed failed"
  56     logcmd chmod 755 config.status || logerr "chmod failed"
  57     logcmd ./config.status || logerr "config status"
  58     logcmd perl -pi -e 's#(\$CC.*\$compiler_flags)#$1 -nostdlib#g;' libtool ||
  59         logerr "libtool patch failed"
  60 }
  61 configure64() {
  62     DBUS_LIBS=-ldbus-1
  63     export DBUS_LIBS
  64     DBUS_CFLAGS="-I/usr/include/dbus-1.0 -I/usr/lib/amd64/dbus-1.0/include"
  65     export DBUS_CFLAGS
  66     DBUS_GLIB_CFLAGS="-I/usr/include/glib-2.0 -I/usr/lib/amd64/glib-2.0/include"
  67     export DBUS_GLIB_CFLAGS
  68     DBUS_GLIB_LIBS="-lglib-2.0 -lgobject-2.0 -lgio-2.0"
  69     export DBUS_GLIB_LIBS
  70     configure64_orig
  71     logcmd mv config.status config.status.old || logerr "status backup failed"
  72     sed -e 's/S\["GLIB_GENMARSHAL"\]=""/S["GLIB_GENMARSHAL"]="glib-genmarshal"/' < config.status.old > config.status || logerr "sed failed"
  73     logcmd chmod 755 config.status || logerr "chmod failed"
  74     logcmd ./config.status || logerr "config status"
  75     logcmd perl -pi -e 's#(\$CC.*\$compiler_flags)#$1 -nostdlib#g;' libtool ||
  76         logerr "libtool patch failed"
  77 }
  78 
  79 init
  80 download_source $PROG $PROG $VER
  81 patch_source
  82 prep_build
  83 build
  84 make_isa_stub
  85 make_package
  86 clean_up