-
Notifications
You must be signed in to change notification settings - Fork 336
Added build script for utf8proc for python3.14 with ubi 10.2 #8726
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,115 @@ | ||
| #!/bin/bash -e | ||
| # ----------------------------------------------------------------------------- | ||
| # | ||
| # Package : utf8proc | ||
| # Version : 2.11.3 | ||
| # Source repo : https://github.com/JuliaStrings/utf8proc.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 the 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 a case, please | ||
| # contact the "Maintainer" of this script. | ||
| # | ||
| # ----------------------------------------------------------------------------- | ||
|
|
||
| # Exit immediately if a command exits with a non-zero status | ||
| set -e | ||
|
|
||
| # Variables | ||
| PACKAGE_NAME=utf8proc | ||
| PACKAGE_VERSION=${1:-v2.11.3} | ||
| PACKAGE_URL=https://github.com/JuliaStrings/utf8proc.git | ||
| PACKAGE_DIR=utf8proc | ||
| WORK_DIR=$(pwd) | ||
|
|
||
| # Install dependencies and tools | ||
| yum install -y wget git cmake python3.14-devel python3.14-pip | ||
| yum install gcc-toolset-15 gcc-toolset-15-gcc gcc-toolset-15-gcc-c++ -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++" | ||
|
|
||
| # Download the source package | ||
| echo "Cloning and installing..." | ||
| git clone $PACKAGE_URL | ||
| cd $PACKAGE_NAME | ||
|
|
||
| # Initialize git submodules | ||
| git submodule update --init | ||
|
|
||
| # Checkout the specified version | ||
| git checkout $PACKAGE_VERSION | ||
|
|
||
| # Setup prefix for installation | ||
| mkdir prefix | ||
| export PREFIX=$(pwd)/prefix | ||
|
|
||
| # Create build directory | ||
| mkdir build | ||
| cd build | ||
|
|
||
| # Run cmake to configure the build | ||
| cmake -G "Unix Makefiles" \ | ||
| -DCMAKE_BUILD_TYPE="Release" \ | ||
| -DCMAKE_INSTALL_PREFIX="${PREFIX}" \ | ||
| -DCMAKE_POSITION_INDEPENDENT_CODE=1 \ | ||
| -DBUILD_SHARED_LIBS=1 \ | ||
| .. | ||
| # Build and install | ||
| cmake --build . | ||
| cmake --build . --target install | ||
| cd .. | ||
| python3.14 -m pip install setuptools wheel | ||
| wget https://raw.githubusercontent.com/ppc64le/build-scripts/refs/heads/master/u/utf8proc/pyproject.toml | ||
| sed -i s/{PACKAGE_VERSION}/$PACKAGE_VERSION/g pyproject.toml | ||
| mkdir -p local/$PACKAGE_NAME | ||
| # Copy the installation files to the local directory | ||
| cp -r prefix/* local/$PACKAGE_NAME/ | ||
| echo "Building wheel..." | ||
| python3.14 -m pip wheel --wheel-dir ${WORK_DIR} -vv --no-build-isolation --no-deps . | ||
|
|
||
| # Install locally built wheel for validation | ||
|
|
||
| WHEEL=$(find "${WORK_DIR}" -name "${PACKAGE_NAME}-*.whl" | head -1) | ||
| echo "Built wheel: ${WHEEL}" | ||
|
|
||
| if ! python3.14 -m pip install "${WHEEL}" --no-deps; then | ||
| echo "------------------${PACKAGE}:Install_fails-------------------------------------" | ||
| echo "${PACKAGE} | ${PACKAGE_URL} | ${PACKAGE_VERSION} | GitHub | Fail | Install_Fails" | ||
| exit 1 | ||
| fi | ||
| SITE_PACKAGES=$(python3.14 -m pip show utf8proc | awk -F': ' '/^Location:/ {print $2}') | ||
|
rashmi-ibm marked this conversation as resolved.
|
||
| test -f "${SITE_PACKAGES}/utf8proc/include/utf8proc.h" || { | ||
| echo "ERROR: utf8proc.h not found" | ||
| exit 1 | ||
| } | ||
| test -f "${SITE_PACKAGES}/utf8proc/lib64/libutf8proc.so" || { | ||
| echo "ERROR: libutf8proc.so not found" | ||
| exit 1 | ||
| } | ||
|
|
||
|
|
||
| echo "Build and installation completed successfully." | ||
| echo "There are no test cases available. Manually tested and skipping the test cases." | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please raise a separate PR to add the path first in
pyproject.toml? Once that PR is merged, please trigger a GHA build here.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah , that is how it should be done but for now , i have locally verified the updated pyproject.toml is working as expected .