Skip to content

Commit

Permalink
fix homebrew packaging
Browse files Browse the repository at this point in the history
  • Loading branch information
igagis committed May 6, 2024
1 parent d7b7429 commit 3e82e5a
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 13 deletions.
27 changes: 17 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,25 +75,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 install --assume-yes devscripts equivs
- name: git clone
uses: myci-actions/checkout@master
- name: set PACKAGE_VERSION
Expand Down Expand Up @@ -139,13 +137,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: "-isystem $HOMEBREW_PREFIX/include $CFLAGS"}
- name: set CXXFLAGS
uses: myci-actions/export-env-var@master
with: {name: CXXFLAGS, value: "-isystem $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
6 changes: 3 additions & 3 deletions homebrew/ruisapp.rb.in
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ class Ruisapp < 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}"
ENV['PATH'] += ":#{ENV['HOMEBREW_PREFIX']}/bin"
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 3e82e5a

Please sign in to comment.