-
-
Notifications
You must be signed in to change notification settings - Fork 12.7k
/
Copy pathpygobject3.rb
45 lines (40 loc) · 1.57 KB
/
pygobject3.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
class Pygobject3 < Formula
desc "GNOME Python bindings (based on GObject Introspection)"
homepage "https://wiki.gnome.org/Projects/PyGObject"
url "https://download.gnome.org/sources/pygobject/3.36/pygobject-3.36.1.tar.xz"
sha256 "d1bf42802d1cec113b5adaa0e7bf7f3745b44521dc2163588d276d5cd61d718f"
bottle do
cellar :any
sha256 "174079a381809080c02d5720bc2538929bf571d28710f7ab3cb646bfcd2a5bbf" => :catalina
sha256 "c2b276445ce99b5094cd6b68b03fb6dc47a8c2eefbc743b40eacc373b822345c" => :mojave
sha256 "f462700d1cd736cc800d410ef3e4d2509527ca98cb7dc437ac80adb9bc04b6d6" => :high_sierra
end
depends_on "meson" => :build
depends_on "ninja" => :build
depends_on "pkg-config" => :build
depends_on "gobject-introspection"
depends_on "py3cairo"
depends_on "[email protected]"
def install
mkdir "buildpy3" do
system "meson", *std_meson_args,
"-Dpycairo=true",
"-Dpython=#{Formula["[email protected]"].opt_bin}/python3",
".."
system "ninja", "-v"
system "ninja", "install", "-v"
end
end
test do
Pathname("test.py").write <<~EOS
import gi
gi.require_version("GLib", "2.0")
assert("__init__" in gi.__file__)
from gi.repository import GLib
assert(31 == GLib.Date.get_days_in_month(GLib.DateMonth.JANUARY, 2000))
EOS
pyversion = Language::Python.major_minor_version Formula["[email protected]"].opt_bin/"python3"
ENV.prepend_path "PYTHONPATH", lib/"python#{pyversion}/site-packages"
system Formula["[email protected]"].opt_bin/"python3", "test.py"
end
end