Skip to content

Commit

Permalink
macos: homebrew stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
igagis committed Apr 28, 2024
1 parent b87af55 commit 99b3a44
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 13 deletions.
29 changes: 18 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,25 +77,23 @@ jobs:
container: ${{ matrix.image_owner }}${{ matrix.os }}:${{ matrix.codename }}
name: linux - ${{ matrix.image_owner }}${{ matrix.os }}:${{ matrix.codename }}
steps:
- name: set TZ for ubuntu:focal
run: |
# configure timezone to avoid 'tzdata' package to require user interaction during installation (needed for ubuntu:focal)
TZ=Europe/Helsinki ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
- name: add cppfw deb repo
uses: myci-actions/add-deb-repo@master
with:
repo: deb https://gagis.hopto.org/repo/cppfw/${{ matrix.os }} ${{ matrix.codename }} main
repo-name: cppfw
keys-asc: https://gagis.hopto.org/repo/cppfw/pubkey.gpg
install: myci git
install: myci git devscripts equivs
- name: add llvm repo (for clang-format)
uses: myci-actions/add-deb-repo@master
with:
repo: deb https://apt.llvm.org/${{ matrix.codename }} llvm-toolchain-${{ matrix.codename }} main
repo-name: llvm
keys-asc: https://apt.llvm.org/llvm-snapshot.gpg.key
- name: install ci tools
run: |
# configure timezone to avoid 'tzdata' package to require user interaction during installation (needed for ubuntu:focal)
TZ=Europe/Helsinki ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
apt --quiet install --assume-yes devscripts equivs
- name: git clone
uses: myci-actions/checkout@master
- name: set PACKAGE_VERSION
Expand All @@ -110,7 +108,7 @@ jobs:
- name: deploy deb packages
run: |
echo "${{ secrets.MYCI_REPO_SSH_KEY }}" > repo_key_rsa && chmod 600 repo_key_rsa
myci-deploy-apt-ssh.sh --key repo_key_rsa --server gagis.hopto.org --repo cppfw/${{ matrix.os }} --distro ${{ matrix.codename }} --component main ../lib${PACKAGE_NAME}*_${PACKAGE_VERSION}_*.deb
myci-deploy-apt-ssh.sh --key repo_key_rsa --server gagis.hopto.org --repo cppfw/${{ matrix.os }} --distro ${{ matrix.codename }} --component main ../lib${PACKAGE_NAME}*_${PACKAGE_VERSION}_*.*deb
if: startsWith(github.ref, 'refs/tags/')
##### archlinux #####
archlinux:
Expand Down Expand Up @@ -185,13 +183,22 @@ jobs:
run: brew install myci make
- name: set PATH to use latest make
uses: myci-actions/export-env-var@master
with: {name: PATH, value: "/usr/local/opt/make/libexec/gnubin:$PATH"}
with: {name: PATH, value: "$HOMEBREW_PREFIX/opt/make/libexec/gnubin:$PATH"}
- name: set CFLAGS
uses: myci-actions/export-env-var@master
with: {name: CFLAGS, value: "-I $HOMEBREW_PREFIX/include $CFLAGS"}
- name: set CXXFLAGS
uses: myci-actions/export-env-var@master
with: {name: CXXFLAGS, value: "-I $HOMEBREW_PREFIX/include $CXXFLAGS"}
- name: set LDFLAGS
uses: myci-actions/export-env-var@master
with: {name: LDFLAGS, value: "-L $HOMEBREW_PREFIX/lib $LDFLAGS"}
- name: install deps
run: myci-brew-install.sh `myci-list-deps-homebrew.sh`
- name: build
run: make
run: make --include-dir=$(brew --prefix)/include
- name: test
run: make test
run: make --include-dir=$(brew --prefix)/include test
- name: deploy
run: myci-deploy-homebrew.sh --tap cppfw/tap
if: startsWith(github.ref, 'refs/tags/')
Expand Down
4 changes: 2 additions & 2 deletions homebrew/libopros.rb.in
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ class Libopros < Formula
# use gmake here because otherwise homebrew uses default Mac's make which is of too old version 3.81
def install
ENV['PATH'] += ':/usr/local/bin'
system "/usr/local/opt/make/libexec/gnubin/make", "install", "PREFIX=#{prefix}", "lint=off"
system "#{ENV['HOMEBREW_PREFIX']}/opt/make/libexec/gnubin/make", "--include-dir=#{ENV['HOMEBREW_PREFIX']}/include", "install", "PREFIX=#{prefix}", "lint=off"
end

test do
system "/usr/local/opt/make/libexec/gnubin/make", "test"
system "#{ENV['HOMEBREW_PREFIX']}/opt/make/libexec/gnubin/make", "--include-dir=#{ENV['HOMEBREW_PREFIX']}/include", "test"
end
end

0 comments on commit 99b3a44

Please sign in to comment.