aboutsummaryrefslogtreecommitdiff
path: root/release/scripts/make-pkg-package.sh
diff options
context:
space:
mode:
Diffstat (limited to 'release/scripts/make-pkg-package.sh')
-rwxr-xr-xrelease/scripts/make-pkg-package.sh41
1 files changed, 23 insertions, 18 deletions
diff --git a/release/scripts/make-pkg-package.sh b/release/scripts/make-pkg-package.sh
index 68172c47f326..3a1b163bd591 100755
--- a/release/scripts/make-pkg-package.sh
+++ b/release/scripts/make-pkg-package.sh
@@ -1,26 +1,31 @@
#!/bin/sh
-#
-#
-# Simulate the build environment.
-eval $(make -C ${SRCDIR} TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} buildenvvars)
+# Simulate the build environment. Note that we need to unset some variables
+# which are set in the src tree since they have different (unwanted) effects
+# in the ports tree.
+SRC_PKG_VERSION=${PKG_VERSION}
+PKG_ABI=$(${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)
+unset PKG_VERSION
+unset MAKEFLAGS
+unset PKGBASE
+# Ports interprets CROSS_TOOLCHAIN differently from src, and having this set
+# breaks the package-pkg build. For now, forcibly unset this and hope ports
+# can find a working compiler.
+if [ -n "$CROSS_TOOLCHAIN" ]; then
+ printf >&2 '%s: WARNING: CROSS_TOOLCHAIN will be ignored for the pkg build.\n' "$0"
+ unset CROSS_TOOLCHAIN
+fi
export WRKDIRPREFIX=/tmp/ports.${TARGET}
-export WSTAGEDIR=${WSTAGEDIR}
-export REPODIR=${REPODIR}
-export PKG_CMD=${PKG_CMD}
-export PKG_VERSION=${PKG_VERSION}
-export OSVERSION=${OSVERSION}
-export WRKDIR=$(make -C ${PORTSDIR}/ports-mgmt/pkg -V WRKDIR)
+export DISTDIR=/tmp/distfiles
+export WRKDIR=$(make -C ${PORTSDIR}/ports-mgmt/pkg I_DONT_CARE_IF_MY_BUILDS_TARGET_THE_WRONG_RELEASE=YES -V WRKDIR)
make -C ${PORTSDIR}/ports-mgmt/pkg TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \
- CONFIGURE_ARGS="--host=$(uname -m)-portbld-freebsd${REVISION}" \
- stage create-manifest
+ CONFIGURE_ARGS="--host=$(uname -m)-portbld-freebsd${REVISION} --prefix=${LOCALBASE}" \
+ I_DONT_CARE_IF_MY_BUILDS_TARGET_THE_WRONG_RELEASE=YES \
+ BATCH=YES stage create-manifest
-${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/bin/sh \
- create -v -m ${WRKDIR}/.metadir/ \
+${PKG_CMD} -o ABI=${PKG_ABI} \
+ create -v -m ${WRKDIR}/.metadir.pkg/ \
-r ${WRKDIR}/stage \
-p ${WRKDIR}/.PLIST.mktmp \
- -o ${REPODIR}/$(${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/${PKG_VERSION}
-mkdir -p ${REPODIR}/$(${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/${PKG_VERSION}/Latest/
-cd ${REPODIR}/$(${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/${PKG_VERSION}/Latest/ && \
- ln -s ../pkg-*.txz
+ -o ${REPODIR}/${PKG_ABI}/${SRC_PKG_VERSION}