1 |
commit: 5778e18ce802eadc134be8da814893287fd06d8c |
2 |
Author: Alessandro Barbieri <lssndrbarbieri <AT> gmail <DOT> com> |
3 |
AuthorDate: Wed May 11 10:18:19 2022 +0000 |
4 |
Commit: Andrew Ammerlaan <andrewammerlaan <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed May 11 11:29:17 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=5778e18c |
7 |
|
8 |
octaveforge.eclass: add octaveforge_src_test() |
9 |
|
10 |
Closes: https://bugs.gentoo.org/843536 |
11 |
Closes: https://bugs.gentoo.org/843521 |
12 |
Closes: https://bugs.gentoo.org/843518 |
13 |
Closes: https://bugs.gentoo.org/843515 |
14 |
Closes: https://bugs.gentoo.org/843512 |
15 |
Closes: https://bugs.gentoo.org/843509 |
16 |
Closes: https://bugs.gentoo.org/843503 |
17 |
Closes: https://bugs.gentoo.org/843500 |
18 |
Closes: https://bugs.gentoo.org/843497 |
19 |
|
20 |
Signed-off-by: Alessandro Barbieri <lssndrbarbieri <AT> gmail.com> |
21 |
|
22 |
eclass/octaveforge.eclass | 125 +++++++++++++++++++++++++--------------------- |
23 |
1 file changed, 68 insertions(+), 57 deletions(-) |
24 |
|
25 |
diff --git a/eclass/octaveforge.eclass b/eclass/octaveforge.eclass |
26 |
index fb708e3a7..bb6176be9 100644 |
27 |
--- a/eclass/octaveforge.eclass |
28 |
+++ b/eclass/octaveforge.eclass |
29 |
@@ -17,7 +17,7 @@ case ${EAPI} in |
30 |
*) die "${ECLASS}: EAPI ${EAPI} unsupported." |
31 |
esac |
32 |
|
33 |
-EXPORT_FUNCTIONS src_unpack src_prepare src_compile src_install pkg_postinst pkg_prerm pkg_postrm |
34 |
+EXPORT_FUNCTIONS src_unpack src_prepare src_compile src_install src_test pkg_postinst pkg_prerm pkg_postrm |
35 |
|
36 |
# @ECLASS-VARIABLE: REPO_URI |
37 |
# @DESCRIPTION: |
38 |
@@ -103,65 +103,21 @@ octaveforge_src_compile() { |
39 |
# @FUNCTION: octaveforge_src_install |
40 |
# @DESCRIPTION: |
41 |
# function to install the octave package |
42 |
-# documentation to docsdir |
43 |
octaveforge_src_install() { |
44 |
- TMPDIR="${T}" |
45 |
- DESTDIR="${D}" |
46 |
- DISTPKG='Gentoo' |
47 |
+ DESTDIR="${D}" _octaveforge_pkg_install || die |
48 |
+} |
49 |
|
50 |
- pushd ../ || die |
51 |
- if [[ "X${DISTPKG}X" != "XX" ]]; then |
52 |
- stripcmd=" |
53 |
- unlink(pkg('local_list')); |
54 |
- unlink(pkg('global_list')); |
55 |
- " |
56 |
- fi |
57 |
- if [[ "X${DESTDIR}X" = "XX" ]]; then |
58 |
- cmd=" |
59 |
- warning('off','all'); |
60 |
- pkg('install','${OCT_PACKAGE}'); |
61 |
- l=pkg('list'); |
62 |
- disp(l{cellfun(@(x)strcmp(x.name,'${PN}'),l)}.dir); |
63 |
- ${stripcmd} |
64 |
- " |
65 |
- oct_pkgdir=$(octavecommand "${cmd}" || die) |
66 |
- else |
67 |
- cmd="disp(fullfile(__octave_config_info__('datadir'),'octave'));" |
68 |
- shareprefix=${DESTDIR}/$(octavecommand "${cmd}" || die) |
69 |
- cmd="disp(fullfile(__octave_config_info__('libdir'),'octave'));" |
70 |
- libprefix=${DESTDIR}/$(octavecommand "${cmd}" || die) |
71 |
- octprefix="${shareprefix}/packages" || die |
72 |
- archprefix="${libprefix}/packages" || die |
73 |
- if [[ ! -e "${octprefix}" ]]; then |
74 |
- mkdir -p "${octprefix}" || die |
75 |
- fi |
76 |
- if [[ ! -e "${archprefix}" ]]; then |
77 |
- mkdir -p "${archprefix}" || die |
78 |
- fi |
79 |
- cmd=" |
80 |
- warning('off','all'); |
81 |
- pkg('prefix','${octprefix}','${archprefix}'); |
82 |
- pkg('global_list',fullfile('${shareprefix}','octave_packages')); |
83 |
- pkg('local_list',fullfile('${shareprefix}','octave_packages')); |
84 |
- pkg('install','-nodeps','-verbose','${OCT_PACKAGE}'); |
85 |
- " |
86 |
- octavecommand "${cmd}" || die |
87 |
- cmd=" |
88 |
- warning('off','all'); |
89 |
- pkg('prefix','${octprefix}','${archprefix}'); |
90 |
- pkg('global_list',fullfile('${shareprefix}','octave_packages')); |
91 |
- pkg('local_list',fullfile('${shareprefix}','octave_packages')); |
92 |
- l=pkg('list'); |
93 |
- disp(l{cellfun(@(x)strcmp(x.name,'${PN}'),l)}.dir); |
94 |
- ${stripcmd} |
95 |
- " |
96 |
- oct_pkgdir=$(octavecommand "${cmd}" || die) |
97 |
- fi |
98 |
- export oct_pkgdir |
99 |
+octaveforge_src_test() { |
100 |
+ DESTDIR="${T}" _octaveforge_pkg_install || die |
101 |
|
102 |
- if [[ -d doc/ ]]; then |
103 |
- dodoc -r doc/* |
104 |
- fi |
105 |
+ # cargo culted from Fedora |
106 |
+ cmd=" |
107 |
+ pkg('load','${PN}'); |
108 |
+ oruntests('${oct_pkgdir}'); |
109 |
+ unlink(pkg('local_list')); |
110 |
+ unlink(pkg('global_list')); |
111 |
+ " |
112 |
+ octavecommand "${cmd}" || die 'failed testing' |
113 |
} |
114 |
|
115 |
# @FUNCTION: octaveforge_pkg_postinst |
116 |
@@ -226,3 +182,58 @@ fi |
117 |
EOF |
118 |
chmod 0755 "configure" || die |
119 |
} |
120 |
+ |
121 |
+_octaveforge_pkg_install() { |
122 |
+ TMPDIR="${T}" |
123 |
+ DISTPKG='Gentoo' |
124 |
+ |
125 |
+ pushd ../ || die |
126 |
+ if [[ "X${DISTPKG}X" != "XX" ]]; then |
127 |
+ stripcmd=" |
128 |
+ unlink(pkg('local_list')); |
129 |
+ unlink(pkg('global_list')); |
130 |
+ " |
131 |
+ fi |
132 |
+ if [[ "X${DESTDIR}X" = "XX" ]]; then |
133 |
+ cmd=" |
134 |
+ warning('off','all'); |
135 |
+ pkg('install','${OCT_PACKAGE}'); |
136 |
+ l=pkg('list'); |
137 |
+ disp(l{cellfun(@(x)strcmp(x.name,'${PN}'),l)}.dir); |
138 |
+ ${stripcmd} |
139 |
+ " |
140 |
+ oct_pkgdir=$(octavecommand "${cmd}" || die) |
141 |
+ else |
142 |
+ cmd="disp(fullfile(__octave_config_info__('datadir'),'octave'));" |
143 |
+ shareprefix=${DESTDIR}/$(octavecommand "${cmd}" || die) |
144 |
+ cmd="disp(fullfile(__octave_config_info__('libdir'),'octave'));" |
145 |
+ libprefix=${DESTDIR}/$(octavecommand "${cmd}" || die) |
146 |
+ octprefix="${shareprefix}/packages" || die |
147 |
+ archprefix="${libprefix}/packages" || die |
148 |
+ if [[ ! -e "${octprefix}" ]]; then |
149 |
+ mkdir -p "${octprefix}" || die |
150 |
+ fi |
151 |
+ if [[ ! -e "${archprefix}" ]]; then |
152 |
+ mkdir -p "${archprefix}" || die |
153 |
+ fi |
154 |
+ cmd=" |
155 |
+ warning('off','all'); |
156 |
+ pkg('prefix','${octprefix}','${archprefix}'); |
157 |
+ pkg('global_list',fullfile('${shareprefix}','octave_packages')); |
158 |
+ pkg('local_list',fullfile('${shareprefix}','octave_packages')); |
159 |
+ pkg('install','-nodeps','-verbose','${OCT_PACKAGE}'); |
160 |
+ " |
161 |
+ octavecommand "${cmd}" || die |
162 |
+ cmd=" |
163 |
+ warning('off','all'); |
164 |
+ pkg('prefix','${octprefix}','${archprefix}'); |
165 |
+ pkg('global_list',fullfile('${shareprefix}','octave_packages')); |
166 |
+ pkg('local_list',fullfile('${shareprefix}','octave_packages')); |
167 |
+ l=pkg('list'); |
168 |
+ disp(l{cellfun(@(x)strcmp(x.name,'${PN}'),l)}.dir); |
169 |
+ ${stripcmd} |
170 |
+ " |
171 |
+ oct_pkgdir=$(octavecommand "${cmd}" || die) |
172 |
+ fi |
173 |
+ export oct_pkgdir |
174 |
+} |