summaryrefslogtreecommitdiff
path: root/sci-biology/meme
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
committerV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
commit4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch)
treeba5f07bf3f9d22d82e54a462313f5d244036c768 /sci-biology/meme
reinit the tree, so we can have metadata
Diffstat (limited to 'sci-biology/meme')
-rw-r--r--sci-biology/meme/Manifest8
-rw-r--r--sci-biology/meme/files/meme-4.11.2_p2-fix-build-system.patch346
-rw-r--r--sci-biology/meme/files/meme-4.11.2_p2-patch1.patch383
-rw-r--r--sci-biology/meme/files/meme-4.11.2_p2-patch2.patch54
-rw-r--r--sci-biology/meme/meme-4.11.2_p2.ebuild109
-rw-r--r--sci-biology/meme/metadata.xml8
6 files changed, 908 insertions, 0 deletions
diff --git a/sci-biology/meme/Manifest b/sci-biology/meme/Manifest
new file mode 100644
index 000000000000..81c0e1d7302c
--- /dev/null
+++ b/sci-biology/meme/Manifest
@@ -0,0 +1,8 @@
+AUX meme-4.11.2_p2-fix-build-system.patch 10447 SHA256 e8fabb881c4b2f24c7ebff9c245aafeb55a4d80db349df067d09d0143195f36e SHA512 85181e114e825081ef52545fef7ab638c91029964eb8be2e1e4042d1d766d5376dbcabc9bd3902f19d162997dd63cb02fea66d231df6bafc0e74981373ea9724 WHIRLPOOL ffa36e94450f9c6752b8e9b6c4b03f9a1ac2d4cabbf4a90bb138c4a0ab2dda4549023b3175c1a2375ac3cba3121681c88cd5ad9773111b49feda2972898a7677
+AUX meme-4.11.2_p2-patch1.patch 13820 SHA256 2cad7e80d00c5b493bcb60a56921e909e4168015d57daf87ac708d1404b59756 SHA512 5a5989b5c626dee6aeaa435ce6c444caed6711d62216743d97215abddef95eb92c66544576866fc43c8efb090410aaed425231642dfcd9634b3f3025d5f1981f WHIRLPOOL 739f4ce6b7b8d9a3649ec262aed66077f60f43629c4be0b8d3ce99d55656272e6dfa21490aee2159e203de113d16f6b48fa9458055215e326dfc0eedaf876f02
+AUX meme-4.11.2_p2-patch2.patch 1684 SHA256 b6bd7747e7995da169d40b9d0101c3a1d7658edbc98917f1f5b120202aab50ad SHA512 9c9b01196f76e3b02fa40c7a4d20bc77622cc3ac188584a53774be4ad72a889a72a7a57b38dda81fc7f1bb23db20eec50b0778b71caade4ddf65e49407f3ef8a WHIRLPOOL df198af71851937b3c3f1cd780e30a850f5a462ac94271898b176abcba64c20cedfc61080770f02b4f45b56ed00a604b0011576dc0e0f40330a28ca362b60f27
+DIST meme_4.11.2.tar.gz 18004930 SHA256 6e3ff843366588ea13fa8060306be9e2c144521912dfb268f03638003bcdd581 SHA512 c97c3815e71e2fb5491548152f00688cdfbf4365f6027657e0ffc68e5d96cdd10a4708e0882ab7a5a61d78d93113c925cf5bb300fbe93fa4b2961becef497894 WHIRLPOOL 6b77d7832342658d5cf546af0b005b59664c811d25a0412df765a15a8c80a75d9618a1f9966c9a2824750eced6605b534d41199382a6f2641e7430540ba19fcf
+EBUILD meme-4.11.2_p2.ebuild 2352 SHA256 e020a0a81f04af2804748a61e76c1c583daf6aef5e57928277c649458877a734 SHA512 fa4bd73f96f5f0f05dbbd12d316abe49d0414978cbcdc25bb625c288feb346d979c955316298489d951430faf60354f380ead663d04e5e711789e67d6be52e63 WHIRLPOOL 9fcb3d03913bc7e01c7172a75654344e03732e83e97f2393fa6ead08041320a1de0f30028ab277e0343daa98a0afab02090aa2168280d02361790df76a965e03
+MISC ChangeLog 3250 SHA256 13e4a82e2ee60bbc8055c50a0c2b11cc0456f3690f2a3e82a18b30f5cb57de58 SHA512 558a4b08e4fa4902edbc58e26f0eeb881ebea51d1f9cf5a7b628fa2de0862aaf6fce20763eecc78c2af63d0df8d3a581656d3e74192d24b0c0b85cebb4bf877e WHIRLPOOL a4d7c84031c71acbe54826e959ebe8a05208432a5e43a5b91ee2ad84feab79bfda41aa727a454b7e7d51f32f3f587cf81816ab58cac955c2283988c54593d696
+MISC ChangeLog-2015 4217 SHA256 d5d809590c2ccd15473b9a412ccac930a684235ef3e0a9c576c89c30385f76b5 SHA512 982aff98dd881e7bff1572a2d6f6aee2264def86787bc1ecaad7b483f984eee0180ecc12788534b77d05e3ac178ac0aeda09821453b8bc009295864e9d817092 WHIRLPOOL 3354f92e6d3340ffaa81284a05c7e6252d0e56791fb261e1fd90ead9333ec6b71432d872926dd407487a405634b9101a9a17b103cc8ddec21dc49d32b56dff2e
+MISC metadata.xml 267 SHA256 b3535fccca0fc8511c1245214c1a7c105447b35f21093bda132991874ce82d48 SHA512 91ab266d9ab24401bc0fec759c5b6cfcf44a3c5669fc31c7301d79770839bb5dfa0e155d949392ef06176b4a0b2c32b91b1b54b0027f972db61f0a5e54644403 WHIRLPOOL d841a2f928c50434f2e8c65f583ea3aa2d04e5cebd664b1531ab5373260f735219131991000bbb2b21aa3add05dcdce29548b78eac8d8c0eced6dc5505b64e13
diff --git a/sci-biology/meme/files/meme-4.11.2_p2-fix-build-system.patch b/sci-biology/meme/files/meme-4.11.2_p2-fix-build-system.patch
new file mode 100644
index 000000000000..b548de5a39a5
--- /dev/null
+++ b/sci-biology/meme/files/meme-4.11.2_p2-fix-build-system.patch
@@ -0,0 +1,346 @@
+Fix and modernise build system
+* Remove all *FLAGS setting, just append to the user-supplied ones
+* Add --enable-doc and --enable-examples configure flags
+* Install documentation and examples in correct directories
+* Discover libxml2 and libxslt dependencies using PKG_CHECK_MODULES
+* Install python and perl modules correctly
+
+--- a/configure.ac
++++ b/configure.ac
+@@ -76,61 +76,10 @@
+ AM_CONDITIONAL(WANT_STRLCPY, test ["$have_strlcpy" = no])
+
+ # Check for compiler-specific settings
+-LARGE_FILE_SUPPORT=`getconf LFS_CFLAGS`
+-if test "${GCC}" = "yes"; then
+- ac_cc_opt="-O3"
+- ac_cc_debug_opt="-O0"
+- ac_cc_warn="-Wall -Wno-unused"
+- ac_cc_debug="-ggdb"
+- # Check for OS X llvm (clang) compiler
+- if `gcc --version |grep llvm >/dev/null`; then
+- ac_cc_debug="-g"
+- fi
+- CFLAGS="-std="gnu89" $ac_cc_warn -DUNIX -D__USE_FIXED_PROTOTYPES__ $LARGE_FILE_SUPPORT"
+-else
+- ac_cc_opt="-O"
+- ac_cc_debug_opt=""
+- ac_cc_warn=""
+- ac_cc_debug="-g"
+- CFLAGS="$ac_cc_warn -DUNIX -D__USE_FIXED_PROTOTYPES__ $LARGE_FILE_SUPPORT"
+-fi
+-
+-# Set up default libxml2 settings
+-# check for installed copy of libxml2
+-build_libxml2="yes"
+-if test -n "$XML2_CONFIG"; then
+- # Require at least version 2.6
+- required_libxml2_version="2006000"
+- LIBXML2_VERSION="`$XML2_CONFIG --version | \
+- awk 'BEGIN { FS = "."; } { printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'`"
+- if test -n "$LIBXML2_VERSION" && \
+- test "$LIBXML2_VERSION" -ge "$required_libxml2_version"; then
+- build_libxml2="no"
+- LIBXML2_LIBS="`$XML2_CONFIG --libs`"
+- LIBXML2_CFLAGS="`$XML2_CONFIG --cflags`"
+- fi
+-fi
+-if test -z "$LIBXML2_LIBS"; then
+- AC_MSG_WARN([libxml2 library not found])
+- LIBXML2_LIBS="\${top_builddir}/src/libxml2/libxml2.la"
+- LIBXML2_CFLAGS="-I\${top_srcdir}/src/libxml2/include"
+-fi
+-
+-# Set up default libxslt settings
+-# check for installed copy of libxslt
+-build_libxslt="yes"
+-if test -n "$XSLT_CONFIG"; then
+- build_libxslt="no"
+- LIBXSLT_LIBS="`$XSLT_CONFIG --libs` -lexslt"
+- LIBXSLT_CFLAGS="`$XSLT_CONFIG --cflags`"
+-fi
+-if test -z "$LIBXSLT_LIBS"; then
+- AC_MSG_WARN([libxslt library not found])
+- LIBEXSLT_LIBS="\${top_builddir}/src/libexslt/libexslt.la"
+- LIBXSLT_LIBS="\${top_builddir}/src/libxslt/libxslt.la"
+- LIBEXSLT_CFLAGS="-I\${top_srcdir}/src/libexslt"
+- LIBXSLT_CFLAGS="-I\${top_srcdir}/src/"
+-fi
++AC_PROG_MKDIR_P
++AC_SYS_LARGEFILE
++CFLAGS="-std=gnu89 -Wall -Wno-unused ${CFLAGS}"
++CPPFLAGS="-DUNIX -D__USE_FIXED_PROTOTYPES__ ${CPPFLAGS}"
+
+ # who is installing
+ USER=`whoami`
+@@ -279,6 +227,16 @@
+ AM_CONDITIONAL(PARALLEL, test ["$parallel" != no])
+ AM_CONDITIONAL(PARALLEL_IS_LAM, test -n ["$lammpi"])
+
++dnl Documentation
++AC_ARG_ENABLE([doc],
++ AS_HELP_STRING([--enable-doc], [Enable installation of documentation]))
++AM_CONDITIONAL([ENABLE_DOC], [test "x$enable_doc" = "xyes"])
++
++dnl Examples
++AC_ARG_ENABLE([examples],
++ AS_HELP_STRING([--enable-examples], [Enable installation of examples]))
++AM_CONDITIONAL([ENABLE_EXAMPLES], [test "x$enable_examples" = "xyes"])
++
+ AC_ARG_ENABLE(
+ webservice,
+ [ --enable-webservice=deploy_dir Deploy the MEME service on an existing Opal 2.5+ installation],
+@@ -309,24 +267,35 @@
+ AM_CONDITIONAL(WEBEITHER, test ["x$OPAL_DEPLOY" != "x" -o "x$OPAL_URL" != "xno"])
+
+ # enable building of included libxml2
+-AC_ARG_ENABLE(
+- build_libxml2,
+- [ --enable-build-libxml2 Build included version of libxml2. Default is to use pre-existing locally installed copy.],
+- build_libxml2=$enableval; \
+- LIBXML2_LIBS="\${top_builddir}/src/libxml2/libxml2.la"; \
+- LIBXML2_CFLAGS="-I\${top_srcdir}/src/libxml2/include" , )
+-AM_CONDITIONAL(BUILD_LIBXML2, test ["$build_libxml2" = yes])
++AC_ARG_ENABLE([build-libxml2],
++ AS_HELP_STRING([--enable-build-libxml2], [Build included version of libxml2. Default is to use pre-existing locally installed copy.]))
++AS_IF([test "x$enable_build_libxml2" = "xyes"], [
++ dnl Enable building of bundled libs
++ LIBXML2_CFLAGS="-I\${top_srcdir}/src/libxml2/include"
++ LIBXML2_LIBS="\${top_builddir}/src/libxml2/libxml2.la"
++ ],[
++ dnl Use system libraries
++ PKG_CHECK_MODULES([LIBXML2], [libxml-2.0 >= 2.6])
++])
++AM_CONDITIONAL([BUILD_LIBXML2], [test "x$enable_build_libxml2" = "xyes"])
++
+
+ # enable building of included libxslt
+-AC_ARG_ENABLE(
+- build_libxslt,
+- [ --enable-build-libxslt Build included version of libxslt. Default is to use pre-existing locally installed copy.],
+- build_libxslt=$enableval; \
+- LIBEXSLT_LIBS="\${top_builddir}/src/libexslt/libexslt.la"; \
+- LIBXSLT_LIBS="\${top_builddir}/src/libxslt/libxslt.la"; \
+- LIBEXSLT_CFLAGS="-I\${top_srcdir}/src/libexslt"; \
+- LIBXSLT_CFLAGS="-I\${top_srcdir}/src/" , )
+-AM_CONDITIONAL(BUILD_LIBXSLT, test ["$build_libxslt" = yes])
++AC_ARG_ENABLE([build-libxslt],
++ AS_HELP_STRING([--enable-build-libxslt], [Build included version of libxslt. Default is to use pre-existing locally installed copy.]))
++AS_IF([test "x$enable_build_libxslt" = "xyes"], [
++ dnl Enable building of bundled libs
++ LIBXSLT_CFLAGS="-I\${top_srcdir}/src/"
++ LIBXSLT_LIBS="\${top_builddir}/src/libxslt/libxslt.la"
++
++ LIBEXSLT_CFLAGS="-I\${top_srcdir}/src/libexslt"
++ LIBEXSLT_LIBS="\${top_builddir}/src/libexslt/libexslt.la"
++ ],[
++ dnl Use system libraries
++ PKG_CHECK_MODULES([LIBXSLT], [libxslt])
++ PKG_CHECK_MODULES([LIBEXSLT], [libexslt])
++])
++AM_CONDITIONAL([BUILD_LIBXSLT], [test "x$enable_build_libxslt" = "xyes"])
+
+ # set website url
+ AC_ARG_WITH(
+@@ -427,13 +396,13 @@
+ [AC_PATH_PROG(PERL, perl)])
+ AC_DEFINE_UNQUOTED(PERL, "$PERL", [Path to Perl] )
+
++AC_ARG_WITH([perl-dir],
++ AS_HELP_STRING([--with-perl-dir], [Perl modules directory]), [perlmoddir="$with_perl_dir"], [perlmoddir="lib/perl"])
++AC_SUBST([perlmoddir])
++
++
+ # set path to Python
+-AC_ARG_WITH(
+- python,
+- [ --with-python=NAME Set path to Python. Default is to take from user's PATH.],
+- [PYTHON=$withval],
+- [AC_PATH_PROG(PYTHON, python)])
+-AC_DEFINE_UNQUOTED(PYTHON, "$PYTHON", [Path to Python] )
++AM_PATH_PYTHON
+
+ # set path to convert utility
+ AC_ARG_WITH(
+@@ -586,13 +555,15 @@
+ Configuration parameters
+ ========================
+
+- Install path: ${prefix}
++ Install path (prefix): ${prefix}
+ Install UID: ${MEME_USER}
+ Version: ${VERSION}
+- C compiler: ${CC}
+- C compiler flags: ${CFLAGS}
+- Linker: ${LD}
+- Special Libs: ${LIBS}
++ C compiler (CC): ${CC}
++ C compiler flags (CFLAGS): ${CFLAGS}
++ C preproc flags (CPPFLAGS): ${CPPFLAGS}
++ Linker (LD): ${LD}
++ Linker flags (LDFLAGS): ${LDFLAGS}
++ Special Libs (LIBS): ${LIBS}
+ MPICC ${MPICC}
+ MPIRUN ${MPIRUN}
+ MPI_CMD ${MPI_CMD}
+--- a/doc/css/Makefile.am
++++ b/doc/css/Makefile.am
+@@ -5,7 +5,7 @@
+
+ EXTRA_DIST = $(NORMAL_FILES)
+
+-if ! WEBSITE
+-doccssdir = $(prefix)/doc/css
++if ENABLE_DOC
++doccssdir = $(htmldir)/css
+ doccss_DATA = $(NORMAL_FILES)
+ endif
+--- a/doc/examples/compute_prior_dist_example_output_files/Makefile.am
++++ b/doc/examples/compute_prior_dist_example_output_files/Makefile.am
+@@ -7,8 +7,8 @@
+ EXAMPLES = \
+ prior.dist.txt
+
+-if ! WEBSITE
+-exdir = $(prefix)/doc/examples/compute_prior_dist_example_output_files
++if ENABLE_EXAMPLES
++exdir = $(docdir)/examples/compute_prior_dist_example_output_files
+ ex_DATA = $(EXAMPLES)
+ endif
+
+--- a/doc/examples/Makefile.am
++++ b/doc/examples/Makefile.am
+@@ -22,8 +22,8 @@
+ # load the EXAMPLE_OUTPUT_FILES variable
+ include examples.mk
+
+-if ! WEBSITE
+-exdir = $(prefix)/doc/examples
++if ENABLE_EXAMPLES
++exdir = $(docdir)/examples
+ nobase_dist_ex_DATA = $(EXAMPLES) $(EXAMPLE_OUTPUT_FILES)
+ endif
+
+--- a/doc/examples/sample_opal_scripts/Makefile.am
++++ b/doc/examples/sample_opal_scripts/Makefile.am
+@@ -15,8 +15,8 @@
+ MemeClient.pl \
+ MemeClient.py
+
+-if ! WEBSITE
+-exdir = $(prefix)/doc/examples/sample_opal_scripts
++if ENABLE_EXAMPLES
++exdir = $(docdir)/examples/sample_opal_scripts
+ ex_DATA = $(EXAMPLES)
+ endif
+
+--- a/doc/images/Makefile.am
++++ b/doc/images/Makefile.am
+@@ -30,8 +30,8 @@
+
+ MEME_IMAGES = $(PROGRAM_ICONS) $(OTHER_IMAGES)
+
+-if ! WEBSITE
+-memeimgdir = $(prefix)/doc/images
++if ENABLE_DOC
++memeimgdir = $(htmldir)/images
+ memeimg_DATA = $(MEME_IMAGES)
+ endif
+
+--- a/doc/js/Makefile.am
++++ b/doc/js/Makefile.am
+@@ -41,8 +41,8 @@
+
+ BUILT_SOURCES = $(BUILT_FILES)
+
+-if ! WEBSITE
+-docjsdir = $(prefix)/doc/js
++if ENABLE_DOC
++docjsdir = $(htmldir)/js
+ docjs_DATA = $(NORMAL_FILES) $(BUILT_FILES) $(SYMLINK_FILES)
+ endif
+
+--- a/doc/Makefile.am
++++ b/doc/Makefile.am
+@@ -129,8 +129,8 @@
+ update-sequence-db.html \
+ ismb94.pdf
+
+-if ! WEBSITE
+-memedocdir = $(prefix)/doc
++if ENABLE_DOC
++memedocdir = $(htmldir)
+ memedoc_DATA = $(NORMAL_FILES)
+ endif
+
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -52,7 +52,7 @@
+ endif
+
+ dbdir:
+- mkdir -p $(MEME_DB)
++ $(MKDIR_P) $(DESTDIR)/$(MEME_DB)
+
+ all-local:
+ if WEBSITE
+@@ -64,8 +64,8 @@
+ endif
+
+ install-data-local:
+- mkdir -p $(MEME_LOGS)
+- chmod a+w $(MEME_LOGS)
++ $(MKDIR_P) $(DESTDIR)/$(MEME_LOGS)
++ chmod a+w $(DESTDIR)/$(MEME_LOGS)
+
+ distdir = $(PACKAGE)_$(VERSION)
+
+--- a/scripts/Makefile.am
++++ b/scripts/Makefile.am
+@@ -22,8 +22,8 @@
+ -e 's%@WHICHJAVA@%$(JAVA)%' \
+ -e 's%@WHICHCONVERT@%$(CONVERT)%' \
+ -e 's%@WHICHGHOSTSCRIPT@%$(GHOSTSCRIPT)%' \
+- -e 's%@PERLLIBDIR@%$(libdir)/perl%' \
+- -e 's%@PYTHONLIBDIR@%$(libdir)/python%' \
++ -e 's%@PERLLIBDIR@%$(perlmoddir)%' \
++ -e 's%@PYTHONLIBDIR@%$(pythondir)%' \
+ -e 's%@JAVALIBDIR@%$(libdir)/java%' \
+ -e 's%@LAM_BIN@%$(LAMBIN)%' \
+ -e 's%@APPCONFIGDIR@%$(sysconfdir)%' \
+@@ -62,7 +62,7 @@
+ DiffXML.pm \
+ HypergeometricDynProg.pm
+
+-perlmoddir=$(libdir)/perl
++perlmoddir = $(exec_prefix)/@perlmoddir@
+ perlmod_SCRIPTS = \
+ $(BUILT_PERL_MOD) \
+ $(NORMAL_PERL_MOD)
+@@ -76,8 +76,7 @@
+ hypergeometric.py \
+ sequence.py
+
+-pythonlibdir=$(libdir)/python
+-pythonlib_SCRIPTS = \
++python_PYTHON = \
+ $(BUILT_PYTHON_LIB) \
+ $(NORMAL_PYTHON_LIB)
+
+--- a/src/Makefile.am
++++ b/src/Makefile.am
+@@ -19,7 +19,13 @@
+ ARCHIVE_REVISION = $(shell cat ../ARCHIVE_REVISION)
+ ARCHIVE_DATE = $(shell cat ../ARCHIVE_DATE)
+
+-SUBDIRS = filters libxml2 libxslt libexslt . parallel
++SUBDIRS = filters . parallel
++if BUILD_LIBXML2
++SUBDIRS += libxml2
++endif
++if BUILD_LIBXSLT
++SUBDIRS += libxslt libexslt
++endif
+
+ BUILT_SOURCES = dir.h projrel.h
+
diff --git a/sci-biology/meme/files/meme-4.11.2_p2-patch1.patch b/sci-biology/meme/files/meme-4.11.2_p2-patch1.patch
new file mode 100644
index 000000000000..30a182f8f43a
--- /dev/null
+++ b/sci-biology/meme/files/meme-4.11.2_p2-patch1.patch
@@ -0,0 +1,383 @@
+--- a/doc/alphabet-format.html
++++ b/doc/alphabet-format.html
+@@ -233,7 +233,7 @@
+ providing a reference on the meaning of the symbols used. If present, the
+ symbol name must be the second field.</p>
+ <p>The &quot;<span class="pdat">name</span>&quot; follows the rules of
+- <a href="qstr">quoted text</a>.</p>
++ <a href="#qstr">quoted text</a>.</p>
+ </div>
+ <h5>color</h5>
+ <div class="indent">
+--- a/doc/release-notes.html
++++ b/doc/release-notes.html
+@@ -14,8 +14,26 @@
+ <h2>Motif-based sequence analysis tools</h2>
+ </div>
+ <h2>MEME Suite Release Notes</h2>
++ <hr>
++ <b>MEME version 4.11.2 patch 1 -- June 16, 2016</b>
++ <ul>
++ <li>
++ <b>Bug fixes</b>
++ <ul>
++ <li>
++ Fixed bug in MCAST 4.11.2 that caused it to prematurely truncate
++ reading the sequence file.
++ </li>
++ <li>
++ Modified MEME to fall back to a simple Dirichlet prior when
++ using DNA or a custom alphabet with a prior that requires
++ a prior library, but no prior libray is specified.
++ </li>
++ </ul
++ </li>
++ </ul>
++ <p>
+ <hr>
+- <p>
+ <b>MEME version 4.11.2 -- May 5 2016</b>
+ </p>
+ <ul>
+--- a/src/fasta-io.c
++++ b/src/fasta-io.c
+@@ -14,6 +14,7 @@
+ #include "alphabet.h"
+ #include "fasta-io.h"
+ #include "io.h"
++#include "seq-reader-from-fasta.h"
+ #include "prior-reader-from-psp.h"
+ #include "seq.h"
+
+@@ -159,61 +160,6 @@
+ }
+
+ /****************************************************************************
+- * Read raw sequence until a new sequence is encountered or too many letters
+- * are read. The new sequence is appended to the end of the given
+- * sequence.
+- *
+- * Return: Was the sequence read completely?
+- ****************************************************************************/
+-static BOOLEAN_T read_raw_sequence_from_reader(
+- DATA_BLOCK_READER_T *fasta_reader, // Sequence source
+- char* name, // Sequence ID (used in error messages).
+- ALPH_T* alph, // Alphabet in use
+- unsigned int offset, // Current position in raw_sequence.
+- unsigned int max_chars, // Maximum chars in raw_sequence.
+- char* raw_sequence // Pre-allocated sequence.
+-) {
+- // tlb; change a_char to integer so it will compile on SGI
+- int a_char;
+- int start_update;
+- BOOLEAN_T return_value = TRUE;
+-
+- // Start at the end of the given sequence.
+- assert(offset < max_chars);
+-
+- DATA_BLOCK_T *seq_block = new_sequence_block(max_chars - offset);
+- return_value = !fasta_reader->get_next_block(fasta_reader, seq_block);
+-
+- char *seq_buffer = get_sequence_from_data_block(seq_block);
+- size_t seq_buffer_size = get_num_read_into_data_block(seq_block);
+- int i;
+- for (i = 0; i < seq_buffer_size; ++i) {
+- a_char = seq_buffer[i];
+- // Skip non-alphabetic characters.
+- if (!isalnum(a_char) && a_char != '-' && a_char != '*' && a_char != '.') {
+- if ((a_char != ' ') && (a_char != '\t') && (a_char != '\n') && (a_char != '\r')) {
+- fprintf(stderr, "Warning: Skipping character %c in sequence %s.\n",
+- a_char, name);
+- }
+- } else {
+- // skip check if unknown alph
+- if (alph != NULL && !alph_is_known(alph, a_char)) {
+- fprintf(stderr, "Warning: Converting illegal character %c to %c ",
+- a_char, alph_wildcard(alph));
+- fprintf(stderr, "in sequence %s.\n", name);
+- a_char = alph_wildcard(alph);
+- }
+- raw_sequence[offset] = (char) a_char;
+- ++offset;
+- }
+- }
+-
+- raw_sequence[offset] = '\0';
+- free_data_block(seq_block);
+- return(return_value);
+-}
+-
+-/****************************************************************************
+ * Read one sequence from a file in Fasta format.
+ *
+ * Return: Was a sequence successfully read?
+@@ -320,44 +266,6 @@
+ }
+
+ /****************************************************************************
+- * Read up to max_chars letters of one sequence from a DATA_BLOCK_T readder
+- * and copy them in to the raw sequence in the SEQ_T object starting at the
+- * given buffer offset.
+- ****************************************************************************/
+-void read_one_fasta_segment_from_reader(
+- DATA_BLOCK_READER_T *fasta_reader,
+- size_t max_size,
+- size_t buffer_offset,
+- SEQ_T *sequence
+-) {
+-
+- assert(sequence != NULL);
+- assert(get_seq_length(sequence) <= max_size);
+-
+- // Get the raw sequence buffer from the SEQ_T
+- char *raw_sequence = get_raw_sequence(sequence);
+- if (raw_sequence == NULL) {
+- // Allocate space for raw sequence if not done yet.
+- raw_sequence = mm_malloc(sizeof(char) * max_size + 1);
+- raw_sequence[0] = 0;
+- }
+-
+- // Read a block of sequence charaters into the
+- // raw sequence buffer for the SEQ_T.
+- char *name = get_seq_name(sequence);
+- BOOLEAN_T is_complete = read_raw_sequence_from_reader(
+- fasta_reader,
+- name,
+- NULL, //FIXME this is dodgy, need a proper way of getting the alphabet. The fasta_reader has it but it is not accessable!
+- buffer_offset,
+- max_size,
+- raw_sequence
+- );
+- set_raw_sequence(raw_sequence, is_complete, sequence);
+-
+-}
+-
+-/****************************************************************************
+ * Read all the sequences from a FASTA file at once.
+ Multiple files can be appended by calling this more than once.
+ ****************************************************************************/
+--- a/src/fasta-io.h
++++ b/src/fasta-io.h
+@@ -43,19 +43,6 @@
+ );
+
+ /****************************************************************************
+- * Read up to max_chars letters of one sequence from a DATA_BLOCK_T readder
+- * and copy them in to the raw sequence in the SEQ_T object starting at the
+- * given buffer offset.
+- ****************************************************************************/
+-void read_one_fasta_segment_from_reader(
+- DATA_BLOCK_READER_T *fasta_reader,
+- size_t max_size,
+- size_t buffer_offset,
+- SEQ_T* sequence
+-);
+-
+-
+-/****************************************************************************
+ * Read all the sequences from a file in Fasta format.
+ ****************************************************************************/
+ void read_many_fastas
+--- a/src/init.c
++++ b/src/init.c
+@@ -767,10 +767,16 @@
+ if (alph_is_builtin_protein(alph)) { // default mixture prior for proteins
+ plib_name = make_path_to_file(get_meme_etc_dir(), PROTEIN_PLIB);
+ } else {
+- fprintf(stderr, "The prior library must be specified for DNA or custom "
+- "alphabets when specifiying a prior type of 'dmix', 'mega' "
+- "or 'megap'.");
+- exit(1);
++ fprintf(
++ stderr,
++ "WARNING: When using DNA or a custom alphabet, "
++ "and specifiying a prior type of\n"
++ "'dmix', 'mega' or 'megap', a prior library must be provided.\n"
++ "No prior library was provided, so a simple Dirichlet prior will be used.\n"
++ );
++ prior = "dirichlet";
++ ptype = Dirichlet;
++ if (beta <= 0) beta = 0.01; // default b = 0.01 for simple Dirichlet
+ }
+ }
+ }
+--- a/src/seq-reader-from-fasta.c
++++ b/src/seq-reader-from-fasta.c
+@@ -639,11 +639,140 @@
+ return fasta_reader->current_position;
+ }
+
++
++/****************************************************************************
++ * Read up to max_chars letters of one sequence from a DATA_BLOCK_T readder
++ * and copy them in to the raw sequence in the SEQ_T object starting at the
++ * given buffer offset.
++ ****************************************************************************/
++void read_one_fasta_segment_from_reader(
++ DATA_BLOCK_READER_T *fasta_reader,
++ size_t max_size,
++ size_t offset,
++ SEQ_T *sequence
++) {
++
++
++ assert(sequence != NULL);
++ assert(offset < max_size);
++
++ // Get the raw sequence buffer from the SEQ_T
++ char *raw_sequence = get_raw_sequence(sequence);
++ if (raw_sequence == NULL) {
++ // Allocate space for raw sequence if not done yet.
++ raw_sequence = mm_malloc(sizeof(char) * max_size + 1);
++ raw_sequence[0] = 0;
++ }
++
++ // Read a block of sequence charaters into the
++ // raw sequence buffer for the SEQ_T, starting at offset.
++ BOOLEAN_T is_complete = read_raw_sequence_from_reader(
++ fasta_reader,
++ max_size - offset,
++ raw_sequence + offset
++ );
++ set_raw_sequence(raw_sequence, is_complete, sequence);
++}
++
++/****************************************************************************
++ * Read raw sequence until a new sequence is encountered or too many letters
++ * are read.
++ *
++ * Return: Was the sequence read completely?
++ ****************************************************************************/
++BOOLEAN_T read_raw_sequence_from_reader(
++ DATA_BLOCK_READER_T *reader, // Sequence source
++ unsigned int max_chars, // Maximum chars in raw_sequence.
++ char* raw_sequence // Pre-allocated sequence buffer.
++) {
++
++ SEQ_READER_FROM_FASTA_T *fasta_reader
++ = (SEQ_READER_FROM_FASTA_T *) get_data_block_reader_data(reader);
++
++ // Read sequence into temp. buffer from the sequence file.
++ char buffer[max_chars];
++ long start_file_pos = ftell(fasta_reader->fasta_file);
++ size_t seq_index = 0;
++ size_t total_read = 0;
++ while (seq_index < max_chars) {
++
++ size_t num_char_read = fread(
++ buffer,
++ sizeof(char),
++ max_chars - seq_index,
++ fasta_reader->fasta_file
++ );
++ fasta_reader->current_position += num_char_read;
++ total_read += num_char_read;
++
++ if (feof(fasta_reader->fasta_file)) {
++ fasta_reader->at_end_of_file = TRUE;
++ }
++ else if (num_char_read < (max_chars - seq_index)) {
++ die(
++ "Error while reading sequence from file:%s.\nError message: %s\n",
++ fasta_reader->filename,
++ strerror(ferror(fasta_reader->fasta_file))
++ );
++ }
++
++ size_t i;
++ for(i = 0; i < num_char_read; ++i) {
++ char c = buffer[i];
++ assert(c != 0);
++ if (isspace(c)) {
++ // Skip over white space
++ fasta_reader->at_start_of_line = (c == '\n');
++ }
++ else if (c == '>' && fasta_reader->at_start_of_line == TRUE) {
++ // We found the start of a new sequence while trying
++ // to fill the buffer. Leave the buffer incomplete.
++ // and wind back the file
++ fseek(fasta_reader->fasta_file, start_file_pos + i - 1, SEEK_SET);
++ fasta_reader->current_position = start_file_pos + i - 1;
++ fasta_reader->at_end_of_seq = TRUE;
++ fasta_reader->at_start_of_line = FALSE;
++ fasta_reader->at_end_of_file = FALSE;
++ break;
++ }
++ else {
++ fasta_reader->at_start_of_line = FALSE;
++ // Check that character is legal in alphabet.
++ // If not, replace with wild card character.
++ if (alph_is_known(fasta_reader->alphabet, c)) {
++ raw_sequence[seq_index] = c;
++ }
++ else {
++ raw_sequence[seq_index] = alph_wildcard(fasta_reader->alphabet);
++ fprintf(
++ stderr,
++ "Warning: %c is not a valid character in %s alphabet.\n"
++ " Converting %c to %c.\n",
++ c,
++ alph_name(fasta_reader->alphabet),
++ c,
++ raw_sequence[i]
++ );
++ }
++ ++seq_index;
++ }
++ }
++ if (fasta_reader->at_end_of_seq | fasta_reader->at_end_of_file) {
++ break;
++ }
++ }
++
++ raw_sequence[seq_index] = '\0';
++ return(fasta_reader->at_end_of_seq | fasta_reader->at_end_of_file);
++}
++
+ /******************************************************************************
+- * Fills in the next data block for the sequence.
+- * During the first call for the sequence it fills in the full data block.
+- * On successive calls, shifts the sequence in the block down one position
+- * and reads one more character.
++ * Populates the data block for the with the next block of sequence.
++ *
++ * During the first call for the sequence it fills in a buffer from a file,
++ * The sequence pointer in the data block is set to point at the start of the buffer.
++ * On successive calls, the sequence pointer in the block is shifted down one position
++ * in the buffer. When the end of the buffer is reached, it is filled again from the file.
+ *
+ * Returns TRUE if it was able to completely fill the block, FALSE if
+ * the next sequence or EOF was reached before the block was filled.
+--- a/src/seq-reader-from-fasta.h
++++ b/src/seq-reader-from-fasta.h
+@@ -37,5 +37,30 @@
+ int * end_ptr // end position of sequence (chr:\d+-(\d+))
+ );
+
++/****************************************************************************
++ * Read raw sequence until a new sequence is encountered or too many letters
++ * are read.
++ *
++ * Return: Was the sequence read completely?
++ ****************************************************************************/
++BOOLEAN_T read_raw_sequence_from_reader(
++ DATA_BLOCK_READER_T *fasta_reader, // Sequence source
++ unsigned int max_chars, // Maximum chars in raw_sequence.
++ char* raw_sequence // Pre-allocated sequence.
++);
++
++/****************************************************************************
++ * Read up to max_chars letters of one sequence from a DATA_BLOCK_T readder
++ * and copy them in to the raw sequence in the SEQ_T object starting at the
++ * given buffer offset.
++ ****************************************************************************/
++void read_one_fasta_segment_from_reader(
++ DATA_BLOCK_READER_T *reader,
++ size_t max_size,
++ size_t offset,
++ SEQ_T *sequence
++);
++
++
+ size_t get_current_pos_from_seq_reader_from_fasta(DATA_BLOCK_READER_T *reader);
+ #endif
diff --git a/sci-biology/meme/files/meme-4.11.2_p2-patch2.patch b/sci-biology/meme/files/meme-4.11.2_p2-patch2.patch
new file mode 100644
index 000000000000..498d1df7b664
--- /dev/null
+++ b/sci-biology/meme/files/meme-4.11.2_p2-patch2.patch
@@ -0,0 +1,54 @@
+--- a/doc/release-notes.html
++++ b/doc/release-notes.html
+@@ -15,6 +15,21 @@
+ </div>
+ <h2>MEME Suite Release Notes</h2>
+ <hr>
++ <b>MEME version 4.11.2 patch 2 -- October 24, 2016</b>
++ <ul>
++ <li>
++ <b>Bug fixes</b>
++ <ul>
++ <li>
++ Fixed bug in handling of RNA-like custom alphabets.
++ </li>
++ <li>
++ Fixed bug in MAST -comp option.
++ </li>
++ </ul
++ </li>
++ </ul>
++ <hr>
+ <b>MEME version 4.11.2 patch 1 -- June 16, 2016</b>
+ <ul>
+ <li>
+--- a/src/alph-in.c
++++ b/src/alph-in.c
+@@ -1044,7 +1044,7 @@
+ lookup[0] = sym->complement;
+ comp2 = (ALPH_SYM_T*)rbtree_get(reader->merged, lookup);
+ }
+- if (comp1 != comp2) {
++ if (comp1 && (comp1 != comp2)) {
+ add_msg(reader, parmsg_create(SEVERITY_ERROR, -1, -1, -1,
+ "not like %s alphabet as %c complement rules are incorrect",
+ ext_name, req_syms[i]));
+--- a/src/mast-util.c
++++ b/src/mast-util.c
+@@ -740,14 +740,14 @@
+
+ // create the frequency array
+ alph = xlate ? xlate_dest_alph(xlate) : alph;
+- freq = allocate_array(alph_size_core(alph));
++ freq = allocate_array(alph_size_full(alph));
+ init_array(0, freq);
+
+ // count the number of letters of each type
+ if (xlate) {
+ for (n=0; sequence[n]; n++) {
+ i = xlate_index(xlate, false, sequence+n);
+- if (i > 0 && i < alph_size_core(alph)) incr_array_item(i, 1, freq);
++ if (i > 0 && i < alph_size_full(alph)) incr_array_item(i, 1, freq);
+ }
+ } else {
+ for (n=0; sequence[n]; n++) {
diff --git a/sci-biology/meme/meme-4.11.2_p2.ebuild b/sci-biology/meme/meme-4.11.2_p2.ebuild
new file mode 100644
index 000000000000..0f7d25b43368
--- /dev/null
+++ b/sci-biology/meme/meme-4.11.2_p2.ebuild
@@ -0,0 +1,109 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+PYTHON_COMPAT=( python2_7 )
+
+inherit autotools perl-functions python-single-r1 versionator
+
+MY_PV=$(get_version_component_range 1-3)
+MY_P=${PN}_${MY_PV}
+
+DESCRIPTION="The MEME/MAST system - Motif discovery and search"
+HOMEPAGE="http://meme-suite.org/tools/meme"
+SRC_URI="http://meme-suite.org/meme-software/${MY_PV}/${MY_P}.tar.gz"
+
+LICENSE="meme"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="debug doc examples mpi"
+
+RDEPEND="
+ ${PYTHON_DEPS}
+ app-shells/tcsh
+ dev-libs/libxml2:2
+ dev-libs/libxslt
+ sys-libs/zlib
+ app-text/ghostscript-gpl
+ media-gfx/imagemagick
+ dev-lang/perl:=
+ dev-perl/HTML-Parser
+ dev-perl/HTML-Template
+ dev-perl/Log-Log4perl
+ dev-perl/Math-CDF
+ dev-perl/XML-Compile-SOAP
+ dev-perl/XML-Compile-WSDL11
+ dev-perl/XML-Parser
+ dev-perl/XML-Simple
+ virtual/perl-Data-Dumper
+ virtual/perl-Exporter
+ virtual/perl-File-Path
+ virtual/perl-File-Spec
+ virtual/perl-File-Temp
+ virtual/perl-Getopt-Long
+ virtual/perl-Scalar-List-Utils
+ virtual/perl-Time-HiRes
+ mpi? ( virtual/mpi )"
+DEPEND="${RDEPEND}"
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+S="${WORKDIR}/${MY_P}"
+PATCHES=(
+ "${FILESDIR}"/${PN}-4.11.2_p2-patch1.patch
+ "${FILESDIR}"/${PN}-4.11.2_p2-patch2.patch
+ "${FILESDIR}"/${PN}-4.11.2_p2-fix-build-system.patch
+)
+
+pkg_setup() {
+ python-single-r1_pkg_setup
+ perl_set_version
+}
+
+src_prepare() {
+ default
+ eautoreconf
+}
+
+src_configure() {
+ econf \
+ --sysconfdir="${EPREFIX}"/etc/${PN} \
+ --with-logs="${EPREFIX}"/var/log/${PN} \
+ --with-perl=perl \
+ --with-convert=convert \
+ --with-gs=gs \
+ --disable-build-libxml2 \
+ --disable-build-libxslt \
+ $(use_enable debug) \
+ $(use_enable doc) \
+ $(use_enable examples) \
+ $(use_enable !mpi serial) \
+ --with-perl-dir="${VENDOR_LIB#${EPREFIX}/usr}" \
+ PYTHON="${EPYTHON}"
+
+ # delete bundled libs, just to be sure. These need
+ # to be removed after econf, else AC_OUTPUT will fail
+ rm -r src/{libxml2,lib{,e}xslt} || die
+}
+
+src_test() {
+ # bug #297070
+ emake -j1 test
+}
+
+src_install() {
+ default
+ docompress -x /usr/share/doc/${PF}/examples
+
+ # prefix all binaries with 'meme-', in order
+ # to prevent collisions, bug 455010
+ cd "${ED%/}"/usr/bin/ || die
+ local i
+ for i in *; do
+ if [[ $i != meme-* ]]; then
+ mv {,meme-}"${i}" || die
+ fi
+ done
+
+ keepdir /var/log/meme
+}
diff --git a/sci-biology/meme/metadata.xml b/sci-biology/meme/metadata.xml
new file mode 100644
index 000000000000..959160fe46b1
--- /dev/null
+++ b/sci-biology/meme/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>sci-biology@gentoo.org</email>
+ <name>Gentoo Biology Project</name>
+ </maintainer>
+</pkgmetadata>