Skip to content

Instantly share code, notes, and snippets.

@anatol
Last active May 4, 2020 19:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anatol/fa78dac4ea683abf730f to your computer and use it in GitHub Desktop.
Save anatol/fa78dac4ea683abf730f to your computer and use it in GitHub Desktop.
#!/usr/bin/ruby
ver = "3.4.2"
rel = "1"
pkgver = ver + "-" + rel
pkgs = [
["glib2"],
["atk", ["glib2"]],
["gobject-introspection", ["glib2"]],
["gio2", ["glib2", "gobject-introspection"]],
["gdk_pixbuf2", ["gio2", "glib2", "gobject-introspection"]],
["cairo-gobject", ["glib2"]],
["pango", ["glib2", "cairo-gobject", "gobject-introspection"]],
["gtk2", ["glib2", "atk", "gdk_pixbuf2", "pango", "gio2", "gobject-introspection", "cairo-gobject"]],
["gdk3", ["cairo-gobject", "gdk_pixbuf2", "pango", "glib2", "gio2", "gobject-introspection"]],
["gtk3", ["atk", "gdk3", "gdk_pixbuf2", "gio2", "glib2", "gobject-introspection", "pango", "cairo-gobject"]],
]
for pkg in pkgs
name, deps = *pkg
if deps
flags_64 = "-- " + deps.map { |d| "-I ../../ruby-#{d}/trunk/ruby-#{d}-#{pkgver}-x86_64.pkg.tar.zst" }.join(" ")
end
cmd = "cd ruby-#{name}/trunk"
cmd += " && sed 's/pkgver=.*/pkgver=#{ver}/' -i PKGBUILD"
cmd += " && sed 's/pkgrel=.*/pkgrel=#{rel}/' -i PKGBUILD"
cmd += " && updpkgsums "
cmd += " && extra-x86_64-build #{flags_64}"
cmd += " && communitypkg 'upgpkg: ruby-#{name} #{pkgver}'"
puts cmd
system("#{cmd}")
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment