How do I recompile one port?

Joshua Root jmr at macports.org
Fri May 21 16:24:38 PDT 2010


On 2010-5-22 08:45 , Michael_google gmail_Gersten wrote:
> Attempting to fix an issue with an SDL header, and a program that used
> it, resulted in this message from the dynamic linker:
> 
> dyld: Library not loaded: /opt/local/lib/libjpeg.8.dylib
>   Referenced from: /opt/local/lib/libSDL_image-1.2.0.dylib
>   Reason: image not found
> 
> Now, that's not inherently unexpected; I had to downgrade libjpeg to
> an earlier version because of a change in the library. But I need to
> recompile the SDL_image library. How hard can that be?
> 
> stbmac:23 Michael$ sudo port uninstall libsdl_image
> --->  Deactivating libsdl_image @1.2.10_2+universal
> --->  Uninstalling libsdl_image @1.2.10_2+universal
> stbmac:23 Michael$ sudo port clean !$
> sudo port clean libsdl_image
> --->  Cleaning libsdl_image
> stbmac:23 Michael$ sudo port install libsdl_image +universal
> --->  Computing dependencies for libsdl_image
> --->  Unpacking tgz archive for libsdl_image 1.2.10_2+universal

You're using archive mode and didn't clean the archive.

> --->  Installing libsdl_image @1.2.10_2+universal
> --->  Activating libsdl_image @1.2.10_2+universal
> --->  Cleaning libsdl_image
> stbmac:23 Michael$ man port
> 
> Alright, so uninstall, clean, and reinstall doesn't do it. Lets check
> the manual.
> 
> The manual indicates that you recompile by upgrade --force. Alright.
> 
> sudo port upgrade --force libsdl_image +universal
> 
> Surprisingly, this causes all of the X windows stuff to be uninstalled
> and reinstalled.

It's not surprising given the definition of the upgrade operation. Use
-n to exclude the dependencies.

> 2. This is typical:
> stbmac:23 Michael$ sudo port upgrade --force libsdl_image +universal
> --->  Computing dependencies for pkgconfig
> --->  Unpacking tgz archive for pkgconfig 0.23_1+universal
> --->  Deactivating pkgconfig @0.23_1+universal
> --->  Uninstalling pkgconfig @0.23_1+universal
> Error: Requested variants "+universal" do not match original selection "".
> Please use the same variants again, perform 'port clean pkgconfig' or
> specify the force option (-f).
> 
> So if it deactivated the universal, why does it need me to redo with universal?

You have an existing work dir for a build without universal. It isn't
asking you to redo with universal, it's asking you to either finish the
build the way it was started (with no variants), or clean.

> --->  Computing dependencies for xorg-libXau
> --->  Unpacking tgz archive for xorg-libXau 1.0.5_0+universal
> --->  Unable to uninstall xorg-libXau 1.0.5_0+universal, the following
> ports depend on it:
> --->  	xorg-libX11
> Warning: Uninstall forced.  Proceeding despite dependencies.
> --->  Deactivating xorg-libXau @1.0.5_0+universal
> --->  Uninstalling xorg-libXau @1.0.5_0+universal
> Error: Requested variants "+universal" do not match original selection "".
> Please use the same variants again, perform 'port clean xorg-libXau'
> or specify the force option (-f).
> 
> 3. For pkgconfig, at least, I had to "port clean" twice.
> 
> Again, my goal here is simply to recompile one port, because instead
> of using libjpeg.8.dylib, I will be using libjpeg.6.dylib. How do I
> just recompile one port?

sudo port clean --work --archive foo
sudo port -n upgrade --force foo

- Josh


More information about the macports-users mailing list