Skip to content

Commit

Permalink
fix homebrew upx dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
Robert Glonek committed Sep 6, 2024
1 parent 1d176c9 commit 2547489
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 1 deletion.
5 changes: 4 additions & 1 deletion .github/workflows/create-prerelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,13 @@ jobs:
run: |
/usr/local/bin/brew install --overwrite python@3.11 || echo "I1.1"
/usr/local/bin/brew link --overwrite python@3.11 || echo "I1.2"
/usr/local/bin/brew install --overwrite dpkg upx zip make wget jq rpm || echo "I2"
/usr/local/bin/brew install --overwrite dpkg zip make wget jq rpm || echo "I2"
/usr/local/bin/brew link --overwrite python@3.11 || echo "I1.3"
/usr/local/bin/brew install python-gdbm@3.11 || echo "I1.4"
/usr/local/bin/brew install python-tk@3.11 || echo "I1.5"
pushd ~/work/aerolab/aerolab/brew
/usr/local/bin/brew install ./upx.rb
popd
for i in dpkg upx zip make wget jq rpm python3.11; do command -v $i || exit 1; done
echo "Dependencies checked"
- name: "Install golang"
Expand Down
33 changes: 33 additions & 0 deletions brew/upx.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
class Upx < Formula
desc "Compress/expand executable files"
homepage "https://upx.github.io/"
url "https://github.com/upx/upx/releases/download/v4.1.0/upx-4.1.0-src.tar.xz"
sha256 "0582f78b517ea87ba1caa6e8c111474f58edd167e5f01f074d7d9ca2f81d47d0"
license "GPL-2.0-or-later"
head "https://github.com/upx/upx.git", branch: "devel"

bottle do
sha256 cellar: :any_skip_relocation, monterey: "db18963055dd657d579824a7daaf69f79e1639a10fd1accb399e84ddcd5d649c"
sha256 cellar: :any_skip_relocation, big_sur: "8e6aa21f689985270ff1cc3857ef9848f63f3c79a96604884ee846ce76e6401b"
end

depends_on "cmake" => :build
depends_on "ucl" => :build

uses_from_macos "zlib"

def install
system "cmake", "-S", ".", "-B", "build", *std_cmake_args
system "cmake", "--build", "build"
system "cmake", "--install", "build"
end

test do
cp bin/"upx", "."
chmod 0755, "./upx"

system bin/"upx", "-1", "--force-execve", "./upx"
system "./upx", "-V" # make sure the binary we compressed works
system bin/"upx", "-d", "./upx"
end
end

0 comments on commit 2547489

Please sign in to comment.