Wireshark-dev: Re: [Wireshark-dev] not all libraries included in macOS DMG

From: Guy Harris <guy@xxxxxxxxxxxx>
Date: Thu, 22 Feb 2018 10:52:36 -0800
On Feb 21, 2018, at 3:34 PM, Peter Meiser <meiser@xxxxxxx> wrote:

> I found another issue while building a DMG on macOS 10.13.3.
> 
> While collecting the libraries which need to be added to the app bundle, objdump shows an error as follows:
> 
> /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/objdump: 'Wireshark.app/Contents/Frameworks/QtCore.framework': Is a directory
> 
> 
> Therefore, I added a check to filter out all directories in the $lib_dep_search_list, so that only files are evaluated.

But it won't evaluate the files *in* those directories - i.e., it won't look at any of the Qt libraries to see what they depend on.  Is that an issue?

Should it, instead, do something such as

while $endl; do
	echo -e "Looking for dependencies. Round" $a
	#
	# libssh, for some reason, has its "install name" set to
	# just libssh.4.dylib, rather than /usr/local/lib/libssh.4.dylib,
	# when built by macosx-setup.sh.  We have to fix that; that's
	# what the sed command does.
	#
	libs="`\
		find "$pkglib" "$pkgexec" -type f -print0 | xargs -0 otool -L $lib_dep_search_list 2>/dev/null \
		| fgrep compatibility \
		| cut -d\( -f1 \
		| sed '1,$s;^	libssh;	/usr/local/lib/libssh;' \
		| egrep -v "$exclude_prefixes" \
		| sort \
		| uniq \
		`"
	cp -vn $libs "$pkglib"
	let "a+=1"
	nnfiles=`ls "$pkglib" | wc -l`
	if [ $nnfiles = $nfiles ]; then
		endl=false
	else
		nfiles=$nnfiles
	fi
done

which 1) only runs otool on plain files and 2) searches arbitrarily deeply in the library and executable file directories?