--- /dev/null
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit toolchain-funcs
+
+MY_P=${PN^^}_${PV}
+
+DESCRIPTION="Greedy and progressive approaches for segment-based multiple sequence alignment"
+HOMEPAGE="http://dialign-tx.gobics.de/"
+SRC_URI="http://dialign-tx.gobics.de/${MY_P}.tar.gz"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+
+S=${WORKDIR}/${MY_P}
+PATCHES=(
+ "${FILESDIR}"/${P}-fix-build-system.patch
+ "${FILESDIR}"/${P}-implicits.patch
+ "${FILESDIR}"/${P}-modernize.patch
+ "${FILESDIR}"/${P}-gnu89-inline.patch
+)
+
+src_configure() {
+ tc-export CC
+}
+
+src_compile() {
+ emake -C source clean
+ emake -C source
+}
+
+src_install() {
+ dobin source/dialign-tx
+ insinto /usr/$(get_libdir)/${PN}/conf
+ doins -r conf/.
+}
+
+pkg_postinst() {
+ einfo "The configuration directory is"
+ einfo "${EROOT%/}/usr/$(get_libdir)/${PN}/conf"
+ einfo "You will need to pass this to ${PN} on every run."
+}
--- /dev/null
+--- a/source/Makefile
++++ b/source/Makefile
+@@ -1,4 +1,3 @@
+-CC=gcc\r
+ # debug\r
+ #CPPFLAGS=-g -O0 -Q -v -da\r
+ #CPPFLAGS=-g -O0 -fstack-check -Q -v -da\r
+@@ -8,7 +7,6 @@
+ # THIS IS FOR THE OPTIMIZED ONE\r
+ #CPPFLAGS=-g \r
+ #CPPFLAGS=-O3 -march=i686 -funroll-loops\r
+-CPPFLAGS=-O3 -funroll-loops -march=i686 -mfpmath=sse -msse -mmmx\r
+ #CPPFLAGS=-march=athlon-mp -g -O0 -Wall -D_USE_XOPEN -D__unix__\r
+ \r
+ OBJ_DIR=.\r
+@@ -33,7 +31,7 @@
+ \r
+ museq: $(OBJ)\r
+ rm -f $(TARGET)/$@\r
+- $(CC) -o $(TARGET)/$@ \\r
++ $(CC) $(LDFLAGS) -o $(TARGET)/$@ \\r
+ $(OBJ) \\r
+ -pipe -Wall -lm \r
+ mv museq dialign-tx\r
--- /dev/null
+--- a/source/diag.c
++++ b/source/diag.c
+@@ -958,7 +958,7 @@
+ * The pointer returned (and the ones included in the struct)
+ * has to be deallocted explicitely from memory.
+ */
+-inline struct simple_diag_col* find_diags_dialign(struct scr_matrix *smatrix,
++static inline struct simple_diag_col* find_diags_dialign(struct scr_matrix *smatrix,
+ struct prob_dist *pdist, struct seq* seq1,
+ struct seq* seq2, struct alignment *algn,
+ long double **tmp_dist, int round) {
---- source/museq.c
-+++ source/museq.c
+--- a/source/museq.c
++++ b/source/museq.c
@@ -38,6 +38,7 @@
//extern void calc_weight(struct diag* dg, struct scr_matrix* smatrix,
// struct prob_dist *pdist);