From 2547489616b1f50a86e23133bede9cc94bb10d19 Mon Sep 17 00:00:00 2001 From: Robert Glonek Date: Thu, 5 Sep 2024 22:31:44 -0700 Subject: [PATCH] fix homebrew upx dependency --- .github/workflows/create-prerelease.yml | 5 +++- brew/upx.rb | 33 +++++++++++++++++++++++++ 2 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 brew/upx.rb diff --git a/.github/workflows/create-prerelease.yml b/.github/workflows/create-prerelease.yml index 4ff3391e..939ce132 100644 --- a/.github/workflows/create-prerelease.yml +++ b/.github/workflows/create-prerelease.yml @@ -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" diff --git a/brew/upx.rb b/brew/upx.rb new file mode 100644 index 00000000..d59a6eaf --- /dev/null +++ b/brew/upx.rb @@ -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