Skip to content

Commit

Permalink
Only change the artifact on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
nhz2 committed Jan 15, 2024
1 parent 40bdf26 commit 7ce5a9d
Show file tree
Hide file tree
Showing 6 changed files with 225 additions and 24 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ docs/build
.DS_Store
Manifest.toml
MutableArtifacts.toml
*.tar.gz

141 changes: 139 additions & 2 deletions Artifacts.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,143 @@
[adwaita_icon_theme]
[[adwaita_icon_theme]]
arch = "i686"
git-tree-sha1 = "65eca7c48dea1e32203b205613441ce9506045b4"
libc = "glibc"
os = "linux"

[[adwaita_icon_theme.download]]
sha256 = "f50f3c85710f7dfbd6959bfaa6cc3a940195cd09dadddefb3b5ae9a2f97adad3"
url = "https://github.com/JuliaBinaryWrappers/adwaita_icon_theme_jll.jl/releases/download/adwaita_icon_theme-v3.33.92+4/adwaita_icon_theme.v3.33.92.any.tar.gz"
[[adwaita_icon_theme]]
arch = "x86_64"
git-tree-sha1 = "65eca7c48dea1e32203b205613441ce9506045b4"
libc = "glibc"
os = "linux"

[[adwaita_icon_theme.download]]
sha256 = "f50f3c85710f7dfbd6959bfaa6cc3a940195cd09dadddefb3b5ae9a2f97adad3"
url = "https://github.com/JuliaBinaryWrappers/adwaita_icon_theme_jll.jl/releases/download/adwaita_icon_theme-v3.33.92+4/adwaita_icon_theme.v3.33.92.any.tar.gz"
[[adwaita_icon_theme]]
arch = "aarch64"
git-tree-sha1 = "65eca7c48dea1e32203b205613441ce9506045b4"
libc = "glibc"
os = "linux"

[[adwaita_icon_theme.download]]
sha256 = "f50f3c85710f7dfbd6959bfaa6cc3a940195cd09dadddefb3b5ae9a2f97adad3"
url = "https://github.com/JuliaBinaryWrappers/adwaita_icon_theme_jll.jl/releases/download/adwaita_icon_theme-v3.33.92+4/adwaita_icon_theme.v3.33.92.any.tar.gz"
[[adwaita_icon_theme]]
arch = "armv6l"
call_abi = "eabihf"
git-tree-sha1 = "65eca7c48dea1e32203b205613441ce9506045b4"
libc = "glibc"
os = "linux"

[[adwaita_icon_theme.download]]
sha256 = "f50f3c85710f7dfbd6959bfaa6cc3a940195cd09dadddefb3b5ae9a2f97adad3"
url = "https://github.com/JuliaBinaryWrappers/adwaita_icon_theme_jll.jl/releases/download/adwaita_icon_theme-v3.33.92+4/adwaita_icon_theme.v3.33.92.any.tar.gz"
[[adwaita_icon_theme]]
arch = "armv7l"
call_abi = "eabihf"
git-tree-sha1 = "65eca7c48dea1e32203b205613441ce9506045b4"
libc = "glibc"
os = "linux"

[[adwaita_icon_theme.download]]
sha256 = "f50f3c85710f7dfbd6959bfaa6cc3a940195cd09dadddefb3b5ae9a2f97adad3"
url = "https://github.com/JuliaBinaryWrappers/adwaita_icon_theme_jll.jl/releases/download/adwaita_icon_theme-v3.33.92+4/adwaita_icon_theme.v3.33.92.any.tar.gz"
[[adwaita_icon_theme]]
arch = "powerpc64le"
git-tree-sha1 = "65eca7c48dea1e32203b205613441ce9506045b4"
libc = "glibc"
os = "linux"

[[adwaita_icon_theme.download]]
sha256 = "f50f3c85710f7dfbd6959bfaa6cc3a940195cd09dadddefb3b5ae9a2f97adad3"
url = "https://github.com/JuliaBinaryWrappers/adwaita_icon_theme_jll.jl/releases/download/adwaita_icon_theme-v3.33.92+4/adwaita_icon_theme.v3.33.92.any.tar.gz"
[[adwaita_icon_theme]]
arch = "i686"
git-tree-sha1 = "65eca7c48dea1e32203b205613441ce9506045b4"
libc = "musl"
os = "linux"

[[adwaita_icon_theme.download]]
sha256 = "f50f3c85710f7dfbd6959bfaa6cc3a940195cd09dadddefb3b5ae9a2f97adad3"
url = "https://github.com/JuliaBinaryWrappers/adwaita_icon_theme_jll.jl/releases/download/adwaita_icon_theme-v3.33.92+4/adwaita_icon_theme.v3.33.92.any.tar.gz"
[[adwaita_icon_theme]]
arch = "x86_64"
git-tree-sha1 = "65eca7c48dea1e32203b205613441ce9506045b4"
libc = "musl"
os = "linux"

[[adwaita_icon_theme.download]]
sha256 = "f50f3c85710f7dfbd6959bfaa6cc3a940195cd09dadddefb3b5ae9a2f97adad3"
url = "https://github.com/JuliaBinaryWrappers/adwaita_icon_theme_jll.jl/releases/download/adwaita_icon_theme-v3.33.92+4/adwaita_icon_theme.v3.33.92.any.tar.gz"
[[adwaita_icon_theme]]
arch = "aarch64"
git-tree-sha1 = "65eca7c48dea1e32203b205613441ce9506045b4"
libc = "musl"
os = "linux"

[[adwaita_icon_theme.download]]
sha256 = "f50f3c85710f7dfbd6959bfaa6cc3a940195cd09dadddefb3b5ae9a2f97adad3"
url = "https://github.com/JuliaBinaryWrappers/adwaita_icon_theme_jll.jl/releases/download/adwaita_icon_theme-v3.33.92+4/adwaita_icon_theme.v3.33.92.any.tar.gz"
[[adwaita_icon_theme]]
arch = "armv6l"
call_abi = "eabihf"
git-tree-sha1 = "65eca7c48dea1e32203b205613441ce9506045b4"
libc = "musl"
os = "linux"

[[adwaita_icon_theme.download]]
sha256 = "f50f3c85710f7dfbd6959bfaa6cc3a940195cd09dadddefb3b5ae9a2f97adad3"
url = "https://github.com/JuliaBinaryWrappers/adwaita_icon_theme_jll.jl/releases/download/adwaita_icon_theme-v3.33.92+4/adwaita_icon_theme.v3.33.92.any.tar.gz"
[[adwaita_icon_theme]]
arch = "armv7l"
call_abi = "eabihf"
git-tree-sha1 = "65eca7c48dea1e32203b205613441ce9506045b4"
libc = "musl"
os = "linux"

[[adwaita_icon_theme.download]]
sha256 = "f50f3c85710f7dfbd6959bfaa6cc3a940195cd09dadddefb3b5ae9a2f97adad3"
url = "https://github.com/JuliaBinaryWrappers/adwaita_icon_theme_jll.jl/releases/download/adwaita_icon_theme-v3.33.92+4/adwaita_icon_theme.v3.33.92.any.tar.gz"
[[adwaita_icon_theme]]
arch = "x86_64"
git-tree-sha1 = "65eca7c48dea1e32203b205613441ce9506045b4"
os = "macos"

[[adwaita_icon_theme.download]]
sha256 = "f50f3c85710f7dfbd6959bfaa6cc3a940195cd09dadddefb3b5ae9a2f97adad3"
url = "https://github.com/JuliaBinaryWrappers/adwaita_icon_theme_jll.jl/releases/download/adwaita_icon_theme-v3.33.92+4/adwaita_icon_theme.v3.33.92.any.tar.gz"
[[adwaita_icon_theme]]
arch = "aarch64"
git-tree-sha1 = "65eca7c48dea1e32203b205613441ce9506045b4"
os = "macos"

[[adwaita_icon_theme.download]]
sha256 = "f50f3c85710f7dfbd6959bfaa6cc3a940195cd09dadddefb3b5ae9a2f97adad3"
url = "https://github.com/JuliaBinaryWrappers/adwaita_icon_theme_jll.jl/releases/download/adwaita_icon_theme-v3.33.92+4/adwaita_icon_theme.v3.33.92.any.tar.gz"
[[adwaita_icon_theme]]
arch = "x86_64"
git-tree-sha1 = "65eca7c48dea1e32203b205613441ce9506045b4"
os = "freebsd"

[[adwaita_icon_theme.download]]
sha256 = "f50f3c85710f7dfbd6959bfaa6cc3a940195cd09dadddefb3b5ae9a2f97adad3"
url = "https://github.com/JuliaBinaryWrappers/adwaita_icon_theme_jll.jl/releases/download/adwaita_icon_theme-v3.33.92+4/adwaita_icon_theme.v3.33.92.any.tar.gz"
[[adwaita_icon_theme]]
arch = "i686"
git-tree-sha1 = "043d0732f572e66059278f5964e3752f018a5cdf"
os = "windows"

[[adwaita_icon_theme.download]]
sha256 = "b11fe18679624c9db04523f55d085e9de804899a82f4df11ec4f38c217a10e49"
url = "https://github.com/medyan-dev/SmallZarrGroups.jl/releases/download/v0.6.6/copy_symlinks_adwaita_icon_theme.v3.33.92.any.tar.gz"
[[adwaita_icon_theme]]
arch = "x86_64"
git-tree-sha1 = "043d0732f572e66059278f5964e3752f018a5cdf"
os = "windows"

[[adwaita_icon_theme.download]]
sha256 = "19b4b36662b2894c2eb2dd348438656df91a2402b5de6e83a0523d53ff6ced64"
sha256 = "b11fe18679624c9db04523f55d085e9de804899a82f4df11ec4f38c217a10e49"
url = "https://github.com/medyan-dev/SmallZarrGroups.jl/releases/download/v0.6.6/copy_symlinks_adwaita_icon_theme.v3.33.92.any.tar.gz"
6 changes: 6 additions & 0 deletions icon-artifacts/Project.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[deps]
CodecZlib = "944b1d66-785c-5afd-91f1-9de20f533193"
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
SHA = "ea8e919c-243c-51af-8825-aaa63cd721ce"
Tar = "a4e569a6-e804-4fa4-b0f3-eef7a1d5b13e"
2 changes: 2 additions & 0 deletions icon-artifacts/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
This directoy contains code to generate specific icon artifacts required to run Gtk.jl.

77 changes: 77 additions & 0 deletions icon-artifacts/adwaita_icon_theme.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
# This script was how the new adwaita_icon_theme artifact was generated.
using Tar: Tar
using Pkg.Artifacts: bind_artifact!, create_artifact, archive_artifact, artifact_path
using Pkg: Pkg, PlatformEngines
using Base.BinaryPlatforms: Platform
using Random: seed!
using CodecZlib: GzipCompressor
using SHA: sha256

seed!(1234)

windows_platforms = [
# Windows
Platform("i686", "windows"),
Platform("x86_64", "windows"),
]

other_platforms = [
# glibc Linuces
Platform("i686", "linux"),
Platform("x86_64", "linux"),
Platform("aarch64", "linux"),
Platform("armv6l", "linux"),
Platform("armv7l", "linux"),
Platform("powerpc64le", "linux"),

# musl Linuces
Platform("i686", "linux"; libc="musl"),
Platform("x86_64", "linux"; libc="musl"),
Platform("aarch64", "linux"; libc="musl"),
Platform("armv6l", "linux"; libc="musl"),
Platform("armv7l", "linux"; libc="musl"),

# BSDs
Platform("x86_64", "macos"),
Platform("aarch64", "macos"),
Platform("x86_64", "freebsd"),
]

# This is the url that the new windows artifact will be available from:
url_to_upload_to = "https://github.com/medyan-dev/SmallZarrGroups.jl/releases/download/v0.6.6/copy_symlinks_adwaita_icon_theme.v3.33.92.any.tar.gz"
windows_tarball = joinpath(@__DIR__, "copy_symlinks_adwaita_icon_theme.v3.33.92.any.tar.gz")

# This is the url of the source artifact:
url_src = "https://github.com/JuliaBinaryWrappers/adwaita_icon_theme_jll.jl/releases/download/adwaita_icon_theme-v3.33.92+4/adwaita_icon_theme.v3.33.92.any.tar.gz"
tree_hash_src = Base.SHA1("65eca7c48dea1e32203b205613441ce9506045b4")
tar_sha256_src = "f50f3c85710f7dfbd6959bfaa6cc3a940195cd09dadddefb3b5ae9a2f97adad3"

# This is the path to the Artifacts.toml we will manipulate
artifact_toml = joinpath(@__DIR__, "../Artifacts.toml")

for p in other_platforms
bind_artifact!(artifact_toml, "adwaita_icon_theme", tree_hash_src;
platform=p,
force=true,
download_info=[(url_src, tar_sha256_src)],
)
end

# Now copy symlinks to allow the artifact to be installed on windows
tree_hash_windows = create_artifact() do dir
Tar.extract(`$(PlatformEngines.exe7z()) x $(download(url_src)) -so`, dir;
copy_symlinks=true,
)
end
tar_tempfile = Tar.create(artifact_path(tree_hash_windows); portable=true)
tarball_data = transcode(GzipCompressor, read(tar_tempfile))
tar_sha256_windows = bytes2hex(sha256(tarball_data))
write(windows_tarball, tarball_data)

for p in windows_platforms
bind_artifact!(artifact_toml, "adwaita_icon_theme", tree_hash_windows;
platform=p,
force=true,
download_info=[(url_to_upload_to, tar_sha256_windows)],
)
end
22 changes: 0 additions & 22 deletions src/Gtk.jl
Original file line number Diff line number Diff line change
Expand Up @@ -76,28 +76,6 @@ include("theme.jl")
include("gio.jl")
include("application.jl")

#=
# This script was how the new adwaita_icon_theme artifact was generated.
using Tar
using Pkg.Artifacts
using Pkg: Pkg, PlatformEngines
# This is the url that the source artifact will be available from:
url_src = "https://github.com/JuliaBinaryWrappers/adwaita_icon_theme_jll.jl/releases/download/adwaita_icon_theme-v3.33.92+4/adwaita_icon_theme.v3.33.92.any.tar.gz"
# This is the url that the new artifact will be available from:
url_to_upload_to = "https://github.com/medyan-dev/SmallZarrGroups.jl/releases/download/v0.6.6/copy_symlinks_adwaita_icon_theme.v3.33.92.any.tar.gz"
# This is the path to the Artifacts.toml we will manipulate
artifact_toml = "Artifacts.toml"
hash = create_artifact() do dir
Tar.extract(`$(PlatformEngines.exe7z()) x $(download(url_src)) -so`, dir;
copy_symlinks=true
)
end
tar_hash = archive_artifact(hash, "copy_symlinks_adwaita_icon_theme.v3.33.92.any.tar.gz")
bind_artifact!(artifact_toml, "adwaita_icon_theme", hash; force=true,
download_info = [(url_to_upload_to, tar_hash)]
)
=#

function __init__()
in(:Gtk4, names(Main, imported=true)) && error("Gtk is incompatible with Gtk4.")

Expand Down

0 comments on commit 7ce5a9d

Please sign in to comment.