OpenBSD and derivatives define MACHINE_ARCH in sys/param.h to "amd64" which overrides our attempt to set it to "x86_64" and ensure consistency across platforms. Work around this by setting it using PKGSRC_MACHINE_ARCH. Confirmed to fix the issue and not break a variety of other platforms by Sevan, and approved under duress by Joerg.diff -r1.211 -r1.212 pkgsrc/pkgtools/pkg_install/Makefile
(jperkin)
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | # $NetBSD: Makefile,v 1.211 2015/09/07 09:06:04 jperkin Exp $ | 1 | # $NetBSD: Makefile,v 1.212 2015/10/20 08:18:12 jperkin Exp $ | |
2 | 2 | |||
3 | # Notes to package maintainers: | 3 | # Notes to package maintainers: | |
4 | # | 4 | # | |
5 | # Updating this package does not automatically necessitate bumping | 5 | # Updating this package does not automatically necessitate bumping | |
6 | # PKGTOOLS_REQD in bsd.pkg.mk. Do so if and only if there is a critical | 6 | # PKGTOOLS_REQD in bsd.pkg.mk. Do so if and only if there is a critical | |
7 | # change in the pkg_* tools that pkgsrc relies on for proper operation. | 7 | # change in the pkg_* tools that pkgsrc relies on for proper operation. | |
8 | 8 | |||
9 | PKGNAME= pkg_install-${VERSION} | 9 | PKGNAME= pkg_install-${VERSION} | |
10 | CATEGORIES= pkgtools | 10 | CATEGORIES= pkgtools | |
11 | 11 | |||
12 | MAINTAINER= agc@NetBSD.org | 12 | MAINTAINER= agc@NetBSD.org | |
13 | HOMEPAGE= http://www.pkgsrc.org/ | 13 | HOMEPAGE= http://www.pkgsrc.org/ | |
14 | COMMENT= Package management and administration tools for pkgsrc | 14 | COMMENT= Package management and administration tools for pkgsrc | |
@@ -66,27 +66,27 @@ PKG_DELETE_CMD= ${WRKSRC}/delete/pkg_de | @@ -66,27 +66,27 @@ PKG_DELETE_CMD= ${WRKSRC}/delete/pkg_de | |||
66 | # Special case for dependency checking in 'non-bootstrap' builds: | 66 | # Special case for dependency checking in 'non-bootstrap' builds: | |
67 | # don't redefine 'pkg_info' if it already exists. | 67 | # don't redefine 'pkg_info' if it already exists. | |
68 | # | 68 | # | |
69 | . if defined(PKG_INFO_CMD) && !exists(${PKG_INFO_CMD}) | 69 | . if defined(PKG_INFO_CMD) && !exists(${PKG_INFO_CMD}) | |
70 | PKG_INFO_CMD= ${WRKSRC}/info/pkg_info | 70 | PKG_INFO_CMD= ${WRKSRC}/info/pkg_info | |
71 | . endif | 71 | . endif | |
72 | .endif | 72 | .endif | |
73 | 73 | |||
74 | CPPFLAGS+= -D_LARGEFILE_SOURCE -D_LARGE_FILES | 74 | CPPFLAGS+= -D_LARGEFILE_SOURCE -D_LARGE_FILES | |
75 | CPPFLAGS+= -D_FILE_OFFSET_BITS=64 | 75 | CPPFLAGS+= -D_FILE_OFFSET_BITS=64 | |
76 | 76 | |||
77 | CPPFLAGS+= -DDEF_UMASK=${DEF_UMASK} | 77 | CPPFLAGS+= -DDEF_UMASK=${DEF_UMASK} | |
78 | 78 | |||
79 | MAKE_ENV+= MACHINE_ARCH=${MACHINE_ARCH} | 79 | MAKE_ENV+= PKGSRC_MACHINE_ARCH=${MACHINE_ARCH} | |
80 | MAKE_ENV+= OPSYS=${OPSYS} | 80 | MAKE_ENV+= OPSYS=${OPSYS} | |
81 | MAKE_ENV+= CATMAN_SECTION_SUFFIX=${CATMAN_SECTION_SUFFIX:Q} | 81 | MAKE_ENV+= CATMAN_SECTION_SUFFIX=${CATMAN_SECTION_SUFFIX:Q} | |
82 | MAKE_ENV+= MANINSTALL=${MANINSTALL:Q} | 82 | MAKE_ENV+= MANINSTALL=${MANINSTALL:Q} | |
83 | 83 | |||
84 | PKG_DBDIR?= /var/db/pkg | 84 | PKG_DBDIR?= /var/db/pkg | |
85 | EGDIR= ${PREFIX}/share/examples/pkg_install | 85 | EGDIR= ${PREFIX}/share/examples/pkg_install | |
86 | 86 | |||
87 | PLIST_SUBST+= PKG_DBDIR=${PKG_DBDIR} | 87 | PLIST_SUBST+= PKG_DBDIR=${PKG_DBDIR} | |
88 | 88 | |||
89 | DEINSTALL_SRC= # empty | 89 | DEINSTALL_SRC= # empty | |
90 | INSTALL_SRC= ${PKGDIR}/INSTALL | 90 | INSTALL_SRC= ${PKGDIR}/INSTALL | |
91 | FILES_SUBST+= PKG_DBDIR=${PKG_DBDIR} \ | 91 | FILES_SUBST+= PKG_DBDIR=${PKG_DBDIR} \ | |
92 | PKG_TOOLS_BIN=${PKG_TOOLS_BIN:Q} \ | 92 | PKG_TOOLS_BIN=${PKG_TOOLS_BIN:Q} \ |
@@ -1,30 +1,30 @@ | @@ -1,30 +1,30 @@ | |||
1 | # $NetBSD: Makefile.in,v 1.31 2015/09/07 09:06:04 jperkin Exp $ | 1 | # $NetBSD: Makefile.in,v 1.32 2015/10/20 08:18:12 jperkin Exp $ | |
2 | 2 | |||
3 | srcdir= @srcdir@ | 3 | srcdir= @srcdir@ | |
4 | 4 | |||
5 | prefix= @prefix@ | 5 | prefix= @prefix@ | |
6 | exec_prefix= @exec_prefix@ | 6 | exec_prefix= @exec_prefix@ | |
7 | sbindir= @sbindir@ | 7 | sbindir= @sbindir@ | |
8 | mandir= @mandir@ | 8 | mandir= @mandir@ | |
9 | datarootdir= @datarootdir@ | 9 | datarootdir= @datarootdir@ | |
10 | 10 | |||
11 | man1dir= $(mandir)/man1 | 11 | man1dir= $(mandir)/man1 | |
12 | cat1dir= $(mandir)/cat1 | 12 | cat1dir= $(mandir)/cat1 | |
13 | 13 | |||
14 | CC= @CC@ | 14 | CC= @CC@ | |
15 | CCLD= $(CC) | 15 | CCLD= $(CC) | |
16 | CPPFLAGS= @CPPFLAGS@ -I. -I$(srcdir) -I../lib | 16 | CPPFLAGS= @CPPFLAGS@ -I. -I$(srcdir) -I../lib | |
17 | DEFS= @DEFS@ -DOPSYS_NAME=\"$(OPSYS)\" -DMACHINE_ARCH=\"$(MACHINE_ARCH)\" -DBINDIR=\"$(sbindir)\" | 17 | DEFS= @DEFS@ -DOPSYS_NAME=\"$(OPSYS)\" -DPKGSRC_MACHINE_ARCH=\"$(PKGSRC_MACHINE_ARCH)\" -DBINDIR=\"$(sbindir)\" | |
18 | CFLAGS= @CFLAGS@ | 18 | CFLAGS= @CFLAGS@ | |
19 | LDFLAGS= @LDFLAGS@ -L../lib | 19 | LDFLAGS= @LDFLAGS@ -L../lib | |
20 | 20 | |||
21 | SSL_SUPPORT= @ssl_support@ | 21 | SSL_SUPPORT= @ssl_support@ | |
22 | 22 | |||
23 | LIBS= -linstall -lnetpgpverify -larchive -lbz2 -lz -lfetch | 23 | LIBS= -linstall -lnetpgpverify -larchive -lbz2 -lz -lfetch | |
24 | .if !empty(SSL_SUPPORT) | 24 | .if !empty(SSL_SUPPORT) | |
25 | LIBS+= -lssl -lcrypto | 25 | LIBS+= -lssl -lcrypto | |
26 | .endif | 26 | .endif | |
27 | LIBS+= @LIBS@ | 27 | LIBS+= @LIBS@ | |
28 | 28 | |||
29 | INSTALL= @INSTALL@ | 29 | INSTALL= @INSTALL@ | |
30 | 30 |
@@ -1,22 +1,22 @@ | @@ -1,22 +1,22 @@ | |||
1 | /* $NetBSD: perform.c,v 1.106 2014/12/30 15:13:20 wiz Exp $ */ | 1 | /* $NetBSD: perform.c,v 1.107 2015/10/20 08:18:12 jperkin Exp $ */ | |
2 | #if HAVE_CONFIG_H | 2 | #if HAVE_CONFIG_H | |
3 | #include "config.h" | 3 | #include "config.h" | |
4 | #endif | 4 | #endif | |
5 | #include <nbcompat.h> | 5 | #include <nbcompat.h> | |
6 | #if HAVE_SYS_CDEFS_H | 6 | #if HAVE_SYS_CDEFS_H | |
7 | #include <sys/cdefs.h> | 7 | #include <sys/cdefs.h> | |
8 | #endif | 8 | #endif | |
9 | __RCSID("$NetBSD: perform.c,v 1.106 2014/12/30 15:13:20 wiz Exp $"); | 9 | __RCSID("$NetBSD: perform.c,v 1.107 2015/10/20 08:18:12 jperkin Exp $"); | |
10 | 10 | |||
11 | /*- | 11 | /*- | |
12 | * Copyright (c) 2003 Grant Beattie <grant@NetBSD.org> | 12 | * Copyright (c) 2003 Grant Beattie <grant@NetBSD.org> | |
13 | * Copyright (c) 2005 Dieter Baron <dillo@NetBSD.org> | 13 | * Copyright (c) 2005 Dieter Baron <dillo@NetBSD.org> | |
14 | * Copyright (c) 2007 Roland Illig <rillig@NetBSD.org> | 14 | * Copyright (c) 2007 Roland Illig <rillig@NetBSD.org> | |
15 | * Copyright (c) 2008, 2009 Joerg Sonnenberger <joerg@NetBSD.org> | 15 | * Copyright (c) 2008, 2009 Joerg Sonnenberger <joerg@NetBSD.org> | |
16 | * Copyright (c) 2010 Thomas Klausner <wiz@NetBSD.org> | 16 | * Copyright (c) 2010 Thomas Klausner <wiz@NetBSD.org> | |
17 | * All rights reserved. | 17 | * All rights reserved. | |
18 | * | 18 | * | |
19 | * Redistribution and use in source and binary forms, with or without | 19 | * Redistribution and use in source and binary forms, with or without | |
20 | * modification, are permitted provided that the following conditions | 20 | * modification, are permitted provided that the following conditions | |
21 | * are met: | 21 | * are met: | |
22 | * | 22 | * | |
@@ -897,27 +897,27 @@ check_platform(struct pkg_task *pkg) | @@ -897,27 +897,27 @@ check_platform(struct pkg_task *pkg) | |||
897 | warnx("uname() failed, continuing."); | 897 | warnx("uname() failed, continuing."); | |
898 | return 0; | 898 | return 0; | |
899 | } else { | 899 | } else { | |
900 | warnx("uname() failed, aborting."); | 900 | warnx("uname() failed, aborting."); | |
901 | return -1; | 901 | return -1; | |
902 | } | 902 | } | |
903 | } | 903 | } | |
904 | 904 | |||
905 | normalise_platform(&host_uname); | 905 | normalise_platform(&host_uname); | |
906 | 906 | |||
907 | if (OverrideMachine != NULL) | 907 | if (OverrideMachine != NULL) | |
908 | effective_arch = OverrideMachine; | 908 | effective_arch = OverrideMachine; | |
909 | else | 909 | else | |
910 | effective_arch = MACHINE_ARCH; | 910 | effective_arch = PKGSRC_MACHINE_ARCH; | |
911 | 911 | |||
912 | /* If either the OS or arch are different, bomb */ | 912 | /* If either the OS or arch are different, bomb */ | |
913 | if (strcmp(OPSYS_NAME, pkg->buildinfo[BI_OPSYS]) || | 913 | if (strcmp(OPSYS_NAME, pkg->buildinfo[BI_OPSYS]) || | |
914 | strcmp(effective_arch, pkg->buildinfo[BI_MACHINE_ARCH]) != 0) | 914 | strcmp(effective_arch, pkg->buildinfo[BI_MACHINE_ARCH]) != 0) | |
915 | fatal = 1; | 915 | fatal = 1; | |
916 | else | 916 | else | |
917 | fatal = 0; | 917 | fatal = 0; | |
918 | 918 | |||
919 | if (fatal || | 919 | if (fatal || | |
920 | compatible_platform(OPSYS_NAME, host_uname.release, | 920 | compatible_platform(OPSYS_NAME, host_uname.release, | |
921 | pkg->buildinfo[BI_OS_VERSION]) != 1) { | 921 | pkg->buildinfo[BI_OS_VERSION]) != 1) { | |
922 | warnx("Warning: package `%s' was built for a platform:", | 922 | warnx("Warning: package `%s' was built for a platform:", | |
923 | pkg->pkgname); | 923 | pkg->pkgname); |