Skip to content

Commit 3c15ce9

Browse files
committed
libptytty 2.0 (new formula)
1 parent 2a4b6d6 commit 3c15ce9

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

Formula/lib/libptytty.rb

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
class Libptytty < Formula
2+
desc "Library for OS-independent pseudo-TTY management"
3+
homepage "https://software.schmorp.de/pkg/libptytty.html"
4+
url "http://dist.schmorp.de/libptytty/libptytty-2.0.tar.gz"
5+
sha256 "8033ed3aadf28759660d4f11f2d7b030acf2a6890cb0f7926fb0cfa6739d31f7"
6+
license "GPL-2.0-or-later"
7+
8+
depends_on "cmake" => :build
9+
10+
def install
11+
system "cmake", "-S", ".", "-B", "build", *std_cmake_args
12+
system "cmake", "--build", "build"
13+
system "cmake", "--install", "build"
14+
end
15+
16+
test do
17+
(testpath/"test.c").write <<~C
18+
#include <stdio.h>
19+
#include <libptytty.h>
20+
21+
int main(void) {
22+
ptytty_init();
23+
PTYTTY p = ptytty_create();
24+
if (!p || !ptytty_get(p)) return 1;
25+
printf("ok\\n");
26+
ptytty_delete(p);
27+
return 0;
28+
}
29+
C
30+
31+
system ENV.cc, "test.c", "-I#{include}", "-L#{lib}", "-lptytty", "-o", "test"
32+
system "./test"
33+
end
34+
end

0 commit comments

Comments
 (0)