From 857fa082f992900e57a0b13e45d384e72d436700 Mon Sep 17 00:00:00 2001 From: Tejas Badjate Date: Tue, 1 Sep 2026 15:34:17 +0530 Subject: [PATCH] added script to support UBI 10.2 and Python3.14 support --- l/libclang/build_info.json | 33 +++++++------ l/libclang/libclang_ubi_10.2.sh | 86 +++++++++++++++++++++++++++++++++ 2 files changed, 104 insertions(+), 15 deletions(-) create mode 100644 l/libclang/libclang_ubi_10.2.sh diff --git a/l/libclang/build_info.json b/l/libclang/build_info.json index edf91aa106..5c0efb9b35 100644 --- a/l/libclang/build_info.json +++ b/l/libclang/build_info.json @@ -1,16 +1,19 @@ -{ - "maintainer": "vinodk99", - "package_name": "libclang", - "github_url": "https://github.com/sighingnow/libclang.git", - "version": "llvm-18.1.1", - "package_dir": "l/libclang", - "default_branch": "master", - "build_script": "libclang_ubi_9.3.sh", - "docker_build": false, - "validate_build_script": true, - "use_non_root_user": false, - "wheel_build" : true, - "*": { - "build_script": "libclang_ubi_9.3.sh" - } +{ + "maintainer": "tejasBadjateIBM", + "package_name": "libclang", + "github_url": "https://github.com/sighingnow/libclang.git", + "version": "llvm-18.1.1", + "package_dir": "l/libclang", + "default_branch": "master", + "build_script": "libclang_ubi_10.2.sh", + "docker_build": false, + "validate_build_script": true, + "use_non_root_user": false, + "wheel_build" : true, + "*": { + "build_script": [ + "libclang_ubi_9.3.sh", + "libclang_ubi_10.2.sh" + ] + } } \ No newline at end of file diff --git a/l/libclang/libclang_ubi_10.2.sh b/l/libclang/libclang_ubi_10.2.sh new file mode 100644 index 0000000000..09ccc896a1 --- /dev/null +++ b/l/libclang/libclang_ubi_10.2.sh @@ -0,0 +1,86 @@ +#!/bin/bash -e +# ----------------------------------------------------------------------------- +# +# Package : libclang +# Version : llvm-18.1.1 +# Source repo : https://github.com/sighingnow/libclang.git +# Tested on : UBI:10.2 +# Language : Python +# Ci-Check : True +# Script License : Apache License, Version 2 or later +# Maintainer : Tejas Badjate +# +# 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. +# +# --------------------------------------------------------------------------- + +# Variables +PACKAGE_NAME=libclang +PACKAGE_VERSION=${1:-llvm-18.1.1} +PACKAGE_URL=https://github.com/sighingnow/libclang.git +PACKAGE_DIR=libclang +CURRENT_DIR="${PWD}" + +# Install necessary system dependencies +yum install -y git make wget llvm-devel clang-devel openssl-devel bzip2-devel libffi-devel zlib-devel python3.14-devel python3.14-pip cmake clang + +yum install gcc-toolset-15 gcc-toolset-15-gcc gcc-toolset-15-gcc-c++ gcc-toolset-15-gcc-gfortran -y + +# --------------------------------------------------------------------------- +# Activate GCC Toolset 15 (SCL removed in UBI 10 — use PATH export) +# --------------------------------------------------------------------------- +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 + +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:-}" + +export CC="/opt/rh/gcc-toolset-15/root/usr/bin/gcc" +export CXX="/opt/rh/gcc-toolset-15/root/usr/bin/g++" + +# Clone the repository +git clone $PACKAGE_URL +cd $PACKAGE_NAME +git checkout $PACKAGE_VERSION + +# Check if Rust is installed +if ! command -v rustc &> /dev/null; then + echo "Rust not found. Installing Rust..." + curl https://sh.rustup.rs -sSf | sh -s -- -y + source "$HOME/.cargo/env" +else + echo "Rust is already installed." +fi + +# Install additional Python dependencies +python3.14 -m pip install pytest setuptools tox wheel + +# Install the package +if ! python3.14 -m pip install . ; 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 + +# Building wheel with script itself as the wheel need to create with ppc64le arch. +if ! python3.14 setup.py bdist_wheel --plat-name manylinux2014_ppc64le --dist-dir="$CURRENT_DIR"; then + echo "------------------$PACKAGE_NAME: Wheel Build Failed ---------------------" + exit 2 +else + echo "------------------$PACKAGE_NAME: Wheel Build Success -------------------------" + exit 0 +fi + +# No tests to run for this package \ No newline at end of file