diff options
-rw-r--r-- | sci-chemistry/relion/Manifest | 1 | ||||
-rw-r--r-- | sci-chemistry/relion/metadata.xml | 1 | ||||
-rw-r--r-- | sci-chemistry/relion/relion-4.0.0.ebuild | 30 | ||||
-rw-r--r-- | sci-chemistry/relion/relion-9999.ebuild | 69 |
4 files changed, 99 insertions, 2 deletions
diff --git a/sci-chemistry/relion/Manifest b/sci-chemistry/relion/Manifest index 058ff2285..75b932e28 100644 --- a/sci-chemistry/relion/Manifest +++ b/sci-chemistry/relion/Manifest @@ -1 +1,2 @@ +DIST class_ranker_0.1.3_torch_1.0.1.pt.tar.gz 2190018 BLAKE2B 157d380693cb97f2f94aea5ee8b1c9b64c50cead45c65d8d95584b12a4901622df025e4bdfccfc9c87286a3d442ffc26ed2a89953b9361f59d7ae2852fcc3a6b SHA512 0e9d4046a9ba211c07abcc44d0b51c7d69805eb946ed96abdd1663760906188050d476268214b4e7a84f529f51226c39f40c3b418373437fae2f4bb24990f338 DIST relion-4.0.0.tar.gz 3342593 BLAKE2B d2293531cdf3c5779a8f6beb5bc753931388f1c577faa89a927c6ccd72436db0d9a84fbe08b836601b466bc23e9df6500f9e87da1630adecd2b0cf0e245d63e6 SHA512 1e873868bc54a13a7cca74c4a623f5f2aeeec7bd2df04f74d0421127a9c9a3b40a56ebc5b04a9f4138cca1208417b05a30c38ae78106d53b92deeadbeeaf4209 diff --git a/sci-chemistry/relion/metadata.xml b/sci-chemistry/relion/metadata.xml index 33e6e7e5d..101a056b9 100644 --- a/sci-chemistry/relion/metadata.xml +++ b/sci-chemistry/relion/metadata.xml @@ -11,6 +11,7 @@ </maintainer> <use> <flag name="gui">Enable relion gui</flag> + <flag name="cuda">Enable CUDA support</flag> </use> <upstream> <remote-id type="github">3dem/relion</remote-id> diff --git a/sci-chemistry/relion/relion-4.0.0.ebuild b/sci-chemistry/relion/relion-4.0.0.ebuild index a40375f64..c6d7d90db 100644 --- a/sci-chemistry/relion/relion-4.0.0.ebuild +++ b/sci-chemistry/relion/relion-4.0.0.ebuild @@ -7,11 +7,22 @@ inherit cmake DESCRIPTION="Image-processing software for cryo-electron microscopy" HOMEPAGE="https://www3.mrc-lmb.cam.ac.uk/relion/index.php/Main_Page" -SRC_URI="https://github.com/3dem/relion/archive/${PV}.tar.gz -> ${P}.tar.gz" + +if [[ ${PV} = *9999* ]]; then + EGIT_REPO_URI="https://github.com/3dem/relion.git" + [[ ${PV} = 9999 ]] && EGIT_BRANCH="master" || EGIT_BRANCH="ver${PV:0:4}" + inherit git-r3 + SRC_URI="ftp://ftp.mrc-lmb.cam.ac.uk/pub/dari/class_ranker_0.1.3_torch_1.0.1.pt.tar.gz" +else + SRC_URI=" + https://github.com/3dem/relion/archive/${PV}.tar.gz -> ${P}.tar.gz + ftp://ftp.mrc-lmb.cam.ac.uk/pub/dari/class_ranker_0.1.3_torch_1.0.1.pt.tar.gz + " + KEYWORDS="~amd64" +fi LICENSE="GPL-2" SLOT="0" -KEYWORDS="~amd64" IUSE="+gui cuda" DEPEND=" @@ -30,6 +41,21 @@ BDEPEND="${DEPEND}" PATCHES=( "${FILESDIR}/${PN}-4.0.0-build.patch" ) +src_unpack() { + git-r3_src_unpack + default +} + +src_prepare() { + cmake_src_prepare + mkdir -p "${S}/external/torch_models/" + cp "${DISTDIR}/class_ranker_0.1.3_torch_1.0.1.pt.tar.gz" "${S}/external/torch_models/" + mkdir -p "${S}/external/torch_models/class_ranker/" + cp "${WORKDIR}/class_ranker_0.1.3_torch_1.0.1.pt" "${S}/external/torch_models/class_ranker/" + sed -e "s:{CMAKE_INSTALL_PREFIX}/lib:{CMAKE_INSTALL_PREFIX}/$(get_libdir):g" -i CMakeLists.txt || die + sed -e "s:LIBRARY DESTINATION lib:LIBRARY DESTINATION $(get_libdir):g" -i src/apps/CMakeLists.txt || die +} + src_configure() { CMAKE_BUILD_TYPE=Release mycmakeargs=( diff --git a/sci-chemistry/relion/relion-9999.ebuild b/sci-chemistry/relion/relion-9999.ebuild new file mode 100644 index 000000000..12e09d2fe --- /dev/null +++ b/sci-chemistry/relion/relion-9999.ebuild @@ -0,0 +1,69 @@ +# Copyright 2019-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit cmake + +DESCRIPTION="Image-processing software for cryo-electron microscopy" +HOMEPAGE="https://www3.mrc-lmb.cam.ac.uk/relion/index.php/Main_Page" + +if [[ ${PV} = *9999* ]]; then + EGIT_REPO_URI="https://github.com/3dem/relion.git" + [[ ${PV} = 9999 ]] && EGIT_BRANCH="master" || EGIT_BRANCH="ver${PV:0:4}" + inherit git-r3 + SRC_URI="ftp://ftp.mrc-lmb.cam.ac.uk/pub/dari/class_ranker_0.1.3_torch_1.0.1.pt.tar.gz" +else + SRC_URI=" + https://github.com/3dem/relion/archive/${PV}.tar.gz -> ${P}.tar.gz + ftp://ftp.mrc-lmb.cam.ac.uk/pub/dari/class_ranker_0.1.3_torch_1.0.1.pt.tar.gz + " + KEYWORDS="~amd64" +fi + +LICENSE="GPL-2" +SLOT="0" +IUSE="+gui cuda" + +DEPEND=" + gui? ( x11-libs/fltk ) + cuda? ( dev-util/nvidia-cuda-toolkit ) + dev-cpp/tbb + sci-libs/fftw:3.0 + media-libs/tiff + virtual/mpi +" +RDEPEND=" + ${DEPEND} + sci-chemistry/ctffind +" +BDEPEND="${DEPEND}" + +src_unpack() { + git-r3_src_unpack + default +} + +src_prepare() { + cmake_src_prepare + mkdir -p "${S}/external/torch_models/" + cp "${DISTDIR}/class_ranker_0.1.3_torch_1.0.1.pt.tar.gz" "${S}/external/torch_models/" + mkdir -p "${S}/external/torch_models/class_ranker/" + cp "${WORKDIR}/class_ranker_0.1.3_torch_1.0.1.pt" "${S}/external/torch_models/class_ranker/" + sed -e "s:{CMAKE_INSTALL_PREFIX}/lib:{CMAKE_INSTALL_PREFIX}/$(get_libdir):g" -i CMakeLists.txt || die + sed -e "s:LIBRARY DESTINATION lib:LIBRARY DESTINATION $(get_libdir):g" -i src/apps/CMakeLists.txt || die +} + +src_configure() { + CMAKE_BUILD_TYPE=Release + mycmakeargs=( + -DBUILD_SHARED_LIBS=ON + -DALTCPU=$(usex !cuda) + -DFORCE_OWN_FFTW=OFF + -DFORCE_OWN_FLTK=OFF + -DFORCE_OWN_TBB=OFF + -DCUDA=$(usex cuda) + -DGUI=$(usex gui) + ) + cmake_src_configure +} |