Skip to content

Commit

Permalink
Merge pull request #340 from OpenChemistry/github-actions-upgrade-macos
Browse files Browse the repository at this point in the history
Upgrade macos version on GitHub Actions
  • Loading branch information
psavery authored Oct 19, 2022
2 parents a168b28 + ea71bb5 commit bd5d908
Show file tree
Hide file tree
Showing 8 changed files with 46 additions and 7 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
}
- {
name: 'MacOSX',
os: macos-10.15,
os: macos-11,
package: 'dmg',
generator: 'Unix Makefiles',
c: 'clang',
Expand Down Expand Up @@ -101,7 +101,7 @@ jobs:
if: ${{ matrix.config.name != 'Linux'}}
uses: jwlawson/[email protected]
with:
cmake-version: '3.15.7'
cmake-version: '3.19.0'

- name: Set compiler variables
run: |
Expand All @@ -122,7 +122,7 @@ jobs:
if: ${{ matrix.config.name == 'MacOSX'}}
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: '11.2.1'
xcode-version: '13.2.1'

- name: Setup configure, build and package commands
run: |
Expand Down
5 changes: 5 additions & 0 deletions cmake/scripts/fixup_bundle.apple.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,11 @@ def create_from_reference(cls, ref, loader):
for path in paths:
if os.path.exists(path):
return cls.create_from_path(path, parent=loader)
if ref.startswith('/System/Library/Frameworks/') or \
ref.startswith('/usr/lib/'):
# These files do not exist on-disk as of macOS 11. This is Apple
# magic and assumed to be a system library.
return None
search_path = loader._find_library(ref)
if os.path.exists(search_path):
return cls.create_from_path(search_path, parent=loader)
Expand Down
10 changes: 9 additions & 1 deletion projects/apple/numpy.cmake
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
set(numpy_platform_string "cp37-cp37m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64")

include(numpy.common)
add_external_project(numpy
DEPENDS python
CONFIGURE_COMMAND ""
INSTALL_COMMAND
${python_pip_executable} install -U pip
COMMAND ${python_pip_executable} install "numpy-1.16.3-${numpy_platform_string}.whl"
BUILD_IN_SOURCE 1
BUILD_COMMAND ""
)
3 changes: 1 addition & 2 deletions projects/cython.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ add_external_project(cython
BUILD_IN_SOURCE 1
INSTALL_COMMAND
${install_command_env}
${pv_python_executable} setup.py install
--prefix=<INSTALL_DIR>
${python_pip_executable} install .
${process_environment}
)
2 changes: 1 addition & 1 deletion projects/ffmpeg.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ add_external_project(
--disable-network
--disable-yasm
${shared_args}
--cc=${CMAKE_C_COMPILER}
# --cc=${CMAKE_C_COMPILER}
\"--extra-cflags=${cppflags}\"
\"--extra-ldflags=${ldflags}\"
${extra_commands}"
Expand Down
11 changes: 11 additions & 0 deletions projects/patches/python3.7/macos/configure.ac.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- configure.ac 2019-03-25 16:21:05.000000000 -0400
+++ configure.ac.new 2022-10-10 10:10:18.000000000 -0400
@@ -490,7 +490,7 @@
# has no effect, don't bother defining them
Darwin/@<:@6789@:>@.*)
define_xopen_source=no;;
- Darwin/1@<:@0-9@:>@.*)
+ Darwin/@<:@[12]@:>@@<:@0-9@:>@.*)
define_xopen_source=no;;
# On AIX 4 and 5.1, mbstate_t is defined only when _XOPEN_SOURCE == 500 but
# used in wcsnrtombs() and mbsnrtowcs() even if _XOPEN_SOURCE is not defined
11 changes: 11 additions & 0 deletions projects/patches/python3.7/macos/configure.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- configure 2019-03-25 16:21:05.000000000 -0400
+++ configure.new 2022-10-10 10:10:03.000000000 -0400
@@ -3387,7 +3387,7 @@
# has no effect, don't bother defining them
Darwin/[6789].*)
define_xopen_source=no;;
- Darwin/1[0-9].*)
+ Darwin/[12][0-9].*)
define_xopen_source=no;;
# On AIX 4 and 5.1, mbstate_t is defined only when _XOPEN_SOURCE == 500 but
# used in wcsnrtombs() and mbsnrtowcs() even if _XOPEN_SOURCE is not defined
5 changes: 5 additions & 0 deletions projects/python.cmake
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
set(_proc_env)
set(_patch_command)

if (APPLE)
list(APPEND _proc_env "MACOSX_DEPLOYMENT_TARGET" "10.9")
Expand All @@ -8,6 +9,9 @@ if (APPLE)
# be used and then we will get run time link errors when running on versions that
# don't actually have them defined ( such as 10.11 )
list(APPEND _proc_env "ac_cv_func_getentropy" "no" "ac_cv_func_clock_gettime" "no")

set(_patches_dir ${CMAKE_CURRENT_SOURCE_DIR}/projects/patches/python3.7/macos)
set(_patch_command patch <SOURCE_DIR>/configure ${_patches_dir}/configure.patch && patch <SOURCE_DIR>/configure.ac ${_patches_dir}/configure.ac.patch)
endif()

add_external_project_or_use_system(python
Expand All @@ -16,6 +20,7 @@ add_external_project_or_use_system(python
--prefix=<INSTALL_DIR>
--enable-unicode=ucs4
--enable-shared
PATCH_COMMAND ${_patch_command}
PROCESS_ENVIRONMENT ${_proc_env}
)
set (pv_python_executable "${install_location}/bin/python3" CACHE INTERNAL "" FORCE)
Expand Down

0 comments on commit bd5d908

Please sign in to comment.