Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How do I force MacPorts to rebuild a specific port? I manually made a change to a MacPorts makefile to link in a specific library, but the missing symbol still cannot be found. Perhaps I need to rebuild, but how do I accomplish that without cleaning out the port (which deletes the file I modified)?


Using MacPorts, I'm trying to install Qt (i.e., the qt4-mac-devel port) in Mac OS X Mountain Lion, but it fails with an undefined symbol (_objc_msgSend_fixup). A MacPorts ticket with a similar problem led me to inspect the offending file under:


The else predicate on line 254 checks for Darwin 11 or the 10.7 SDK (both of which are in Lion and unavailable in Mountain Lion). There is no predicate in the if-else list for Mountain Lion's WebKit.

254:  } else: equals(DARWIN_MAJOR_VERSION, "11") | contains(QMAKE_MAC_SDK, "/Developer/SDKs/MacOSX10.7.sdk") {
255:    LIBS += $$SOURCE_DIR/../WebKitLibraries/libWebKitSystemInterfaceLion.a
256:  }

As a dirty quick fix, I changed line 254 to be an unconditional else. When I try to test this by re-running the port install command, I see the same original error. I'm pretty sure MacPorts is not even looking at my change because I reran the command after entering garbage text into the file and renaming the file. So, I'm now looking for a way to force the rebuild.

Things I've tried

  • Rebuild with the -s flag (to rebuild from source): sudo port install -s qt4-mac-devel
  • Rebuild after touching all Qt source files: find ${QT4_SRC} -name "*.cpp" -exec touch {} \;
  • Clean the port and then rebuild (no go...port clean deletes the file, which contains my necessary changes)

Any suggestions? Thanks.

share|improve this question
Possible duplicate of Stack Overflow question… – Vortexfive Aug 20 '12 at 11:11

I would advise to create a local portfile for qt4-mac-devel and add your changes as a patch that is applied during the build process.

  1. Create a local portfile repository: howto
  2. Copy the qt4-mac-devel portfile directory (a directory called "qt4-mac-devel" (path "/opt/local/var/macports/sources/") containing the file "Portfile" and directory "files") into your local portfile repository
  3. Create a patch with your changes of the qt4-mac-devel source code and add it to the "files" directory.
  4. Edit your local qt4-mac-devel Portfile to include the line patchfiles yourpatch.diff
  5. Run portindex again in your local portfile repository
  6. Install qt4-mac-devel with port install -s qt4-mac-devel

I hope this can help.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .