Skip to content

Commit

Permalink
Turn on USE_3DCONNEXION for Windows and Mac builds (#1356)
Browse files Browse the repository at this point in the history
* Turn on USE_3DCONNEXION for Windows and Mac builds

* Update to also grab molecules and i18n repos
* Fix Windows error with OpenSSL
* Fixup both Mac and Ubuntu AppImage packages

Signed-off-by: Geoff Hutchison <[email protected]>
  • Loading branch information
ghutchis authored Sep 29, 2023
1 parent 1c213f3 commit 4a442c9
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 33 deletions.
36 changes: 26 additions & 10 deletions .github/workflows/build_cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ env:
# this is different from MACOSX_DEPLOYMENT_TARGET to prevent build problems
# we set MACOSX_DEPLOYMENT_TARGET later
MACOS_TARGET: 10.12
FEATURES: -DBUILD_GPL_PLUGINS=ON -DWITH_COORDGEN=OFF -DUSE_VTK=ON
FEATURES: -DBUILD_GPL_PLUGINS=ON -DWITH_COORDGEN=OFF -DUSE_VTK=ON -DUSE_3DCONNEXION=ON
CACHE: -DCMAKE_C_COMPILER_LAUNCHER=sccache -DCMAKE_CXX_COMPILER_LAUNCHER=sccache
SCCACHE_GHA_ENABLED: "true"

Expand Down Expand Up @@ -106,6 +106,18 @@ jobs:
repository: openchemistry/avogadroapp
path: avogadroapp

- name: Checkout molecules
uses: actions/checkout@v4
with:
repository: openchemistry/molecules
path: molecules

- name: Checkout i18n
uses: actions/checkout@v4
with:
repository: openchemistry/avogadro-i18n
path: avogadro-i18n

- name: Checkout avogadrolibs
uses: actions/checkout@v4
with:
Expand All @@ -122,7 +134,7 @@ jobs:
uses: jurplel/install-qt-action@v3
with:
cache: True
tools: 'tools_openssl_x64'
tools: 'tools_opensslv3_x64'
version: ${{ env.QT_VERSION }}
host: 'windows'
target: 'desktop'
Expand Down Expand Up @@ -181,6 +193,15 @@ jobs:
done
otool -L libinchi.?.?.?.dylib
cp -p libinchi* ../Avogadro2.app/Contents/Frameworks/
# finally, fixup the binaries
cd ../bin
for exe in obabel obmm eht_bind genXrdPattern; do
for libpath in `otool -L ${exe} | grep '/Users/runner/work' | awk '{print $1}'`; do
export lib=`echo $libpath | cut -d '/' -f 9`;
echo "Fixing $exe $lib $libpath"
install_name_tool -change $libpath @executable_path/../Frameworks/$lib $exe
done
done
- name: Run tests
if: matrix.config.os == 'ubuntu-20.04'
Expand Down Expand Up @@ -234,18 +255,18 @@ jobs:
fi # certificate exists
fi # password exists
- name: Pack
if: matrix.config.artifact != 0
- name: Create Mac and Windows Packages
if: matrix.config.os == 'windows-latest' || matrix.config.os == 'macos-latest'
shell: bash
run: |
if [ -z "${P12_PASSWORD}" ]; then
unset CODESIGN_IDENTITY # to prevent cpack failing when trying to sign
fi
cpack ${{ matrix.config.cpack_flags }}
working-directory: ${{ runner.workspace }}/build/avogadroapp
env:
P12_PASSWORD: ${{ secrets.P12_PASSWORD }}
CODESIGN_IDENTITY: ${{ secrets.CODESIGN_ID }}
working-directory: ${{ runner.workspace }}/build/avogadroapp

- name: AppImage
if: matrix.config.os == 'ubuntu-20.04' && matrix.config.build_type == 'Release'
Expand All @@ -263,16 +284,11 @@ jobs:
chmod a+x appdir/AppRun
./appimagetool-x86_64.AppImage appdir
mv Avogadro2*.AppImage avogadroapp # for upload
# remove the cpack files
rm avogadroapp/Avogadro2*Linux.*
working-directory: ${{ runner.workspace }}/build

- name: Notarize Mac DMG
if: runner.os == 'macOS'
run: |
# check current directory (failing signing)
echo `pwd`
ls -ld
# check if we have the password and the username
if [ -n "${NOTARIZE_PASSWORD}" ] && [ -n "${NOTARIZE_USERNAME}" ]; then
codesign -s "$CODESIGN_IDENTITY" --timestamp Avogadro2*.dmg
Expand Down
48 changes: 25 additions & 23 deletions .github/workflows/build_m1.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ env:
# this is different from MACOSX_DEPLOYMENT_TARGET to prevent build problems
# we set MACOSX_DEPLOYMENT_TARGET later
MACOS_TARGET: 10.12
FEATURES: -DUSE_VTK=ON -DBUILD_GPL_PLUGINS=ON -DWITH_COORDGEN=OFF
FEATURES: -DUSE_VTK=ON -DBUILD_GPL_PLUGINS=ON -DWITH_COORDGEN=OFF -DUSE_3DCONNEXION=ON

jobs:
build:
Expand Down Expand Up @@ -48,6 +48,12 @@ jobs:
repository: openchemistry/avogadroapp
path: avogadroapp

- name: Checkout molecules
uses: actions/checkout@v4
with:
repository: openchemistry/molecules
path: molecules

- name: Checkout avogadrolibs
uses: actions/checkout@v4
with:
Expand All @@ -59,19 +65,10 @@ jobs:
repository: openchemistry/avogadro-i18n
path: avogadro-i18n

- name: Grab cache files
uses: actions/cache@v3
with:
path: |
${{ runner.workspace }}/build/thirdparty
${{ runner.workspace }}/build/Downloads
key: ${{ matrix.config.name }}-thirdparty

- name: Configure
run: |
if [ ! -d "${{ runner.workspace }}/build" ]; then mkdir "${{ runner.workspace }}/build"; fi
cd "${{ runner.workspace }}/build"
# won't have any effect except on Mac
echo "MACOSX_DEPLOYMENT_TARGET=${{ env.MACOS_TARGET }}" >> $GITHUB_ENV
CC=${{matrix.config.cc}} CXX=${{matrix.config.cxx}} cmake $GITHUB_WORKSPACE ${{env.FEATURES}} -DCMAKE_BUILD_TYPE=${{matrix.config.build_type}} ${{matrix.config.cmake_flags}}
shell: bash
Expand All @@ -87,22 +84,32 @@ jobs:
working-directory: ${{ runner.workspace }}/build/prefix/lib/openbabel
run: |
for plugin in *.so; do
for libpath in `otool -L ${plugin} | grep '/Users/runner/work' | awk '{print $1}'`; do
export lib=`echo $libpath | cut -d '/' -f 9`;
for libpath in `otool -L ${plugin} | grep '/Users/runner' | awk '{print $1}'`; do
export lib=`echo $libpath | cut -d '/' -f 10`;
echo "Fixing $plugin $lib $libpath"
install_name_tool -change $libpath @executable_path/../Frameworks/$lib $plugin
done
done
cd .. # build/prefix/lib
for plugin in libinchi.?.?.?.dylib; do
for libpath in `otool -L ${plugin} | grep '/Users/runner/work' | awk '{print $1}'`; do
export lib=`echo $libpath | cut -d '/' -f 9`;
for libpath in `otool -L ${plugin} | grep '/Users/runner' | awk '{print $1}'`; do
export lib=`echo $libpath | cut -d '/' -f 10`;
echo "Fixing $plugin $lib $libpath"
install_name_tool -change $libpath @executable_path/../Frameworks/$lib $plugin
done
done
otool -L libinchi.?.?.?.dylib
cp -p libinchi* ../Avogadro2.app/Contents/Frameworks/
# finally, fixup the binaries
cd ../bin
for exe in obabel obmm eht_bind genXrdPattern; do
for libpath in `otool -L ${exe} | grep '/Users/runner' | awk '{print $1}'`; do
export lib=`echo $libpath | cut -d '/' -f 10`;
echo "Fixing $exe $lib $libpath"
install_name_tool -change $libpath @executable_path/../Frameworks/$lib $exe
done
done
- name: Install the Apple certificate
# From GitHub docs: https://docs.github.com/en/actions/guides/installing-an-apple-certificate-on-macos-runners-for-xcode-development
Expand Down Expand Up @@ -139,39 +146,34 @@ jobs:
fi # certificate exists
fi # password exists
- name: Pack
if: matrix.config.artifact != 0
- name: Create Mac and Windows Packages
shell: bash
run: |
if [ -z "${P12_PASSWORD}" ]; then
unset CODESIGN_IDENTITY # to prevent cpack failing when trying to sign
fi
cpack ${{ matrix.config.cpack_flags }}
working-directory: ${{ runner.workspace }}/build/avogadroapp
env:
P12_PASSWORD: ${{ secrets.P12_PASSWORD }}
CODESIGN_IDENTITY: ${{ secrets.CODESIGN_ID }}
working-directory: ${{ runner.workspace }}/build/avogadroapp

- name: Notarize Mac DMG
if: runner.os == 'macOS'
run: |
pwd
ls -l
# check if we have the password and the username
if [ -n "${NOTARIZE_PASSWORD}" ] && [ -n "${NOTARIZE_USERNAME}" ]; then
echo "codesign DMG"
codesign -s "$CODESIGN_IDENTITY" --timestamp Avogadro2*.dmg
echo "notarizing"
xcrun notarytool submit Avogadro2*.dmg --apple-id "$NOTARIZE_USERNAME" --team-id "$NOTARIZE_TEAM" --password "$NOTARIZE_PASSWORD" --verbose --wait
xcrun stapler staple -v Avogadro2*.dmg
fi
working-directory: ${{ runner.workspace }}/build/avogadroapp
env:
NOTARIZE_TEAM: ${{ secrets.AC_TEAM }}
NOTARIZE_USERNAME: ${{ secrets.AC_USERNAME }}
NOTARIZE_PASSWORD: ${{ secrets.AC_PASSWORD }}
CODESIGN_IDENTITY: ${{ secrets.CODESIGN_ID }}
NOTARIZE_TEAM: ${{ secrets.AC_TEAM }}
continue-on-error: true
working-directory: ${{ runner.workspace }}/build/avogadroapp

- name: Upload
if: matrix.config.artifact != 0
Expand Down

0 comments on commit 4a442c9

Please sign in to comment.