-
Notifications
You must be signed in to change notification settings - Fork 9
/
oncofuse.rb
49 lines (45 loc) · 1.32 KB
/
oncofuse.rb
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
require 'formula'
class Oncofuse < Formula
homepage 'https://github.com/mikessh/oncofuse'
version '1.0.9'
url 'https://github.com/mikessh/oncofuse/releases/download/1.0.9a/oncofuse-1.0.9.zip'
sha1 'c23a93bed693a4641a834f10b69bacf2a4e6cb74'
def install
# avoid confusion with __MACOSX folder
java=share/'java/oncofuse'
java.install Dir['*', "oncofuse-v#{version}/*"]
bin.mkdir
open(bin / 'oncofuse', 'w') do |file|
file.write <<-EOS.undent
#!/bin/bash
default_jvm_mem_opts="-Xms512m -Xmx1g"
jvm_mem_opts=""
jvm_prop_opts=""
pass_args=""
for arg in "$@"; do
case $arg in
'-D'*)
jvm_prop_opts="$jvm_prop_opts $arg"
;;
'-Xm'*)
jvm_mem_opts="$jvm_mem_opts $arg"
;;
'*8')
pass_args="$pass_args \\*8"
;;
*)
pass_args="$pass_args $arg"
;;
esac
done
if [ "$jvm_mem_opts" == "" ]; then
jvm_mem_opts="$default_jvm_mem_opts"
fi
eval java $jvm_mem_opts $jvm_prop_opts -jar #{java}/Oncofuse.jar $pass_args
EOS
end
end
test do
system "oncofuse --version"
end
end