Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions g/gmpy2/build_info.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,21 @@
{
"maintainer": "Harithanagothu2",
"maintainer": "shivansh-ibm",
"package_name": "gmpy2",
"github_url": "https://github.com/aleaxit/gmpy.git",
"version": "gmpy2-2.1.2",
"version": "v2.3.1",
"wheel_build" : true,
"package_dir": "g/gmpy2",
"default_branch": "master",
"build_script": "gmpy2_ubi_9.3.sh",
"docker_build": false,
"validate_build_script": true,
"use_non_root_user": "false",
"v2.3.1": {
"build_script": [
"gmpy2_ubi_9.3.sh",
"gmpy2_ubi_10.2.sh"
]
},
"gmpy2-*.*.*": {
"build_script": "gmpy2_ubi_9.3.sh"
}
Expand Down
84 changes: 84 additions & 0 deletions g/gmpy2/gmpy2_ubi_10.2.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
#!/bin/bash -e
# -----------------------------------------------------------------------------
#
# Package : gmpy2
# Version : v2.3.1
# Source repo : https://github.com/aleaxit/gmpy.git
# Tested on : UBI:10.2
# Language : Python
# Ci-Check : True
# Script License : Apache License, Version 2 or later
# Maintainer : Shivansh Sharma <shivansh.s1@ibm.com>
#
# Disclaimer: This script has been tested in root mode on given
# ========== platform using the mentioned version of the package.
# It may not work as expected with newer versions of the
# package and/or distribution. In such case, please
# contact "Maintainer" of this script.
#
# -----------------------------------------------------------------------------

set -e

PACKAGE_NAME=gmpy2
PACKAGE_VERSION=${1:-v2.3.1}
PACKAGE_URL=https://github.com/aleaxit/gmpy.git
PACKAGE_DIR=gmpy
CURRENT_DIR=$(pwd)

# Install dependencies and tools.
yum install -y python3.14 python3.14-devel python3.14-pip \
wget gcc gcc-c++ gcc-gfortran git make openssl-devel \
gmp-devel mpfr-devel libmpc-devel \
gcc-toolset-15 gcc-toolset-15-gcc gcc-toolset-15-gcc-c++

if [[ -f /opt/rh/gcc-toolset-15/enable ]]; then
source /opt/rh/gcc-toolset-15/enable
elif [[ -d /opt/rh/gcc-toolset-15/root/usr/bin ]]; then
export PATH="/opt/rh/gcc-toolset-15/root/usr/bin:$PATH"
export LD_LIBRARY_PATH="/opt/rh/gcc-toolset-15/root/usr/lib64:$LD_LIBRARY_PATH"
else
echo "ERROR: gcc-toolset-15 not found"
exit 1
fi

echo "Using gcc: $(gcc --version | head -1)"

python3.14 -m pip install --upgrade pip 'setuptools<80' setuptools-scm wheel build
python3.14 -m pip install cython

# Clone repository
git clone "$PACKAGE_URL" "$PACKAGE_DIR"
cd "$PACKAGE_DIR"

if git rev-parse "${PACKAGE_VERSION}" &>/dev/null; then
git checkout "${PACKAGE_VERSION}"
elif git rev-parse "v${PACKAGE_VERSION}" &>/dev/null; then
git checkout "v${PACKAGE_VERSION}"
else
echo "ERROR: No git tag found for version '${PACKAGE_VERSION}'"
exit 1
fi

# Install
if ! python3.14 -m pip install --no-build-isolation .; then
echo "------------------$PACKAGE_NAME:Install_fails-------------------------------------"
echo "$PACKAGE_URL $PACKAGE_NAME"
echo "$PACKAGE_NAME | $PACKAGE_URL | $PACKAGE_VERSION | GitHub | Fail | Install_Fails"
exit 1
fi

python3.14 -m build --wheel --no-isolation --outdir="$CURRENT_DIR/"

#test
if ! python3 test_cython/runtests.py; then
echo "------------------$PACKAGE_NAME:Install_success_but_test_fails---------------------"
echo "$PACKAGE_URL $PACKAGE_NAME"
echo "$PACKAGE_NAME | $PACKAGE_URL | $PACKAGE_VERSION | GitHub | Fail | Install_success_but_test_Fails"
exit 2
else
echo "------------------$PACKAGE_NAME:Install_&_test_both_success-------------------------"
echo "$PACKAGE_URL $PACKAGE_NAME"
echo "$PACKAGE_NAME | $PACKAGE_URL | $PACKAGE_VERSION | GitHub | Pass | Both_Install_and_Test_Success"
exit 0
fi
Loading