Skip to contentSkip to conversation

package/perl-db-file: Fix berkeleydb detection

PATCH New Bernd Kuhls 2 participants 3 messages Dec 5, 2015 – Dec 20, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 package/perl-db-file: Fix berkeleydb detection

Without this patch libdb.so is not detected and lib/perl5/site_perl/5.22.0/i586-linux/auto/DB_File/DB_File.so is not linked against it:

Parsing config.in...
Looks Good.
Checking if your kit is complete...
Looks good
Warning (mostly harmless): No library found for -ldb Generating a Unix-style Makefile
Writing Makefile for DB_File
Writing MYMETA.yml and MYMETA.json

Quoted 1 line
Quoted 1 line
Quoted 1 line

perl-db-file 1.835 Building

$ output/host/usr/bin/i586-buildroot-linux-uclibc-readelf -a output/target/usr/lib/perl5/site_perl/5.22.0/i586-linux/auto/DB_File/DB_File.so | grep NEEDED
 0x00000001 (NEEDED)                     Shared library: [libc.so.1]

After applying this patch configure output will look like this:

Parsing config.in...
Looks Good.
Checking if your kit is complete...
Looks good
Generating a Unix-style Makefile
Writing Makefile for DB_File
Writing MYMETA.yml and MYMETA.json

Quoted 1 line
Quoted 1 line
Quoted 1 line

perl-db-file 1.835 Building

and the resulting library is correctly linked against libdb:

$ output/host/usr/bin/i586-buildroot-linux-uclibc-readelf -a output/target/usr/lib/perl5/site_perl/5.22.0/i586-linux/auto/DB_File/DB_File.so | grep NEEDED
 0x00000001 (NEEDED)                     Shared library: [libdb-5.3.so]
 0x00000001 (NEEDED)                     Shared library: [libc.so.1]
---
 package/perl-db-file/perl-db-file.mk | 8 ++++++++
 1 file changed, 8 insertions(+)
package/perl-db-file/perl-db-file.mk +8 -0
index 6d611ea..3db8c56 100644
@@ -11,4 +11,12 @@ PERL_DB_FILE_DEPENDENCIES = berkeleydb
 PERL_DB_FILE_LICENSE = Artistic or GPLv1+
 PERL_DB_FILE_LICENSE_FILES = README
 
+define PERL_DB_FILE_FIX_CONFIG_IN
+	$(SED) 's%^INCLUDE.*%INCLUDE = $(STAGING_DIR)/usr/include%' \
+		$(@D)/config.in
+	$(SED) 's%^LIB.*%LIB = $(STAGING_DIR)/usr/lib%' \
+		$(@D)/config.in
+endef
+PERL_DB_FILE_POST_PATCH_HOOKS += PERL_DB_FILE_FIX_CONFIG_IN
+
 $(eval $(perl-package))
Signature · 1 line
2.6.2
#1 lore raw

PATCH 2/2 package/perl-db-file: Berkeley DB 1.85 compatibility API is not needed

This package is also compatible with Berkeley DB v2 or higher:
https://metacpan.org/source/PMQS/DB_File-1.835/Changes

1.50
DB_File can now build with either DB 1.x or 2.x, but not both at the same time.

---
 package/perl-db-file/Config.in | 1 -
 1 file changed, 1 deletion(-)
package/perl-db-file/Config.in +0 -1
index 37bc5da..cf6cb72 100644
@@ -2,7 +2,6 @@ config BR2_PACKAGE_PERL_DB_FILE
 	bool "perl-db-file"
 	depends on !BR2_STATIC_LIBS
 	select BR2_PACKAGE_BERKELEYDB
-	select BR2_PACKAGE_BERKELEYDB_COMPAT185
 	help
 	  Perl5 access to Berkeley DB version 1.x
 
Signature · 1 line
2.6.2
#2 lore raw

PATCH 2/2 package/perl-db-file: Berkeley DB 1.85 compatibility API is not needed

Dear Bernd Kuhls,

Quoted 17 lines · Bernd Kuhls

This package is also compatible with Berkeley DB v2 or higher:
https://metacpan.org/source/PMQS/DB_File-1.835/Changes

1.50
DB_File can now build with either DB 1.x or 2.x, but not both at the same time.

---
 package/perl-db-file/Config.in | 1 -
 1 file changed, 1 deletion(-)
package/perl-db-file/Config.in +0 -0
index 37bc5da..cf6cb72 100644

package/perl-db-file/Config.in config BR2_PACKAGE_PERL_DB_FILE · line 6

Quoted 6 lines
package/perl-db-file/Config.in +0 -1
@@ -2,7 +2,6 @@ config BR2_PACKAGE_PERL_DB_FILE
 	bool "perl-db-file"
 	depends on !BR2_STATIC_LIBS
 	select BR2_PACKAGE_BERKELEYDB
-	select BR2_PACKAGE_BERKELEYDB_COMPAT185
 	help
 	  Perl5 access to Berkeley DB version 1.x

The Config.in help text needed some update, since it now works with Berkeley DB 2.x. I've adjusted that and applied.

Fran?ois, don't hesitate to have a look and give a comment if there is any issue with this.

Thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com