Can't install qt4?

Ken Cunningham ken.cunningham.webuse at gmail.com
Wed Sep 21 10:40:36 PDT 2016


Sure! Basically, you need the diff file in the folder with the Portfile, and then you run “patch”. Details to follow:

1. clean out any current leftovers from previous attempts

“sudo port clean qt4-mac”

2. find the existing port file for qt4-mac

$ port file qt4-mac
/opt/local/var/macports/sources/rsync.macports.org/release/tarballs/ports/aqua/qt4-mac/Portfile <http://rsync.macports.org/release/tarballs/ports/aqua/qt4-mac/Portfile>

3. go into the the portfile’s directory

$ cd /opt/local/var/macports/sources/rsync.macports.org/release/tarballs/ports/aqua/qt4-mac/

4. take a moment to look and make sure all is well in there

$ pwd
/opt/local/var/macports/sources/rsync.macports.org/release/tarballs/ports/aqua/qt4-mac
$ ls -la
total 80
drwxr-xr-x    4 root  wheel    136  4 Mar  2016 .
drwxr-xr-x  113 root  wheel   3842  4 Sep 17:00 ..
-rw-r--r--    1 root  wheel  39430  4 Mar  2016 Portfile
drwxr-xr-x   51 root  wheel   1734 14 Oct  2015 files

5. download the patch from the website link. You can download this using a browser to your home folder (easiest to understand, but slowest) and ‘sudo mv’ it to where you are

a) download the patch using Safari, for example, to your home folder from the website
you want this one: https://trac.macports.org/attachment/ticket/51844/qt4-SL-Libcxx-fix-revised.diff <https://trac.macports.org/attachment/ticket/51844/qt4-SL-Libcxx-fix-revised.diff>
right click on the little drawer with the down arrow above it to the right of qt4-SL-Libcxx-fix-revised.diff in the attached files to ‘download linked file as’ and then save it in your home folder

b) make sure it’s there if you want to…

$ls ~

your should see
qt4-SL-Libcxx-fix-revised.diff

if you see
qt4-SL-Libcxx-fix-revised.diff.hml

then you clicked on the name instead of the badge, and try again until you see it with just the .diff ending

c) then move it into your current folder (the port’s folder)
$ sudo mv ~/qt4-SL-Libcxx-fix-revised.diff ./

d) and just for good measure, check that all is well. The portfile and the .diff file need to be in the same directory
$ ls
Portfile			files				qt4-SL-Libcxx-fix-revised.diff


 (or as a shortcut, once you understand what you’re doing you can just do all of step 5 by using 

$ sudo wget https://trac.macports.org/attachment/ticket/51844/qt4-SL-Libcxx-fix-revised.diff

 from the port's folder once you have found and copied the proper link with Safari

6. You’re almost done. Patch the portfile using the .diff file

sudo patch <qt4-SL-Libcxx-fix-revised.diff
patching file Portfile

7. That’s it. You can check the new Portfile if you want to, and you should see this new block about 1/2 way down the Portfile. Or if you’re trusting, you can just go ahead and install it (I’m not too trusting, so I always check the diff and new Portfile, myself).



    # on Leopard and Snow Leopard with libc++ForOlderSystems installed, SDK must be unset as we can only use system libraries
    # also, a missing library link must be replaced for build to succeed
    # <https://trac.macports.org/ticket/51844>
    platform darwin {
        if {${os.major} == 9 || ${os.major} == 10} {
            if {${configure.cxx_stdlib} eq "libc++"} {
                set SDK ""
                configure.ldflags-append "-lobjc"
            }
        }
    }


8. when you’re happy, go for it:

sudo port -v install qt4-mac


The above works for me. There are lots of options in the manpages for patch, but for this simple application, doesn’t seem you need any. You can back up portfiles before patching them if you want, etc, etc — but in this case, if you mess things up, you can just “sudo port selfupdate” and macports will set everything back to the beginning for you automagically.

Best,

Ken






> On Sep 21, 2016, at 8:48 AM, [ftp83plus] <gestos at ftp83plus.net> wrote:
> 
> That may sound silly, but the instructions on how to patch a port are not clear when attempting to apply a patch to a port that hasn't been successfully installed.
> 
> Would you point me to a clear explanation please? 
> 
> El 2016-09-17, a las 21:08, Ken Cunningham escribió:
> 
>> Hi Pat,
>> 
>> just rebuilt it to make sure it's all still good with the current port mix -- indeed, it built without trouble, with the patch I referenced. It took about two and a half hours, though.
>> 
>> If you get stuck and it won't build for you, let me know and I'll send you a link to a binary.
>> 
>> ken
>> 
>> On 2016-09-16, at 4:08 PM, [ftp83plus] wrote:
>> 
>>> Hello all, 
>>> 
>>> I want to install cutecom on Mac OS X 10.6.
>>> 
>>> As a dependency, qt4 needs to be installed as well, but fails:
>>> http://pastebin.com/YMLLEvZ1 <http://pastebin.com/YMLLEvZ1> (cut because exceeded 512kb)
>>> 
>>> Why?
>>> Pat
>>> _______________________________________________
>>> macports-users mailing list
>>> macports-users at lists.macosforge.org <mailto:macports-users at lists.macosforge.org>
>>> https://lists.macosforge.org/mailman/listinfo/macports-users <https://lists.macosforge.org/mailman/listinfo/macports-users>
>> 
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/macports-users/attachments/20160921/321b4f7a/attachment.html>


More information about the macports-users mailing list