1 |
commit: c2861a35cb4f890544347dc141403e8dc32c8ff5 |
2 |
Author: Alexey Shvetsov <alexxy <AT> gentoo <DOT> org> |
3 |
AuthorDate: Wed Feb 1 12:03:34 2023 +0000 |
4 |
Commit: Alexey Shvetsov <alexxy <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Feb 1 12:03:34 2023 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/sci.git/commit/?id=c2861a35 |
7 |
|
8 |
sci-chemistry/relion: Update relion ebuilds |
9 |
|
10 |
Signed-off-by: Alexey Shvetsov <alexxy <AT> gentoo.org> |
11 |
|
12 |
sci-chemistry/relion/metadata.xml | 1 + |
13 |
sci-chemistry/relion/relion-4.0.0.ebuild | 30 +++++++++++++- |
14 |
sci-chemistry/relion/relion-9999.ebuild | 69 ++++++++++++++++++++++++++++++++ |
15 |
3 files changed, 98 insertions(+), 2 deletions(-) |
16 |
|
17 |
diff --git a/sci-chemistry/relion/metadata.xml b/sci-chemistry/relion/metadata.xml |
18 |
index 33e6e7e5d..101a056b9 100644 |
19 |
--- a/sci-chemistry/relion/metadata.xml |
20 |
+++ b/sci-chemistry/relion/metadata.xml |
21 |
@@ -11,6 +11,7 @@ |
22 |
</maintainer> |
23 |
<use> |
24 |
<flag name="gui">Enable relion gui</flag> |
25 |
+ <flag name="cuda">Enable CUDA support</flag> |
26 |
</use> |
27 |
<upstream> |
28 |
<remote-id type="github">3dem/relion</remote-id> |
29 |
|
30 |
diff --git a/sci-chemistry/relion/relion-4.0.0.ebuild b/sci-chemistry/relion/relion-4.0.0.ebuild |
31 |
index a40375f64..c6d7d90db 100644 |
32 |
--- a/sci-chemistry/relion/relion-4.0.0.ebuild |
33 |
+++ b/sci-chemistry/relion/relion-4.0.0.ebuild |
34 |
@@ -7,11 +7,22 @@ inherit cmake |
35 |
|
36 |
DESCRIPTION="Image-processing software for cryo-electron microscopy" |
37 |
HOMEPAGE="https://www3.mrc-lmb.cam.ac.uk/relion/index.php/Main_Page" |
38 |
-SRC_URI="https://github.com/3dem/relion/archive/${PV}.tar.gz -> ${P}.tar.gz" |
39 |
+ |
40 |
+if [[ ${PV} = *9999* ]]; then |
41 |
+ EGIT_REPO_URI="https://github.com/3dem/relion.git" |
42 |
+ [[ ${PV} = 9999 ]] && EGIT_BRANCH="master" || EGIT_BRANCH="ver${PV:0:4}" |
43 |
+ inherit git-r3 |
44 |
+ SRC_URI="ftp://ftp.mrc-lmb.cam.ac.uk/pub/dari/class_ranker_0.1.3_torch_1.0.1.pt.tar.gz" |
45 |
+else |
46 |
+ SRC_URI=" |
47 |
+ https://github.com/3dem/relion/archive/${PV}.tar.gz -> ${P}.tar.gz |
48 |
+ ftp://ftp.mrc-lmb.cam.ac.uk/pub/dari/class_ranker_0.1.3_torch_1.0.1.pt.tar.gz |
49 |
+ " |
50 |
+ KEYWORDS="~amd64" |
51 |
+fi |
52 |
|
53 |
LICENSE="GPL-2" |
54 |
SLOT="0" |
55 |
-KEYWORDS="~amd64" |
56 |
IUSE="+gui cuda" |
57 |
|
58 |
DEPEND=" |
59 |
@@ -30,6 +41,21 @@ BDEPEND="${DEPEND}" |
60 |
|
61 |
PATCHES=( "${FILESDIR}/${PN}-4.0.0-build.patch" ) |
62 |
|
63 |
+src_unpack() { |
64 |
+ git-r3_src_unpack |
65 |
+ default |
66 |
+} |
67 |
+ |
68 |
+src_prepare() { |
69 |
+ cmake_src_prepare |
70 |
+ mkdir -p "${S}/external/torch_models/" |
71 |
+ cp "${DISTDIR}/class_ranker_0.1.3_torch_1.0.1.pt.tar.gz" "${S}/external/torch_models/" |
72 |
+ mkdir -p "${S}/external/torch_models/class_ranker/" |
73 |
+ cp "${WORKDIR}/class_ranker_0.1.3_torch_1.0.1.pt" "${S}/external/torch_models/class_ranker/" |
74 |
+ sed -e "s:{CMAKE_INSTALL_PREFIX}/lib:{CMAKE_INSTALL_PREFIX}/$(get_libdir):g" -i CMakeLists.txt || die |
75 |
+ sed -e "s:LIBRARY DESTINATION lib:LIBRARY DESTINATION $(get_libdir):g" -i src/apps/CMakeLists.txt || die |
76 |
+} |
77 |
+ |
78 |
src_configure() { |
79 |
CMAKE_BUILD_TYPE=Release |
80 |
mycmakeargs=( |
81 |
|
82 |
diff --git a/sci-chemistry/relion/relion-9999.ebuild b/sci-chemistry/relion/relion-9999.ebuild |
83 |
new file mode 100644 |
84 |
index 000000000..12e09d2fe |
85 |
--- /dev/null |
86 |
+++ b/sci-chemistry/relion/relion-9999.ebuild |
87 |
@@ -0,0 +1,69 @@ |
88 |
+# Copyright 2019-2021 Gentoo Authors |
89 |
+# Distributed under the terms of the GNU General Public License v2 |
90 |
+ |
91 |
+EAPI=8 |
92 |
+ |
93 |
+inherit cmake |
94 |
+ |
95 |
+DESCRIPTION="Image-processing software for cryo-electron microscopy" |
96 |
+HOMEPAGE="https://www3.mrc-lmb.cam.ac.uk/relion/index.php/Main_Page" |
97 |
+ |
98 |
+if [[ ${PV} = *9999* ]]; then |
99 |
+ EGIT_REPO_URI="https://github.com/3dem/relion.git" |
100 |
+ [[ ${PV} = 9999 ]] && EGIT_BRANCH="master" || EGIT_BRANCH="ver${PV:0:4}" |
101 |
+ inherit git-r3 |
102 |
+ SRC_URI="ftp://ftp.mrc-lmb.cam.ac.uk/pub/dari/class_ranker_0.1.3_torch_1.0.1.pt.tar.gz" |
103 |
+else |
104 |
+ SRC_URI=" |
105 |
+ https://github.com/3dem/relion/archive/${PV}.tar.gz -> ${P}.tar.gz |
106 |
+ ftp://ftp.mrc-lmb.cam.ac.uk/pub/dari/class_ranker_0.1.3_torch_1.0.1.pt.tar.gz |
107 |
+ " |
108 |
+ KEYWORDS="~amd64" |
109 |
+fi |
110 |
+ |
111 |
+LICENSE="GPL-2" |
112 |
+SLOT="0" |
113 |
+IUSE="+gui cuda" |
114 |
+ |
115 |
+DEPEND=" |
116 |
+ gui? ( x11-libs/fltk ) |
117 |
+ cuda? ( dev-util/nvidia-cuda-toolkit ) |
118 |
+ dev-cpp/tbb |
119 |
+ sci-libs/fftw:3.0 |
120 |
+ media-libs/tiff |
121 |
+ virtual/mpi |
122 |
+" |
123 |
+RDEPEND=" |
124 |
+ ${DEPEND} |
125 |
+ sci-chemistry/ctffind |
126 |
+" |
127 |
+BDEPEND="${DEPEND}" |
128 |
+ |
129 |
+src_unpack() { |
130 |
+ git-r3_src_unpack |
131 |
+ default |
132 |
+} |
133 |
+ |
134 |
+src_prepare() { |
135 |
+ cmake_src_prepare |
136 |
+ mkdir -p "${S}/external/torch_models/" |
137 |
+ cp "${DISTDIR}/class_ranker_0.1.3_torch_1.0.1.pt.tar.gz" "${S}/external/torch_models/" |
138 |
+ mkdir -p "${S}/external/torch_models/class_ranker/" |
139 |
+ cp "${WORKDIR}/class_ranker_0.1.3_torch_1.0.1.pt" "${S}/external/torch_models/class_ranker/" |
140 |
+ sed -e "s:{CMAKE_INSTALL_PREFIX}/lib:{CMAKE_INSTALL_PREFIX}/$(get_libdir):g" -i CMakeLists.txt || die |
141 |
+ sed -e "s:LIBRARY DESTINATION lib:LIBRARY DESTINATION $(get_libdir):g" -i src/apps/CMakeLists.txt || die |
142 |
+} |
143 |
+ |
144 |
+src_configure() { |
145 |
+ CMAKE_BUILD_TYPE=Release |
146 |
+ mycmakeargs=( |
147 |
+ -DBUILD_SHARED_LIBS=ON |
148 |
+ -DALTCPU=$(usex !cuda) |
149 |
+ -DFORCE_OWN_FFTW=OFF |
150 |
+ -DFORCE_OWN_FLTK=OFF |
151 |
+ -DFORCE_OWN_TBB=OFF |
152 |
+ -DCUDA=$(usex cuda) |
153 |
+ -DGUI=$(usex gui) |
154 |
+ ) |
155 |
+ cmake_src_configure |
156 |
+} |