/
xtrans.rb
43 lines (37 loc) 路 1.04 KB
/
xtrans.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
class Xtrans < Formula
desc "X.Org: X Network Transport layer shared code"
homepage "https://www.x.org/"
url "https://www.x.org/archive/individual/lib/xtrans-1.5.0.tar.xz"
sha256 "1ba4b703696bfddbf40bacf25bce4e3efb2a0088878f017a50e9884b0c8fb1bd"
license "MIT"
bottle do
rebuild 2
sha256 cellar: :any_skip_relocation, all: "9b83139171ea1c0b61f5d053e824f1be8715c28e7fe190a8784a1a6ea9234047"
end
depends_on "pkg-config" => :build
depends_on "util-macros" => :build
depends_on "xorgproto" => :test
def install
args = %W[
--prefix=#{prefix}
--sysconfdir=#{etc}
--localstatedir=#{var}
--disable-dependency-tracking
--disable-silent-rules
--enable-docs=no
]
system "./configure", *args
system "make", "install"
end
test do
(testpath/"test.c").write <<~EOS
#include "X11/Xtrans/Xtrans.h"
int main(int argc, char* argv[]) {
Xtransaddr addr;
return 0;
}
EOS
system ENV.cc, "test.c"
assert_equal 0, $CHILD_STATUS.exitstatus
end
end