Bug 191997 - [patch] multimedia/vlc: SMB option with linker error
Summary: [patch] multimedia/vlc: SMB option with linker error
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: Timur I. Bakeyev
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-07-21 06:51 UTC by kdeguchi
Modified: 2014-09-11 21:41 UTC (History)
4 users (show)

See Also:


Attachments
SMB option with linker error (292 bytes, text/plain)
2014-07-21 06:51 UTC, kdeguchi
no flags Details
samba-libsmbclient patch (1.46 KB, patch)
2014-07-23 10:51 UTC, Tijl Coosemans
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description kdeguchi 2014-07-21 06:51:17 UTC
Created attachment 144830 [details]
SMB option with linker error

Add "SMB_LDFLAGS= -L${LOCALBASE}/lib" to Makefile. I attached a patch.

linker error message as follows,

gmake-lite[7]: Entering directory `/tmp/usr/ports/multimedia/vlc/work/vlc-2.1.4/modules/access'
/bin/sh ../../libtool  --tag=CC   --mode=link cc  -I/usr/local/include/samba   -O2 -pipe -fstack-protector -fno-strict-aliasing -Wall -Wextra -Wsign-compare -Wundef -Wpointer-arith -Wbad-function-cast -Wwrite-strings -Wmissing-prototypes -Wvolatile-register-var -Werror-implicit-function-declaration -pipe -fvisibility=hidden -O4 -ffast-math -funroll-loops -fomit-frame-pointer -rpath '/usr/local/lib/vlc/plugins/access' -avoid-version -module -export-symbols-regex ^vlc_entry -shrext .so -no-undefined ../../compat/libcompat.la ../../src/libvlccore.la  -Wl,-rpath=/usr/lib:/usr/local/lib -fstack-protector -o libaccess_smb_plugin.la  libaccess_smb_plugin_la-smb.lo -pthread -lsmbclient    
libtool: link: rm -fr  .libs/libaccess_smb_plugin.exp
libtool: link: /usr/bin/nm -B  .libs/libaccess_smb_plugin_la-smb.o   | sed -n -e 's/^.*[	 ]\([ABCDGIRSTW][ABCDGIRSTW]*\)[	 ][ ]*\([_A-Za-z][_A-Za-z0-9]*\)$/\1 \2 \2/p' | sed '/ __gnu_lto/d' | /usr/bin/sed 's/.* //' | sort | uniq > .libs/libaccess_smb_plugin.exp
libtool: link: /usr/bin/egrep -e "^vlc_entry" ".libs/libaccess_smb_plugin.exp" > ".libs/libaccess_smb_plugin.expT"
libtool: link: mv -f ".libs/libaccess_smb_plugin.expT" ".libs/libaccess_smb_plugin.exp"
libtool: link: cc -shared  -fPIC -DPIC  .libs/libaccess_smb_plugin_la-smb.o   -Wl,-rpath -Wl,/tmp/usr/ports/multimedia/vlc/work/vlc-2.1.4/src/.libs -Wl,-rpath -Wl,/usr/local/lib ../../compat/.libs/libcompat.a ../../src/.libs/libvlccore.so -lsmbclient  -O2 -O4 -Wl,-rpath=/usr/lib:/usr/local/lib -pthread   -pthread -Wl,-soname -Wl,libaccess_smb_plugin.so -Wl,-retain-symbols-file -Wl,.libs/libaccess_smb_plugin.exp -o .libs/libaccess_smb_plugin.so
/usr/bin/ld: cannot find -lsmbclient
cc: error: linker command failed with exit code 1 (use -v to see invocation)
gmake-lite[7]: *** [libaccess_smb_plugin.la] Error 1
Comment 1 Tijl Coosemans freebsd_committer 2014-07-21 13:18:33 UTC
I believe this is actually a bug the samba-libsmbclient port.  It installs /usr/local/libdata/pkgconfig/smbclient.pc and that file contains these two lines:

#Libs: -L/usr/local/lib -lsmbclient
Libs: -lsmbclient

Remove # from the first line and add # to the second line.  Then try to build vlc again without your Makefile modification.
Comment 2 John Marino freebsd_committer 2014-07-22 14:11:52 UTC
assign PR to group maintainer

(They can close it based on tijl comment)
Comment 3 Jordan Irwin 2014-07-22 18:59:47 UTC
I can confirm this bug in FreeBSD 10. I had to to create sim-links for /usr/local/lib/libsmbclient.a, /usr/local/lib/libsmbclient.so, & /usr/local/lib/libsmbclient.so.0 in /usr/lib in order to compile VLC.
Comment 4 Jordan Irwin 2014-07-22 19:42:18 UTC
Similar to bug 192044.
Comment 5 Matthew Rezny freebsd_committer 2014-07-23 01:59:03 UTC
(In reply to Jordan Irwin from comment #4)
> Similar to bug 192044.

Similar fix would be

Index: multimedia/vlc/Makefile
===================================================================
--- multimedia/vlc/Makefile     (revision 362615)
+++ multimedia/vlc/Makefile     (working copy)
@@ -252,6 +252,7 @@
 
 SMB_LIB_DEPENDS=       libsmbclient.so:${PORTSDIR}/net/samba-libsmbclient
 SMB_CONFIGURE_ENABLE=  smbclient
+SMB_CONFIGURE_ENV=     SMBCLIENT_LIBS="-L${LOCALBASE}/lib -lsmbclient"
 
 STREAM_CONFIGURE_ENABLE=sout
 
but Tijl's solution sounds better
Comment 6 Tijl Coosemans freebsd_committer 2014-07-23 10:51:58 UTC
Created attachment 144905 [details]
samba-libsmbclient patch

Please apply this patch to your ports tree:

If you use subversion:
% cd /usr/ports
% svn patch /path/to/patch

Otherwise:
% cd /usr/ports
% patch < /path/to/patch

Then rebuild net/samba-libsmbclient and try multimedia/vlc.
Comment 7 Matthew Rezny freebsd_committer 2014-07-24 09:31:20 UTC
All the .pc.in files as provided by upstream have the commented Libs line with libdir and another Libs line without. Rather than patch just this one, it would make more sense to patch all the pkgconf files in the master port, which would fix all the slaves at once.
Comment 8 Tijl Coosemans freebsd_committer 2014-07-24 10:26:37 UTC
Over to maintainer of samba ports to fix samba pkgconfig files.
Comment 9 commit-hook freebsd_committer 2014-08-08 21:37:20 UTC
A commit references this bug:

Author: timur
Date: Fri Aug  8 21:36:33 UTC 2014
New revision: 364390
URL: http://svnweb.freebsd.org/changeset/ports/364390

Log:
  Add explicitly library path to the corresponding .pc files

  PR:		191997

Changes:
  head/net/samba-libsmbclient/Makefile
  head/net/samba36/Makefile