MFH: r521828

Attempt to fix build after removal of Linux c6.

- Replace build dependency on linux-c7-devtools with
  USE_LINUX=devtools:build so it takes into account LINUX_DEFAULT.
- Install libusb.so.3 which is the SONAME of the library.
- Disable -Werror.
- Don't build profiling library.  It's not installed and -pg and
  -fstack-protector are incompatible.
- Don't let the build make parse /etc/make.conf because this may redefine
  *FLAGS.  The file is already handled by the ports tree.
- Create symbolic links instead of hard links.
This commit is contained in:
Antoine Brodin 2020-01-03 10:05:21 +00:00
parent 078e0c1276
commit 7722d290ad
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/branches/2020Q1/; revision=521920

View File

@ -3,27 +3,30 @@
PORTNAME= linux_libusb
PORTVERSION= 11.0r${FSVN_REV}
PORTREVISION= 3
PORTREVISION= 4
CATEGORIES= devel linux
MASTER_SITES= LOCAL/nox
MAINTAINER= emulation@FreeBSD.org
COMMENT= Linux-compatibility libusb
BUILD_DEPENDS= ${LINUXBASE}/usr/bin/gcc:devel/linux-c7-devtools
USES= tar:bzip2
USES= linux tar:bzip2
ONLY_FOR_ARCHS= i386 amd64
USE_LDCONFIG= yes
USE_LINUX= devtools:build
USE_LINUX_PREFIX= yes
PLIST_FILES= usr/lib/libusb.so \
usr/lib/libusb.so.3 \
usr/lib/libusb-0.1.so.4
CC= ${LINUXBASE}/usr/bin/gcc
CFLAGS+= -I${WRKDIR}/sys
SSP_CFLAGS?= -fstack-protector # XXX -strong isn't supported by GCC < 4.9
MAKE_ARGS+= LIBUSB_GLOBAL_INCLUDE_FILE=libusb_global_linux.h
MAKE_ARGS+= PTHREAD_LIBS="-lpthread -lrt"
MAKE_ARGS+= NO_WERROR=yes
MAKE_ARGS+= WITHOUT_PROFILE=yes
MAKE_ARGS+= WITHOUT_SSP=yes
MAKE_ARGS+= __MAKE_CONF=""
# XXX ${LINUXBASE}/usr/bin/ld is a broken link with gentoo atm?
#MAKE_ENV+= COMPILER_PATH=/usr/i486-pc-linux-gnu/binutils-bin/2.22
@ -56,14 +59,12 @@ post-patch:
${MKDIR} ${WRKDIR}/sys
${LN} -s ${SRC_BASE}/sys/compat ${SRC_BASE}/sys/dev ${WRKDIR}/sys
# XXX: Due to problems with ports/ infrastructure, we don't seem to be able
# to symlink files. I provide hardlink instead. If fixed, remember to remove
# link name from PLIST_FILES.
do-install:
${MKDIR} ${STAGEDIR}${PREFIX}/usr/lib
${INSTALL_DATA} ${WRKSRC}/libusb.so ${STAGEDIR}${PREFIX}/usr/lib
${INSTALL_LIB} ${WRKSRC}/libusb.so.3 ${STAGEDIR}${PREFIX}/usr/lib
${LN} -s libusb.so.3 ${STAGEDIR}${PREFIX}/usr/lib/libusb.so
# Xilinx ISE requirement.
${LN} -f ${STAGEDIR}${PREFIX}/usr/lib/libusb.so ${STAGEDIR}${PREFIX}/usr/lib/libusb-0.1.so.4
${LN} -s libusb.so.3 ${STAGEDIR}${PREFIX}/usr/lib/libusb-0.1.so.4
.if defined(BOOTSTRAP) || defined(SVN_FETCH)
#FETCH_DEPENDS+= svn:devel/subversion