1+ #! /bin/bash
2+ set -e
3+
4+ brew install
[email protected] || true 5+ brew link --overwrite
[email protected] 6+ # brew update
7+ # rm -rf /usr/local/bin/python3.1*-config /usr/local/bin/2to3-3.1* /usr/local/bin/idle3.1* /usr/local/bin/pydoc3.1* /usr/local/bin/python3.1*
8+ # rm -rf /usr/local/bin/python3-config /usr/local/bin/2to3 /usr/local/bin/idle3 /usr/local/bin/pydoc3 /usr/local/bin/python3
9+ brew install --force --verbose --overwrite \
10+ ccache \
11+ fftw \
12+ libomp \
13+ xquartz \
14+ xerces-c \
15+ wget || true
16+ brew uninstall --ignore-dependencies libxext
17+ brew uninstall --ignore-dependencies libx11
18+ export LDFLAGS=" -L/usr/local/opt/llvm/lib"
19+ export CPPFLAGS=" -I/usr/local/opt/llvm/include -fopenmp"
20+ conda info
21+ conda list
22+ which python
23+ python --version
24+ export PATH=" /usr/local/miniconda/envs/opengate_core/bin/:$PATH "
25+ pip install wget colored
26+ pip install wheel delocate
27+ if [[ ${{ matrix.os } } == " macos-15-intel" ]]; then
28+ conda install conda-forge::qt6-main conda-forge::qt6-3d
29+ else
30+ brew install qt
31+ fi
32+ mkdir -p $HOME /software
33+ if [ " ${{ steps.cache_opengate_core_dependencies.outputs.cache-hit } }" != ' true' ]; then
34+ cd $HOME /software
35+ mkdir geant4
36+ cd geant4
37+ mkdir src bin data
38+ git clone --branch $GEANT4_VERSION https://github.com/Geant4/geant4.git --depth 1 src
39+ cd bin
40+ cmake -DCMAKE_CXX_FLAGS=-std=c++17 \
41+ -DGEANT4_INSTALL_DATA=OFF \
42+ -DGEANT4_INSTALL_DATADIR=$HOME /software/geant4/data \
43+ -DGEANT4_USE_QT=ON \
44+ -DGEANT4_USE_OPENGL_X11=OFF \
45+ -DGEANT4_USE_QT_QT6=ON \
46+ -DGEANT4_USE_SYSTEM_EXPAT=OFF \
47+ -DGEANT4_BUILD_MULTITHREADED=ON \
48+ -DGEANT4_USE_GDML=ON \
49+ ../src
50+ make -j4
51+ cd $HOME /software
52+ mkdir itk
53+ cd itk
54+ mkdir src bin
55+ git clone --branch $ITK_VERSION https://github.com/InsightSoftwareConsortium/ITK.git --depth 1 src
56+ cd bin
57+ cmake -DCMAKE_CXX_FLAGS=-std=c++17 \
58+ -DBUILD_TESTING=OFF \
59+ -DITK_USE_FFTWD=ON \
60+ -DITK_USE_FFTWF=ON \
61+ -DITK_USE_SYSTEM_FFTW:BOOL=ON \
62+ ../src
63+ make -j4
64+ fi
65+ cd $GITHUB_WORKSPACE
66+ source $HOME /software/geant4/bin/geant4make.sh
67+ export CMAKE_PREFIX_PATH=$HOME /software/geant4/bin:$HOME /software/itk/bin/:${CMAKE_PREFIX_PATH}
68+ cd core
69+ mkdir opengate_core/plugins
70+ if [[ ${{ matrix.os } } == " macos-15-intel" ]]; then
71+ cp -r /Users/runner/miniconda3/envs/opengate_core/lib/qt6/plugins/platforms/* opengate_core/plugins/
72+ cp -r /Users/runner/miniconda3/envs/opengate_core/lib/qt6/plugins/imageformats opengate_core/plugins/
73+ else
74+ cp -r /opt/homebrew/share/qt/plugins/platforms/* opengate_core/plugins/
75+ cp -r /opt/homebrew/share/qt/plugins/imageformats/* opengate_core/plugins/
76+ fi
77+ python3 setup.py sdist bdist_wheel
78+ ls dist
79+ if [[ ${{ matrix.os } } == " macos-15-intel" ]]; then
80+ export DYLD_LIBRARY_PATH=$HOME /software/geant4/bin/BuildProducts/lib:/Users/runner/miniconda3/envs/opengate_core/lib/qt6/plugins/platforms:/opt/X11/lib/:$DYLD_LIBRARY_PATH :/Users/runner/miniconda3/envs/opengate_core/lib
81+ else
82+ export DYLD_LIBRARY_PATH=$HOME /software/geant4/bin/BuildProducts/lib:/opt/homebrew/share/qt/plugins/platforms/:/opt/X11/lib/:$DYLD_LIBRARY_PATH :/opt/homebrew/lib
83+ python -c " import os,delocate; print(os.path.join(os.path.dirname(delocate.__file__), 'tools.py'));quit()" | xargs -I{} sed -i." " " s/first, /input.pop('i386',None); first, /g" {}
84+ fi
85+ delocate-listdeps --all dist/* .whl
86+ delocate-wheel -w fixed_wheels -v dist/* .whl
87+ rm -rf dist
88+ ls fixed_wheels
89+ delocate-listdeps --all fixed_wheels/* .whl
90+ mv fixed_wheels dist
91+ cd dist
92+ if [[ ${{ matrix.os } } == " macos-15-intel" ]]; then
93+ find . -name ' *whl' -exec bash -c ' mv $0 ${0/macosx_15_0/macosx_10_9}' {} \;
94+ fi
95+ cd ../..
96+ mv core/dist .
0 commit comments