From owner-dev-commits-ports-all@freebsd.org Fri Sep 24 21:58:05 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 B1A1F6758C9; Fri, 24 Sep 2021 21:58:05 +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 4HGQrY4dVcz4SsM; Fri, 24 Sep 2021 21:58:05 +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 7B4691E5B1; Fri, 24 Sep 2021 21:58:05 +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 18OLw5xU057629; Fri, 24 Sep 2021 21:58:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18OLw5eB057628; Fri, 24 Sep 2021 21:58:05 GMT (envelope-from git) Date: Fri, 24 Sep 2021 21:58:05 GMT Message-Id: <202109242158.18OLw5eB057628@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: d94f19ab9ffc - main - biology/ucsc-userapps: Add "kent" command in ${PREFIX}/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: d94f19ab9ffcd2fac7650802d6aea3f68156f5d7 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:58:05 -0000 The branch main has been updated by jwb: URL: https://cgit.FreeBSD.org/ports/commit/?id=d94f19ab9ffcd2fac7650802d6aea3f68156f5d7 commit d94f19ab9ffcd2fac7650802d6aea3f68156f5d7 Author: Jason W. Bacon AuthorDate: 2021-09-24 21:53:30 +0000 Commit: Jason W. Bacon CommitDate: 2021-09-24 21:53:30 +0000 biology/ucsc-userapps: Add "kent" command in ${PREFIX}/bin Standard kent userapps commands are installed under ${PREFIX}/userapps because of multiple conflicts. The kent command turns the standard commands into subcommands, so no special PATH is needed. /usr/local/ucsc-userapps/bin/bigWigToBedGraph [args] can be run as kent bigWigToBedGraph [args] --- biology/ucsc-userapps/Makefile | 3 ++ biology/ucsc-userapps/files/kent.c | 59 ++++++++++++++++++++++++++++++++++++++ biology/ucsc-userapps/pkg-plist | 1 + 3 files changed, 63 insertions(+) diff --git a/biology/ucsc-userapps/Makefile b/biology/ucsc-userapps/Makefile index c7e44cc879ed..da61329ba20b 100644 --- a/biology/ucsc-userapps/Makefile +++ b/biology/ucsc-userapps/Makefile @@ -2,6 +2,7 @@ PORTNAME= ucsc-userapps DISTVERSION= 414 +PORTREVISION= 1 CATEGORIES= biology perl5 python MASTER_SITES= http://hgdownload.cse.ucsc.edu/admin/exe/userApps.archive/ DISTNAME= userApps.v${PORTVERSION}.src @@ -57,6 +58,7 @@ do-build: @(cd ${WRKSRC}/kent/src/jkOwnLib && ${DO_MAKE_BUILD}) @(cd ${WRKSRC}/kent/src/hg/lib && ${DO_MAKE_BUILD}) @(cd ${WRKSRC}/kent/src/utils && ${DO_MAKE_BUILD}) + ${CC} -DUCSC_PREFIX="\"${PREFIX}/userapps\"" ${FILESDIR}/kent.c -o ${WRKDIR}/kent do-install: @${MKDIR} ${WRKSRC}/scripts ${WRKSRC}/binaries @@ -71,5 +73,6 @@ do-install: ${STAGEDIR}${PREFIX}/userapps/bin ${INSTALL_SCRIPT} ${WRKDIR}/ucsc-shell \ ${STAGEDIR}${PREFIX}/bin + ${INSTALL_PROGRAM} ${WRKDIR}/kent ${STAGEDIR}${LOCALBASE}/bin .include diff --git a/biology/ucsc-userapps/files/kent.c b/biology/ucsc-userapps/files/kent.c new file mode 100644 index 000000000000..f1c8887068f5 --- /dev/null +++ b/biology/ucsc-userapps/files/kent.c @@ -0,0 +1,59 @@ +/*************************************************************************** + * Description: + * Wrapper to turn ucsc kent commands into subcommands. The kent 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 kent 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: + * + * kent bigWigToBedGraph args + * + * instead of one of the following: + * + * prefix/bin/bigWigToBedGraph args + * + * env PATH=prefix/bin:$PATH bigWigToBedGraph args + * + * conda activate kent + * bigWigToBedGraph args + * + * Arguments: + * The full kent utils command you would use if it were in PATH. + * + * Compile with UCSC_PREFIX set to the parent of the bin directory + * containing the kent binaries. + * + * History: + * Date Name Modification + * 2021-09-13 Jason Bacon Begin + ***************************************************************************/ + +#include +#include +#include +#include + +#ifndef UCSC_PREFIX +#define UCSC_PREFIX "/usr/local/userapps" +#endif + +int main(int argc,char *argv[]) + +{ + char cmd[PATH_MAX + 1]; + + if ( argc < 2 ) + { + fprintf(stderr, "Usage: %s UCSC-userapps-command [args]\n", argv[0]); + return EX_USAGE; + } + + snprintf(cmd, PATH_MAX, "%s/bin/%s", UCSC_PREFIX, argv[1]); + execv(cmd, argv + 1); +} diff --git a/biology/ucsc-userapps/pkg-plist b/biology/ucsc-userapps/pkg-plist index e8304be64af2..f8605fc771d0 100644 --- a/biology/ucsc-userapps/pkg-plist +++ b/biology/ucsc-userapps/pkg-plist @@ -1,3 +1,4 @@ +bin/kent bin/ucsc-shell userapps/bin/aNotB userapps/bin/addCols