-
Notifications
You must be signed in to change notification settings - Fork 0
/
alienfile
65 lines (56 loc) · 2.08 KB
/
alienfile
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
# -*- mode: perl; -*-
use strict;
use warnings;
use alienfile;
use File::Spec::Functions qw{catfile};
probe [ 'env | grep -q ^KENT_SRC=' ];
probe [ 'env | grep -q ^MACHTYPE=' ];
share {
requires 'Archive::Zip';
start_url 'http://hgdownload.cse.ucsc.edu/admin/';
plugin Download => (
filter => qr/\.zip$/,
version => qr/v(\d+)\.zip$/,
);
plugin 'Extract' => ( format => 'zip' );
meta->before_hook(
build => sub {
my ($build) = @_;
chomp(my $type = `uname -m`);
$build->runtime_prop->{kent_machtype} = $type;
log("set MACHTYPE to $type");
}
);
build [
## make jkweb.a
[ '%{make} -C src/lib CC=%{perl.config.cc} CFLAGS="-fPIC -g -Wall -O2"' ],
## make htslib.a
[ '%{make} -C src/htslib CC=%{perl.config.cc} CFLAGS="-fPIC -g -Wall -O2"' ],
## copy library files into place
[ 'mkdir -p %{.install.prefix}/lib/%{.runtime.kent_machtype}' ],
[ 'cp src/lib/%{.runtime.kent_machtype}/jkweb.a %{.install.prefix}/lib/%{.runtime.kent_machtype}/libjkweb.a' ],
[ 'cp src/lib/%{.runtime.kent_machtype}/jkweb.a %{.install.prefix}/lib/%{.runtime.kent_machtype}/jkweb.a' ],
[ 'cp src/htslib/libhts.a %{.install.prefix}/lib/%{.runtime.kent_machtype}/' ],
## copy include files
[ 'mkdir -p %{.install.prefix}/inc' ],
[ 'cp src/inc/*.h %{.install.prefix}/inc' ],
[ 'mkdir -p %{.install.prefix}/inc/htslib' ],
[ 'cp src/htslib/htslib/*.h %{.install.prefix}/inc/htslib/' ],
];
meta->after_hook(
gather_share => sub {
my ($build) = @_;
$build->runtime_prop->{version} =
join '.', split //, $build->runtime_prop->{version};
$build->runtime_prop->{cflags} = join ' ',
'-Wno-format',
'-Wformat=0',
join('', '-DMACHTYPE_', $build->runtime_prop->{kent_machtype}),
join('', '-I', catfile $build->install_prop->{prefix}, 'inc'),
;
$build->runtime_prop->{libs} = join ' ',
join('', '-L', catfile $build->install_prop->{prefix}, 'lib', $build->runtime_prop->{kent_machtype}),
'-ljkweb', '-lhts', '-lz', '-lssl', '-lpthread';
},
);
};