From 65d0d212d4ee067db13d943e2fa2e22d8c5cc0d6 Mon Sep 17 00:00:00 2001 From: shivansh-ibm Date: Sun, 9 Aug 2026 21:18:53 -0700 Subject: [PATCH] Added build script for libclang==18.1.1 for UBI 10.1 --- l/libclang/build_info.json | 9 +++-- l/libclang/libclang_ubi_10.1.sh | 69 +++++++++++++++++++++++++++++++++ 2 files changed, 75 insertions(+), 3 deletions(-) create mode 100644 l/libclang/libclang_ubi_10.1.sh diff --git a/l/libclang/build_info.json b/l/libclang/build_info.json index edf91aa106..5e0f9a2173 100644 --- a/l/libclang/build_info.json +++ b/l/libclang/build_info.json @@ -1,5 +1,5 @@ { - "maintainer": "vinodk99", + "maintainer": "shivansh-ibm", "package_name": "libclang", "github_url": "https://github.com/sighingnow/libclang.git", "version": "llvm-18.1.1", @@ -11,6 +11,9 @@ "use_non_root_user": false, "wheel_build" : true, "*": { - "build_script": "libclang_ubi_9.3.sh" + "build_script": [ + "libclang_ubi_9.3.sh", + "libclang_ubi_10.1.sh" + ] } -} \ No newline at end of file +} diff --git a/l/libclang/libclang_ubi_10.1.sh b/l/libclang/libclang_ubi_10.1.sh new file mode 100644 index 0000000000..9cc3775a4a --- /dev/null +++ b/l/libclang/libclang_ubi_10.1.sh @@ -0,0 +1,69 @@ +#!/bin/bash -e +# ----------------------------------------------------------------------------- +# +# Package : libclang +# Version : llvm-18.1.1 +# Source repo : https://github.com/sighingnow/libclang.git +# Tested on : UBI:10.1 +# 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. +# +# --------------------------------------------------------------------------- + +# 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 gcc-toolset-15-gcc gcc-toolset-15-gcc-c++ gcc-toolset-15-gcc-gfortran make wget llvm-devel clang-devel openssl-devel bzip2-devel libffi-devel zlib-devel python3.12-devel python3.12-pip cmake clang + +source /opt/rh/gcc-toolset-15/enable +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 + +# 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.12 -m pip install pytest setuptools tox wheel + +# Install the package +if ! python3.12 -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.12 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