Skip to content

Commit

Permalink
darwin workaround for python3
Browse files Browse the repository at this point in the history
  • Loading branch information
thehajime committed Jul 11, 2024
1 parent d6a8a7e commit c086e3f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,8 @@ jobs:
CC: ${{ matrix.cc }}
CXX: ${{ matrix.cxx }}
RUMPRUN_TOOLCHAIN_TUPLE: ${{ matrix.rumprun_tuple }}
C_INCLUDE_PATH: /Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/Headers
CPLUS_INCLUDE_PATH: /Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/Headers

defaults:
run:
Expand Down Expand Up @@ -162,7 +164,7 @@ jobs:
if: runner.os == 'macos'
run: |
mkdir -p ~/.local/bin
brew install gnu-sed ccache e2fsprogs
brew install gnu-sed ccache e2fsprogs gawk
brew install binutils coreutils automake
ln -sf /usr/local/bin/gsed ~/.local/bin/sed
ln -sf /usr/local/bin/gdate ~/.local/bin/date
Expand All @@ -171,6 +173,7 @@ jobs:
# we didn't use gcp as CoW of coreutil 9.0 breaks somehow
#ln -sf /usr/local/opt/coreutils/bin/gcp ~/.local/bin/cp
ln -sf /usr/local/opt/binutils/bin/objcopy ~/.local/bin/objcopy
ln -sf /usr/local/bin/gawk ~/.local/bin/awk
- name: ccache counter reset
run: ccache -z
Expand Down
5 changes: 4 additions & 1 deletion python3/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,10 @@ dl/$(TARBALL):
build/hostpython: | dl/$(TARBALL)
mkdir -p build
(cd build && tar -x --strip-components 1 -f ../dl/$(TARBALL))
(cd build; CFLAGS=$(HOST_CFLAGS) ./configure --prefix=$(shell pwd)/build/hostdist; make python Parser/pgen && make install)
ifeq ($(shell uname),Darwin)
(cd build && sed "s/^MULTIARCH.*//" configure > /tmp/a; mv /tmp/a configure; chmod +x configure)
endif
(cd build; CFLAGS=$(HOST_CFLAGS) ./configure --prefix=$(shell pwd)/build/hostdist; CFLAGS=-IInclude make python Parser/pgen && make install)
mv build/python$(EXESUFFIX) build/hostpython

build/Parser/hostpgen: build/hostpython
Expand Down

0 comments on commit c086e3f

Please sign in to comment.