Skip to content

Commit

Permalink
We should support linux bottle now
Browse files Browse the repository at this point in the history
  • Loading branch information
mxcl committed Jan 14, 2025
1 parent 701b8b9 commit 484eeba
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 22 deletions.
11 changes: 1 addition & 10 deletions .github/actions/bump.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,16 +163,7 @@ function mapPlatformToBottleTag(platform: string): string {
function generateBottleBlock(bottles: Bottle[], version: string) {
let bottleBlock = "bottle do\n"
for (const { platform, sha256 } of bottles) {
if (platform === "x86_64_linux") {
bottleBlock += "" +
" # Linux bottles fail currently: patchelf breaks deno compiled binaries.\n" +
" # https://github.com/pkgxdev/brewkit/blob/main/share/brewkit/fix-elf.ts#L38-L42\n" +
" # and it's not possible to skip relocation in linuxbrew:\n" +
" # https://github.com/Homebrew/brew/blob/d1f60aea49d35fc0ba8f02a1f4fd26d0a369e071/Library/Homebrew/extend/os/linux/software_spec.rb\n" +
` #sha256 cellar: :any_skip_relocation, ${platform}: "${sha256}"\n`
} else {
bottleBlock += ` sha256 cellar: :any_skip_relocation, ${platform}: "${sha256}"\n`
}
bottleBlock += ` sha256 cellar: :any_skip_relocation, ${platform}: "${sha256}"\n`
}
bottleBlock += ` root_url "${rootUrl}/v${version}"\n`
bottleBlock += " end"
Expand Down
17 changes: 13 additions & 4 deletions .github/workflows/bump.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# h/t https://github.com/jonchang/homebrew-tap/blob/main/.github/workflows/bump.yml
name: bump version
name: bump n bottle

on:
push:
Expand All @@ -23,7 +23,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: Homebrew/actions/setup-homebrew@master
- uses: pkgxdev/setup@v1
- uses: pkgxdev/setup@v2

- run: .github/actions/bump.ts ${{ github.event.inputs.version }}
id: bump
Expand All @@ -43,8 +43,17 @@ jobs:
files: bottles/*
fail_on_unmatched_files: true
generate_release_notes: true
if: steps.bump.outputs.name

- name: test `brew install`
test:
needs: bump
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: Homebrew/actions/setup-homebrew@master
- name: brew install pkgxdev/made/pkgx
run: |
brew install ./pkgx.rb
brew install pkgxdev/made/pkgx
pkgx semverator satisfies ^1 1.0.0
2 changes: 2 additions & 0 deletions .github/workflows/ci.pkgm.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
name: ci/pkgm

on:
pull_request:
paths:
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/ci.pkgx.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
name: ci/pkgx

on:
pull_request:
paths:
- pkgx.rb

jobs:
smoke:
runs-on: ubuntu-latest
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: Homebrew/actions/setup-homebrew@master
Expand Down
11 changes: 4 additions & 7 deletions pkgx.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,16 @@ class Pkgx < Formula
end

bottle do
sha256 cellar: :any_skip_relocation, arm64_big_sur: "11766d5262265c9652ec7456b4df19c14f6c60478c98cbf80c3415a4158efe10"
sha256 cellar: :any_skip_relocation, big_sur: "d13bbcaa822abf3f98e7930cc54f08373695eab2ce675cc9adb1a22889a3ac90"
# Linux bottles fail currently: patchelf breaks deno compiled binaries.
# https://github.com/pkgxdev/brewkit/blob/main/share/brewkit/fix-elf.ts#L38-L42
# and it's not possible to skip relocation in linuxbrew:
# https://github.com/Homebrew/brew/blob/d1f60aea49d35fc0ba8f02a1f4fd26d0a369e071/Library/Homebrew/extend/os/linux/software_spec.rb
#sha256 cellar: :any_skip_relocation, x86_64_linux: "4c5b8b8a3d7046c2328b8849fcc7b8012e41e872b113952de83139e8bd1deb88"
sha256 cellar: :any_skip_relocation, arm64_big_sur: "870330d6a1ee55356f876d062bad28f2d4a2e7c7ee24e61d5155ec9310a33be3"
sha256 cellar: :any_skip_relocation, big_sur: "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
sha256 cellar: :any_skip_relocation, x86_64_linux: "c7167aedfb196135460b363a5b5ecd419acd205937e80ec1284df5893af50842"
root_url "https://github.com/pkgxdev/homebrew-made/releases/download/v2.0.0"
end

depends_on "deno" => :build
depends_on "unzip" => :build # deno >=1.39.1 uses unzip when remote-fetching their compilable runtime
depends_on "rust" => :build
depends_on "openssl" => :build

def install
if File.file? "Cargo.toml"
Expand Down

0 comments on commit 484eeba

Please sign in to comment.