commit: 7fe9fb808188b046045fb31e3bf5a7d228511d09 Author: Martin Mokrejš <mmokrejs <AT> fold <DOT> natur <DOT> cuni <DOT> cz> AuthorDate: Sun Dec 4 18:41:07 2016 +0000 Commit: Martin Mokrejs <mmokrejs <AT> fold <DOT> natur <DOT> cuni <DOT> cz> CommitDate: Sun Dec 4 18:41:07 2016 +0000 URL: https://gitweb.gentoo.org/proj/sci.git/commit/?id=7fe9fb80
sci-biology/plinkseq: fixing issues with bundled dev-libs/protobuf and www-servers/mongoose The git repo received some commits this year so trying to create an ebuild for that. It bailed out at more places than the latest release tarball v0.10. The static Makefile needs more tweaks so that the values from 'pkg-config protobuf' calls get propagated properly. And not to look for the removed protobuf and mongoose subdirs. Package-Manager: portage-2.3.2 sci-biology/plinkseq/plinkseq-0.10.ebuild | 8 +++-- sci-biology/plinkseq/plinkseq-9999.ebuild | 59 +++++++++++++++++++++++++++++++ 2 files changed, 64 insertions(+), 3 deletions(-) diff --git a/sci-biology/plinkseq/plinkseq-0.10.ebuild b/sci-biology/plinkseq/plinkseq-0.10.ebuild index 71871e8..f39458b 100644 --- a/sci-biology/plinkseq/plinkseq-0.10.ebuild +++ b/sci-biology/plinkseq/plinkseq-0.10.ebuild @@ -20,14 +20,16 @@ KEYWORDS="" IUSE="" DEPEND="sys-libs/zlib - dev-libs/protobuf" + dev-libs/protobuf + !sci-biology/fsl" # file collision on /usr/bin/mm RDEPEND="${DEPEND}" src_prepare(){ sed -e "s/gcc/$(tc-getCC)/g;s/g++/$(tc-getCXX)/g;s/-O3/${CFLAGS}/g" -i config_defs.Makefile || die sed -e "s/= -static/=/g" -i config_defs.Makefile || die rm -rf sources/ext/protobuf-* || die - sed -e 's#^all:.*#all: echo "skipping compilation of bundled dev-libs/protobuf"#' -i sources/ext/Makefile || die + rm -rf sources/mongoose || die + sed -e 's@^all:.*@all: # skipping compilation of bundled dev-libs/protobuf@' -i sources/ext/Makefile || die # TODO: fix also sources/ext/sources/include/DUMMY/include/google/protobuf/compiler/plugin.proto causing: # plugin.proto: Import "google/protobuf/descriptor.proto" was not found or had errors. # plugin.proto:74:12: "FileDescriptorProto" is not defined. @@ -44,5 +46,5 @@ src_install(){ cd build/execs || die # TODO: avoid file collision with sci-biology/fsl # https://bitbucket.org/statgen/plinkseq/issue/9/rename-mm-filename-to-plinkseq_mm - dobin gcol browser pseq behead mm smp tab2vcf mongoose pdas + dobin gcol browser pseq behead mm smp tab2vcf pdas } diff --git a/sci-biology/plinkseq/plinkseq-9999.ebuild b/sci-biology/plinkseq/plinkseq-9999.ebuild new file mode 100644 index 0000000..49c9a13 --- /dev/null +++ b/sci-biology/plinkseq/plinkseq-9999.ebuild @@ -0,0 +1,59 @@ +# Copyright 1999-2016 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +EAPI=5 + +AUTOTOOLS_AUTORECONF=yes + +inherit toolchain-funcs git-r3 + +DESCRIPTION="C/C++ library for working with human genetic variation data" +HOMEPAGE="http://atgu.mgh.harvard.edu/plinkseq" +EGIT_REPO_URI="https://bitbucket.org/statgen/plinkseq.git" +# https://bitbucket.org/statgen/plinkseq/commits/all +# http://pngu.mgh.harvard.edu/~purcell/plink/download.shtml + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="" +IUSE="" + +DEPEND="sys-libs/zlib + dev-libs/protobuf + www-servers/mongoose + !sci-biology/fsl" # file collision on /usr/bin/mm +RDEPEND="${DEPEND}" + +src_prepare(){ + sed -e "s/gcc/$(tc-getCC)/g;s/g++/$(tc-getCXX)/g;s/-O3/${CFLAGS}/g" -i config_defs.Makefile || die + sed -e "s/= -static/=/g" -i config_defs.Makefile || die + rm -rf sources/ext/protobuf-* || die + rm -rf sources/mongoose || die + sed -e 's@^all:.*@all: # skipping compilation of bundled dev-libs/protobuf@' -i sources/ext/Makefile || die + find . -name \*.proto | while read f; do \ + d=`dirname $f`; \ + pushd $d; \ + protoc --cpp_out=. *.proto || exit 255; \ + popd; \ + done || die + # + # recopy the updated files + cp -p sources/plinkseq/sources/lib/matrix.pb.h sources/plinkseq/sources/include/plinkseq/matrix.pb.h || die + cp -p sources/plinkseq/sources/lib/variant.pb.h sources/plinkseq/sources/include/plinkseq/variant.pb.h || die + sed -e 's/google::protobuf::internal::kEmptyString/google::protobuf::internal::GetEmptyStringAlreadyInited()/g' -i sources/plinkseq/sources/lib/matrix.pb.cpp || die + sed -e 's/google::protobuf::internal::kEmptyString/google::protobuf::internal::GetEmptyStringAlreadyInited()/g' -i sources/plinkseq/sources/lib/variant.pb.cpp || die + local myinc=`pkg-config protobuf --variable=includedir` + sed -e "s@\$(PROTOBUF_LIB_BASE_DIR)/\$(INC_DIR)/@$myinc@" -i Makefile || die + local mylib=`pkg-config protobuf --variable=libdir` + sed -e "s@$(PROTOBUF_LIB_BASE_DIR)/$(BLD_LIB_DIR)/@$mylib@" -i Makefile || die + local mylibs=`pkg-config protobuf --libs` + sed -e "s@libprotobuf.a@$mylibs@" -i Makefile || die +} + +src_install(){ + cd build/execs || die + # TODO: avoid file collision with sci-biology/fsl + # https://bitbucket.org/statgen/plinkseq/issue/9/rename-mm-filename-to-plinkseq_mm + dobin gcol browser pseq behead mm smp tab2vcf pdas +}