From owner-dev-commits-ports-all@freebsd.org Fri Sep 24 21:38:56 2021 Return-Path: Delivered-To: dev-commits-ports-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0C98667506E; Fri, 24 Sep 2021 21:38:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HGQQR6hjMz4Rtx; Fri, 24 Sep 2021 21:38:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C5C391E15B; Fri, 24 Sep 2021 21:38:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18OLctNx031615; Fri, 24 Sep 2021 21:38:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18OLctS6031614; Fri, 24 Sep 2021 21:38:55 GMT (envelope-from git) Date: Fri, 24 Sep 2021 21:38:55 GMT Message-Id: <202109242138.18OLctS6031614@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: "Jason W. Bacon" Subject: git: c68b6dc6448c - main - biology/emboss: Add "emboss" command in ${LOCALBASE}/bin MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jwb X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c68b6dc6448c618b79c8d1800d25b789b1b01a90 Auto-Submitted: auto-generated X-BeenThere: dev-commits-ports-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the ports repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Sep 2021 21:38:56 -0000 The branch main has been updated by jwb: URL: https://cgit.FreeBSD.org/ports/commit/?id=c68b6dc6448c618b79c8d1800d25b789b1b01a90 commit c68b6dc6448c618b79c8d1800d25b789b1b01a90 Author: Jason W. Bacon AuthorDate: 2021-09-24 21:34:20 +0000 Commit: Jason W. Bacon CommitDate: 2021-09-24 21:34:20 +0000 biology/emboss: Add "emboss" command in ${LOCALBASE}/bin Standard emboss commands are installed under a special prefix because of multiple conflicts. The emboss command turns the standard commands into subcommands, so no special PATH is needed. /usr/local/emboss/bin/needle [args] can be run as emboss needle [args] --- biology/emboss/Makefile | 6 ++++- biology/emboss/distinfo | 2 +- biology/emboss/files/emboss.c | 59 +++++++++++++++++++++++++++++++++++++++++++ biology/emboss/pkg-plist | 1 + 4 files changed, 66 insertions(+), 2 deletions(-) diff --git a/biology/emboss/Makefile b/biology/emboss/Makefile index 24862d3e1732..fed3bdc4df4e 100644 --- a/biology/emboss/Makefile +++ b/biology/emboss/Makefile @@ -2,7 +2,7 @@ PORTNAME= emboss PORTVERSION= 6.6.0 -PORTREVISION= 5 +PORTREVISION= 6 CATEGORIES= biology MASTER_SITES= ftp://emboss.open-bio.org/pub/EMBOSS/ DISTNAME= ${PORTNAME:tu}-${PORTVERSION} @@ -50,6 +50,9 @@ CONFIG_FILE= ${WRKSRC}/emboss/emboss.default.template post-patch: @${REINPLACE_CMD} -e 's/-liconv/${ICONV_LIB}/' ${WRKSRC}/configure +post-build: + ${CC} -DEMBOSS_PREFIX="\"${PREFIX}\"" ${FILESDIR}/emboss.c -o ${WRKDIR}/emboss + pre-install: @ ${REINPLACE_CMD} -e 's#%%DATADIR%%#${PREFIX}/share/${PORTNAME:tu}#' ${CONFIG_FILE} @@ -57,5 +60,6 @@ post-install: @${MKDIR} ${STAGEDIR}${LOCALBASE}/bin ${INSTALL_SCRIPT} ${WRKDIR}/emboss-shell ${STAGEDIR}${LOCALBASE}/bin ${INSTALL_DATA} ${CONFIG_FILE} ${STAGEDIR}${DATADIR} + ${INSTALL_PROGRAM} ${WRKDIR}/emboss ${STAGEDIR}${LOCALBASE}/bin .include diff --git a/biology/emboss/distinfo b/biology/emboss/distinfo index ea7511984c28..a8e5c23c1cc6 100644 --- a/biology/emboss/distinfo +++ b/biology/emboss/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1630940920 +TIMESTAMP = 1632518858 SHA256 (emboss/EMBOSS-6.6.0.tar.gz) = 7184a763d39ad96bb598bfd531628a34aa53e474db9e7cac4416c2a40ab10c6e SIZE (emboss/EMBOSS-6.6.0.tar.gz) = 117962028 diff --git a/biology/emboss/files/emboss.c b/biology/emboss/files/emboss.c new file mode 100644 index 000000000000..1b6f1deca5df --- /dev/null +++ b/biology/emboss/files/emboss.c @@ -0,0 +1,59 @@ +/*************************************************************************** + * Description: + * Wrapper to turn emboss commands into subcommands. The emboss suite + * contains executables that conflict with multiple other software + * packages and therefore cannot be safely installed directly under a + * standard prefix. This wrapper can be installed under the standard + * PATH and used to to execute emboss commands installed under a + * private prefix, without altering PATH, activating a special + * environment, opening a container, etc. This sub-command paradigm + * is already familiar to bioinformaticians thanks to other suites + * like samtools, bedtools, etc. + * + * Example: + * + * emboss seqret args + * + * instead of one of the following: + * + * prefix/bin/seqret args + * + * env PATH=prefix/bin:$PATH seqret args + * + * conda activate emboss + * seqret args + * + * Arguments: + * The full emboss command you would use if it were in PATH. + * + * Compile with EMBOSS_PREFIX set to the parent of the bin directory + * containing the emboss binaries. + * + * History: + * Date Name Modification + * 2021-09-13 Jason Bacon Begin + ***************************************************************************/ + +#include +#include +#include +#include + +#ifndef EMBOSS_PREFIX +#define EMBOSS_PREFIX "/usr/local/emboss" +#endif + +int main(int argc,char *argv[]) + +{ + char cmd[PATH_MAX + 1]; + + if ( argc < 2 ) + { + fprintf(stderr, "Usage: %s emboss-command [args]\n", argv[0]); + return EX_USAGE; + } + + snprintf(cmd, PATH_MAX, "%s/bin/%s", EMBOSS_PREFIX, argv[1]); + execv(cmd, argv + 1); +} diff --git a/biology/emboss/pkg-plist b/biology/emboss/pkg-plist index 281c02c28196..f2b9e61952fd 100644 --- a/biology/emboss/pkg-plist +++ b/biology/emboss/pkg-plist @@ -77,6 +77,7 @@ bin/edamisid bin/edamname bin/edialign bin/einverted +%%LOCALBASE%%/bin/emboss %%LOCALBASE%%/bin/emboss-shell bin/embossdata bin/embossupdate