freebsd-ports/devel/fb-adb/Makefile

104 lines
3.2 KiB
Makefile
Raw Normal View History

# $FreeBSD$
PORTNAME= fb-adb
DISTVERSION= 1.4.4-126
DISTVERSIONSUFFIX= -g6fd78ae
PORTREVISION= 2
2016-12-16 17:21:59 +01:00
CATEGORIES= devel comms
PATCH_SITES= https://github.com/${GH_ACCOUNT}/${GH_PROJECT}/commit/
PATCHFILES= 1b5524282981.patch:-p1 \
8f532a9ee3a3.patch:-p1 \
a25602788c1b.patch:-p1 \
3a3a52355a39.patch:-p1 \
281df4766b82.patch:-p1 \
723148059ce2.patch:-p1 \
${NULL}
MAINTAINER= jbeich@FreeBSD.org
COMMENT= Better shell for Android devices
LICENSE= BSD3CLAUSE
LICENSE_FILE= ${WRKSRC}/LICENSE
2018-01-11 21:34:08 +01:00
BUILD_DEPENDS= xxd:editors/vim-console \
${BASH_CMD}:shells/${BASH_CMD:T}
RUN_DEPENDS= adb:devel/android-tools-adb
USE_GITHUB= yes
GH_ACCOUNT= facebook
USES= autoreconf gmake ncurses perl5 python:3.4+,build
USE_PERL5= build # pod2man
BASH_CMD?= bash # can be zsh
GNU_CONFIGURE= yes
CONFIGURE_OUTSOURCE= yes
CONFIGURE_ENV= PYTHON3="${PYTHON_CMD}"
INSTALL_TARGET= install-strip
PLIST_FILES= bin/${PORTNAME} \
man/man1/${PORTNAME}.1.gz
# Cross-build sanitization
CONFIG_SITE= /dev/null # XXX Only for AC_CONFIG_SUBDIRS
CONFIGURE_ENV+= HOST_CFLAGS="${CPPFLAGS} ${CFLAGS:N-[Og]*:N-pipe}" \
STUB_CFLAGS="${STUB_CFLAGS}" \
CPPFLAGS="" CFLAGS="${CFLAGS:M-[Og]*} ${CFLAGS:M-pipe}" \
HOST_LDFLAGS="${LDFLAGS} ${LIBS}" \
STUB_LDFLAGS="${STUB_LDFLAGS}" \
LDFLAGS="" LIBS=""
OPTIONS_DEFINE= ASSERT BASH DEBUG NDK
OPTIONS_DEFAULT=NDK
OPTIONS_EXCLUDE=${ARCH:Namd64:Ni386:C/.+/NDK/}
OPTIONS_EXCLUDE_DragonFly=NDK
ASSERT_CONFIGURE_ENABLE=checking
BASH_DESC= Install JSON parser used by bash-completion
BASH_RUN_DEPENDS= jq:textproc/jq
DEBUG_CONFIGURE_ENABLE= debuggable-stubs
# XXX Convert into USES=android once more things depend on it
NDK_DESC= Build target stubs using Android NDK
NDK_MASTER_SITES= https://dl.google.com/android/ndk/:7z \
https://dl.google.com/android/repository/:zip
.if defined(ANDROID_NDK)
# Prefer NDK from environment
WRKSRC_ndk= ${ANDROID_NDK}
.else
- Replace Mk/bsd.linux-apps.mk and Mk/bsd.linux-rpm.mk with Mk/Uses/linux.mk. - Replace USE_LINUX=yes with USES+=linux and USE_LINUX=(.*) with USES+=linux:\1 in all ports. - Replace USE_LINUX_APPS with USE_LINUX in all ports. - Use INSTALL_SCRIPT instead of INSTALL_PROGRAM to install scripts in some ports. - When USE_LINUX_RPM is defined, simplify the way DISTFILES and EXTRACT_ONLY are defined. - Remove BRANDELF_DIRS and BRANDELF_FILES handling. In the very rare cases that it is still necessary ports can run ${BRANDELF} from post-patch. - Remove AUTOMATIC_PLIST handling. Only one port used it. - Fix Linux MASTER_SITES. - Replace OVERRIDE_LINUX_BASE_PORT and OVERRIDE_LINUX_NONBASE_PORTS with default versions framework. - bsd.port.mk: - Move Linux related bits to Uses/linux.mk, except USE_LINUX_PREFIX. - Put USE_LINUX_PREFIX handling after USES processing. - Define DOCSDIR, DATADIR, etc. after handling USE_LINUX_PREFIX so it can give these variables a different default value. - When a package needs to run Linux ldconfig check before installation if Linux support is enabled. - emulators/linux_base-*: - Use USES=linux and remove duplication. - Remove files/lp. FreeBSD or CUPS lp(1) should work. - Remove files/yp.conf. No longer seems to be used. - Remove pkg-deinstall and move pkg-install into pkg-plist. - Update pkg-descr and pkg-message. - Fix handling of ldconfig cache in pkg-plist. - devel/fb-adb: Use a Linux shell to run a Linux script but patch the script to use FreeBSD mkdir so mkdir -p $path creates $path and not /compat/linux/$path. PR: 211645 Exp-run by: antoine Approved by: portmgr (antoine)
2016-09-05 21:23:42 +02:00
NDK_DISTFILES= ${NDK_DISTFILES_${LINUX_ARCH}}
NDK_DISTFILES_i386= android-ndk-r10e-linux-x86.bin:7z
NDK_DISTFILES_x86_64= android-ndk-r12b-linux-x86_64.zip:zip
WRKSRC_ndk= ${WRKDIR}/${NDK_DISTFILES:R:C/(-[^-]+){2}$//}
.endif
- Replace Mk/bsd.linux-apps.mk and Mk/bsd.linux-rpm.mk with Mk/Uses/linux.mk. - Replace USE_LINUX=yes with USES+=linux and USE_LINUX=(.*) with USES+=linux:\1 in all ports. - Replace USE_LINUX_APPS with USE_LINUX in all ports. - Use INSTALL_SCRIPT instead of INSTALL_PROGRAM to install scripts in some ports. - When USE_LINUX_RPM is defined, simplify the way DISTFILES and EXTRACT_ONLY are defined. - Remove BRANDELF_DIRS and BRANDELF_FILES handling. In the very rare cases that it is still necessary ports can run ${BRANDELF} from post-patch. - Remove AUTOMATIC_PLIST handling. Only one port used it. - Fix Linux MASTER_SITES. - Replace OVERRIDE_LINUX_BASE_PORT and OVERRIDE_LINUX_NONBASE_PORTS with default versions framework. - bsd.port.mk: - Move Linux related bits to Uses/linux.mk, except USE_LINUX_PREFIX. - Put USE_LINUX_PREFIX handling after USES processing. - Define DOCSDIR, DATADIR, etc. after handling USE_LINUX_PREFIX so it can give these variables a different default value. - When a package needs to run Linux ldconfig check before installation if Linux support is enabled. - emulators/linux_base-*: - Use USES=linux and remove duplication. - Remove files/lp. FreeBSD or CUPS lp(1) should work. - Remove files/yp.conf. No longer seems to be used. - Remove pkg-deinstall and move pkg-install into pkg-plist. - Update pkg-descr and pkg-message. - Fix handling of ldconfig cache in pkg-plist. - devel/fb-adb: Use a Linux shell to run a Linux script but patch the script to use FreeBSD mkdir so mkdir -p $path creates $path and not /compat/linux/$path. PR: 211645 Exp-run by: antoine Approved by: portmgr (antoine)
2016-09-05 21:23:42 +02:00
NDK_USES= 7z:partial linux
NDK_USE= LINUX=base:build
NDK_SHELL= ${LINUXBASE}/bin/sh
NDK_CONFIGURE_ENV= ANDROID_NDK="${WRKSRC_ndk}" \
ANDROID_NDK_SHELL="${NDK_SHELL}" \
NDK_TMPDIR="${WRKDIR}"
NDK_BUILD_DEPENDS_OFF= ${LOCALBASE}/android/ARMv7/bin/arm-aux-linux-androideabi-gcc:lang/gnatdroid-armv7 \
${LOCALBASE}/android-x86/x86_32/bin/i686-aux-linux-android-gcc:lang/gnatdroid-x86
NDK_CONFIGURE_ENV_OFF= PATH="${NDK_BUILD_DEPENDS_OFF:C/:.*//:H:ts:}:$$PATH"
NDK_CONFIGURE_OFF= --with-android-ndk=system
post-extract:
# XXX gold: fatal error: a.out: Invalid argument
@for f in $$(${FIND} ${WRKSRC_ndk} -type l -name '*-ld'); do \
(cd $${f%/*} && ${LN} -sf $${f##*/}.bfd $${f##*/}); \
done
post-patch:
# XXX Decouple -Werror from --enable-checking (ASSERT=on)
@${REINPLACE_CMD} -e '/CPPFLAGS.*-Werror/d' ${WRKSRC}/configure.ac
- Replace Mk/bsd.linux-apps.mk and Mk/bsd.linux-rpm.mk with Mk/Uses/linux.mk. - Replace USE_LINUX=yes with USES+=linux and USE_LINUX=(.*) with USES+=linux:\1 in all ports. - Replace USE_LINUX_APPS with USE_LINUX in all ports. - Use INSTALL_SCRIPT instead of INSTALL_PROGRAM to install scripts in some ports. - When USE_LINUX_RPM is defined, simplify the way DISTFILES and EXTRACT_ONLY are defined. - Remove BRANDELF_DIRS and BRANDELF_FILES handling. In the very rare cases that it is still necessary ports can run ${BRANDELF} from post-patch. - Remove AUTOMATIC_PLIST handling. Only one port used it. - Fix Linux MASTER_SITES. - Replace OVERRIDE_LINUX_BASE_PORT and OVERRIDE_LINUX_NONBASE_PORTS with default versions framework. - bsd.port.mk: - Move Linux related bits to Uses/linux.mk, except USE_LINUX_PREFIX. - Put USE_LINUX_PREFIX handling after USES processing. - Define DOCSDIR, DATADIR, etc. after handling USE_LINUX_PREFIX so it can give these variables a different default value. - When a package needs to run Linux ldconfig check before installation if Linux support is enabled. - emulators/linux_base-*: - Use USES=linux and remove duplication. - Remove files/lp. FreeBSD or CUPS lp(1) should work. - Remove files/yp.conf. No longer seems to be used. - Remove pkg-deinstall and move pkg-install into pkg-plist. - Update pkg-descr and pkg-message. - Fix handling of ldconfig cache in pkg-plist. - devel/fb-adb: Use a Linux shell to run a Linux script but patch the script to use FreeBSD mkdir so mkdir -p $path creates $path and not /compat/linux/$path. PR: 211645 Exp-run by: antoine Approved by: portmgr (antoine)
2016-09-05 21:23:42 +02:00
post-patch-NDK-on:
@${REINPLACE_CMD} 's,mkdir,/compat/linux/../../bin/mkdir,' \
${WRKSRC_ndk}/build/tools/make-standalone-toolchain.sh \
${WRKSRC_ndk}/build/tools/ndk-common.sh
post-patch-NDK-off:
@${REINPLACE_CMD} -i '.aux.bak' -e 's/linux-android/aux-&/' \
${WRKSRC}/stub-*/configure
.include <bsd.port.mk>