svn commit: r327648 - in head/ports-mgmt/pkg: . files
Baptiste Daroussin
bapt at FreeBSD.org
Thu Sep 19 20:04:53 UTC 2013
Author: bapt
Date: Thu Sep 19 20:04:51 2013
New Revision: 327648
URL: http://svnweb.freebsd.org/changeset/ports/327648
Log:
Fix build on mips
Fix analyzing elf when package/registering from a stage directory
Added:
head/ports-mgmt/pkg/files/patch-libpkg__pkg.h.in (contents, props changed)
head/ports-mgmt/pkg/files/patch-libpkg__pkgdb.c (contents, props changed)
head/ports-mgmt/pkg/files/patch-libpkg__private__elf_tables.h (contents, props changed)
head/ports-mgmt/pkg/files/patch-pkg__register.c (contents, props changed)
Modified:
head/ports-mgmt/pkg/Makefile
head/ports-mgmt/pkg/files/patch-libpkg__pkg_elf.c
Modified: head/ports-mgmt/pkg/Makefile
==============================================================================
--- head/ports-mgmt/pkg/Makefile Thu Sep 19 19:36:27 2013 (r327647)
+++ head/ports-mgmt/pkg/Makefile Thu Sep 19 20:04:51 2013 (r327648)
@@ -2,7 +2,7 @@
PORTNAME= pkg
DISTVERSION= 1.1.4
-PORTREVISION= 2
+PORTREVISION= 3
CATEGORIES= ports-mgmt
MASTER_SITES= http://files.etoilebsd.net/pkg/ \
http://mirror.shatow.net/freebsd/${PORTNAME}/ \
Added: head/ports-mgmt/pkg/files/patch-libpkg__pkg.h.in
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/ports-mgmt/pkg/files/patch-libpkg__pkg.h.in Thu Sep 19 20:04:51 2013 (r327648)
@@ -0,0 +1,11 @@
+--- ./libpkg/pkg.h.in.orig 2013-07-06 12:48:19.000000000 +0200
++++ ./libpkg/pkg.h.in 2013-09-19 20:59:25.679219359 +0200
+@@ -626,7 +626,7 @@
+ #define PKG_CONTAINS_STATIC_LIBS (1U << 25)
+ #define PKG_CONTAINS_H_OR_LA (1U << 26)
+
+-int pkg_analyse_files(struct pkgdb *, struct pkg *);
++int pkg_analyse_files(struct pkgdb *, struct pkg *, const char *stage);
+
+ /**
+ * Suggest if a package could be marked architecture independent or
Modified: head/ports-mgmt/pkg/files/patch-libpkg__pkg_elf.c
==============================================================================
--- head/ports-mgmt/pkg/files/patch-libpkg__pkg_elf.c Thu Sep 19 19:36:27 2013 (r327647)
+++ head/ports-mgmt/pkg/files/patch-libpkg__pkg_elf.c Thu Sep 19 20:04:51 2013 (r327648)
@@ -1,6 +1,31 @@
---- ./libpkg/pkg_elf.c.orig 2013-07-06 05:48:19.000000000 -0500
-+++ ./libpkg/pkg_elf.c 2013-09-05 06:33:00.416129335 -0500
-@@ -271,6 +271,10 @@
+--- ./libpkg/pkg_elf.c.orig 2013-07-06 12:48:19.000000000 +0200
++++ ./libpkg/pkg_elf.c 2013-09-19 21:49:03.825014672 +0200
+@@ -87,6 +87,8 @@
+ const char *name, bool is_shlib)
+ {
+ const char *pkgname, *pkgversion;
++ struct pkg_file *file = NULL;
++ const char *filepath;
+
+ switch(filter_system_shlibs(name, NULL, 0)) {
+ case EPKG_OK: /* A non-system library */
+@@ -100,6 +102,15 @@
+ if (is_shlib)
+ return (EPKG_OK);
+
++ /* Search in libraries we do provide */
++ while (pkg_files(pkg, &file) == EPKG_OK) {
++ filepath = pkg_file_path(file);
++ if (strcmp(&filepath[strlen(filepath) - strlen(name)], name) == 0) {
++ pkg_addshlib_required(pkg, name);
++ return (EPKG_OK);
++ }
++ }
++
+ pkg_get(pkg, PKG_NAME, &pkgname, PKG_VERSION, &pkgversion);
+ warnx("(%s-%s) %s - shared library %s not found",
+ pkgname, pkgversion, fpath, name);
+@@ -271,6 +282,10 @@
ret = EPKG_END; /* Some error occurred, ignore this file */
goto cleanup;
}
@@ -11,7 +36,42 @@
osname = (const char *) data->d_buf + sizeof(Elf_Note);
if (strncasecmp(osname, "freebsd", sizeof("freebsd")) != 0 &&
strncasecmp(osname, "dragonfly", sizeof("dragonfly")) != 0) {
-@@ -484,7 +488,7 @@
+@@ -323,7 +338,7 @@
+ if (dyn->d_tag != DT_RPATH && dyn->d_tag != DT_RUNPATH)
+ continue;
+
+- shlib_list_from_rpath(elf_strptr(e, sh_link, dyn->d_un.d_val),
++ shlib_list_from_rpath(elf_strptr(e, sh_link, dyn->d_un.d_val),
+ dirname(fpath));
+ break;
+ }
+@@ -377,11 +392,11 @@
+ }
+
+ int
+-pkg_analyse_files(struct pkgdb *db, struct pkg *pkg)
++pkg_analyse_files(struct pkgdb *db, struct pkg *pkg, const char *stage)
+ {
+ struct pkg_file *file = NULL;
+ int ret = EPKG_OK;
+- const char *fpath;
++ char fpath[MAXPATHLEN];
+ bool autodeps = false;
+ bool developer = false;
+ int (*action)(void *, struct pkg *, const char *, const char *, bool);
+@@ -410,7 +425,10 @@
+ PKG_CONTAINS_H_OR_LA);
+
+ while (pkg_files(pkg, &file) == EPKG_OK) {
+- fpath = pkg_file_path(file);
++ if (stage != NULL)
++ snprintf(fpath, MAXPATHLEN, "%s/%s", stage, pkg_file_path(file));
++ else
++ strlcpy(fpath, pkg_file_path(file), MAXPATHLEN);
+
+ ret = analyse_elf(pkg, fpath, action, db);
+ if (developer) {
+@@ -484,7 +502,7 @@
uint32_t version = 0;
int ret = EPKG_OK;
int i;
@@ -20,7 +80,7 @@
if (elf_version(EV_CURRENT) == EV_NONE) {
pkg_emit_error("ELF library initialization failed: %s",
-@@ -569,10 +573,28 @@
+@@ -569,10 +587,28 @@
endian_corres_str = elf_corres_to_string(endian_corres,
(int)elfhdr.e_ident[EI_DATA]);
Added: head/ports-mgmt/pkg/files/patch-libpkg__pkgdb.c
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/ports-mgmt/pkg/files/patch-libpkg__pkgdb.c Thu Sep 19 20:04:51 2013 (r327648)
@@ -0,0 +1,11 @@
+--- ./libpkg/pkgdb.c.orig 2013-09-19 20:55:45.183234062 +0200
++++ ./libpkg/pkgdb.c 2013-09-19 20:55:15.578236583 +0200
+@@ -2661,7 +2661,7 @@
+ return (EPKG_FATAL);
+ }
+
+- if ((ret = pkg_analyse_files(db, pkg)) == EPKG_OK) {
++ if ((ret = pkg_analyse_files(db, pkg, NULL)) == EPKG_OK) {
+ if (!db->prstmt_initialized &&
+ prstmt_initialize(db) != EPKG_OK)
+ return (EPKG_FATAL);
Added: head/ports-mgmt/pkg/files/patch-libpkg__private__elf_tables.h
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/ports-mgmt/pkg/files/patch-libpkg__private__elf_tables.h Thu Sep 19 20:04:51 2013 (r327648)
@@ -0,0 +1,13 @@
+--- ./libpkg/private/elf_tables.h.orig 2013-07-06 12:48:19.000000000 +0200
++++ ./libpkg/private/elf_tables.h 2013-09-19 21:52:03.661029778 +0200
+@@ -59,7 +59,9 @@
+ { -1, NULL }
+ };
+
+-#define EF_MIPS_ABI 0x0000F000
++#ifndef EF_MIPS_ABI
++#define EF_MIPS_ABI 0x0000f000
++#endif
+ #define E_MIPS_ABI_O32 0x00001000
+ #define E_MIPS_ABI_N32 0x00000020
+
Added: head/ports-mgmt/pkg/files/patch-pkg__register.c
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/ports-mgmt/pkg/files/patch-pkg__register.c Thu Sep 19 20:04:51 2013 (r327648)
@@ -0,0 +1,11 @@
+--- ./pkg/register.c.orig 2013-09-19 20:56:18.299519000 +0200
++++ ./pkg/register.c 2013-09-19 20:56:34.568231772 +0200
+@@ -285,7 +285,7 @@
+ */
+
+ if (!testing_mode)
+- pkg_analyse_files(db, pkg);
++ pkg_analyse_files(db, pkg, input_path);
+
+ pkg_get(pkg, PKG_ARCH, &arch);
+ if (arch == NULL) {
More information about the svn-ports-all
mailing list