Index: Mk/Uses/7z.mk =================================================================== --- /dev/null +++ Mk/Uses/7z.mk @@ -0,0 +1,64 @@ +# $FreeBSD$ +# +# Extract 7-Zip archives +# +# Feature: 7z +# Usage: USES=7z or USES=7z:ARGS +# Valid ARGS: p7zip, partial +# +# p7zip Extract using 7z(1) instead of bsdtar(1) +# partial Extract only files tagged with :7z or in EXTRACT_ONLY_7z +# +# MAINTAINER: jbeich@FreeBSD.org + +.if !defined(_INCLUDE_USES_7Z_MK) +_INCLUDE_USES_7Z_MK= yes + +P7ZIP_CMD?= 7z +P7ZIP_BEFORE_ARGS?= x -bd -y -o${P7ZIP_WRKDIR} >/dev/null +P7ZIP_AFTER_ARGS?= # empty +P7ZIP_WRKDIR?= ${EXTRACT_WRKDIR} + +.if !empty(7z_ARGS:Np7zip:Npartial) +IGNORE= USES=7z has invalid arguments: ${7z_ARGS:Np7zip:Npartial} +.endif + +.if ! ${7z_ARGS:Mp7zip} && (${OPSYS} == FreeBSD && ${OSVERSION} < 1000009) +# libarchive lacks 7zip reader, fallback to P7ZIP_CMD +7z_ARGS+= p7zip +.endif + +.if ${7z_ARGS:Mp7zip} +EXTRACT_DEPENDS+= ${P7ZIP_CMD}:${PORTSDIR}/archivers/p7zip +.endif + +.if ! ${7z_ARGS:Mpartial} +EXTRACT_SUFX?= .7z +.endif + +.if ${7z_ARGS:Mp7zip} && ! ${7z_ARGS:Mpartial} +EXTRACT_CMD?= ${P7ZIP_CMD} +EXTRACT_BEFORE_ARGS?= ${P7ZIP_BEFORE_ARGS} +EXTRACT_AFTER_ARGS?= ${P7ZIP_AFTER_ARGS} +.endif + +.if ! ${7z_ARGS:Mp7zip} && ${7z_ARGS:Mpartial} && defined(EXTRACT_ONLY) +EXTRACT_ONLY+= ${EXTRACT_ONLY_7z} +.endif + +.if ${7z_ARGS:Mp7zip} && ${7z_ARGS:Mpartial} +EXTRACT_ONLY?= ${_DISTFILES:N*\:*7z*} +EXTRACT_ONLY_7z?= ${_DISTFILES:M*\:*7z*} + +_USES_extract+= 520:do-p7zip-extract +do-p7zip-extract: + @for file in ${EXTRACT_ONLY_7z}; do \ + if ! ${P7ZIP_CMD} ${P7ZIP_BEFORE_ARGS} \ + ${_DISTDIR}/$$file ${P7ZIP_AFTER_ARGS}; \ + then \ + exit 1; \ + fi; \ + done +.endif + +.endif Index: devel/fb-adb/Makefile =================================================================== --- devel/fb-adb/Makefile +++ devel/fb-adb/Makefile @@ -64,6 +64,7 @@ WRKSRC_ndk= ${WRKDIR}/${DISTNAME_ndk:C/(-[^-]+){2}$//} .endif NDK_BUILD_DEPENDS= ${LINUX_BASE_PORT} +NDK_USES= 7z:partial${NDK_WANTS_P7ZIP} NDK_USE= LINUX=yes # build NDK_SHELL= ${SETENV} UNAME_s=Linux UNAME_m=${LINUX_RPM_ARCH} ${SH} NDK_CONFIGURE_ENV= ANDROID_NDK="${WRKSRC_ndk}" \ @@ -73,6 +74,11 @@ NDK_CONFIGURE_ENV_OFF= PATH="${NDK_BUILD_DEPENDS_OFF:C/:.*//:H}:$$PATH" NDK_CONFIGURE_OFF= --with-android-ndk=system +# libarchive cannot handle x86_64 sfx? +.if defined(OVERRIDE_LINUX_BASE_PORT) && ${OVERRIDE_LINUX_BASE_PORT:M*64} +NDK_WANTS_P7ZIP= ,p7zip +.endif + post-extract: # XXX gold: fatal error: a.out: Invalid argument @for f in $$(${FIND} ${WRKSRC_ndk} -type l -name '*-ld'); do \ @@ -109,27 +115,6 @@ @${MKDIR} ${CONFIGURE_WRKSRC} .endif -.include - -# Extract :p7zip files with 7z(1) if libarchive cannot handle x86_64 sfx -# or is too old to have 7zip reader -.if defined(OVERRIDE_LINUX_BASE_PORT) || \ - (${OPSYS} == FreeBSD && ${OSVERSION} < 1000009) -EXTRACT_ONLY+= ${DISTFILES:N*\:*p7zip*:C/:.*//} -EXTRACT_DEPENDS+=${P7ZIP_CMD}:${PORTSDIR}/archivers/p7zip - -P7ZIP_CMD?= 7z -P7ZIP_ARGS?= x -bd -y -o${WRKDIR} >/dev/null - -_OPTIONS_extract+= 520:do-p7zip-extract -do-p7zip-extract: - @for f in ${DISTFILES:M*\:*p7zip*:C/:.*//}; do \ - if ! ${P7ZIP_CMD} ${P7ZIP_ARGS} ${_DISTDIR}/$$f; then \ - return 1; \ - fi; \ - done -.endif - .include # XXX Teach USE_LINUX about build-only deps Index: games/rocksndiamonds-data/Makefile =================================================================== --- games/rocksndiamonds-data/Makefile +++ games/rocksndiamonds-data/Makefile @@ -23,15 +23,17 @@ Veysi_Orak_2006.zip DIST_SUBDIR= rocksndiamonds EXTRACT_ONLY= #empty +EXTRACT_ONLY_7z=Emerald_Mine_Club-2.1.1.7z MAINTAINER= nemysis@FreeBSD.org COMMENT= Additional Player Levels for Rocks'n'Diamonds and R'n'D jue -EXTRACT_DEPENDS+=${UNZIP_CMD}:${PORTSDIR}/archivers/unzip \ - 7z:${PORTSDIR}/archivers/p7zip +EXTRACT_DEPENDS+=${UNZIP_CMD}:${PORTSDIR}/archivers/unzip +USES= 7z:partial NO_BUILD= yes NO_WRKSUBDIR= yes +WRKSRC= ${WRKDIR}/${PORTNAME} # for EXTRACT_WRKDIR SUB_FILES= pkg-message pkg-deinstall @@ -76,9 +78,6 @@ .endif post-extract-script: - ${MKDIR} ${WRKDIR}/${PORTNAME} - 7z x ${_DISTDIR}/Emerald_Mine_Club-2.1.1.7z -o${WRKDIR}/${PORTNAME}/levels - .for l in BD2K3-1.0.0.zip Snake_Bite-1.0.0.zip Zelda-1.0.0.zip \ ZeldaII-1.0.0.zip Boulder_Dash_Dream-1.0.0.zip @${UNZIP_CMD} -qo -d ${WRKDIR}/${PORTNAME} ${_DISTDIR}/${l} Index: korean/nanumfonts-otf/Makefile =================================================================== --- korean/nanumfonts-otf/Makefile +++ korean/nanumfonts-otf/Makefile @@ -14,20 +14,17 @@ LICENSE= OFL11 -EXTRACT_DEPENDS= 7z:${PORTSDIR}/archivers/p7zip - DISTFILE_LIST= ALL GOTHICECO MYUNGJOECO DISTFILE_PRFX= NanumFontSetup_${FONTTYPE:tu}_ DISTFILE_SUFX= _hangeulcamp.exe DISTINFO_FILE= ${PKGDIR}/distinfo.${FONTTYPE} -EXTRACT_CMD= 7z EXTRACT_BEFORE_ARGS= e -y EXTRACT_AFTER_ARGS= '$$WINDIR/Fonts' NO_ARCH= yes NO_BUILD= yes -USES= fonts +USES= 7z:p7zip fonts FONTTYPE?= otf FONTFORMAT?= OpenType Index: sysutils/namefix/Makefile =================================================================== --- sysutils/namefix/Makefile +++ sysutils/namefix/Makefile @@ -7,30 +7,24 @@ CATEGORIES= sysutils perl5 MASTER_SITES= SF/${PORTNAME}/${PORTNAME}.pl/${PORTVERSION} DISTNAME= ${PORTNAME}.pl_${PORTVERSION} -EXTRACT_SUFX= .7z MAINTAINER= ports@FreeBSD.org COMMENT= Batch file renamer LICENSE= GPLv2 -EXTRACT_DEPENDS=7z:${PORTSDIR}/archivers/p7zip RUN_DEPENDS= p5-MP3-Tag>=0:${PORTSDIR}/audio/p5-MP3-Tag \ p5-Tk>=0:${PORTSDIR}/x11-toolkits/p5-Tk \ p5-Tk-JComboBox>=0:${PORTSDIR}/x11-toolkits/p5-Tk-JComboBox \ p5-Tk-DynaTabFrame>=0:${PORTSDIR}/x11-toolkits/p5-Tk-DynaTabFrame -EXTRACT_CMD= 7z -EXTRACT_BEFORE_ARGS= x -EXTRACT_AFTER_ARGS= -bd -y >/dev/null 2>&1 - WRKSRC= ${WRKDIR}/${PORTNAME}.pl NO_BUILD= yes NO_ARCH= yes BROKEN_sparc64= cannot extract: coredump in extract phase -USES= perl5 shebangfix +USES= 7z perl5 shebangfix USE_PERL5= run SHEBANG_FILES= namefix-cli.pl namefix.pl