Hugin Compiling FreeBSD

From PanoTools.org Wiki
(Difference between revisions)
Jump to: navigation, search
(Change compiling category)
(Changing between different versions)
 
(8 intermediate revisions by 3 users 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 FreeBSD.
+
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 approaches.  Note 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 latest released port ===
  
 
<pre>
 
<pre>
# su
+
$ su
 
# cd /usr/ports/graphics/hugin
 
# cd /usr/ports/graphics/hugin
# make
+
# make clean install
# make install
+
 
</pre>
 
</pre>
  
== Update the port ==
+
This port is currently maintained by Vasil Dimov <vd (at) FreeBSD.org>.
  
{| style="margin: 1em auto 1em 1em;background:#FFFF99;color:#FF0000;text-align:left;border: solid #FF3300;"
+
=== Install the latest development version ===
|-valign="top"
+
! '''WARNING:'''
+
Below is newbie's work in progress. Following these instructions may corrupt your FreeBSD system or worse. Exercise caution (read: don't do this) until the experts confirm that the newbie has done things rights.
+
|}
+
  
to track closely Hugin's releases, after each new release edit the following files in the ports collection:
+
<pre>
 +
$ su
 +
# cd /usr/ports/graphics/hugin-devel
 +
# make clean install
 +
</pre>
  
1. edit '''[http://www.freebsd.org/cgi/cvsweb.cgi/ports/graphics/hugin/distinfo?rev=1.8;content-type=text%2Fplain distinfo]''' to point to the right tarball. You will need to edit the name in parenthesis, to calculate and edit the md5 and sha256 hashes, to edit the filesize.
+
This port is currently maintained by Greg Lehey <grog (at) FreeBSD.org>.
  
2. edit the '''Makefile'''.
+
=== Multiple versions ===
* edit PORTVERSION and PORTREVISION
+
* add/update build dependencies to LIB_DEPENDS=
+
* add/update runtime dependencies to RUN_DEPENDS=
+
* add/update Cmake building arguments to CMAKE_ARGS=
+
* if you're not sure about something that need to be done, ask the experts.
+
  
3. edit the '''pkg-plist''' list of installed files. 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)
+
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.
  
4. probably not necessary: edit the '''pkg-descr''' description of Hugin.
+
For example, to try a new development version, you would do:
  
make a diff and submit it to the FreeBSD experts.
+
<pre>
 +
$ su
 +
# cd /usr/ports/graphics/hugin
 +
# make backup
 +
# make deinstall
 +
# cd /usr/ports/graphics/hugin-devel
 +
# make clean install
 +
</pre>
  
== files / patches ==
+
If you then decide to go back to the old version, you can do:
 
+
{| style="margin: 1em auto 1em 1em;background:#FFFF99;color:#FF0000;text-align:left;border: solid #FF3300;"
+
|-valign="top"
+
! '''Note:'''
+
This is a work in progress - mainly thoughts about simplifying / streamlining the patching to make life easier to the FreeBSD port maintainer. Please contribute if you have experience in this area.
+
|}
+
 
+
The patches are listed at http://www.freebsd.org/cgi/cvsweb.cgi/ports/graphics/hugin/files/
+
 
+
=== CMake build ===
+
* patch-CMakeLists.txt
+
* patch-doc_CMakeLists.txt
+
 
+
I think it makes sense for the variable mandir to be set in the general CMake build.
+
 
+
if I put an IF(CMAKE_SYSTEM_NAME=="FreeBSD") condition and make the changes inside the Hugin repository, it should work, right?
+
 
+
 
+
=== patch-src_hugin1_base_wx_RunStitchPanel.cpp ===
+
 
+
I think this one I can apply upstream as-is?
+
 
+
 
+
=== patch-src_hugin1_hugin_TextureManager.cpp ===
+
 
+
Do I understand right that log2(x) is not defined in FreeBSD? and I fi put it inside a conditional expression, I could apply it upstream and it would coexist with the rest, e.g.
+
  
 
<pre>
 
<pre>
#if defined __FreeBSD__
+
# make backup
#define log2(x) (log(x) / log(2))
+
# make deinstall
#endif
+
# cd /usr/ports/graphics/hugin
 +
# pkg_add hugin-2012.0.0.tbz
 
</pre>
 
</pre>
  
?
+
== Install the binary package ==
  
 
+
The following command installs the latest version of the released binary package. This may be older than the version in the ports collection.
=== patch-src_hugin1_hugin_config_defaults.h ===
+
 
+
this one looks outdated to me? Autopano-SIFT-C is now in the ports collection:
+
 
+
http://www.freebsd.org/cgi/cvsweb.cgi/ports/graphics/autopano-sift-c/
+
+
the "best practice" in the Hugin project is now to give users a choice of different CP generations. Panomatic is already in the Makefile of the Hugin port, and we now have also match-n-shift and a few other variations and more is expected in the future - each with its own specific settings.
+
 
+
how would be the best way to approach this? should I submit a patch for the ports makefile with
+
  
 
<pre>
 
<pre>
.if defined(WITH_AUTOPANOSIFT-C)
+
$ su
RUN_DEPENDS+= autopanog:${PORTSDIR}/graphics/autopano-sift-c
+
# pkg_add -r hugin
.endif
+
 
</pre>
 
</pre>
 
?
 
 
and what would be the optimal way to set different defaults for the different choices inside the above conditional expression? multiple patch-src_hugin1_hugin_config_defaults.h ? I don't think so but I'm not sure.
 
 
I've added Bruno Postle to this mail. My goal is to streamline the process of getting the latest Hugin and related tools into FreeBSD. We'll have more frequent releases in the foreseeable future and the more we can simplify and automate, the better.
 
 
thank you for your efforts.
 
  
 
[[Category:Software:Hugin]]
 
[[Category:Software:Hugin]]
 
[[Category:Software:Hugin:Compiling]]
 
[[Category:Software:Hugin:Compiling]]

Latest revision as of 07:16, 13 March 2013

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.

Contents

[edit] Build locally

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

[edit] 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>.

[edit] 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>.

[edit] 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

[edit] Install the binary package

The following command installs the latest version of the released binary package. This may be older than the version in the ports collection.

$ su
# pkg_add -r hugin
Personal tools
Namespaces

Variants
Actions
Navigation
tools
Tools