install via homebrew
tcurdt opened this issue Β· comments
Any chance for making this available via homebrew?
Right now there are only
- gitx
- rowanj-gitx
and both are ancient.
If a universal binary is not happening soon #204 maybe even as a source build (if that works for a cask?)
@hannesa2 @rowanj Do you know how to publish to homebrew? I could do a source build of the ARM version, and someone could do a source build of the X86, until we can get this working in CI.
Need to get gitx/objective-git#15 working then we can close out #234 β but we're not close to that right now (I'm recovering from surgery for a few weeks).
To publish to homebrew I found these links
- https://docs.brew.sh/How-to-Create-and-Maintain-a-Tap
- https://betterprogramming.pub/a-step-by-step-guide-to-create-homebrew-taps-from-github-repos-f33d3755ba74
But first we should be able to build it for arm64
I guess this issue should be posted here https://github.com/gitx/gitx
I guess this issue should be posted here https://github.com/gitx/gitx
ups - totally
Need to get gitx/objective-git#15 working then we can close out #234 β but we're not close to that right now (I'm recovering from surgery for a few weeks).
@jspiro These preconditions are done
I made the following formula: https://gist.github.com/diasjorge/c5ce0c2dd55270ab8e5843e929b07738
Thanks @diasjorge ; I see version 0.20 is out now; would you want to update your gist? Also, it could be helpful to mention the install command?
I used
curl -O https://gist.githubusercontent.com/diasjorge/c5ce0c2dd55270ab8e5843e929b07738/raw/d6817aa5b95087db50bbae816920f4eadcbb1c10/gitx-gitx.rb
brew install --HEAD -s gitx-gitx.rb
I think an updated formulae might be like
cask "gitx-gitx" do
arch = Hardware::CPU.intel? ? "x86_64" : "arm64"
version "0.20"
if Hardware::CPU.intel?
sha256 "767cc46bb18428bef484e58079bc9c04ed1c8651e204c11c7dd78ae37f289db1"
else
sha256 "1173a59e0e0570432f4b2dd267ffd09c9edb9ccd0a418aae998509d3034754dd"
end
url "https://github.com/gitx/gitx/releases/download/#{version}/GitX-#{arch}.dmg",
verified: "github.com/gitx/gitx"
name "GitX-GitX"
desc "Native graphical client for the git version control system"
homepage "https://gitx.github.io/"
livecheck do
url "https://github.com/gitx/gitx/releases/latest"
strategy :page_match do |page|
match = page.match(%r{href=.*?/download/(\d+(?:\.\d+)*)/GitX.*\.dmg}i)
next if match.blank?
"#{match[1]}"
end
end
conflicts_with cask: ["gitx", "rowanj-gitx"]
app "GitX.app"
binary "#{appdir}/GitX.app/Contents/Resources/gitx"
end
(Just updated version and SHAs)
hi folks, want any help finishing this? not sure what's left
the problem is the name of the repo. As it is a fork of rowanj-gitx, homebrew doesn't let us publish the formula
Not sure if Brew requires a source build, but normal ZIP files for x86_64 and arm64 will be available next release if that makes the Brew install any easier. The change to allow ZIP distributions is here: eb781a0
@jvanzyl As per Homebrew's parlance, pre-built binaries are bottles.
I tried to have a look, but couldn't find information on how to "take over" outdated/abandoned brew formulas. Kinda annoying, but like @techieshark shared above, I think using a composite name gitx-gitx
is fine, unless someone who's more in the know has a better idea.
the problem is the name of the repo. As it is a fork of rowanj-gitx, homebrew doesn't let us publish the formula
diasjorge Which CLI command I've to trigger, to run into this ?
homebrew doesn't let us publish the formula
You could kindly ask GitHub to break the link to rowanj. When we set up the org, I asked for that link to be preserved, but I think they have the power to do that (and it's not like rowaj-gitx has been dead for years anyway).
You could kindly ask GitHub to break the link to rowanj. When we set up the org, I asked for that link to be preserved, but I think they have the power to do that (and it's not like rowaj-gitx has been dead for years anyway).
@tiennou
I'm not sure, if I understand you right. We should remove the "forked" info ? Normally it's just an email.
But what do we will win then ?
How does this helps us in this issue ?
Yeah. Initially when we setup the org repo, I think it was forked from mine, and then I've kindly asked to our Github overlords to change the parenting so it would be Rowan's < the org < mine.
If it's the only thing Homebrew doesn't like about having a formula for us, I guess it's a work around.
I'm currently reinstalling Xcode*, and if I don't struggle too much with how the infrastructure is now, I'll try to inspect a few things that seem to have been broken recently.
*10Gb XIP file, 100Gb free, and still not enough free space to decompress π
If it's the only thing Homebrew doesn't like about having a formula for us, I guess it's a work around.
Just to let you know, I asked Github support to remove upstream
I'm currently reinstalling Xcode*, and if I don't struggle too much with how the infrastructure is now, I'll try to inspect a few things that seem to have been broken recently.
β€οΈ
*10Gb XIP file, 100Gb free, and still not enough free space to decompress π
Maybe remove some local Timemachine snapshots ?
I relented and asked the App Store for its Xcode version. It turns out Archive Utility.app
unzips stuff in a temporary folder and then copies the output next to the archive file (I found that out by trying to use an external disk as scratch space and got the disk-space-low notification). When it's a 50Gb+ monster, it turns out that you need a load of disk space π.
Guess I'm back in business now π . I've made a few tweaks to some of OCGit build scripts (patch attached, since I'm not sure it's worth filing that upstream yet):
- tweak the bootstrap script so it copies
libssh2.a
correctly - remove the mandatory configure && rebuild libgit2 from scratch every time you run, since that's a bit painful
What's the purpose of the $brew_prefix
/uname
checks? Making sure simulator builds are still fine when targeting Apple silicon? I'm just wondering why a simpler brew --prefix $dep
isn't sufficient π.
Checking around all those projects and branches will take me some time, but I've got a few low-hanging ones that I might be able to file ASAPβ¦
diff --git i/script/bootstrap w/script/bootstrap
index 1c3afd1f..c95ff090 100755
--- i/script/bootstrap
+++ w/script/bootstrap
@@ -87,8 +87,8 @@ check_deps ()
done
install_path="./External"
- echo "*** copy "$brew_prefix"/lib/libssh2.a to $install_path"
- cp "$brew_prefix"/lib/libssh2.a $install_path
+ echo "*** copy "`brew --prefix libssh2`"/lib/libssh2.a to $install_path"
+ cp "`brew --prefix libssh2`"/lib/libssh2.a $install_path
if [ "$brew_prefix" != "$expected_prefix" ]
then
diff --git i/script/update_libgit2 w/script/update_libgit2
index 6fb997fd..b3e6925f 100755
--- i/script/update_libgit2
+++ w/script/update_libgit2
@@ -4,11 +4,7 @@ set -e
cd "External/libgit2"
-if [ -d "build" ]; then
- rm -rf "build"
-fi
-
-mkdir build
+mkdir -p build
cd build
# OpenSSL is keg-only, so add its pkgconfig location manually
@@ -26,11 +22,13 @@ export PKG_CONFIG_PATH=$ARCH_PREFIX/opt/openssl/lib/pkgconfig
# ~/.MacOSX/environment.plist
PATH="$ARCH_PREFIX/bin:$PATH"
-cmake -DBUILD_SHARED_LIBS:BOOL=OFF \
- -DLIBSSH2_INCLUDE_DIRS:PATH=$ARCH_PREFIX/include/ \
- -DBUILD_CLAR:BOOL=OFF \
- -DTHREADSAFE:BOOL=ON \
- ..
+if [ ! -f CMakeCache.txt ]; then
+ cmake -DBUILD_SHARED_LIBS:BOOL=OFF \
+ -DLIBSSH2_INCLUDE_DIRS:PATH=$ARCH_PREFIX/include/ \
+ -DBUILD_CLAR:BOOL=OFF \
+ -DTHREADSAFE:BOOL=ON \
+ ..
+fi
cmake --build .
product="libgit2.a"
What's the purpose of the
$brew_prefix
/uname
checks? Making sure simulator builds are still fine when targeting Apple silicon? I'm just wondering why a simplerbrew --prefix $dep
isn't sufficient π.
When I understand right, it was the way to build x86 or arm64.
Any improvement is welcome.
diff --git i/script/bootstrap w/script/bootstrap index 1c3afd1f..c95ff090 100755 --- i/script/bootstrap +++ w/script/bootstrap @@ -87,8 +87,8 @@ check_deps () done install_path="./External" - echo "*** copy "$brew_prefix"/lib/libssh2.a to $install_path" - cp "$brew_prefix"/lib/libssh2.a $install_path + echo "*** copy "`brew --prefix libssh2`"/lib/libssh2.a to $install_path" + cp "`brew --prefix libssh2`"/lib/libssh2.a $install_path if [ "$brew_prefix" != "$expected_prefix" ] then diff --git i/script/update_libgit2 w/script/update_libgit2 index 6fb997fd..b3e6925f 100755
What's about to make a pull request and label it probably as WIP
Then it's easier to comment on it
I guess I'll do that. I just didn't want to reopen all three projects at the same time.
Sorry for derailing the topic slightly π .
You could kindly ask GitHub to break the link to rowanj. When we set up the org, I asked for that link to be preserved, but I think they have the power to do that (and it's not like rowaj-gitx has been dead for years anyway).
@tiennou I'm not sure, if I understand you right. We should remove the "forked" info ? Normally it's just an email.
As requested the upstream linking is gone. I hope this removed the prevention of progress here
Homebrew/homebrew-cask#141659 is merged now. Is there more to do on our side, or can we close this now ?
Thanks for seeing this through!
@tcurdt
Do we have to change these lines on each new version ?
https://github.com/Homebrew/homebrew-cask/blob/9d9bc236a1f2ba17633f28a9f6680627842b4810/Casks/gitx.rb#L4-L6
@hannesa2 I know people often also automate this. But yes - that's the idea.
@hannesa2 I know people often also automate this. But yes - that's the idea.
Does someone knows a sample how to publish a new release to brew ?