Date: Wed, 5 Mar 2014 21:24:00 GMT From: Christian Elmerot <christian@elmerot.se> To: freebsd-gnats-submit@FreeBSD.org Subject: ports/187304: multimedia/libvpx: allow building with zsh Message-ID: <201403052124.s25LO0Gj095155@cgiserv.freebsd.org> Resent-Message-ID: <201403052130.s25LU0rp059774@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 187304 >Category: ports >Synopsis: multimedia/libvpx: allow building with zsh >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Wed Mar 05 21:30:00 UTC 2014 >Closed-Date: >Last-Modified: >Originator: Christian Elmerot >Release: 10-STABLE >Organization: >Environment: >Description: Changes to libvpx have rendered it unable to be built by default using zsh. By making the port detect if zsh is installed and have the user disable EXAMPLES will enable proper building using zsh instead of bash which removes additional dependencies when zsh is already installed. There are several bash-isms in examples/gen_example_code.sh & examples/gen_example_text.sh such as short if statements, tests and printf that fails for zsh making EXAMPLES currently a no-go. ANy fixes for those files should likely be upstreamed >How-To-Repeat: $ cd /usr/ports/shells/zsh; make install $ cd /usr/ports/multimedia/libvpx; make install >Fix: $ cd /usr/ports/shells/zsh; make install Apply attached patch to Makefile for libvpx, Deselect EXAMPLES $ cd /usr/ports/multimedia/libvpx; make config; make install Patch attached with submission follows: --- Makefile.orig 2014-01-12 17:08:27.000000000 +0100 +++ Makefile 2014-03-05 22:07:23.721069292 +0100 @@ -13,7 +13,7 @@ LICENSE= BSD LICENSE_FILE= ${WRKSRC}/LICENSE -BUILD_DEPENDS= bash:${PORTSDIR}/shells/bash \ +BUILD_DEPENDS= ${SHELL}:${PORTSDIR}/shells/${SHELL} \ yasm:${PORTSDIR}/devel/yasm USES= gmake perl5 @@ -22,11 +22,12 @@ USE_PERL5= build USE_LDCONFIG= yes -OPTIONS_DEFINE= DEBUG POSTPROC RUNTIME THREADS SHARED +OPTIONS_DEFINE= DEBUG POSTPROC RUNTIME THREADS SHARED EXAMPLES OPTIONS_DEFAULT= POSTPROC RUNTIME THREADS SHARED POSTPROC_DESC= Enable postprocessing RUNTIME_DESC= Enable runtime CPU detection SHARED_DESC= Enable shared-library support +EXAMPLES_DESC= Build and/or install examples (requires Bash) WRKSRC= ${WRKDIR}/${PORTNAME}-${DISTVERSION} ALL_TARGET= @@ -46,9 +47,18 @@ RUNTIME_CONFIGURE_ON= --enable-runtime-cpu-detect THREADS_CONFIGURE_OFF= --disable-multithread SHARED_CONFIGURE_ON= --enable-shared +EXAMPLES_CONFIGURE_OFF= --disable-examples .include <bsd.port.options.mk> +.if ${PORT_OPTIONS:MEXAMPLES} +SHELL= bash +.elif exists(${LOCALBASE}/bin/zsh) +SHELL= zsh +.else +SHELL= bash +.endif + .if ${OSVERSION} < 900000 .if ${ARCH} == "amd64" USE_GCC= yes @@ -85,7 +95,7 @@ @${REINPLACE_CMD} -e 's|%%DESTDIR%%|${STAGEDIR}|g' \ ${WRKSRC}/build/make/Makefile ${WRKSRC}/libs.mk @${GREP} -Rl '^#!/bin/bash' ${WRKSRC} |${XARGS} ${REINPLACE_CMD} \ - -e 's,#!/bin/bash,#!/usr/bin/env bash,g' + -e 's,#!/bin/bash,#!/usr/bin/env ${SHELL},g' @${GREP} -Rl -- '-l\?pthread' ${WRKSRC} |${XARGS} ${REINPLACE_CMD} -E \ -e 's/-l?pthread/${PTHREAD_LIBS}/g' >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201403052124.s25LO0Gj095155>