57
edits
Changes
From Gramps
→Building Gramps from Scratch: How it works
==Building Gramps from Scratch==
Building Gramps from scratch is useful to produce a version not currently available as a binary (for example, a PPC version) or to produce a complete environment for debugging and further development, inclduing including debugging of all the C libraries Gramps uses, like gtk.
To build gramps from scratch, click on an entry from the [http://www.gramps-project.org/apple/ download page] like gramps-3.1.2-mac13-builder.zip. The builder files are build environments. The downloaded builder file when uncompressed will produce a directory called gramps_important_info. This is intended to be saved at ~/gramps_important_info, where ~ is the home directory of the logged-in user. It's possible to download the builder file wiht with any browser and the to uncompress it and move it to ~ / and then to execute ~/gramps_important_info/build_gramps (by double-clicking it) entirely from within Finder. build_gramps should dowload download a bunch of stuff (It may hang up if any of the required webservers are down) and build it.build_gramps does everything needed to build gramps (provided Apple Xcode tools are installed). build_gramps uses the [http://library.gnome.org/devel/jhbuild/unstable/ jhbuild] system to fetch code and compile it. It's important that jhbuild is not confused by any existing Macports or Fink installation. For this reason, it can be convenient to create a new Mac User account, without admin privilege, and log in to that account to fetch and run build_gramps. Admin access is not required to build Gramps from scratch: no sudo. jhbuild is installed in ~/Source, and produces a binary which appears in ~/bin. jhbuild then puts everything it is building in ~/gtk (controlled by the .jhbuildrc hidden file). ~/gtk/source contains the downloaded sources, and ~/gtk/inst contains the built libraries and applications. More is built than is needed in the final Gramps application - for example, the build tools are themselves built. jhbuild gets its instructions on how to build things from the file ~/gramps_important_info/gramps.modules. This large file includes all the instructions to build all the libraries as well as Gramps itself, to avoid relying on jhbuild's own instructions, which might change with time and change a build of Gramps unexpectedly. The intent is that each major release of Gramps ported to Mac will see this gramps.modules file revisited to update build instructions for libraries to the latest stable releases. The application ~gtk/inst/bin/gramps can run Gramps straight from the build directory without any OS X packaging, provided that PATH searches ~gtk/inst/bin first to pick up the right Python. Gramps will not work, in this build, with the standard Apple 2.5.1 Python. jhbuild constructs a 2.6.2 Python for Gramps to use. build_gramps goes on to produce an application package on the desktop. It does this just by copying the relevant files, and creating some symbolic links in the target. The files come either from ~/gtk/inst, or from ~/gramps_important_info. It's a fairly ad hoc procedure. It's possible some critical Python file or compiled C library is missed out of the application and will only be discovered later. This is to reduce the download size. Finally, build_gramps creates a pair of zipped files, the zipped packaged application for download, and the zipped gramps_important_info directory for building. The version macnn which is given to the files (and to the file info for the packaged application) is taken from the file ~/gramps_important_info/built_version. To create a different built version (version 0 for testing, perhaps) invoke build_gramps from a command line with a single argument:* build_gramps 0