Skip to content

Commit

Permalink
fixing macos workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
styler00dollar committed Dec 25, 2023
1 parent 8a9832c commit 8289126
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 74 deletions.
47 changes: 11 additions & 36 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
- name: Install meson
run: |
python -m pip install --upgrade pip
pip install meson
pip install meson -U
- name: Install ninja
run: sudo apt-get install ninja-build
Expand Down Expand Up @@ -81,8 +81,8 @@ jobs:
- name: Install automake
run: |
brew update
brew install automake
brew install automake ninja llvm libomp pkg-config molten-vk vulkan-headers ncnn
- name: Setup Python
uses: actions/setup-python@v3
with:
Expand All @@ -91,49 +91,24 @@ jobs:
- name: Install meson
run: |
python -m pip install --upgrade pip
pip install meson
- name: Install ninja
run: brew install ninja
pip install meson -U
- name: Install zimg
run: brew install zimg
run: git clone https://github.com/sekrit-twc/zimg --depth 1 --recurse-submodules --shallow-submodules && cd zimg && CC=clang CXX=clang++ ./autogen.sh && CC=clang CXX=clang++ CFLAGS=-fPIC CXXFLAGS=-fPIC ./configure --enable-static --disable-shared && CC=clang CXX=clang++ make -j$(nproc) && sudo make install

- name: Install VapourSynth
run: |
git clone https://github.com/vapoursynth/vapoursynth --depth 1
pushd vapoursynth
./autogen.sh
./configure --disable-static --disable-x86-asm --disable-vsscript --disable-vspipe --disable-python-module
make -j3
CC=clang CXX=clang++ ./autogen.sh
CC=clang CXX=clang++ ./configure --disable-static --disable-x86-asm --disable-vsscript --disable-vspipe --disable-python-module
CC=clang CXX=clang++ make -j3
sudo make install -j3
popd
rm -rf vapoursynth
- name: Cache Vulkan SDK
id: cache-vulkansdk
uses: actions/cache@v3
with:
path: vulkansdk-macos-1.2.170.0
key: vulkansdk-macos-1.2.170.0

- name: Install Vulkan SDK
if: steps.cache-vulkansdk.outputs.cache-hit != 'true'
run: |
wget https://sdk.lunarg.com/sdk/download/1.2.170.0/mac/vulkansdk-macos-1.2.170.0.dmg
hdiutil attach vulkansdk-macos-1.2.170.0.dmg
cp -r /Volumes/vulkansdk-macos-1.2.170.0 .
rm -rf vulkansdk-macos-1.2.170.0/Applications
find vulkansdk-macos-1.2.170.0 -type f | grep -v -E 'vulkan|glslang|MoltenVK' | xargs rm
hdiutil detach /Volumes/vulkansdk-macos-1.2.170.0
- name: Set VULKAN_SDK
run: echo "VULKAN_SDK=$GITHUB_WORKSPACE/vulkansdk-macos-1.2.170.0/macOS" >> $GITHUB_ENV

- name: Install ncnn
run: brew install ncnn

- name: Build
run: |
meson build -Dcpp_args=-I$VULKAN_SDK/include -Dcpp_link_args=-L/usr/local/lib -Duse_system_ncnn=true
ninja -C build
git submodule update --init --recursive --depth 1
PKG_CONFIG_PATH="$PWD/pkgconfig/" CC=clang CXX=clang++ meson build
CC=clang CXX=clang++ ninja -C build
46 changes: 10 additions & 36 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,8 @@ jobs:
- name: Install automake
run: |
brew update
brew install automake
brew install automake ninja llvm libomp pkg-config molten-vk vulkan-headers ncnn
- name: Setup Python
uses: actions/setup-python@v3
with:
Expand All @@ -131,55 +132,28 @@ jobs:
- name: Install meson
run: |
python -m pip install --upgrade pip
pip install meson
- name: Install ninja
run: brew install ninja
pip install meson -U
- name: Install zimg
run: brew install zimg

- name: reinstalling xcode
run: |
sudo rm -rf /Library/Developer/CommandLineTools
xcode-select --install
run: git clone https://github.com/sekrit-twc/zimg --depth 1 --recurse-submodules --shallow-submodules && cd zimg && CC=clang CXX=clang++ ./autogen.sh && CC=clang CXX=clang++ CFLAGS=-fPIC CXXFLAGS=-fPIC ./configure --enable-static --disable-shared && CC=clang CXX=clang++ make -j$(nproc) && sudo make install

- name: Install VapourSynth
run: |
git clone https://github.com/vapoursynth/vapoursynth --depth 1
pushd vapoursynth
./autogen.sh
./configure --disable-static --disable-x86-asm --disable-vsscript --disable-vspipe --disable-python-module
make -j3
CC=clang CXX=clang++ ./autogen.sh
CC=clang CXX=clang++ ./configure --disable-static --disable-x86-asm --disable-vsscript --disable-vspipe --disable-python-module
CC=clang CXX=clang++ make -j3
sudo make install -j3
popd
rm -rf vapoursynth
- name: Cache Vulkan SDK
id: cache-vulkansdk
uses: actions/cache@v3
with:
path: vulkansdk-macos-1.2.170.0
key: vulkansdk-macos-1.2.170.0

- name: Install Vulkan SDK
if: steps.cache-vulkansdk.outputs.cache-hit != 'true'
run: |
wget https://sdk.lunarg.com/sdk/download/1.2.170.0/mac/vulkansdk-macos-1.2.170.0.dmg
hdiutil attach vulkansdk-macos-1.2.170.0.dmg
cp -r /Volumes/vulkansdk-macos-1.2.170.0 .
rm -rf vulkansdk-macos-1.2.170.0/Applications
find vulkansdk-macos-1.2.170.0 -type f | grep -v -E 'vulkan|glslang|MoltenVK' | xargs rm
hdiutil detach /Volumes/vulkansdk-macos-1.2.170.0
- name: Set VULKAN_SDK
run: echo "VULKAN_SDK=$GITHUB_WORKSPACE/vulkansdk-macos-1.2.170.0/macOS" >> $GITHUB_ENV

- name: Install ncnn
run: brew install ncnn
- name: Build
run: |
git submodule update --init --recursive --depth 1
meson build -Dcpp_args=-I$VULKAN_SDK/include -Dcpp_link_args=-L/usr/local/lib
ninja -C build
PKG_CONFIG_PATH="$PWD/pkgconfig/" CC=clang CXX=clang++ meson build
CC=clang CXX=clang++ ninja -C build
- name: Upload
uses: actions/upload-release-asset@v1
env:
Expand Down
13 changes: 11 additions & 2 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,19 @@ if get_option('buildtype') == 'release'
add_global_arguments(gcc_syntax ? ['-fno-math-errno', '-fno-trapping-math'] : '/GS-', language: 'cpp')
endif

omp_dep = 0
if meson.get_compiler('cpp').get_id() == 'clang'
omp_dep = declare_dependency(
compile_args : ['-Xpreprocessor', '-fopenmp']
)
else
omp_dep = dependency('openmp')
endif

deps = [
dependency('openmp'),
omp_dep,
dependency('threads'),
dependency('vulkan')
dependency('vulkan', required: false)
]

if gcc_syntax
Expand Down
7 changes: 7 additions & 0 deletions pkgconfig/vulkan-headers.pc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
prefix=/opt/homebrew/Cellar/vulkan-headers/1.3.268
includedir=${prefix}/include

Name: vulkan-headers
Description: Headers for Vulkan
Version: 1.3.268
Cflags: -I${includedir}
9 changes: 9 additions & 0 deletions pkgconfig/vulkan.pc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
prefix=/opt/homebrew/Cellar/molten-vk/1.2.6
libdir=${prefix}/lib
includedir=${prefix}/include

Name: libMoltenVK
Description: Vulkan Portability implementation
Version: 1.2.6
Libs: -L${libdir}
Cflags: -I${includedir}

0 comments on commit 8289126

Please sign in to comment.