aboutsummaryrefslogtreecommitdiffstats
path: root/ports-mgmt/pkg-devel
diff options
context:
space:
mode:
authorbapt <bapt@FreeBSD.org>2013-09-21 20:42:38 +0800
committerbapt <bapt@FreeBSD.org>2013-09-21 20:42:38 +0800
commitb58a8d8516adf37ca9fbddab6051edb02ba6f0d2 (patch)
tree30a81452acf8fad71bdb187e560316a740ea4f35 /ports-mgmt/pkg-devel
parentc1699bde1e94666b4b409b3acb6d8f13e9bf51df (diff)
downloadfreebsd-ports-gnome-b58a8d8516adf37ca9fbddab6051edb02ba6f0d2.tar.gz
freebsd-ports-gnome-b58a8d8516adf37ca9fbddab6051edb02ba6f0d2.tar.zst
freebsd-ports-gnome-b58a8d8516adf37ca9fbddab6051edb02ba6f0d2.zip
Pickup patches from ports-mgmt/pkg so that pkg-devel is also stage ready
Diffstat (limited to 'ports-mgmt/pkg-devel')
-rw-r--r--ports-mgmt/pkg-devel/Makefile1
-rw-r--r--ports-mgmt/pkg-devel/files/patch-libpkg__pkg.h.in11
-rw-r--r--ports-mgmt/pkg-devel/files/patch-libpkg__pkg_elf.c114
-rw-r--r--ports-mgmt/pkg-devel/files/patch-libpkg__pkgdb.c11
-rw-r--r--ports-mgmt/pkg-devel/files/patch-libpkg__private__elf_tables.h13
-rw-r--r--ports-mgmt/pkg-devel/files/patch-pkg__register.c11
6 files changed, 161 insertions, 0 deletions
diff --git a/ports-mgmt/pkg-devel/Makefile b/ports-mgmt/pkg-devel/Makefile
index a6a11b20f276..f5c7e9d2a1db 100644
--- a/ports-mgmt/pkg-devel/Makefile
+++ b/ports-mgmt/pkg-devel/Makefile
@@ -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}/ \
diff --git a/ports-mgmt/pkg-devel/files/patch-libpkg__pkg.h.in b/ports-mgmt/pkg-devel/files/patch-libpkg__pkg.h.in
new file mode 100644
index 000000000000..2afea253b6d0
--- /dev/null
+++ b/ports-mgmt/pkg-devel/files/patch-libpkg__pkg.h.in
@@ -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
diff --git a/ports-mgmt/pkg-devel/files/patch-libpkg__pkg_elf.c b/ports-mgmt/pkg-devel/files/patch-libpkg__pkg_elf.c
new file mode 100644
index 000000000000..343c43eaef48
--- /dev/null
+++ b/ports-mgmt/pkg-devel/files/patch-libpkg__pkg_elf.c
@@ -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:
+ /*
diff --git a/ports-mgmt/pkg-devel/files/patch-libpkg__pkgdb.c b/ports-mgmt/pkg-devel/files/patch-libpkg__pkgdb.c
new file mode 100644
index 000000000000..8f93324bab28
--- /dev/null
+++ b/ports-mgmt/pkg-devel/files/patch-libpkg__pkgdb.c
@@ -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);
diff --git a/ports-mgmt/pkg-devel/files/patch-libpkg__private__elf_tables.h b/ports-mgmt/pkg-devel/files/patch-libpkg__private__elf_tables.h
new file mode 100644
index 000000000000..15f6fed982eb
--- /dev/null
+++ b/ports-mgmt/pkg-devel/files/patch-libpkg__private__elf_tables.h
@@ -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
+
diff --git a/ports-mgmt/pkg-devel/files/patch-pkg__register.c b/ports-mgmt/pkg-devel/files/patch-pkg__register.c
new file mode 100644
index 000000000000..ddb4bccbf270
--- /dev/null
+++ b/ports-mgmt/pkg-devel/files/patch-pkg__register.c
@@ -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) {