tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

OpenBSD/amd64 / pkgtools/pkg_install - pkg_add compatible_platform() check oddness



Hi,
While attempting to get things going on AIX I came across version
detection issues:
pkg_add: AIX/powerpc 7.1 (pkg) vs. AIX/powerpc 1 (this host)

But as the arch matched, things worked fine.
Yesterday I worked on OpenBSD support by fixing x11/libX11 which was
causing the most breakage in my builds (with X11_TYPE=modular) then
moved on to x11/libdrm where things got a bit more hairy.
It appears that OpenBSD arch is left as amd64 and not changed to x86_64,
hence the check in x11/libdrm/Makefile to pull in libpciaccess never
passed and things stopped at the configure stage due to a missing
dependency (libpciaccess).
I made the necessary changes to mk/bsd.prefs.mk and added the minimum
bits to get things detecting correctly but opened up another can of worms.

Now libpciaccess would be pulled in as a dependency correctly and built
but fail at the pkg_add stage with:
pkg_add: OpenBSD/x86_64 5.7 (pkg) vs. OpenBSD/amd64 5.7 (this host)

I went back and added the necessary parts to mk/gnu-config/config.guess
and pkgtools/pkg_install/files/config.guess based on what's there for
FreeBSD & DragonflyBSD, re-bootstrapped and still the same.

At this point I resorted to a kludge just to get the ball rolling as I
was more interested in the packages that would be freed to build & the
new breakages that would be revealed.
My kludge was to comment out the fatal || compatible_platform() check.

The changes I made are below (ignore the $LP64PLATFORMS change, that's
wrong).

Any pointers on where the issue lies with pkg_add?


Sevan

Index: mk/bsd.prefs.mk
===================================================================
RCS file: /cvsroot/pkgsrc/mk/bsd.prefs.mk,v
retrieving revision 1.364
diff -u -p -u -r1.364 bsd.prefs.mk
--- mk/bsd.prefs.mk     29 Apr 2015 14:23:23 -0000      1.364
+++ mk/bsd.prefs.mk     21 May 2015 15:57:41 -0000
@@ -232,6 +232,17 @@ OS_VERSION=                3.0
 .    endif
 .  endif

+.elif ${OPSYS} == "OpenBSD"
+LOWER_OPSYS?=          openbsd
+LOWER_OS_VERSION=      ${OS_VERSION}
+LOWER_OPSYS_VERSUFFIX= ${OS_VERSION}
+LOWER_ARCH!=           arch -s
+.   if ${LOWER_ARCH} == "amd64"
+MACHINE_ARCH=          x86_64
+.   else
+MACHINE_ARCH=          ${LOWER_ARCH}
+.   endif
+
 .elif ${OPSYS} == "MirBSD"
 LOWER_OPSYS?=          mirbsd
 LOWER_OS_VERSION=      ${OS_VERSION}
@@ -842,7 +853,7 @@ _SYS_VARS.dirs=             WRKDIR DESTDIR PKG_SYSC
 #
 LP64PLATFORMS=         *-*-aarch64 *-*-aarch64eb *-*-alpha *-*-ia64 \
                        *-*-mips64eb *-*-mips64el *-*-powerpc64
*-*-riscv64 \
-                       *-*-sparc64 *-*-x86_64 *-*-amd64
+                       *-*-sparc64 *-*-x86_64 OpenBSD-*-amd64

 # Lists of big-endian and little-endian platforms, to be used with
 # BROKEN_ON_PLATFORM.


Index: mk/gnu-config/config.guess
===================================================================
RCS file: /cvsroot/pkgsrc/mk/gnu-config/config.guess,v
retrieving revision 1.16
diff -u -p -u -r1.16 config.guess
--- mk/gnu-config/config.guess  23 Feb 2015 22:52:50 -0000      1.16
+++ mk/gnu-config/config.guess  21 May 2015 15:58:48 -0000
@@ -234,8 +234,13 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:$
        echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE}
        exit ;;
     *:OpenBSD:*:*)
-       UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
-       echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
+       UNAME_MACHINE_ARCH=`arch -s`
+       case ${UNAME_MACHINE_ARCH} in
+       amd64)
+           echo x86_64-unknown-openbsd${UNAME_RELEASE} ;;
+       *)
+           echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} ;;
+       esac
        exit ;;
     *:ekkoBSD:*:*)
        echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}




diff -u -p -u -r1.4 config.guess
--- pkgtools/pkg_install/files/config.guess     23 Jan 2010 23:43:58
-0000      1.4
+++ pkgtools/pkg_install/files/config.guess     21 May 2015 15:54:01 -0000
@@ -203,8 +203,13 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:$
        echo "${machine}-${os}${release}"
        exit ;;
     *:OpenBSD:*:*)
-       UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
-       echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
+       UNAME_MACHINE_ARCH=`arch -s`
+       case ${UNAME_MACHINE_ARCH} in
+       amd64)
+           echo x86_64-unknown-openbsd${UNAME_RELEASE} ;;
+       *)
+           echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} ;;
+       esac
        exit ;;
     *:ekkoBSD:*:*)
        echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}


Index: pkgtools/pkg_install/files/add/perform.c
===================================================================
RCS file: /cvsroot/pkgsrc/pkgtools/pkg_install/files/add/perform.c,v
retrieving revision 1.106
diff -u -p -u -r1.106 perform.c
--- pkgtools/pkg_install/files/add/perform.c    30 Dec 2014 15:13:20
-0000      1.106
+++ pkgtools/pkg_install/files/add/perform.c    21 May 2015 15:54:01 -0000
@@ -916,7 +916,7 @@ check_platform(struct pkg_task *pkg)
        else
                fatal = 0;

-       if (fatal ||
+/*     if (fatal ||
            compatible_platform(OPSYS_NAME, host_uname.release,
                                pkg->buildinfo[BI_OS_VERSION]) != 1) {
                warnx("Warning: package `%s' was built for a platform:",
@@ -930,7 +930,7 @@ check_platform(struct pkg_task *pkg)
                    host_uname.release);
                if (!Force && fatal)
                        return -1;
-       }
+       } */
        return 0;
 }


Home | Main Index | Thread Index | Old Index