Skip to content

Commit 888cb58

Browse files
committed
* Update to use new BinDeps features, namely library groups and onload hooks!
* Add a .gitignore to never commit deps/deps.jl, along with those pesky .DS_Store files
1 parent b3d2af5 commit 888cb58

File tree

3 files changed

+24
-29
lines changed

3 files changed

+24
-29
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
11
*.swp
2+
deps/deps.jl
3+
.DS_Store

deps/build.jl

Lines changed: 22 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@ using BinDeps
22

33
@BinDeps.setup
44

5+
group = library_group("gtk")
6+
57
deps = [
6-
gtk = library_dependency("gtk", aliases = ["libgtk-3", "libgtk-3-0"])
7-
@windows_only begin
8-
gdk = library_dependency("gdk", aliases = ["libgdk-3-0"])
9-
gdk_pixbuf = library_dependency("gdk_pixbuf", aliases = ["libgdk_pixbuf-2.0-0"])
10-
glib = library_dependency("glib", aliases = ["libglib-2.0-0"], os = :Windows)
11-
gobject = library_dependency("gobject", aliases = ["libgobject-2.0-0", "libgobject-2.0", "libgobject-2_0-0"], os = :Windows)
12-
gio = library_dependency("gio", aliases = ["libgio-2.0-0"])
13-
end
8+
gtk = library_dependency("gtk", aliases = ["libgtk-3", "libgtk-3-0"], group = group)
9+
glib = library_dependency("glib", aliases = ["libglib-2.0", "libglib-2.0-0"], group = group)
10+
gdk = library_dependency("gdk", aliases = ["libgdk-3-0", "libgdk-3.0"], group = group)
11+
gdk_pixbuf = library_dependency("gdk_pixbuf", aliases = ["libgdk_pixbuf-2.0-0", "libgdk_pixbuf-2.0.0"], group = group)
12+
gio = library_dependency("gio", aliases = ["libgio-2.0-0","libgio-2.0.0"], group = group)
13+
gobject = library_dependency("gobject", aliases = ["libgobject-2.0.0", "libgobject-2.0-0", "libgobject-2.0", "libgobject-2_0-0"], group = group)
1414
]
1515

1616
@linux_only begin
@@ -20,24 +20,31 @@ end
2020

2121
@windows_only begin
2222
using WinRPM
23-
provides(WinRPM.RPM,"gtk3", [gtk,gdk,gdk_pixbuf,glib,gio], os = :Windows)
23+
provides(WinRPM.RPM,"gtk3", [gtk,gdk,gdk_pixbuf,glib,gio], os = :Windows )
2424
provides(WinRPM.RPM,"libgobject-2_0-0", [gobject], os = :Windows)
2525
end
2626

2727
@osx_only begin
2828
using Homebrew
29-
provides(Homebrew.HB, "gtk+3", gtk, os = :Darwin)
29+
provides(Homebrew.HB, "gtk+3", [gtk, gdk, gobject], os = :Darwin, onload =
30+
"""
31+
function __init__()
32+
if "XDG_DATA_DIRS" in ENV
33+
ENV["XDG_DATA_DIRS"] *= ":" * joinpath("$(Homebrew.brew_prefix)", "share")
34+
else
35+
ENV["XDG_DATA_DIRS"] = joinpath("$(Homebrew.brew_prefix)", "share")
36+
end
37+
end
38+
""" )
39+
provides(Homebrew.HB, "glib", [glib, gio], os = :Darwin)
40+
provides(Homebrew.HB, "gdk-pixbuf", gdk_pixbuf, os = :Darwin)
3041
end
3142

32-
if OS_NAME == :Windows
3343
@BinDeps.install [
3444
:gtk => :libgtk,
3545
:gdk => :libgdk,
3646
:gdk_pixbuf => :libgdk_pixbuf,
3747
:gio => :libgio,
3848
:gobject => :libgobject,
3949
:glib => :libglib
40-
]
41-
else
42-
@BinDeps.install
43-
end
50+
]

deps/ext_glib.jl

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,4 @@ else
1010
const libgobject = "libgobject-2.0"
1111
const libglib = "libglib-2.0"
1212
end
13-
end
14-
15-
@osx_only begin
16-
if Pkg.installed("Homebrew") != nothing
17-
using Homebrew
18-
if Homebrew.installed("gtk+3")
19-
# Append to XDG_DATA_DIRS to get us the proper paths setup for glib schemas
20-
if "XDG_DATA_DIRS" in ENV
21-
ENV["XDG_DATA_DIRS"] *= ":" * joinpath(Homebrew.brew_prefix, "share")
22-
else
23-
ENV["XDG_DATA_DIRS"] = joinpath(Homebrew.brew_prefix, "share")
24-
end
25-
end
26-
end
2713
end

0 commit comments

Comments
 (0)