From e69b75381a992fef22a0854b8dc71bdfe721f8a3 Mon Sep 17 00:00:00 2001 From: shivansh-ibm Date: Tue, 4 Aug 2026 11:30:24 -0700 Subject: [PATCH] Added build script for gmpy2==2.2.1 for UBI:10.2 Update build script for python3.14 --- g/gmpy2/build_info.json | 10 ++++- g/gmpy2/gmpy2_ubi_10.2.sh | 84 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 92 insertions(+), 2 deletions(-) create mode 100644 g/gmpy2/gmpy2_ubi_10.2.sh diff --git a/g/gmpy2/build_info.json b/g/gmpy2/build_info.json index 6c5e118078..eff851e4cb 100644 --- a/g/gmpy2/build_info.json +++ b/g/gmpy2/build_info.json @@ -1,8 +1,8 @@ { - "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", @@ -10,6 +10,12 @@ "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" } diff --git a/g/gmpy2/gmpy2_ubi_10.2.sh b/g/gmpy2/gmpy2_ubi_10.2.sh new file mode 100644 index 0000000000..e12001c3f5 --- /dev/null +++ b/g/gmpy2/gmpy2_ubi_10.2.sh @@ -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 +# +# 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 \ No newline at end of file