/
libxslt.go
44 lines (37 loc) · 1.03 KB
/
libxslt.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
package packages
import (
"fmt"
"github.com/alexandrecarlton/gogurt"
)
type LibXSLT struct{}
func (libxslt LibXSLT) Name() string {
return "libxslt"
}
func (libxslt LibXSLT) URL(version string) string {
return fmt.Sprintf("http://xmlsoft.org/sources/libxslt-%s.tar.gz", version)
}
func (libxslt LibXSLT) Build(config gogurt.Config) error {
configure := gogurt.ConfigureCmd{
Prefix: config.InstallDir(libxslt),
Args: []string{
"--disable-shared",
"--enable-static",
"--with-libxml-prefix=" + config.InstallDir(LibXML2{}),
"--without-python", // TODO: When we start building Python with expat, set this config.InstallDir(Python2{})
},
}.Cmd()
if err := configure.Run(); err != nil {
return err
}
make := gogurt.MakeCmd{Jobs: config.NumCores}.Cmd()
return make.Run()
}
func (libxslt LibXSLT) Install(config gogurt.Config) error {
makeInstall := gogurt.MakeCmd{Args: []string{"install"}}.Cmd()
return makeInstall.Run()
}
func (libxslt LibXSLT) Dependencies() []gogurt.Package {
return []gogurt.Package{
LibXML2{},
}
}