Skip to content

Commit

Permalink
Merge pull request #39 from fasmat/fix-36
Browse files Browse the repository at this point in the history
Fix borgbackup unable to find packaging dependency
  • Loading branch information
ThomasWaldmann authored Nov 12, 2024
2 parents cc4929c + e94839c commit 806bd6f
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 28 deletions.
66 changes: 50 additions & 16 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,34 +1,68 @@
on: [push, pull_request]
on:
# Allow manually triggering this workflow
workflow_dispatch:
# run for all pull requests and pushes to certain branches
pull_request:
push:
branches:
- master

jobs:
test:
name: Test Homebrew install
runs-on: macos-latest
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
os:
- macos-13
- macos-14
timeout-minutes: 15

steps:
- name: Checkout
uses: actions/checkout@v1
- name: Set up Homebrew
id: set-up-homebrew
uses: Homebrew/actions/setup-homebrew@master
with:
test-bot: false

- name: Cache Homebrew Gems
id: cache
uses: actions/cache@v4
with:
path: ${{ steps.set-up-homebrew.outputs.gems-path }}
key: ${{ matrix.os }}-rubygems-${{ steps.set-up-homebrew.outputs.gems-hash }}
restore-keys: ${{ matrix.os }}-rubygems-

- name: Install Homebrew Gems
id: gems
run: brew install-bundler-gems
if: steps.cache.outputs.cache-hit != 'true'

- name: Install macFUSE
run: brew install --cask macfuse

# - name: Debug
# uses: mxschmitt/action-tmate@v3

- name: Test formula
working-directory: ./Formula
env:
HOMEBREW_NO_INSTALL_FROM_API: 1
run: |
# brew audit --strict borgbackup-fuse.rb
brew install borgbackup-fuse.rb
brew test borgbackup-fuse.rb
brew install borgbackup-fuse
brew test borgbackup-fuse
brew style borgbackup-fuse
brew audit --online --strict borgbackup-fuse
brew uninstall borgbackup-fuse
# Step is disabled because it times out on GH hosted runners
# bacause of a macOS security prompt - can only be done on
# selfhosted runners
- name: Test mount command
if: vars.TESTMOUNT
run: |
borg init -e none test-repo
borg create test-repo::test-archive Formula
# Will timeout due to macOS security prompt
# mkdir mnt
# borg mount test-repo::test-archive mnt
# ls mnt/Formula
mkdir mnt
borg mount test-repo::test-archive mnt
ls mnt/Formula
18 changes: 9 additions & 9 deletions Formula/borgbackup-fuse.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,26 +46,25 @@ class BorgbackupFuse < Formula
depends_on "libb2"
depends_on "lz4"
depends_on "openssl@3"
depends_on "python-packaging"
depends_on "[email protected]"
depends_on "[email protected]"
depends_on "xxhash"
depends_on "zstd"

conflicts_with "borgbackup", because: "borgbackup-fuse is a patched version of borgbackup"

resource "msgpack" do
url "https://files.pythonhosted.org/packages/08/4c/17adf86a8fbb02c144c7569dc4919483c01a2ac270307e2d59e1ce394087/msgpack-1.0.8.tar.gz"
sha256 "95c02b0e27e706e48d0e5426d1710ca78e0f0628d6e89d5b5a5b91a5f12274f3"
url "https://files.pythonhosted.org/packages/cb/d0/7555686ae7ff5731205df1012ede15dd9d927f6227ea151e901c7406af4f/msgpack-1.1.0.tar.gz"
sha256 "dd432ccc2c72b914e4cb77afce64aab761c1137cc698be3984eee260bcb2896e"
end

resource "pyparsing" do
url "https://files.pythonhosted.org/packages/46/3a/31fd28064d016a2182584d579e033ec95b809d8e220e74c4af6f0f2e8842/pyparsing-3.1.2.tar.gz"
sha256 "a1bac0ce561155ecc3ed78ca94d3c9378656ad4c94c1270de543f621420f94ad"
resource "packaging" do
url "https://files.pythonhosted.org/packages/51/65/50db4dda066951078f0a96cf12f4b9ada6e4b811516bf0262c0f4f7064d4/packaging-24.1.tar.gz"
sha256 "026ed72c8ed3fcce5bf8950572258698927fd1dbda10a5e981cdf0ac37f4f002"
end

resource "llfuse" do
url "https://files.pythonhosted.org/packages/d2/2c/64f01042d1ed08725342c85ddb48a29d2a4f8712d27f22f66f28a67a079c/llfuse-1.5.0.tar.gz"
sha256 "d094448bb4eb20099537be53dc2b5b2c0369d36bde09207a9bb228cc3cd58ee1"
url "https://files.pythonhosted.org/packages/be/a5/a3dc8426732f75ff2cdd48aaaa60a44afd56812760f49198c0d204768b1f/llfuse-1.5.1.tar.gz"
sha256 "7c9be52289cf647e3d735104531cc23a1a89fd1be3a621613a1cc0991f1b2699"
end

def install
Expand All @@ -74,6 +73,7 @@ def install
ENV["BORG_LIBXXHASH_PREFIX"] = Formula["xxhash"].prefix
ENV["BORG_LIBZSTD_PREFIX"] = Formula["zstd"].prefix
ENV["BORG_OPENSSL_PREFIX"] = Formula["openssl@3"].prefix

virtualenv_install_with_resources

man1.install Dir["docs/man/*.1"]
Expand Down
3 changes: 0 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,20 @@ These dependencies have been [removed](https://github.com/Homebrew/homebrew-core

If one doesn’t plan on using `borg mount`, installing Borg using `brew install borgbackup` works just fine.


## How to install Borg using this tap?

```shell
brew install --cask macfuse
brew install borgbackup/tap/borgbackup-fuse
```


## How to update to a new BorgBackup version?

1. Get new package URLs and SHAs from [PyPi](https://pypi.org/project/borgbackup/)
2. ~~Lint `brew audit --strict Formula/borgbackup-fuse.rb`~~
3. Install `brew install Formula/borgbackup-fuse.rb`
4. Test `brew test Formula/borgbackup-fuse.rb`


## Documentation

`brew help`, `man brew` or check [Homebrew’s documentation](https://docs.brew.sh).

0 comments on commit 806bd6f

Please sign in to comment.