This repository has been archived by the owner on Jul 22, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 80
WIP: Move to BinaryProvider build #439
Closed
IanButterworth
wants to merge
5
commits into
JuliaGraphics:master
from
IanButterworth:binaryprovider
Closed
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,10 @@ | ||
*.swp | ||
deps/deps.jl | ||
docs/build | ||
*.jl.*.cov | ||
*.jl.cov | ||
*.jl.mem | ||
.DS_Store | ||
Manifest.toml | ||
/Manifest.toml | ||
/dev/ | ||
/deps/* | ||
!/deps/build.jl | ||
docs/build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,70 +1,50 @@ | ||
using BinDeps, Compat | ||
|
||
@BinDeps.setup | ||
|
||
group = library_group("gtk") | ||
|
||
glib = library_dependency("glib", aliases = ["libglib-2.0", "libglib-2.0-0"], group = group) | ||
gobject = library_dependency("gobject", aliases = ["libgobject-2.0", "libgobject-2.0-0"], group = group) | ||
gtk = library_dependency("gtk", aliases = ["libgtk-3", "libgtk-3-0"], group = group) | ||
gdk = library_dependency("gdk", aliases = ["libgdk-3", "libgdk-3-0"], group = group) | ||
# for gtk2 use these two lines instead of the previous two | ||
#gtk = library_dependency("gtk", aliases = ["libgtk-quartz-2.0", "libgtk-win32-2.0-0", "libgtk-x11-2.0"], group = group) | ||
#gdk = library_dependency("gdk", aliases = ["libgdk-quartz-2.0", "libgdk-win32-2.0-0", "libgdk-x11-2.0"], group = group) | ||
gdk_pixbuf = library_dependency("gdk_pixbuf", aliases = ["libgdk_pixbuf-2.0", "libgdk_pixbuf-2.0-0"], group = group) | ||
gio = library_dependency("gio", aliases = ["libgio-2.0", "libgio-2.0-0"], group = group) | ||
|
||
deps = [glib, gobject, gtk, gdk, gdk_pixbuf, gio] | ||
|
||
if Sys.islinux() | ||
provides(AptGet, "libgtk-3-dev", deps) | ||
provides(Yum, "gtk3", deps) | ||
end | ||
|
||
if Sys.iswindows() | ||
using WinRPM | ||
provides(WinRPM.RPM,"libgtk-3-0", [gtk,gdk,gdk_pixbuf,glib,gio], os = :Windows) | ||
provides(WinRPM.RPM,"libgobject-2_0-0", [gobject], os = :Windows) | ||
|
||
# install some other quasi-required packages | ||
WinRPM.install([ | ||
"glib2-tools","gtk3-tools","gtk2-tools", | ||
"pango-tools","gdk-pixbuf-query-loaders", | ||
"hicolor-icon-theme","tango-icon-theme", | ||
"gnome-icon-theme","gnome-icon-theme-extras", | ||
"gnome-icon-theme-symbolic",]; | ||
yes = !isinteractive()) # don't prompt for unattended installs | ||
|
||
# compile the schemas | ||
libdir = joinpath(dirname(pathof(WinRPM)), "..", "deps","usr","$(Sys.ARCH)-w64-mingw32","sys-root","mingw","bin") | ||
run(`$libdir/glib-compile-schemas $libdir/../share/glib-2.0/schemas`) | ||
end | ||
|
||
if Sys.isapple() | ||
using Homebrew | ||
provides(Homebrew.HB, "gtk+3", [gtk, gdk, gobject], os = :Darwin, onload = | ||
""" | ||
function __init__bindeps__() | ||
if "XDG_DATA_DIRS" in keys(ENV) | ||
ENV["XDG_DATA_DIRS"] *= ":" * joinpath("$(Homebrew.brew_prefix)", "share") | ||
else | ||
ENV["XDG_DATA_DIRS"] = joinpath("$(Homebrew.brew_prefix)", "share") | ||
end | ||
ENV["GDK_PIXBUF_MODULEDIR"] = joinpath("$(Homebrew.brew_prefix)", "lib/gdk-pixbuf-2.0/2.10.0/loaders") | ||
ENV["GDK_PIXBUF_MODULE_FILE"] = joinpath("$(Homebrew.brew_prefix)", "lib/gdk-pixbuf-2.0/2.10.0/loaders.cache") | ||
run(`$(joinpath("$(Homebrew.brew_prefix)", "bin/gdk-pixbuf-query-loaders")) --update-cache`) | ||
end | ||
""") | ||
provides(Homebrew.HB, "glib", [glib, gio], os = :Darwin) | ||
provides(Homebrew.HB, "gdk-pixbuf", gdk_pixbuf, os = :Darwin) | ||
Homebrew.add("adwaita-icon-theme") | ||
using BinaryProvider # requires BinaryProvider 0.3.0 or later | ||
|
||
# Parse some basic command-line arguments | ||
const verbose = "--verbose" in ARGS | ||
const prefix = Prefix(get([a for a in ARGS if a != "--verbose"], 1, joinpath(@__DIR__, "usr"))) | ||
|
||
# These are the two binary objects we care about | ||
products = Product[ | ||
LibraryProduct(prefix, ["libz"], :libz), | ||
LibraryProduct(prefix, ["libglib"], :libglib), | ||
LibraryProduct(prefix, ["libgobject"], :gobject), | ||
LibraryProduct(prefix, ["libgio"], :gio), | ||
# Gets to here! | ||
LibraryProduct(prefix, ["libgtk"], :gtk), | ||
LibraryProduct(prefix, ["libgdk"], :gdk), | ||
LibraryProduct(prefix, ["libgdk_pixbuf"], :gdk_pixbuf), | ||
|
||
] | ||
|
||
dependencies = [ | ||
# We need zlib | ||
"https://github.com/bicycle1885/ZlibBuilder/releases/download/v1.0.4/build_Zlib.v1.2.11.jl", | ||
# We need libffi | ||
"https://github.com/JuliaPackaging/Yggdrasil/releases/download/Libffi-v3.2.1-0/build_Libffi.v3.2.1.jl", | ||
# We need gettext | ||
"https://github.com/JuliaPackaging/Yggdrasil/releases/download/Gettext-v0.19.8-0/build_Gettext.v0.19.8.jl", | ||
# We need pcre | ||
"https://github.com/JuliaPackaging/Yggdrasil/releases/download/PCRE-v8.42-2/build_PCRE.v8.42.0.jl", | ||
# We need iconv | ||
"https://github.com/JuliaPackaging/Yggdrasil/releases/download/Libiconv-v1.15-0/build_Libiconv.v1.15.0.jl", | ||
# We need Glib | ||
"https://github.com/JuliaPackaging/Yggdrasil/releases/download/Glib-v2.59.0%2B0/build_Glib.v2.59.0.jl", | ||
|
||
|
||
] | ||
|
||
|
||
for dependency in dependencies | ||
file = joinpath(@__DIR__, basename(dependency)) | ||
isfile(file) || download(dependency, file) | ||
# it's a bit faster to run the build in an anonymous module instead of | ||
# starting a new julia process | ||
|
||
# Build the dependencies | ||
Mod = @eval module Anon end | ||
Mod.include(file) | ||
end | ||
|
||
@BinDeps.install Dict([ | ||
(:glib, :libglib), | ||
(:gobject, :libgobject), | ||
(:gtk, :libgtk), | ||
(:gdk, :libgdk), | ||
(:gdk_pixbuf, :libgdk_pixbuf), | ||
(:gio, :libgio), | ||
]) | ||
# Finally, write out a deps.jl file | ||
write_deps_file(joinpath(@__DIR__, "deps.jl"), products) |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think
docs/build
shouldn't be removedThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it was removed previously (see below), I just changed the ordering when copying from another .gitignore
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I shouldn't comment when I'm that tired, sorry
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for checking! I shouldn't have reordered it tbh :)