pkgsrc-Users archive

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

Re: digest not found after installing (cross-compiling)



I got a little further along on this. It appears that the logic is
different when installing packages vs dependency resolution. When
dependencies are being checked, the type of package is used to
determine if it should look in HOST_PKG_DBDIR or PKD_DBDIR. This
differs from the package installation logic where all packages are
placed in PKG_DBDIR

Here is what is happening in mk/pkgformat/pkg/depends.mk

case $$type in                                                  \
        bootstrap|tool)                                                 \
                if expr "${USE_CROSS_COMPILE:Uno}" : '[yY][eE][sS]'
>/dev/null; then \
                        extradep="";                                    \
                else                                                    \
                        extradep=" ${PKGNAME}";                         \
                fi;                                                     \
                cross=no;                                               \
                archopt=TARGET_ARCH=${MACHINE_ARCH};                    \
                pkg=`${_HOST_PKG_BEST_EXISTS} "$$pattern" || ${TRUE}`;  \
                ;;                                                      \
        build|full)                                                     \
                extradep=" ${PKGNAME}";                                 \
                cross=${USE_CROSS_COMPILE:Uno};                         \
                archopt=;                                               \
                pkg=`${_PKG_BEST_EXISTS} "$$pattern" || ${TRUE}`;       \
                ;;                                                      \
        esac;

And here is what is happening in mk/pkgformat/pkg/install.mk

_pkgformat-register: .PHONY _pkgformat-generate-metadata ${_RDEPENDS_FILE}
        @${STEP_MSG} "Registering installation for ${PKGNAME}"
        ${RUN}${RM} -fr ${_PKG_DBDIR}/${PKGNAME}
        ${RUN}${MKDIR} ${_PKG_DBDIR}/${PKGNAME}
        ${RUN}${CP} ${PKG_DB_TMPDIR}/* ${_PKG_DBDIR}/${PKGNAME}
        ${RUN}${PKG_ADMIN} add ${PKGNAME}
        ${RUN}



On Fri, Nov 3, 2017 at 10:32 PM, Justin Schneck
<schneck.justin%gmail.com@localhost> wrote:
> I am trying to cross compile pkgsrc packages using an external
> toolchain but I am encountering some errors when it first attempts to
> build a patched libtool. The error I am getting is
>
> ===> Install binary package of digest-20121220
> /usr/pkg/sbin/pkg_add -K
> /opt/toolchain/arm-unknown-linux-gnueabihf/sysroot/var/db/pkg -m arm
> -I -p /opt/toolchain/arm-unknown-linux-gnueabihf/sysroot/usr/pkg
> /usr/pkgsrc/pkgtools/digest/work/.packages/digest-20121220.tgz
> Fixing recorded cwd...
> + /bin/sed -e s|@cwd
> /opt/toolchain/arm-unknown-linux-gnueabihf/sysroot|@cwd |
> /opt/toolchain/arm-unknown-linux-gnueabihf/sysroot/var/db/pkg/digest-20121220/+CONTENTS
> + /usr/pkg/sbin/pkg_info -K /var/db/pkg -E digest>=20010302
> + true
> + pkg=
> + echo ERROR: [depends.mk] A package matching ``digest>=20010302'' should
> ERROR: [depends.mk] A package matching ``digest>=20010302'' should
> + echo ERROR: be installed, but one cannot be found. Perhaps there is a
> ERROR: be installed, but one cannot be found. Perhaps there is a
> + echo ERROR: stale work directory for ../../pkgtools/digest?
> ERROR: stale work directory for ../../pkgtools/digest?
> + exit 1
> *** Error code 1
> Stop.
> bmake: stopped in /usr/pkgsrc/cross/libtool-base
>
> It appears to install the package and clean up the work directory but
> it stops here when trying to satisfy the dependency for digest.
>
> Here is my mk.conf
>
> MAKE_JOBS=              8
>
> .ifdef BSD_PKG_MK       # begin pkgsrc settings
>
> PKG_DBDIR=              /var/db/pkg
> LOCALBASE=              /usr/pkg
> VARBASE=                /var
> PKG_TOOLS_BIN=          /usr/pkg/sbin
> PKGINFODIR=             info
> PKGMANDIR=              man
>
> .endif                  # end pkgsrc settings
>
> USE_CROSS_COMPILE=      yes
>
> .if defined(USE_CROSS_COMPILE) && !empty(USE_CROSS_COMPILE:M[yY][eE][sS])
> USE_DESTDIR=            yes
> DEPENDS_TARGET=         package-install
>
> CROSS_DESTDIR=          /opt/toolchain/arm-unknown-linux-gnueabihf/sysroot
>
> TARGET_ARCH=            arm
> MACHINE_ARCH=           arm
> MACHINE_PLATFORM=       Linux-arm
> MACHINE_GNU_PLATFORM=   arm-unknown-linux-gnueabihf
>
> PACKAGES=${PKGSRCDIR}/packages.${MACHINE_ARCH}
> WRKDIR_BASENAME=  work.${MACHINE_ARCH}
>
> PKGSRC_COMPILER=        gcc
> USE_PKGSRC_GCC=         no
> USE_NATIVE_GCC=         yes
> INSTALL_UNSTRIPPED=     yes
>
> CC=/opt/toolchain/bin/arm-unknown-linux-gnueabihf-gcc
> CPP=/opt/toolchain/bin/arm-unknown-linux-gnueabihf-g++
> CFLAGS=-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE
> -D_FILE_OFFSET_BITS=64  -pipe -Os -I/opt/system/staging/usr/include
> CXXFLAGS=-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE
> -D_FILE_OFFSET_BITS=64  -pipe -Os -I/opt/system/staging/usr/include
> LDFLAGS=--sysroot=/opt/system/staging
> STRIP=/opt/toolchain/bin/arm-unknown-linux-gnueabihf-strip
>
> .endif                  # end cross-compilation settings


Home | Main Index | Thread Index | Old Index