Skip to content

Commit

Permalink
Merge pull request #3730 from citrus-it/pkg
Browse files Browse the repository at this point in the history
Updates to pkg5 build following reshuffle
  • Loading branch information
oetiker authored Nov 18, 2024
2 parents 88ca386 + 1b7b382 commit 5d5ebbc
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 15 deletions.
59 changes: 49 additions & 10 deletions build/pkg/build-arch-aarch64.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,48 +35,87 @@ 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
}

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 \
Expand Down
12 changes: 7 additions & 5 deletions build/pkg/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand All @@ -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 \
Expand Down

0 comments on commit 5d5ebbc

Please sign in to comment.