Difference between revisions of "Hugin Compiling FreeBSD"

From PanoTools.org Wiki
Jump to navigation Jump to search
(→‎Update the port: link to porter's handbook)
(Remove instructions for the old style packages)
(5 intermediate revisions by the same user not shown)
Line 1: Line 1:
Hugin is part of the FreeBSD [http://www.freebsd.org/cgi/cvsweb.cgi/ports/graphics/hugin/ ports collection]. Using the ports collection (and contributing fixes to it) is the recommended way to install Hugin on FreeBSDThe Hugin port is currently maintained by Vasil Dimov <vd (at) FreeBSD.org>.
+
FreeBSD supports Hugin with two ports in the [http://www.freebsd.org/cgi/cvsweb.cgi/ports/graphics/hugin/ ports collection]. The FreeBSD project is currently in a transition from building ports locally to distributing binary packages.  This page describes both approachesNote that the binary package approach is changing, and this description could become out of date.
  
== Install with the port ==
+
== Build locally ==
 +
 
 +
The details of building FreeBSD ports are described [http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/ports.html here].  Briefly, once you ensure that your ports tree is up to date,
 +
 
 +
=== Install the package ===
 +
With the new packages collection, simply:
  
 
<pre>
 
<pre>
# su
+
$ su
# cd /usr/ports/graphics/hugin
+
# pkg install hugin
# make
 
# make install
 
 
</pre>
 
</pre>
  
== Update the port ==
+
=== Install the latest released port ===
  
To track Hugin's releases, after each new release edit the following files in the Ports Collection:
+
<pre>
 +
$ su
 +
# cd /usr/ports/graphics/hugin
 +
# make clean install
 +
</pre>
  
1. Create a directory '''/usr/ports/graphics/hugin-new''' with the same contents as '''/usr/ports/graphics/hugin'''. Copy the files '''Makefile''', '''pkg-descr''' and '''pkg-plist''' from '''/usr/ports/graphics/hugin''' to '''/usr/ports/graphics/hugin-new'''
+
This port is currently maintained by Vasil Dimov <vd (at) FreeBSD.org>.
  
2. Edit the '''Makefile''':
+
=== Install the latest development version ===
* Set PORTVERSION to the name of the new release (e.g. 2011.2.0).
 
* Set PORTREVISION to 0
 
* Change any necessary build dependencies in LIB_DEPENDS
 
* Change any necessary runtime dependencies in RUN_DEPENDS
 
* Change any necessary Cmake building arguments in CMAKE_ARGS
 
  
3. Run ''make makesum'' to create the file '''distinfo'''.
+
<pre>
 +
$ su
 +
# cd /usr/ports/graphics/hugin-devel
 +
# make clean install
 +
</pre>
  
4. Check the '''pkg-plist''' list of installed files and change if necessary. While it can't be done automatically, the trick is to ''make PREFIX=/tmp/foobar install'' and then check the files under '''/tmp/foobar''' (assuming it was non-existent before).
+
This port is currently maintained by Greg Lehey <grog (at) FreeBSD.org>.
  
5. Probably not necessary: edit the '''pkg-descr''' description of Hugin.
+
=== Multiple versions ===
  
6. Build and confirm that it works.
+
It is not possible to install both the released and the development versions of Hugin on the same machine. If you want to experiment, first make a backup of the installed version, remove it, and install the other version.  If you want to go back, remove the new version and restore the old version.
  
7. Make a diff and submit it to the FreeBSD maintainer (see at top).
+
For example, to try a new development version, you would do:
  
If you would like to know more about porting software to FreeBSD see the [http://www.freebsd.org/doc/en/books/porters-handbook/ FreeBSD Porter's Handbook].
+
<pre>
 +
$ su
 +
# cd /usr/ports/graphics/hugin
 +
# make backup
 +
# make deinstall
 +
# cd /usr/ports/graphics/hugin-devel
 +
# make clean install
 +
</pre>
  
==Development versions==
+
If you then decide to go back to the old version, you can do:
  
The FreeBSD Ports Collection expects to get the software in the form of a tarball.  When using software checked out of the Mercurial repository, you will need to do some trickery.
+
<pre>
 
+
# make backup
One method is to check out the version and then create a tarball for the Ports Collection to use, but it's easier to first check out a released version (for example the latest release) and then replace it with the version from the repository.  The following example assumes that the current release is version 2010.4.0:
+
# make deinstall
 
+
# cd /usr/ports/graphics/hugin
CARE: The code below was wrong, and would have removed everything.  I have modified it so it's not so dangerous, but it's still wrong.  Watch this space.
+
# pkg_add hugin-2012.0.0.tbz
 
+
</pre>
mkdir -p /usr/ports/graphics/hugin-devel
 
cd /usr/ports/graphics/hugin                  ''note: the release directory''
 
cp -p Makefile pkg-info pkg-plist distinfor ../hugin-devel
 
cd ../hugin-devel
 
make patch                                    ''extracts the tarball''
 
cd work
 
mv hugin-2010.4.0 hugin-2010.4.0-old          ''we currently need this: see below''
 
mkdir hugin-2010.4.0                          ''this is referred to by the Makefile''
 
cd hugin-2010.4.0       
 
rm -rf .                                      ''remove everything''
 
hg up                                        ''check out the version you want''
 
 
 
At this point you currently need to patch the tree.  The [http://tclap.sourceforge.net/ tclap library] that used to be in Hugin has been removed, and until we decide what to do with the FreeBSD build, it will need to be replaced:
 
 
 
mkdir hugin-2010.4.0/src/foreign/tclap
 
cp -p hugin-2010.4.0-old/src/foreign/tclap/* hugin-2010.4.0/src/foreign/tclap
 
 
 
After this, you can build the version.  Change to the FreeBSD build directory, edit '''Makefile''' if necessary, and build.  If you already have an installed version which you want to keep, you can make a backup of it (second line below):
 
 
 
cd /usr/ports/graphics/hugin-devel
 
pkg_create -b /var/db/pkg/hugin-2010.4.0         ''this usage allows file name completion''
 
make install
 
 
 
Note that the Ports Collection stores a number of dummy files in the subdirectory '''work''':
 
 
 
-rw-r--r--  1 grog  lemis        0 Jul 28 12:34 .build_done.hugin._usr_local
 
-rw-r--r--  1 grog  lemis        0 Jul 28 12:00 .configure_done.hugin._usr_local
 
-rw-r--r--  1 grog  lemis        0 Jul 25 10:59 .extract_done.hugin._usr_local
 
-rw-r--r--  1 grog  lemis        0 Jul 25 10:59 .patch_done.hugin._usr_local
 
 
 
These are used by the Makefile to know which steps need to be repeated.  In particular, the last two are important: if they're missing, the build directory will be removed and replaced by the release.  That's why you need to do a ''make patch'' early in the above procedure.
 
 
 
===Updating the installation===
 
  
If you find you need to change something after building or installing (either because of an update or a local bug fix), '''don't''' run ''make clean''.  That would remove the entire work tree, including the sources.  Instead, remove the files '''work/.build_done.hugin._usr_local''' and  '''work/.install_done.hugin._usr_local''', make the changes, and run ''make install'' again.
 
  
 
[[Category:Software:Hugin]]
 
[[Category:Software:Hugin]]
 
[[Category:Software:Hugin:Compiling]]
 
[[Category:Software:Hugin:Compiling]]

Revision as of 07:42, 3 October 2014

FreeBSD supports Hugin with two ports in the ports collection. The FreeBSD project is currently in a transition from building ports locally to distributing binary packages. This page describes both approaches. Note that the binary package approach is changing, and this description could become out of date.

Build locally

The details of building FreeBSD ports are described here. Briefly, once you ensure that your ports tree is up to date,

Install the package

With the new packages collection, simply:

$ su
# pkg install hugin

Install the latest released port

$ su
# cd /usr/ports/graphics/hugin
# make clean install

This port is currently maintained by Vasil Dimov <vd (at) FreeBSD.org>.

Install the latest development version

$ su
# cd /usr/ports/graphics/hugin-devel
# make clean install

This port is currently maintained by Greg Lehey <grog (at) FreeBSD.org>.

Multiple versions

It is not possible to install both the released and the development versions of Hugin on the same machine. If you want to experiment, first make a backup of the installed version, remove it, and install the other version. If you want to go back, remove the new version and restore the old version.

For example, to try a new development version, you would do:

$ su
# cd /usr/ports/graphics/hugin
# make backup
# make deinstall
# cd /usr/ports/graphics/hugin-devel
# make clean install

If you then decide to go back to the old version, you can do:

# make backup
# make deinstall
# cd /usr/ports/graphics/hugin
# pkg_add hugin-2012.0.0.tbz