Skip to content

Commit

Permalink
Build action.
Browse files Browse the repository at this point in the history
  • Loading branch information
ncruces committed Jul 8, 2024
1 parent 5ee59db commit e67639d
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 3 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#!/bin/bash

set -Eeuo pipefail

JVER=3.0.3
if [ ! -d "libjpeg-turbo-$JVER" ]; then
url="https://github.com/libjpeg-turbo/libjpeg-turbo/releases/download/$JVER/libjpeg-turbo-$JVER.tar.gz"
curl -#L "$url" | tar xz
fi

mkdir -p build_arm
pushd build_arm
cmake -G"Unix Makefiles" "../libjpeg-turbo-$JVER" \
-D"CMAKE_OSX_DEPLOYMENT_TARGET=11" \
-D"CMAKE_OSX_ARCHITECTURES=arm64"
make -j jpeg-static
cc -O3 -o dcraw ../dcraw.c -DNO_JASPER -DNO_LCMS \
-I. -I"../libjpeg-turbo-$JVER" libjpeg.a \
--target=arm64-apple-macos11
popd

mkdir -p build_x86
pushd build_x86
cmake -G"Unix Makefiles" "../libjpeg-turbo-$JVER" \
-D"CMAKE_OSX_DEPLOYMENT_TARGET=10.13" \
-D"CMAKE_OSX_ARCHITECTURES=x86_64"
make -j jpeg-static
cc -O3 -o dcraw ../dcraw.c -DNO_JASPER -DNO_LCMS \
-I. -I"../libjpeg-turbo-$JVER" libjpeg.a \
--target=x86_64-apple-macos10.13
popd

lipo -create -output dcraw build_arm/dcraw build_x86/dcraw

tar c dcraw | gzip -9 > dcraw.tgz
15 changes: 12 additions & 3 deletions .github/workflows/dist.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,17 @@ on:
jobs:

build:
runs-on: ubuntu-latest
runs-on: macos-latest

steps:
- name: Placeholder
run: true
- uses: actions/checkout@v4
- uses: ilammy/setup-nasm@v1

- name: Build artifact
run: .github/workflows/build.sh

- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: dcraw-macos.tgz
path: dcraw.tgz
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
build*/
libjpeg-turbo*/

0 comments on commit e67639d

Please sign in to comment.