From 1b7b3828412b560f750ad8c49c5b8d20d520c1bf Mon Sep 17 00:00:00 2001 From: Andy Fiddaman Date: Thu, 14 Nov 2024 00:28:35 +0000 Subject: [PATCH] Updates to pkg5 build following reshuffle --- build/pkg/build-arch-aarch64.sh | 59 +++++++++++++++++++++++++++------ build/pkg/build.sh | 12 ++++--- 2 files changed, 56 insertions(+), 15 deletions(-) diff --git a/build/pkg/build-arch-aarch64.sh b/build/pkg/build-arch-aarch64.sh index 1cad135231..1827eae11e 100755 --- a/build/pkg/build-arch-aarch64.sh +++ b/build/pkg/build-arch-aarch64.sh @@ -35,40 +35,79 @@ BUILDNUM=$RELVER : ${PKG_SOURCE_BRANCH:=r$RELVER} VER+="-$PKG_SOURCE_BRANCH" +MAKE=$USRBIN/dmake + clone_source() { clone_github_source pkg \ "$PKG_SOURCE_REPO" "$PKG_SOURCE_BRANCH" "$PKG5_CLONE" ((EXTRACT_MODE)) && exit } +pyvar() { + python -c "import sysconfig; print(sysconfig.get_config_var('$1'))" +} + build() { - CODE_WS=$TMPDIR/$BUILDDIR/pkg + export CODE_WS=$TMPDIR/$BUILDDIR/pkg pushd $CODE_WS/src > /dev/null || logerr "Cannot chdir" + # Run the CFFI build with native python to generate the source files + # that we'll later cross compile. We can't use FFI in the cross python + # environment. logmsg "--- generate CFFI source" - logcmd make cffi_src || logerr "Failed to build cffi_src" + logcmd $MAKE cffi_src || logerr "Failed to build cffi_src" versions=`grep '^PYVERSIONS' Makefile.com | tr -s ' ' | cut -d\ -f3-` for v in $versions; do note -n "Building python version $v" set_python_version $v python_cross_setup $ARCH + + export CC + export PYCFLAGS="-I`pyvar INCLUDEPY` `pyvar CFLAGS`" + export PYLDFLAGS="`pyvar SHLIBS`" + export PYVERSIONS=$v + export USEPY=$v + export MACH=$ARCH + export TRIPLET=aarch64-unknown-solaris2 + export TARGET=install + logmsg "--- build" - logcmd python setup.py install - logmsg "--- modules" - logcmd make -e \ - MACH=$ARCH \ + + logcmd $MAKE -e install-cmd \ + || logerr "make install-cmd failed" + + logcmd $MAKE -C modules -e install \ + || logerr "make install failed" + + logmsg "--- external modules" + + logcmd $MAKE -e \ REQUIREMENTS=requirements-aarch64.txt \ - TARGET=install modules/$PYTHONVER + extmodules/$PYTHONVER \ + || logerr "make extmodules failed" + + logmsg "--- FFI extensions" + + logcmd $MAKE -e \ + -C cffi_src/src/$v \ + -f $PWD/cffi_src/Makefile.crossext \ + install \ + || logerr "make ffi extensions failed" + python_cross_end done for d in po man svc web; do logmsg "--- running install in $d" - logcmd make -C $d -e install CODE_WS=$CODE_WS MACH=$ARCH \ - || logerr "Failed to install $d" + logcmd $MAKE -C $d -e install || logerr "Failed to install $d" done + logmsg "--- running install in util" + logcmd $MAKE -C util -e \ + SUBDIRS="misc publish/transforms" install \ + || logerr "Failed to install $d" + popd > /dev/null set_python_version $PYTHON3VER } @@ -76,7 +115,7 @@ build() { package() { pushd $TMPDIR/$BUILDDIR/pkg/src/pkg > /dev/null note -n "Packaging" - logcmd make publish-pkgs \ + logcmd $MAKE publish-pkgs \ BUILDNUM=$BUILDNUM \ PKGSEND_OPTS="" \ PKGPUBLISHER=$PKGPUBLISHER \ diff --git a/build/pkg/build.sh b/build/pkg/build.sh index 2296d162ff..e31c8c90b6 100755 --- a/build/pkg/build.sh +++ b/build/pkg/build.sh @@ -55,6 +55,9 @@ BUILD_DEPENDS_IPS=" text/intltool " +# We use the native illumos parallel make for this +MAKE=$USRBIN/dmake + # Respect environmental overrides for these to ease development. : ${PKG_SOURCE_REPO:=$OOCEGITHUB/pkg5} : ${PKG_SOURCE_BRANCH:=r$RELVER} @@ -71,18 +74,17 @@ clone_source() { build() { pushd $TMPDIR/$BUILDDIR/pkg/src > /dev/null || logerr "Cannot chdir" - logmsg "--- build" - logcmd make clean - logcmd make || logerr "make failed" + logmsg "--- clean" + logcmd $MAKE clean logmsg "--- install" - logcmd make install || logerr "install failed" + logcmd $MAKE install || logerr "install failed" popd > /dev/null } package() { pushd $TMPDIR/$BUILDDIR/pkg/src/pkg > /dev/null logmsg "--- packaging" - logcmd make check publish-pkgs \ + logcmd $MAKE check publish-pkgs \ BUILDNUM=$BUILDNUM \ PKGSEND_OPTS="" \ PKGPUBLISHER=$PKGPUBLISHER \