Skip to content

Commit

Permalink
tarsnap-gui: use qt@5, fix build, and do not bundle Qt
Browse files Browse the repository at this point in the history
Closes #106421.

Signed-off-by: Carlo Cabrera <[email protected]>
Signed-off-by: BrewTestBot <[email protected]>
  • Loading branch information
cho-m authored and BrewTestBot committed Jul 23, 2022
1 parent b6356fb commit 55c34fb
Showing 1 changed file with 37 additions and 4 deletions.
41 changes: 37 additions & 4 deletions Formula/tarsnap-gui.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ class TarsnapGui < Formula
url "https://github.com/Tarsnap/tarsnap-gui/archive/v1.0.2.tar.gz"
sha256 "3b271f474abc0bbeb3d5d62ee76b82785c7d64145e6e8b51fa7907b724c83eae"
license "BSD-2-Clause"
revision 1
head "https://github.com/Tarsnap/tarsnap-gui.git", branch: "master"

bottle do
Expand All @@ -13,17 +14,49 @@ class TarsnapGui < Formula
sha256 cellar: :any, high_sierra: "d3e5e2aeee094f0e5944d68765965f2b9261cce026bafe45482a2b1e9abb1273"
end

depends_on "qt"
depends_on "qt@5"
depends_on "tarsnap"

on_linux do
depends_on "gcc"
end

fails_with gcc: "5" # qt@5 is built with GCC

# Work around build error: Set: Entry, ":CFBundleGetInfoString", Does Not Exist
# Issue ref: https://github.com/Tarsnap/tarsnap-gui/issues/557
patch :DATA

def install
system "qmake"
system "make"
system "macdeployqt", "Tarsnap.app"
prefix.install "Tarsnap.app"
if OS.mac?
prefix.install "Tarsnap.app"
bin.install_symlink prefix/"Tarsnap.app/Contents/MacOS/Tarsnap" => "tarsnap-gui"
else
bin.install "tarsnap-gui"
end
end

test do
system "#{opt_prefix}/Tarsnap.app/Contents/MacOS/Tarsnap", "--version"
# Set QT_QPA_PLATFORM to minimal to avoid error "could not connect to display"
ENV["QT_QPA_PLATFORM"] = "minimal" if OS.linux? && ENV["HOMEBREW_GITHUB_ACTIONS"]
system bin/"tarsnap-gui", "--version"
end
end

__END__
diff --git a/Tarsnap.pro b/Tarsnap.pro
index 9954fc5c..560621b1 100644
--- a/Tarsnap.pro
+++ b/Tarsnap.pro
@@ -131,5 +131,8 @@ osx {

# Add VERSION to the app bundle. (Why doesn't qmake do this?)
INFO_PLIST_PATH = $$shell_quote($${OUT_PWD}/$${TARGET}.app/Contents/Info.plist)
- QMAKE_POST_LINK += /usr/libexec/PlistBuddy -c \"Set :CFBundleGetInfoString $${VERSION}\" $${INFO_PLIST_PATH} ;
+ QMAKE_POST_LINK += /usr/libexec/PlistBuddy \
+ -c \"Add :CFBundleVersionString string $${VERSION}\" \
+ -c \"Add :CFBundleShortVersionString string $${VERSION}\" \
+ $${INFO_PLIST_PATH} ;
}

0 comments on commit 55c34fb

Please sign in to comment.