Bug 223724 - graphics/netpbm can not be upgraded
Summary: graphics/netpbm can not be upgraded
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Tobias Kortkamp
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-11-17 21:38 UTC by Mikhail T.
Modified: 2017-11-18 01:07 UTC (History)
0 users

See Also:
tobik: maintainer-feedback+


Attachments
Move the local build directory to the front of the linker's search path (1.72 KB, patch)
2017-11-17 22:38 UTC, Mikhail T.
mi: maintainer-approval?
Details | Diff
netpbm.diff (400 bytes, patch)
2017-11-17 23:18 UTC, Tobias Kortkamp
tobik: maintainer-approval+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mikhail T. 2017-11-17 21:38:52 UTC
Trying to build the new version (10.80.00) with the old one (10.35.98) still installed, I kept getting various errors like:

cc -o ppmtompeg ppmtompeg.o mfwddct.o postdct.o huff.o bitio.o mheaders.o  mpeg.o subsample.o param.o rgbtoycc.o readframe.o combine.o jrevdct.o frame.o fsize.o frametype.o specifics.o rate.o opts.o input.o  parallel.o psocket.o gethostname.o frames.o iframe.o pframe.o bframe.o psearch.o bsearch.o block.o  jpeg.o    -L/opt/lib -ljpeg   -L/mi/ports/graphics/netpbm/work/netpbm-10.80.00/lib -lnetpbm    -lm  
ppmtompeg.o: In function `main':
ppmtompeg.c:(.text+0x9a5): undefined reference to `pm_strfree'
ppmtompeg.o: In function `getUserFrameFile':
ppmtompeg.c:(.text+0xcb1): undefined reference to `pm_asprintf'
ppmtompeg.c:(.text+0xcfb): undefined reference to `pm_strfree'
ppmtompeg.c:(.text+0xd04): undefined reference to `pm_strfree'


Evidently, ${LOCALBASE}/lib is in the linker's search path ahead of the build-directory and so the already installed libnetpbm is picked instead of the just-built version.

Obviously, this is unhealthy and dangerous.
Comment 1 Tobias Kortkamp freebsd_committer 2017-11-17 21:47:10 UTC
(In reply to Mikhail T. from comment #0)
Yes, this is documented in UPDATING.
Comment 2 Mikhail T. 2017-11-17 22:19:32 UTC
(In reply to Tobias Kortkamp from comment #1)
> Yes, this is documented in UPDATING.

That's nice, I suppose, but why not just fix it?..
Comment 3 Mikhail T. 2017-11-17 22:38:43 UTC
Created attachment 188083 [details]
Move the local build directory to the front of the linker's search path

This moves the output of the software's own libopt to the front. No port-revision bump is necessary.
Comment 4 Tobias Kortkamp freebsd_committer 2017-11-17 23:18:34 UTC
Created attachment 188084 [details]
netpbm.diff

Can you test with this patch instead?
Comment 5 Mikhail T. 2017-11-17 23:27:46 UTC
Comment on attachment 188084 [details]
netpbm.diff

This replaces "-Lpath -lnetpbm" with "path/libnetpbm.so". I'm not sure, that's desirable... But the build does succeed now.

Whichever method you choose -- mine or yours -- be sure, to remove the offensive entry from UPDATING. Thank you for the prompt attention!
Comment 6 commit-hook freebsd_committer 2017-11-18 00:52:32 UTC
A commit references this bug:

Author: tobik
Date: Sat Nov 18 00:51:34 UTC 2017
New revision: 454404
URL: https://svnweb.freebsd.org/changeset/ports/454404

Log:
  graphics/netpbm: Fix build with older netpbm versions installed

  The build currently fails when older netpbm version are still
  installed in the build environment e.g. when upgrading from 10.35.98
  to 10.80.00 the build fails with

  ppmtompeg.o: In function `main':
  ppmtompeg.c:(.text+0x9a5): undefined reference to `pm_strfree'
  ppmtompeg.o: In function `getUserFrameFile':
  ppmtompeg.c:(.text+0xcb1): undefined reference to `pm_asprintf'
  ppmtompeg.c:(.text+0xcfb): undefined reference to `pm_strfree'
  ppmtompeg.c:(.text+0xd04): undefined reference to `pm_strfree'

  - Use explicit paths when linking with libnetpbm
  - Remove UPDATING entry that previously recommended deinstalling
    netpbm first when using portmaster/portupgrade

  PR:		223724

Changes:
  head/UPDATING
  head/graphics/netpbm/Makefile
  head/graphics/netpbm/files/config.mk