Skip to content

Commit

Permalink
Helper script fix
Browse files Browse the repository at this point in the history
Signed-off-by: Alexis Jeandet <alexis.jeandet@member.fsf.org>
  • Loading branch information
jeandet committed Jun 2, 2024
1 parent 4d1f68c commit 1397d53
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 23 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/build_wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,7 @@ jobs:
pip install "aqtinstall"
&& aqt install-qt -O "${{ env.GITHUB_WORKSPACE }}/Qt" mac desktop ${{ env.PYSIDE_VERSION }}
CIBW_BEFORE_BUILD_LINUX: >
dnf install -y /usr/lib64/libxkbcommon.so.0 /usr/lib64/libxslt.so.1 clang
&& dnf remove -y /usr/bin/llvm-config
dnf install -y /usr/lib64/libxkbcommon.so.0 /usr/lib64/libxslt.so.1 clang /usr/bin/llvm-config
&& pip install "aqtinstall" && aqt install-qt -O "${{ env.GITHUB_WORKSPACE }}/Qt" linux desktop ${{ env.PYSIDE_VERSION }}
CIBW_REPAIR_WHEEL_COMMAND_LINUX: >
auditwheel repair -w {dest_dir} --exclude libpyside6.abi3.so.6.7 --exclude libshiboken6.abi3.so.6.7 --exclude libQt6Core.so.6 --exclude libQt6Widgets.so.6 --exclude libQt6Gui.so.6 --exclude libpyside6qml.abi3.so.6.7 --exclude libGLX.so.0 --exclude libOpenGL.so.0 --exclude libxcb.so.1 --only-plat --plat manylinux_2_28_x86_64 {wheel}
Expand Down
45 changes: 24 additions & 21 deletions SciQLopPlots/bindings/helper_scripts/shiboken-gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,27 +41,30 @@ def cpp_flags(build_dir, ref_build_target):
'--generator-set=shiboken']

if 'linux' in platform.system().lower():
if os.environ.get('AUDITWHEEL_PLAT', '') == 'manylinux_2_28_x86_64':
gcc_found = False
for v in reversed(range(11,14)):
prefix = f'/opt/rh/gcc-toolset-{v}/root/usr'
if os.path.exists(prefix):
shiboken_constant_args += [
f"-I/opt/rh/gcc-toolset-{v}/root/usr/lib/gcc/x86_64-redhat-linux/{v}/../../../../include/c++/{v}",
f"-I/opt/rh/gcc-toolset-{v}/root/usr/lib/gcc/x86_64-redhat-linux/{v}/../../../../include/c++/{v}/x86_64-redhat-linux",
f"-I/opt/rh/gcc-toolset-{v}/root/usr/lib/gcc/x86_64-redhat-linux/{v}/../../../../include/c++/{v}/backward",
f"-I/opt/rh/gcc-toolset-{v}/root/usr/lib/gcc/x86_64-redhat-linux/{v}/include",
f"-I/opt/rh/gcc-toolset-13/root/usr/include",
f"-I/usr/local/include",
f"-I/usr/include",
]
gcc_found = True
shiboken_constant_args += ['--compiler=g++']
break
llvm_dir = subprocess.run(['llvm-config', '--prefix'], check=True, stdout=subprocess.PIPE)
if llvm_dir.returncode == 0:
llvm_dir = llvm_dir.stdout.decode().strip()
env['LLVM_INSTALL_DIR'] = llvm_dir
#if os.environ.get('AUDITWHEEL_PLAT', '') == 'manylinux_2_28_x86_64':
# gcc_found = False
# for v in reversed(range(11,14)):
# prefix = f'/opt/rh/gcc-toolset-{v}/root/usr'
# if os.path.exists(prefix):
# shiboken_constant_args += [
# f"-I/opt/rh/gcc-toolset-{v}/root/usr/lib/gcc/x86_64-redhat-linux/{v}/../../../../include/c++/{v}",
# f"-I/opt/rh/gcc-toolset-{v}/root/usr/lib/gcc/x86_64-redhat-linux/{v}/../../../../include/c++/{v}/x86_64-redhat-linux",
# f"-I/opt/rh/gcc-toolset-{v}/root/usr/lib/gcc/x86_64-redhat-linux/{v}/../../../../include/c++/{v}/backward",
# f"-I/opt/rh/gcc-toolset-{v}/root/usr/lib/gcc/x86_64-redhat-linux/{v}/include",
# f"-I/opt/rh/gcc-toolset-13/root/usr/include",
# f"-I/usr/local/include",
# f"-I/usr/include",
# ]
# gcc_found = True
# shiboken_constant_args += ['--compiler=g++']
# break
try:
llvm_dir = subprocess.run(['llvm-config', '--prefix'], check=True, stdout=subprocess.PIPE)
if llvm_dir.returncode == 0:
llvm_dir = llvm_dir.stdout.decode().strip()
env['LLVM_INSTALL_DIR'] = llvm_dir
except FileNotFoundError:
pass

cmd = [args.shiboken, args.input_header, args.input_xml ] + shiboken_constant_args + cpp_flags(args.build_directory, args.ref_build_target) + [ f'--typesystem-paths={args.typesystem_paths}', f'--output-directory={args.output_directory}']

Expand Down

0 comments on commit 1397d53

Please sign in to comment.