-
Notifications
You must be signed in to change notification settings - Fork 7
/
autoraise.rb
38 lines (32 loc) · 1.28 KB
/
autoraise.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
class Autoraise < Formula
version "5.3"
desc "Focus-follows-mouse for MacOS"
homepage "https://github.com/sbmpost/AutoRaise"
url "https://github.com/sbmpost/AutoRaise/archive/refs/tags/v#{version}.tar.gz"
sha256 "3be2d3a47b51e4c006470ef14d3e167933c6d4a1f165418825453c01547acefb"
license "GPL-3.0"
head do
url "https://github.com/sbmpost/AutoRaise.git"
end
option "with-dalternative_task_switcher", "Build with compile flag -DALTERNATIVE_TASK_SWITCHER"
option "with-dold_activation_method", "Build with compile flag -DOLD_ACTIVATION_METHOD"
option "with-dexperimental_focus_first", "Build with compile flag -DEXPERIMENTAL_FOCUS_FIRST"
def install
opts = []
opts << "-DALTERNATIVE_TASK_SWITCHER" if build.with? "dalternative_task_switcher"
opts << "-DOLD_ACTIVATION_METHOD" if build.with? "dold_activation_method"
opts << "-DEXPERIMENTAL_FOCUS_FIRST" if build.with? "dexperimental_focus_first"
cxxflags = "CXXFLAGS='#{opts.join(" ")}'" unless opts.empty?
system "make", "clean"
system ["make", cxxflags].join(" ")
bin.install "AutoRaise"
end
service do
run opt_bin/"AutoRaise"
log_path "#{Dir.home}/Library/Logs/AutoRaise.log"
error_log_path "#{Dir.home}/Library/Logs/AutoRaise.log"
end
test do
system "false"
end
end