Bug 195597 - [patch] deskutils/gnote 3.14.0 build fails on FreeBSD 8.4
Summary: [patch] deskutils/gnote 3.14.0 build fails on FreeBSD 8.4
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Don Lewis
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-12-03 01:32 UTC by Don Lewis
Modified: 2015-04-12 05:28 UTC (History)
0 users

See Also:
bugzilla: maintainer-feedback? (gnome)


Attachments
patch to fix deskutils/gnote configure script to fix build on FreeBSD 8.4 (1.38 KB, patch)
2014-12-03 01:32 UTC, Don Lewis
no flags Details | Diff
config.log showing Boost unit_test_framework link failure (229.00 KB, text/plain)
2015-04-10 23:21 UTC, Don Lewis
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Don Lewis freebsd_committer freebsd_triage 2014-12-03 01:32:05 UTC
Created attachment 150123 [details]
patch to fix deskutils/gnote configure script to fix build on FreeBSD 8.4

The deskutils/gnote port version 3.14.0 fails to build on FreeBSD 8.4 because of a failure during the configure phase:

checking boost/test/unit_test.hpp presence... yes
checking for boost/test/unit_test.hpp... yes
checking for the Boost unit_test_framework library... no
configure: error: cannot find the flags to link with Boost unit_test_framework
===>  Script "configure" failed unexpectedly.
Please run the gnomelogalyzer, available from
"http://www.freebsd.org/gnome/gnomelogalyzer.sh", which will diagnose the
problem and suggest a solution. If - and only if - the gnomelogalyzer cannot
solve the problem, report the build failure to the FreeBSD GNOME team at
gnome@FreeBSD.org, and attach (a)
"/wrkdirs/usr/ports/deskutils/gnote/work/gnote-3.14.0/config.log", (b) the
output of the failed make command, and (c) the gnomelogalyzer output. Also,
it might be a good idea to provide an overview of all packages installed on
your system (i.e. an `ls /var/db/pkg`). Put your attachment up on any website,
copy-and-paste into http://freebsd-gnome.pastebin.com, or use send-pr(1) with
the attachment. Try to avoid sending any attachments to the mailing list
(gnome@FreeBSD.org), because attachments sent to FreeBSD mailing lists are
usually discarded by the mailing list software.
*** Error code 1

Stop in /usr/ports/deskutils/gnote.

The problem is that configure first tries to link this library statically, and when that fails, it "forgets" to try linking it dynamically.  The reason is that it has a bunch of nested loops to try multiple variations on the library name and keeps track of which library names it has tried so that it doesn't retry the same library name.  The problem is that one of the loop variables also governs whether it should try static or dynamic liking, and if static linking fais, the library name gets added to the exclusion list, which prevents it from trying dynamic linking.

The attached patch adds the value of this loop variable ($boost_rtopt_) to disambiguate the two cases so that linking both ways is tried.  An alterative fix would be to remove the values of $boost_lib that don't contain $boost_rtopt_ since one of the values of $boost_rtopt_ is ''.

Also, the location where $boost_failed_libs is incorrect.  It needs to be
moved out one loop nesting level to prevent the same library name value from being added to the list multiple times.

Upstream should patch m4/boost.m4 and regenerate configure.
Comment 1 Bugzilla Automation freebsd_committer freebsd_triage 2014-12-03 01:32:05 UTC
Auto-assigned to maintainer gnome@FreeBSD.org
Comment 2 Don Lewis freebsd_committer freebsd_triage 2015-04-10 23:21:08 UTC
Created attachment 155436 [details]
config.log showing Boost unit_test_framework link failure
Comment 3 commit-hook freebsd_committer freebsd_triage 2015-04-12 05:20:22 UTC
A commit references this bug:

Author: truckman
Date: Sun Apr 12 05:20:00 UTC 2015
New revision: 383837
URL: https://svnweb.freebsd.org/changeset/ports/383837

Log:
  Configure fails to find proper link command for Boost unit_test_framework
  because it first tries to link this library statically, and when
  that fails, it "forgets" to try linking it dynamically.  The reason
  is that it has a bunch of nested loops to try multiple variations
  on the library name and keeps track of which library names it has
  tried so that it doesn't retry the same library name. The problem
  is that one of the loop variables also governs whether it should
  try static or dynamic liking, and if static linking fails, the
  library name gets added to the exclusion list, which prevents it
  from trying dynamic linking.  Fix by the value of the loop variable
  $boost_rtopt_ to the key value into the list of library variations
  to disambiguate the two cases so that linking both ways is tried.

  Also move the location where $boost_failed_libs is set out by one
  nesting level to prevent the same library name value from being added
  to the list multiple times.

  Get rid of .include <bsd.port.options.mk> and .if ${PORT_OPTIONS:MDOCS}
  as suggested by mat@. Portlint whines about it but the Porters Handbook
  says it is OK because the doc files are few and small.

  Unmute ${INSTALL_DATA} as suggested by portlint.

  PR:		195597
  Differential Revision:	https://reviews.freebsd.org/D2279
  Reviewed by:	kwm
  Approved by:	mat (mentor)

Changes:
  head/deskutils/gnote/Makefile
  head/deskutils/gnote/files/patch-configure