From owner-svn-ports-head@FreeBSD.ORG Sat Sep 21 12:42:40 2013 Return-Path: Delivered-To: svn-ports-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 7491D732; Sat, 21 Sep 2013 12:42:40 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 50C2A2D52; Sat, 21 Sep 2013 12:42:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8LCgeil098830; Sat, 21 Sep 2013 12:42:40 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8LCgdQE098824; Sat, 21 Sep 2013 12:42:39 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201309211242.r8LCgdQE098824@svn.freebsd.org> From: Baptiste Daroussin Date: Sat, 21 Sep 2013 12:42:39 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r327813 - in head/ports-mgmt/pkg-devel: . files X-SVN-Group: ports-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the ports tree for head List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Sep 2013 12:42:40 -0000 Author: bapt Date: Sat Sep 21 12:42:38 2013 New Revision: 327813 URL: http://svnweb.freebsd.org/changeset/ports/327813 Log: Pickup patches from ports-mgmt/pkg so that pkg-devel is also stage ready Added: head/ports-mgmt/pkg-devel/files/ head/ports-mgmt/pkg-devel/files/patch-libpkg__pkg.h.in (contents, props changed) head/ports-mgmt/pkg-devel/files/patch-libpkg__pkg_elf.c (contents, props changed) head/ports-mgmt/pkg-devel/files/patch-libpkg__pkgdb.c (contents, props changed) head/ports-mgmt/pkg-devel/files/patch-libpkg__private__elf_tables.h (contents, props changed) head/ports-mgmt/pkg-devel/files/patch-pkg__register.c (contents, props changed) Modified: head/ports-mgmt/pkg-devel/Makefile Modified: head/ports-mgmt/pkg-devel/Makefile ============================================================================== --- head/ports-mgmt/pkg-devel/Makefile Sat Sep 21 12:26:55 2013 (r327812) +++ head/ports-mgmt/pkg-devel/Makefile Sat Sep 21 12:42:38 2013 (r327813) @@ -2,6 +2,7 @@ PORTNAME= pkg DISTVERSION= 1.1.4 +PORTREVISION= 1 CATEGORIES= ports-mgmt MASTER_SITES= http://files.etoilebsd.net/pkg/ \ http://mirror.shatow.net/freebsd/${PORTNAME}/ \ Added: head/ports-mgmt/pkg-devel/files/patch-libpkg__pkg.h.in ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/ports-mgmt/pkg-devel/files/patch-libpkg__pkg.h.in Sat Sep 21 12:42:38 2013 (r327813) @@ -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 Added: head/ports-mgmt/pkg-devel/files/patch-libpkg__pkg_elf.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/ports-mgmt/pkg-devel/files/patch-libpkg__pkg_elf.c Sat Sep 21 12:42:38 2013 (r327813) @@ -0,0 +1,114 @@ +--- ./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; + } ++ if (data->d_buf == NULL) { ++ ret = EPKG_END; /* No osname available */ ++ goto cleanup; ++ } + osname = (const char *) data->d_buf + sizeof(Elf_Note); + if (strncasecmp(osname, "freebsd", sizeof("freebsd")) != 0 && + strncasecmp(osname, "dragonfly", sizeof("dragonfly")) != 0) { +@@ -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; +- const char *abi, *endian_corres_str, *wordsize_corres_str; ++ const char *abi, *endian_corres_str, *wordsize_corres_str, *fpu; + + if (elf_version(EV_CURRENT) == EV_NONE) { + pkg_emit_error("ELF library initialization failed: %s", +@@ -569,10 +587,28 @@ + endian_corres_str = elf_corres_to_string(endian_corres, + (int)elfhdr.e_ident[EI_DATA]); + ++ /* FreeBSD doesn't support the hard-float ABI yet */ ++ fpu = "softfp"; ++ if ((elfhdr.e_flags & 0xFF000000) != 0) { ++ /* This is an EABI file, the conformance level is set */ ++ abi = "eabi"; ++ } else if (elfhdr.e_ident[EI_OSABI] != ELFOSABI_NONE) { ++ /* ++ * EABI executables all have this field set to ++ * ELFOSABI_NONE, therefore it must be an oabi file. ++ */ ++ abi = "oabi"; ++ } else { ++ /* ++ * We may have failed to positively detect the ABI, ++ * set the ABI to unknown. If we end up here one of ++ * the above cases should be fixed for the binary. ++ */ ++ pkg_emit_error("unknown ARM ABI"); ++ goto cleanup; ++ } + snprintf(dest + strlen(dest), sz - strlen(dest), ":%s:%s:%s", +- endian_corres_str, +- (elfhdr.e_flags & EF_ARM_NEW_ABI) > 0 ? "eabi" : "oabi", +- (elfhdr.e_flags & EF_ARM_VFP_FLOAT) > 0 ? "softfp" : "vfp"); ++ endian_corres_str, abi, fpu); + break; + case EM_MIPS: + /* Added: head/ports-mgmt/pkg-devel/files/patch-libpkg__pkgdb.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/ports-mgmt/pkg-devel/files/patch-libpkg__pkgdb.c Sat Sep 21 12:42:38 2013 (r327813) @@ -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-devel/files/patch-libpkg__private__elf_tables.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/ports-mgmt/pkg-devel/files/patch-libpkg__private__elf_tables.h Sat Sep 21 12:42:38 2013 (r327813) @@ -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-devel/files/patch-pkg__register.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/ports-mgmt/pkg-devel/files/patch-pkg__register.c Sat Sep 21 12:42:38 2013 (r327813) @@ -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) {