aboutsummaryrefslogtreecommitdiff
path: root/biology
diff options
context:
space:
mode:
authorJason W. Bacon <jwb@FreeBSD.org>2021-09-24 21:34:20 +0000
committerJason W. Bacon <jwb@FreeBSD.org>2021-09-24 21:34:20 +0000
commitc68b6dc6448c618b79c8d1800d25b789b1b01a90 (patch)
treec8f3dfa17d41cd32ddf357a08c09ea814257e868 /biology
parent6b077d7a7d1311e91865d94b195ae374db0464c1 (diff)
downloadports-c68b6dc6448c618b79c8d1800d25b789b1b01a90.tar.gz
ports-c68b6dc6448c618b79c8d1800d25b789b1b01a90.zip
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]
Diffstat (limited to 'biology')
-rw-r--r--biology/emboss/Makefile6
-rw-r--r--biology/emboss/distinfo2
-rw-r--r--biology/emboss/files/emboss.c59
-rw-r--r--biology/emboss/pkg-plist1
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 <bsd.port.mk>
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 <stdio.h>
+#include <sysexits.h>
+#include <limits.h>
+#include <unistd.h>
+
+#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