[packages] glib2 fixes:
authorNicolas Thill <nico@openwrt.org>
Wed, 3 Oct 2007 07:42:01 +0000 (07:42 +0000)
committerNicolas Thill <nico@openwrt.org>
Wed, 3 Oct 2007 07:42:01 +0000 (07:42 +0000)
 * build our own glib-genmarshal and remove requirement for a host one
 * add a patch to disable docs and tests
 * add libtool fixes
 * tweak sed-ifications for pkgconfig files
 * cleanup

SVN-Revision: 9106

libs/glib2/Makefile
libs/glib2/patches/001-no_docs_and_tests.patch [new file with mode: 0644]

index 321093c..608880f 100644 (file)
@@ -15,13 +15,12 @@ PKG_RELEASE:=1
 PKG_SOURCE:=glib-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=ftp://ftp.gtk.org/pub/glib/2.12/
 PKG_MD5SUM:=6c6a61e4b08fb4b110ca7953f71c8b5e
-PKG_CAT:=zcat
 
 PKG_BUILD_DIR:=$(BUILD_DIR)/glib-$(PKG_VERSION)
-PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
 
 include $(INCLUDE_DIR)/package.mk
 
+
 define Package/glib2
   SECTION:=libs
   CATEGORY:=Libraries
@@ -31,56 +30,67 @@ define Package/glib2
   URL:=http://www.gtk.org/
 endef
 
-define Build/Configure 
+
+define Build/Configure
+endef
+
+define Build/Compile
+       mkdir -p $(PKG_BUILD_DIR)/build/$(GNU_HOST_NAME)
+       ( cd $(PKG_BUILD_DIR); ./configure \
+               --target=$(GNU_HOST_NAME) \
+               --host=$(GNU_HOST_NAME) \
+               --build=$(GNU_HOST_NAME) \
+               --prefix=$(PKG_BUILD_DIR)/build/$(GNU_HOST_NAME) \
+               --disable-shared \
+               --enable-static \
+               --enable-debug=no \
+       );
+       $(MAKE) -C $(PKG_BUILD_DIR) install clean
+
        $(call Build/Configure/Default, \
                --enable-shared \
                --enable-static \
-               LDFLAGS="-L$(STAGING_DIR)/usr/lib/libiconv/lib \
-                       -L$(STAGING_DIR)/usr/lib/libintl/lib" \
-               CPPFLAGS="-I$(STAGING_DIR)/usr/lib/libiconv/include \
-                       -I$(STAGING_DIR)/usr/lib/libintl/include" \
+               --enable-debug=no \
                , \
+               CPPFLAGS="$$$$CPPFLAGS -I$(STAGING_DIR)/usr/lib/libiconv/include" \
+               CPPFLAGS="$$$$CPPFLAGS -I$(STAGING_DIR)/usr/lib/libintl/include" \
+               LDFLAGS="$$$$LDFLAGS -L$(STAGING_DIR)/usr/lib/libiconv/lib" \
+               LDFLAGS="$$$$LDFLAGS -L$(STAGING_DIR)/usr/lib/libintl/lib" \
                glib_cv_stack_grows=no \
                glib_cv_uscore=no \
-       )
+               ac_cv_path_GLIB_GENMARSHAL=$(PKG_BUILD_DIR)/build/$(GNU_HOST_NAME)/bin/glib-genmarshal \
+       );
+       $(call libtool_disable_rpath)
+       $(MAKE) -C $(PKG_BUILD_DIR) all
+       $(call libtool_fixup_libdir,$(PKG_INSTALL_DIR))
+       $(MAKE) -C $(PKG_BUILD_DIR) DESTDIR="$(PKG_INSTALL_DIR)" install
 endef
 
-define Build/Compile
-       $(MAKE) -C $(PKG_BUILD_DIR) \
-               DESTDIR="$(PKG_INSTALL_DIR)" \
-               all install
-endef
-
-
 define Build/InstallDev
        mkdir -p $(STAGING_DIR)/usr/include
        $(CP) $(PKG_INSTALL_DIR)/usr/include/glib-2.0 $(STAGING_DIR)/usr/include/
-       $(CP) $(PKG_BUILD_DIR)/glibconfig.h $(STAGING_DIR)/usr/include/glib-2.0
        mkdir -p $(STAGING_DIR)/usr/lib
-       $(CP) $(PKG_INSTALL_DIR)/usr/lib/* $(STAGING_DIR)/usr/lib/
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/glib-2.0 $(STAGING_DIR)/usr/lib/
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libg{lib,module,object,thread}-2.0.{a,so*} $(STAGING_DIR)/usr/lib/
        mkdir -p $(STAGING_DIR)/usr/lib/pkgconfig
-       $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/* $(STAGING_DIR)/usr/lib/pkgconfig
-       $(SED)  "s,"libdir\=\'/usr/lib\'",libdir='$(STAGING_DIR)/usr/lib\'," $(STAGING_DIR)/usr/lib/{libglib,libgmodule,libgobject,libgthread}-2.0.la
-       $(SED)  "s,"prefix\=/usr",prefix=$(STAGING_DIR)/usr," $(STAGING_DIR)/usr/lib/pkgconfig/{glib,gmodule,gmodule-export,gmodule-no-export,gobject,gthread}-2.0.pc
-       $(SED)  "s,"exec_prefix\=/usr",exec_prefix=$(STAGING_DIR)/usr," $(STAGING_DIR)/usr/lib/pkgconfig/{glib,gmodule,gmodule-export,gmodule-no-export,gobject,gthread}-2.0.pc
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/g{lib,module,object,thread}-2.0.pc $(STAGING_DIR)/usr/lib/pkgconfig
+       $(SED) 's,^includedir=.*,includedir=$(STAGING_DIR)/usr/include,g' $(STAGING_DIR)/usr/lib/pkgconfig/g{lib,module,object,thread}-2.0.pc
+       $(SED) 's,^libdir=.*,libdir=$(STAGING_DIR)/usr/lib,g' $(STAGING_DIR)/usr/lib/pkgconfig/g{lib,module,object,thread}-2.0.pc
 endef
 
 define Build/UninstallDev
-       rm -rf \
-               $(STAGING_DIR)/usr/include/glib-2.0 \
-               $(STAGING_DIR)/usr/lib/libg*-2.0.* \
+       rm -rf  $(STAGING_DIR)/usr/include/glib-2.0 \
                $(STAGING_DIR)/usr/lib/glib-2.0 \
-               $(STAGING_DIR)/usr/lib/pkgconfig/g*-2.0.pc
+               $(STAGING_DIR)/usr/lib/libg{lib,module,object,thread}-2.0.{a,so*} \
+               $(STAGING_DIR)/usr/lib/pkgconfig/g{lib,module,object,thread}-2.0.pc
 endef
 
-define Package/glib2/install   
+
+define Package/glib2/install
        $(INSTALL_DIR) $(1)/usr/lib
        $(CP) $(PKG_INSTALL_DIR)/usr/lib/libg*-2.0.so* $(1)/usr/lib/
 endef
 
+
 $(eval $(call BuildPackage,glib2))
 
-$(eval $(call RequireCommand,glib-genmarshal, \
-       $(PKG_NAME) requires the glib2 dev (named like libglib2.0-dev, \
-       depending of your package manager) package be installed on the host-system. \
-))
diff --git a/libs/glib2/patches/001-no_docs_and_tests.patch b/libs/glib2/patches/001-no_docs_and_tests.patch
new file mode 100644 (file)
index 0000000..b145954
--- /dev/null
@@ -0,0 +1,12 @@
+diff -ruN glib-2.12.12-old/Makefile.in glib-2.12.12-new/Makefile.in
+--- glib-2.12.12-old/Makefile.in       2007-05-02 01:20:29.000000000 +0200
++++ glib-2.12.12-new/Makefile.in       2007-08-18 22:02:49.000000000 +0200
+@@ -239,7 +239,7 @@
+ AUTOMAKE_OPTIONS = 1.7
+-SUBDIRS = . m4macros glib gobject gmodule gthread tests build po docs
++SUBDIRS = . m4macros glib gobject gmodule gthread build po
+ bin_SCRIPTS = glib-gettextize