cartr / homebrew-qt4

Homebrew tap for Qt4 and dependent formulae on Sierra
BSD 2-Clause "Simplified" License
105 stars 42 forks source link

qt@4 bottle broken since openssl 1.0 was removed from homebrew-core #67

Closed scpeters closed 4 years ago

scpeters commented 4 years ago

The qt@4 formula depends on openssl 1.0, but that has been removed from homebrew-core as of https://github.com/Homebrew/homebrew-core/pull/46876, so the qt@4 bottles are currently broken for anything that uses the QtNetwork component. The openssl 1.0 bottle was removed as it will be end-of-life very soon.

cartr commented 4 years ago

Thanks for reporting this! I'll look into re-adding openssl 1.0 to this tap.

devernay commented 4 years ago

Thanks for looking into that! The removal PR is here: https://github.com/Homebrew/homebrew-core/pull/46876 But I would actually recommend compiling against openssl 1.1, using this patch (originated from debian, then MacPorts, and finally modified by me): https://github.com/NatronGitHub/Natron/blob/RB-2.3/tools/MacPorts/aqua/qt4-mac/files/patch-qt4-openssl111.diff

Thanks a lot for keeping this tap alive, which allows building qt4 apps on Travis CI (among other things)

sandvige commented 4 years ago

Anything new? How can we help?

cartr commented 4 years ago

@sandvige I've created a branch (https://github.com/cartr/homebrew-qt4/tree/readd-openssl-1.0) that adds OpenSSL 1.0 to the tap. I'd appreciate it if you could test that branch out and tell me if it works on your system. (I wasn't able to get @devernay's patches to build in the version of Qt used in this formula.)

The main blocker right now is getting bottles built -- I haven't had a lot of time to work on that lately, but I'll take another swing at it.

cartr commented 4 years ago

And more generally, I don't use a Mac as my primary computer anymore (because I got tired of software updates breaking stuff all the time), so it's kind of a hassle for me to create and test updates to this tap. I'd really appreciate it if people filed pull requests to fix issues they found.

sandvige commented 4 years ago

@cartr, thanks for your answer!

I will try my best to help you. So far, I'm not an Homebrew expert, and I tried something that might be "dumb" to test (because I don't have a mac neither). We're using your tap with a Travis job, here is the previous code I was using to pour your tap:

brew tap cartr/qt4
brew tap-pin cartr/qt4
brew update
brew install qt@4

I forked your repository, and since it looks like it's not supported to pour bottles from github through branches, I merged your branch into my fork's master: https://github.com/sandvige/homebrew-qt4/pull/1

Then, I patched my job with this:

brew tap sandvige/qt4
brew tap-pin sandvige/qt4
brew update
brew install qt@4

Here are the logs:

brew tap sandvige/qt4
==> Tapping sandvige/qt4
Cloning into '/usr/local/Homebrew/Library/Taps/sandvige/homebrew-qt4'...
Tapped 23 formulae (85 files, 118.6KB)
+brew tap-pin sandvige/qt4
==> Pinned sandvige/qt4
+brew update
==> Downloading https://homebrew.bintray.com/bottles-portable-ruby/portable-ruby-2.6.3.mavericks.bottle.tar.gz
Already downloaded: /Users/travis/Library/Caches/Homebrew/portable-ruby-2.6.3.mavericks.bottle.tar.gz
==> Pouring portable-ruby-2.6.3.mavericks.bottle.tar.gz
==> Homebrew has enabled anonymous aggregate formulae and cask analytics.
Read the analytics documentation (and how to opt-out) here:
  https://docs.brew.sh/Analytics
==> Homebrew is run entirely by unpaid volunteers. Please consider donating:
  https://github.com/Homebrew/brew#donations
Updated 2 taps (caskroom/cask and homebrew/core).
==> New Formulae
adios2
ahoy
aliyun-cli
allureofthestars
alp
amtk
angle-grinder
anime-downloader
... SNIP ...
xar-mackyle
xmoto
zeromq@3.2
zeromq@4.0
zeromq@4.1
zim
zxing-cpp
+brew install qt@4
Warning: You are using macOS 10.12.
We (and Apple) do not provide support for this old version.
You will encounter build failures with some formulae.
Please create pull requests instead of asking for help on Homebrew's GitHub,
Discourse, Twitter or IRC. You are responsible for resolving any issues you
experience while you are running this old version.
Error: openssl@1.0 is already installed from homebrew/core!
Please `brew uninstall openssl@1.0` first."
==> Installing qt@4 from sandvige/qt4
==> Installing dependencies for sandvige/qt4/qt@4: openssl@1.0

So I tried to uninstall the openssl@1.0, as mentioned, before running brew install qt@4:

+brew uninstall openssl@1.0
Error: No such keg: /usr/local/Cellar/openssl@1.0

I'm almost sure I'm missing an important part of the process, could you point out a documentation that shows and explains how to start building and publishing taps?

sandvige commented 4 years ago

@cartr it looks like this is working! https://travis-ci.com/sandvige/homebrew-qt4/builds/143793188

cartr commented 4 years ago

@sandvige Thanks for your help! I've gone ahead and merged the OpenSSL branch into master and built some new bottles.

qq42 commented 4 years ago

Running brew upgrade says:

==> Upgrading 1 outdated package:
cartr/qt4/qt@4 4.8.7_5 -> 4.8.7_6
==> Upgrading cartr/qt4/qt@4
==> Installing dependencies for cartr/qt4/qt@4: openssl@1.0
Error: openssl@1.0 is already installed from homebrew/core!
Please `brew uninstall openssl@1.0` first."

However running the suggested brew uninstall openssl@1.0 says:

Error: No such keg: /usr/local/Cellar/openssl@1.0

How do I get out of this catch-22?

cartr commented 4 years ago

@qq42 That is a good question, and I don't have an answer off the top of my head -- sorry! (It may be worth filing a bug against Homebrew/brew, or posting on their forum, or something. This seems like a bug in brew.)

I did find https://github.com/Homebrew/brew/issues/3024 , which suggests using brew uninstall --force openssl@1.0.

qq42 commented 4 years ago

brew uninstall --force openssl@1.0 ran but did not display any output, but then brew upgrade still says:

==> Upgrading 1 outdated package:
cartr/qt4/qt@4 4.8.7_5 -> 4.8.7_6
==> Upgrading cartr/qt4/qt@4 4.8.7_5 -> 4.8.7_6
==> Installing dependencies for cartr/qt4/qt@4: openssl@1.0
Error: openssl@1.0 is already installed from homebrew/core!
Please `brew uninstall openssl@1.0` first."

Thank you for the pointer! It gave me a few more ideas to try. I ran brew info openssl@1.0 which led to running brew install openssl@1.0 which then allowed brew upgrade to successfully run!

# brew info openssl@1.0

cartr/qt4/openssl@1.0: stable 1.0.2t (bottled) [keg-only]
SSL/TLS cryptography library
https://openssl.org/
Not installed
From: https://github.com/cartr/homebrew-qt4/blob/master/openssl@1.0.rb
==> Caveats
A CA file has been bootstrapped using certificates from the SystemRoots
keychain. To add additional certificates (e.g. the certificates added in
the System keychain), place .pem files in
  /usr/local/etc/openssl/certs
and run
  /usr/local/opt/openssl@1.0/bin/c_rehash

openssl@1.0 is keg-only, which means it was not symlinked into /usr/local,
because Apple has deprecated use of OpenSSL in favor of its own TLS and crypto libraries.

# brew install openssl@1.0

==> Installing openssl@1.0 from cartr/qt4
==> Downloading https://dl.bintray.com/cartr/autobottle-qt4/openssl@1.0-1.0.2t.mojave.bottle.tar.gz
==> Downloading from https://d29vzk4ow07wi7.cloudfront.net/faa8d3dc06601237a6f42a93ec6d8b0229426f01ea109e3fab691ac1cf9fd681?response-content-disposition=attachment%3Bfilename%3D%22openssl%401.0-1.0.2t.mojave.bottle.tar.gz%22&Policy=eyJTdGF0ZW1lbnQiOiBbeyJSZXNvdXJjZSI6Im
######################################################################## 100.0%
==> Pouring openssl@1.0-1.0.2t.mojave.bottle.tar.gz
==> Caveats
A CA file has been bootstrapped using certificates from the SystemRoots
keychain. To add additional certificates (e.g. the certificates added in
the System keychain), place .pem files in
  /usr/local/etc/openssl/certs
and run
  /usr/local/opt/openssl@1.0/bin/c_rehash

openssl@1.0 is keg-only, which means it was not symlinked into /usr/local,
because Apple has deprecated use of OpenSSL in favor of its own TLS and crypto libraries.

If you need to have openssl@1.0 first in your PATH run:
  echo 'set -g fish_user_paths "/usr/local/opt/openssl@1.0/bin" $fish_user_paths' >> ~/.config/fish/config.fish

For compilers to find openssl@1.0 you may need to set:
  set -gx LDFLAGS "-L/usr/local/opt/openssl@1.0/lib"
  set -gx CPPFLAGS "-I/usr/local/opt/openssl@1.0/include"

==> Summary
🍺  /usr/local/Cellar/openssl@1.0/1.0.2t: 1,796 files, 12MB

# brew upgrade

==> Upgrading 1 outdated package:
cartr/qt4/qt@4 4.8.7_5 -> 4.8.7_6
==> Upgrading cartr/qt4/qt@4 4.8.7_5 -> 4.8.7_6
==> Downloading https://dl.bintray.com/cartr/autobottle-qt4/qt@4-4.8.7_6.mojave.bottle.tar.gz
==> Downloading from https://d29vzk4ow07wi7.cloudfront.net/6c66adaf110ce3534d7ced855b51ae744e0a4750f4daaff635928e7476183c35?response-content-disposition=attachment%3Bfilename%3D%22qt%404-4.8.7_6.mojave.bottle.tar.gz%22&Policy=eyJTdGF0ZW1lbnQiOiBbeyJSZXNvdXJjZSI6Imh0dHAq
######################################################################## 100.0%
==> Pouring qt@4-4.8.7_6.mojave.bottle.tar.gz
==> Caveats
We agreed to the Qt opensource license for you.
If this is unacceptable you should uninstall.

Phonon is not supported on macOS Sierra or with Xcode 8.

WebKit is no longer included for security reasons. If you absolutely
need it, it can be installed with `brew install qt-webkit@2.3`.
==> Summary
🍺  /usr/local/Cellar/qt@4/4.8.7_6: 2,971 files, 76.4MB
Removing: /usr/local/Cellar/qt@4/4.8.7_5... (2,962 files, 80.4MB)
Removing: /Users/.../Library/Caches/Homebrew/qt@4--4.8.7_5.mojave.bottle.tar.gz... (28.6MB)
==> Checking for dependents of upgraded formulae...
==> No dependents found!
adamjakab commented 4 years ago

At the time of writing the above steps by @qq42 are still necessary on my macOS 10.13.6 to install qt4. In short:

brew tap cartr/qt4
brew uninstall --force openssl@1.0
brew install openssl@1.0
brew install qt@4