Rebuild old version of port?

Ryan Schmidt ryandesign at
Thu Oct 8 07:02:11 PDT 2015

On Oct 8, 2015, at 8:34 AM, Adam Dershowitz wrote:

> On Oct 8, 2015, at 8:57 AM, Ryan Schmidt wrote:
>> On Oct 7, 2015, at 9:53 AM, Adam Dershowitz wrote:
>>> Is there a way that I can rebuild and reactivate an older version of a  port?  I know about this link:  but the problem I have is a little bit different.
>>> I have the old versions still on my computer, including the source (these were ports that build from source), and they are for a port that is not hosted on macports.  
>>> The problem is that one of the dependents changed, so if I just activate the old version it fails.  So, what I want is essentially to “activate from source” or “rebuild @version)” since I already have the source and the port for the old version.  
>>> I can just activate the old version because there is the issue of a bad link, so it needs to be rebuilt.  
>>> I tried: 
>>> sudo port install myport @myoldversion but it tried to rebuild the new version, which is not what I want.  
>>> I also tried just giving the source flag:
>>> sudo port activate -s myport @myoldversion but then it just activated the old version.  
>>> I actually had no intention of yet upgrading this port, but when I upgraded one of the dependents , macports found that the port was now broken, and proceeded to download the new version of the port before rebuilding.  But, that new version is actually broken (for a completely unrelated reason).  So, now I can’t use the new version of the port, and I want to go back to the old version, but I can just activate it, because of the dependent issue.  So, I want to just have macports rebuild the old version from source.  
>> I don't know what to tell you. I don't completely understand your issue. InstallingOlderPort explains how to install an older version of a port. "sudo port install" does not support an "@version" modifier.
>> Maybe it would help if you told us what version of what port you're trying to build, and, since you said it's not hosted on MacPorts, where it's hosted, or where you got it.
> Sure.  Sorry that my description was not detailed enough.
> I have openmodelica-devel installed, and it was working fine.  And, I have often done upgrades with no problem.  
> Some install details are here:
> And, they keep the source code here:
> Yesterday I upgraded qt4-mac.  That caused macports to determine that a few ports were broken (since qt4-mac seems to have changed the location of some files) and to cause them to rebuild.  One that it tried to rebuild was openmodelica-devel.  The problem is that I was not using the most recent version.  They upgrade every few hours typically, as this is develop code.  Some recent change that they made has caused the recent versions not to build correctly.  The developers are aware of that, and it will get fixed eventually.  
> So, I just wanted to keep using the version I had from a few days ago.  The problem is that macports saw the broken install of openmodelica-devel was not the newest so downloaded the new source and tried to build it, and failed due to the bug mentioned earlier.  Now the problem is that if I activate the older version (a few days old) it activates, but doesn’t run (because it linked against the old location of qt4-mac libraries).  
> So, my current situation is I have old versions installed but not activated.  And, I can’t get old ones to work, and I can’t build a new version, since there is a bug that is yet to be fixed in openmodelica.  
> So, would like to do is to rebuild an old version from the source that was downloaded when I last did a successful upgrade and build.  Since that build worked, and left the source stored in macports, it seems like there should be a way to reactivate that version, but let it use the source and rebuild it, instead of just doing the typical activate from the binaries that macports build and saved.
> Does that make more sense?  

Ok, so you have 2 options.

1. Downgrade qt4-mac to the version before the change in filesystem layout, and then you can activate your already-installed older version of openmodelica-devel and it will work. of course, you'll break all the ports that require the new qt4-mac layout, and if you want to continue using them, would have to downgrade them to pre-layout-change versions as well.

2. (probably the better option) Follow the InstallingOlderPort instructions, except where it tells you to look in the MacPorts Subversion repository's log to find which revision of the port to use, you'll instead be consulting the log of whatever revision control system the Open Modelica developers use for their ports, and you'll get the old version of the port from there. Then you'll install that version, possibly first uninstalling the one you already have installed, since although it will have the correct version number, it will be for the wrong qt4-mac layout. It's possible the old port (or even the new port) won't build correctly with the new qt4-mac layout. If so, that's a bug the people who provide that portfile will have to fix.

More information about the macports-users mailing list