From 99b3a448d6c94d62328ef16237b0919ec0e09e19 Mon Sep 17 00:00:00 2001 From: Ivan Gagis Date: Sun, 28 Apr 2024 22:04:38 +0300 Subject: [PATCH] macos: homebrew stuff --- .github/workflows/ci.yml | 29 ++++++++++++++++++----------- homebrew/libopros.rb.in | 4 ++-- 2 files changed, 20 insertions(+), 13 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e6631f2..7c5d3ee 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 @@ -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: @@ -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/') diff --git a/homebrew/libopros.rb.in b/homebrew/libopros.rb.in index 4913629..686f98a 100644 --- a/homebrew/libopros.rb.in +++ b/homebrew/libopros.rb.in @@ -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