How to Build LPub

LPub is a program by Kevin Clague which you can use to create building instructions from LDraw models. If you are eager to test out features that are still in development, you will need to compile it yourself. Here’s how!

Install Qt

QtDownload.png

Qt is an interface toolkit and application framework. The current version of LPub requires Qt 4.5. I downloaded the LGPL/Free version of the Qt SDK for Mac (436 Mb). Installation is easy: just double-click the installer package and accept the default settings.

Download the LPub Code

LPubCheckout.png

Fire up Terminal and navigate to an appropriate place to store your files (probably not the Desktop). Check out a fresh copy of the LPub source code with the following two commands (just press enter when prompted for a password):

cvs -d:pserver:anonymous@lpub4.cvs.sourceforge.net:/cvsroot/lpub4 login
cvs -z3 -d:pserver:anonymous@lpub4.cvs.sourceforge.net:/cvsroot/lpub4 co -P LPub4

This will result in an LPub4 folder containing everything you need. To update your working copy of the code with any recent changes, issue the following command from anywhere within the LPub4 folder:

cvs update

Compile LPub

LPubApp.png

Navigate to the innermost LPub4 directory, create a Makefile for your machine, and compile the program with the following commands:

cd LPub4/LPub4
/usr/bin/qmake -spec /usr/local/Qt4.5/mkspecs/macx-g++ -macx -o Makefile LPub.pro
make

After updating from previous versions of LPub, you may occasionally find it necessary to delete the com.lpub.LDraw Building Instruction Tool.plist file from your ~/Library/Preferences directory.

Test and Provide Feedback

Now you’re ready to experiment with the latest LPub technology. Make some custom instructions! (Explaining the ins and outs of the program itself is a subject for another post.)

LPubWindow.png

Your work is not done yet, though: an important part of playing with unreleased software, in my opinion, is to provide feedback to the developer (even if you are not a programmer, your input can be very useful). Offer detailed descriptions of any bugs you encounter, cogent suggestions for improvements, and thanks to folks like Kevin for investing so much effort in programs like LPub.

Posted on Saturday, May 16th, 2009. Tags: , , .

One Response to “How to Build LPub”

Posted by Jim on Wednesday, December 23rd, 2009 at 12:43 PM.

To build LPub on Mac OS X 10.6 with the Qt 4.6 SDK requires some additional changes. Recreate the Makefile with the following command:

/usr/bin/qmake -spec /usr/local/Qt4.6/mkspecs/macx-g++42 -macx -o
Makefile LPub.pro

Make the following changes:

  • lpub.h:592 – Change Gui::getBOMParts to getBOMParts
  • pligobals.cpp:44 – Change bool &_bom to bool _bom
  • pointeritem.h:150 – Change CalloutPointerItem::mousePressEvent to mousePressEvent

Then open lpub.xcodeproj and click “Build & Go” to compile lpub.app!