Skip to content
This repository was archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
build/bin/sage-spkg: Handle *.whl packages
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthias Koeppe committed Aug 29, 2022
1 parent 8d90b56 commit 28f30ac
Showing 1 changed file with 24 additions and 14 deletions.
38 changes: 24 additions & 14 deletions build/bin/sage-spkg
Original file line number Diff line number Diff line change
Expand Up @@ -451,20 +451,30 @@ echo "Setting up build directory for $PKG_NAME"
cp -RLp "$PKG_SCRIPTS" "$PKG_NAME"
cd "$PKG_NAME" || exit $?

sage-uncompress-spkg -d src "$PKG_SRC"
if [ $? -ne 0 ]; then
error_msg "Error: failed to extract $PKG_SRC"
exit 1
fi

echo "Finished extraction"

cd src
if ! sage-apply-patches; then
error_msg "Error applying patches"
exit 1
fi
cd ..
case "$PKG_SRC" in
*.whl)
# (Non-platform) wheel. Do not extract, do not create a src directory,
# just copy to dist/ and create a simple install script.
mkdir -p dist
cp "$PKG_SRC" dist/
echo "sdh_store_and_pip_install_wheel ." > spkg-install.in
;;
*)
# Source tarball
sage-uncompress-spkg -d src "$PKG_SRC"
if [ $? -ne 0 ]; then
error_msg "Error: failed to extract $PKG_SRC"
exit 1
fi
echo "Finished extraction"
cd src
if ! sage-apply-patches; then
error_msg "Error applying patches"
exit 1
fi
cd ..
;;
esac

##################################################################
# The package has been extracted, prepare for installation
Expand Down

0 comments on commit 28f30ac

Please sign in to comment.