/
converters_tdaq.go
236 lines (198 loc) · 7.03 KB
/
converters_tdaq.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
package main
import (
"fmt"
"os"
"path/filepath"
"github.com/hwaf/hwaf/hlib"
)
func cnv_tdaq_library(wscript *hlib.Wscript_t, stmt Stmt) error {
x := stmt.(*ApplyPattern)
margs := cmt_arg_map(x.Args)
libname := ""
if _, ok := margs["library"]; ok {
libname = margs["library"]
} else {
libname = filepath.Base(wscript.Package.Name)
}
source := []string{"src/*.cxx"}
if _, ok := margs["files"]; ok {
source = []string{margs["files"]}
}
if libname == "" {
return fmt.Errorf(
"cmt2yml: empty tdaq_library name (package=%s, args=%v)",
wscript.Package.Name,
x.Args,
)
}
itgt, tgt := find_tgt(wscript, libname)
if itgt < 0 {
wscript.Build.Targets = append(
wscript.Build.Targets,
hlib.Target_t{Name: libname},
)
itgt, tgt = find_tgt(wscript, libname)
}
tgt.Features = []string{"tdaq_library"}
uses := use_list(wscript)
if len(uses) > 0 {
tgt.Use = []hlib.Value{hlib.DefaultValue("uses", uses)}
}
tgt.Source = []hlib.Value{hlib.DefaultValue("source", source)}
return nil
}
func cnv_tdaq_application(wscript *hlib.Wscript_t, stmt Stmt) error {
x := stmt.(*ApplyPattern)
margs := cmt_arg_map(x.Args)
appname := margs["name"]
if appname == "" {
return fmt.Errorf(
"cmt2yml: empty tdaq_application name (package=%s, args=%v)",
wscript.Package.Name,
x.Args,
)
}
tgtname := appname
itgt, tgt := find_tgt(wscript, tgtname)
if itgt < 0 {
wscript.Build.Targets = append(
wscript.Build.Targets,
hlib.Target_t{Name: tgtname},
)
itgt, tgt = find_tgt(wscript, tgtname)
}
tgt.Features = []string{"tdaq_application"}
source := []string{fmt.Sprintf("src/%s.cxx", appname)}
tgt.Source = []hlib.Value{hlib.DefaultValue("source", source)}
uses := []string{filepath.Base(wscript.Package.Name), "boost-thread"}
uses = append(uses, use_list(wscript)...)
tgt.Use = []hlib.Value{hlib.DefaultValue("uses", uses)}
//fmt.Printf(">>> [%v] \n", *tgt)
return nil
}
func cnv_tdaq_declare_lcg_mapping(wscript *hlib.Wscript_t, stmt Stmt) error {
fmt.Fprintf(os.Stderr, "** error ** [cnv_tdaq_declare_lcg_mapping] not implemented\n")
return nil
}
func cnv_tdaq_external_rpm_package(wscript *hlib.Wscript_t, stmt Stmt) error {
fmt.Fprintf(os.Stderr, "** error ** [cnv_tdaq_external_rpm_package] not implemented\n")
return nil
}
func cnv_tdaq_external_rpm_post(wscript *hlib.Wscript_t, stmt Stmt) error {
fmt.Fprintf(os.Stderr, "** error ** [cnv_tdaq_external_rpm_post] not implemented\n")
return nil
}
func cnv_tdaq_external_rpm_preun(wscript *hlib.Wscript_t, stmt Stmt) error {
fmt.Fprintf(os.Stderr, "** error ** [cnv_tdaq_external_rpm_preun] not implemented\n")
return nil
}
func cnv_tdaq_make_external_slinks(wscript *hlib.Wscript_t, stmt Stmt) error {
fmt.Fprintf(os.Stderr, "** error ** [cnv_tdaq_make_external_slinks] not implemented\n")
return nil
}
func cnv_tdaq_check_target(wscript *hlib.Wscript_t, stmt Stmt) error {
fmt.Fprintf(os.Stderr, "** error ** [cnv_tdaq_check_target] not implemented\n")
return nil
}
func cnv_tdaq_copy_file(wscript *hlib.Wscript_t, stmt Stmt) error {
fmt.Fprintf(os.Stderr, "** error ** [cnv_tdaq_copy_file] not implemented\n")
return nil
}
func cnv_tdaq_global_install_dirs(wscript *hlib.Wscript_t, stmt Stmt) error {
fmt.Fprintf(os.Stderr, "** error ** [cnv_tdaq_global_install_dirs] not implemented\n")
return nil
}
func cnv_tdaq_global_rpms(wscript *hlib.Wscript_t, stmt Stmt) error {
fmt.Fprintf(os.Stderr, "** error ** [cnv_tdaq_global_rpms] not implemented\n")
return nil
}
func cnv_tdaq_global_rpms_macros(wscript *hlib.Wscript_t, stmt Stmt) error {
fmt.Fprintf(os.Stderr, "** error ** [cnv_tdaq_global_rpms_macros] not implemented\n")
return nil
}
func cnv_tdaq_include_path_1(wscript *hlib.Wscript_t, stmt Stmt) error {
fmt.Fprintf(os.Stderr, "** error ** [cnv_tdaq_include_path_1] not implemented\n")
return nil
}
func cnv_tdaq_inst_docs_auto(wscript *hlib.Wscript_t, stmt Stmt) error {
fmt.Fprintf(os.Stderr, "** error ** [cnv_tdaq_inst_docs_auto] not implemented\n")
return nil
}
func cnv_tdaq_inst_headers_auto(wscript *hlib.Wscript_t, stmt Stmt) error {
fmt.Fprintf(os.Stderr, "** error ** [cnv_tdaq_inst_headers_auto] not implemented\n")
return nil
}
func cnv_tdaq_inst_headers_bin_auto(wscript *hlib.Wscript_t, stmt Stmt) error {
fmt.Fprintf(os.Stderr, "** error ** [cnv_tdaq_inst_headers_bin_auto] not implemented\n")
return nil
}
func cnv_tdaq_inst_idl_auto(wscript *hlib.Wscript_t, stmt Stmt) error {
fmt.Fprintf(os.Stderr, "** error ** [cnv_tdaq_inst_idl_auto] not implemented\n")
return nil
}
func cnv_tdaq_inst_scripts_auto(wscript *hlib.Wscript_t, stmt Stmt) error {
fmt.Fprintf(os.Stderr, "** error ** [cnv_tdaq_inst_scripts_auto] not implemented\n")
return nil
}
func cnv_tdaq_install_apps(wscript *hlib.Wscript_t, stmt Stmt) error {
fmt.Fprintf(os.Stderr, "** error ** [cnv_tdaq_install_apps] not implemented\n")
return nil
}
func cnv_tdaq_install_data(wscript *hlib.Wscript_t, stmt Stmt) error {
pkgname := filepath.Base(wscript.Package.Name)
tgt := hlib.Target_t{Name: pkgname + "-install-data"}
tgt.Features = []string{"atlas_install_data"}
tgt.Source = []hlib.Value{hlib.DefaultValue(
"data-files",
[]string{"data/*"},
)}
wscript.Build.Targets = append(wscript.Build.Targets, tgt)
return nil
}
func cnv_tdaq_install_dir(wscript *hlib.Wscript_t, stmt Stmt) error {
fmt.Fprintf(os.Stderr, "** error ** [cnv_tdaq_install_dir] not implemented\n")
return nil
}
func cnv_tdaq_install_docs(wscript *hlib.Wscript_t, stmt Stmt) error {
fmt.Fprintf(os.Stderr, "** error ** [cnv_tdaq_install_docs] not implemented\n")
return nil
}
func cnv_tdaq_install_examples(wscript *hlib.Wscript_t, stmt Stmt) error {
fmt.Fprintf(os.Stderr, "** error ** [cnv_tdaq_install_examples] not implemented\n")
return nil
}
func cnv_tdaq_install_headers(wscript *hlib.Wscript_t, stmt Stmt) error {
pkgname := filepath.Base(wscript.Package.Name)
tgt := hlib.Target_t{Name: pkgname + "-install-headers"}
tgt.Features = []string{"tdaq_install_headers"}
wscript.Build.Targets = append(wscript.Build.Targets, tgt)
return nil
}
func cnv_tdaq_install_libs(wscript *hlib.Wscript_t, stmt Stmt) error {
fmt.Fprintf(os.Stderr, "** error ** [cnv_tdaq_install_libs] not implemented\n")
return nil
}
func cnv_tdaq_install_scripts(wscript *hlib.Wscript_t, stmt Stmt) error {
pkgname := filepath.Base(wscript.Package.Name)
tgt := hlib.Target_t{Name: pkgname + "-install-scripts"}
tgt.Features = []string{"tdaq_install_scripts"}
tgt.Source = []hlib.Value{hlib.DefaultValue(
"script-files",
[]string{"scripts/*"},
)}
wscript.Build.Targets = append(wscript.Build.Targets, tgt)
return nil
}
func cnv_tdaq_release_inst_path(wscript *hlib.Wscript_t, stmt Stmt) error {
fmt.Fprintf(os.Stderr, "** error ** [cnv_tdaq_release_inst_path] not implemented\n")
return nil
}
func cnv_tdaq_set_cmtpath(wscript *hlib.Wscript_t, stmt Stmt) error {
fmt.Fprintf(os.Stderr, "** error ** [cnv_tdaq_set_cmtpath] not implemented\n")
return nil
}
func cnv_tdaq_set_release_package(wscript *hlib.Wscript_t, stmt Stmt) error {
fmt.Fprintf(os.Stderr, "** error ** [cnv_tdaq_set_release_package] not implemented\n")
return nil
}
// EOF