pidgin: 3012bdc5: Install the Purple and Pidgin perl modul...

deryni at pidgin.im deryni at pidgin.im
Sun Jul 5 11:15:53 EDT 2009


-----------------------------------------------------------------
Revision: 3012bdc54e5d2391c4fe52e687e87903ecbf44cc
Ancestor: 020e4e3b64a5c0271c6736685bcd23afbd293920
Author: deryni at pidgin.im
Date: 2009-06-18T23:01:51
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/3012bdc54e5d2391c4fe52e687e87903ecbf44cc

Modified files:
        configure.ac libpurple/plugins/perl/Makefile.am
        libpurple/plugins/perl/common/Makefile.PL.in
        libpurple/plugins/perl/perl.c
        pidgin/plugins/perl/Makefile.am
        pidgin/plugins/perl/common/Makefile.PL.in

ChangeLog: 

Install the Purple and Pidgin perl modules under $libdir instead of in perl's
normal @INC locations. Since they aren't usable by perl directly existing
there just confused people and conflicted with similarly named perl modules.

Thanks Zsombor Welker. Fixes #5428

-------------- next part --------------
============================================================
--- configure.ac	81109c47a6adbfb8a22b8c241a69102b39f7c4d8
+++ configure.ac	634f3483497318882a7259f19b87d45c681c7291
@@ -1563,30 +1563,6 @@ if test "$enable_perl" = yes ; then
 			AC_MSG_RESULT(no)
 		fi
 
-		if test "x$prefix" != "xNONE"; then
-			prefix=`eval echo $prefix`
-			PERL_MM_PARAMS="INSTALLDIRS=vendor PREFIX=$prefix"
-		fi
-
-		AC_ARG_WITH(perl-lib,
-		[AC_HELP_STRING([--with-perl-lib=[site|vendor|DIR]],
-			[specify where to install the Perl libraries for pidgin. Default is site.])],
-		[
-			if test "x$withval" = xsite; then
-				PERL_MM_PARAMS=""
-			elif test "x$withval" = xvendor; then
-				if test -z "`$perlpath -v | grep '5\.0'`"; then
-					PERL_MM_PARAMS="INSTALLDIRS=vendor"
-				else
-					PERL_MM_PARAMS="INSTALLDIRS=vendor PREFIX=`perl -e 'use Config; print $Config{prefix}'`"
-				fi
-			else
-				PERL_MM_PARAMS="INSTALLDIRS=vendor PREFIX=$withval"
-			fi
-		])
-
-		AC_SUBST(PERL_MM_PARAMS)
-
 		AC_MSG_CHECKING(for DynaLoader.a)
 		DYNALOADER_A=`echo $PERL_LDFLAGS | $perlpath -pe 's/^(.* )*([[^ ]]*DynaLoader\.a).*/\2/'`
 
============================================================
--- libpurple/plugins/perl/Makefile.am	c904ca26ca0f66c530d06c9aee3e3503faab80c7
+++ libpurple/plugins/perl/Makefile.am	a7a855ce28fbc4ea9e31092a11d69bd16a04c2d7
@@ -99,7 +99,7 @@ common/Makefile: common/Makefile.PL
 			${LN_S} -f $$srcloc/$$f $$f; \
 		done; \
 	fi
-	@cd common && $(perlpath) Makefile.PL $(PERL_MM_PARAMS)
+	@cd common && $(perlpath) Makefile.PL
 
 common/Makefile.PL: common/Makefile.PL.in $(top_builddir)/config.status
 	cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)
@@ -108,7 +108,7 @@ all-local: common/Makefile
 	@for dir in $(perl_dirs); do \
 		cd $$dir && \
 		if [ ! -f Makefile ]; then \
-			$(perlpath) Makefile.PL $(PERL_MM_PARAMS); \
+			$(perlpath) Makefile.PL; \
 		fi && \
 		($(MAKE) CC="$(CC)" CCFLAGS="$(PERL_CFLAGS) $(CFLAGS)" $(PERL_EXTRA_OPTS) || \
 		 $(MAKE) CC="$(CC)" CCFLAGS="$(PERL_CFLAGS) $(CFLAGS)" $(PERL_EXTRA_OPTS)) && \
@@ -164,6 +164,7 @@ AM_CPPFLAGS = \
 	-I$(top_srcdir) \
 	-I$(top_srcdir)/libpurple \
 	-I$(top_builddir)/libpurple \
+	-DLIBDIR=\"$(libdir)/purple-$(PURPLE_MAJOR_VERSION)\" \
 	$(DEBUG_CFLAGS) \
 	$(GLIB_CFLAGS) \
 	$(PLUGIN_CFLAGS) \
============================================================
--- libpurple/plugins/perl/common/Makefile.PL.in	c170d5535c6bba774e8dca0aad9082cdb9bea74f
+++ libpurple/plugins/perl/common/Makefile.PL.in	a8840c8f3fed5b6b6678cd4d8604e266b90f5175
@@ -13,4 +13,16 @@ WriteMakefile(
     'INC'               => '-I. -I at srcdir@ -I at top_srcdir@ -I at top_srcdir@/libpurple @GLIB_CFLAGS@',
     'OBJECT'            => '$(O_FILES)', # link all the C files too
 #    'OPTIMIZE'          => '-g', # For debugging
+    'INSTALLDIRS'          => 'vendor',
+    'INSTALL_BASE'         => '$(prefix)',
+    'INSTALLVENDORARCH'    => '$(libdir)/purple-$(PURPLE_MAJOR_VERSION)/perl',
+    'INSTALLVENDORMAN3DIR' => '$(mandir)/man3',
+    'macro'                => {
+        'prefix'               => '@prefix@',
+        'exec_prefix'          => '@exec_prefix@',
+        'libdir'               => '@libdir@',
+        'mandir'               => '@mandir@',
+        'datarootdir'          => '@datarootdir@',
+        'PURPLE_MAJOR_VERSION' => '@PURPLE_MAJOR_VERSION@',
+    },
 );
============================================================
--- libpurple/plugins/perl/perl.c	81dc5ab2c5239fb8d93c5b6dda4e4b258aa8ed4d
+++ libpurple/plugins/perl/perl.c	037fd7cfbd867302d89092b491cdad7034e7c6fc
@@ -131,6 +131,7 @@ xs_init(pTHX)
 #endif
 {
 	char *file = __FILE__;
+	GList *search_paths = purple_plugins_get_search_paths();
 	dXSUB_SYS;
 
 	/* This one allows dynamic loading of perl modules in perl scripts by
@@ -139,6 +140,17 @@ xs_init(pTHX)
 #ifdef _WIN32
 	newXS("Win32CORE::bootstrap", boot_Win32CORE, file);
 #endif
+
+	while (search_paths != NULL) {
+		gchar *uselib;
+		const gchar *search_path = search_paths->data;
+		search_paths = g_list_next(search_paths);
+
+		uselib = g_strdup_printf("unshift @INC, \"%s%cperl\";",
+		                         search_path, G_DIR_SEPARATOR);
+		eval_pv(uselib, TRUE);
+		g_free(uselib);
+	}
 }
 
 static void
============================================================
--- pidgin/plugins/perl/Makefile.am	d8a7c7064afb5bfa57c47a5da41ec6d125499e99
+++ pidgin/plugins/perl/Makefile.am	7c78068b97f0a7a6376268c9c45b6d71535f2a94
@@ -44,7 +44,7 @@ common/Makefile: common/Makefile.PL
 			${LN_S} -f $$srcloc/$$f $$f; \
 		done; \
 	fi
-	@cd common && $(perlpath) Makefile.PL $(PERL_MM_PARAMS)
+	@cd common && $(perlpath) Makefile.PL
 
 common/Makefile.PL: common/Makefile.PL.in $(top_builddir)/config.status
 	cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)
@@ -53,7 +53,7 @@ all-local: common/Makefile
 	@for dir in $(perl_dirs); do \
 		cd $$dir && \
 		if [ ! -f Makefile ]; then \
-			$(perlpath) Makefile.PL $(PERL_MM_PARAMS); \
+			$(perlpath) Makefile.PL; \
 		fi && \
 		($(MAKE) CC="$(CC)" CCFLAGS="$(PERL_CFLAGS) $(CFLAGS)" $(PERL_EXTRA_OPTS) || \
 		$(MAKE) CC="$(CC)" CCFLAGS="$(PERL_CFLAGS) $(CFLAGS)" $(PERL_EXTRA_OPTS)) && \
============================================================
--- pidgin/plugins/perl/common/Makefile.PL.in	69d9db077d74b20b7194d48e1534b44cf7a800f6
+++ pidgin/plugins/perl/common/Makefile.PL.in	1830f8e101ea68b0f7b3334ea9a4e72b0c59ca73
@@ -13,4 +13,15 @@ WriteMakefile(
     'OBJECT'        => '$(O_FILES)', # link all the C files too
     'TYPEMAPS'      => ["@top_srcdir@/libpurple/plugins/perl/common/typemap"],
 #    'OPTIMIZE'      => '-g', # For debugging.
+    'INSTALLDIRS'          => 'vendor',
+    'INSTALL_BASE'         => '$(prefix)',
+    'INSTALLVENDORARCH'    => '$(libdir)/pidgin/perl',
+    'INSTALLVENDORMAN3DIR' => '$(mandir)/man3',
+    'macro'                => {
+        'prefix'      => '@prefix@',
+        'exec_prefix' => '@exec_prefix@',
+        'libdir'      => '@libdir@',
+        'mandir'      => '@mandir@',
+        'datarootdir' => '@datarootdir@',
+    },
 );


More information about the Commits mailing list