mirror of
https://github.com/chromebrew/chromebrew.git
synced 2026-01-10 07:57:59 -05:00
* move libpng inside harfbuzz, make sure harfbuzz installs before freetype * Make mold linker default for x86, make ragel an is_fake package * fix fetchtags, start gtk3 update * Add buildable gdk_pixbuf with patch * rev harfbuzz version * add rebuilds * add pixman builds * add binaries * suggested changes * add libva build * change CREW_LINKER logic * crew: Remove `CREW_*_PACKAGES` support * const.rb: Remove `CREW_*_PACKAGES` * suggested changes * suggested changes * fix linker env variable logic * Don't let icon cache update failure derail other installs * upload glew binaries * suggested changes + add updated glib * suggested changes Co-authored-by: supechicken <supechicken666@gmail.com>
120 lines
4.4 KiB
Ruby
120 lines
4.4 KiB
Ruby
require 'package'
|
|
|
|
class Gtk3 < Package
|
|
description 'GTK+ is a multi-platform toolkit for creating graphical user interfaces.'
|
|
homepage 'https://developer.gnome.org/gtk3/3.0/'
|
|
@_ver = '3.24.33'
|
|
@_ver_prelastdot = @_ver.rpartition('.')[0]
|
|
version @_ver
|
|
license 'LGPL-2.1'
|
|
compatibility 'all'
|
|
source_url 'https://gitlab.gnome.org/GNOME/gtk.git'
|
|
git_hashtag @_ver
|
|
|
|
binary_url({
|
|
aarch64: 'https://gitlab.com/api/v4/projects/26210301/packages/generic/gtk3/3.24.33_armv7l/gtk3-3.24.33-chromeos-armv7l.tar.zst',
|
|
armv7l: 'https://gitlab.com/api/v4/projects/26210301/packages/generic/gtk3/3.24.33_armv7l/gtk3-3.24.33-chromeos-armv7l.tar.zst',
|
|
i686: 'https://gitlab.com/api/v4/projects/26210301/packages/generic/gtk3/3.24.33_i686/gtk3-3.24.33-chromeos-i686.tar.zst',
|
|
x86_64: 'https://gitlab.com/api/v4/projects/26210301/packages/generic/gtk3/3.24.33_x86_64/gtk3-3.24.33-chromeos-x86_64.tar.zst'
|
|
})
|
|
binary_sha256({
|
|
aarch64: '651888d424ed031a023d9d7473bb2cb8f3996e4aeac262fa6bbad4c6643ddf22',
|
|
armv7l: '651888d424ed031a023d9d7473bb2cb8f3996e4aeac262fa6bbad4c6643ddf22',
|
|
i686: '6c62f793c25f0bbae8b1d7df68f1f187a315aaf2791a49ee74265d91fcbc7590',
|
|
x86_64: '433d3ec60a0582d31cc70f9b041ca309b7bc3182cafe2abc2ff759f3a1e2bb23'
|
|
})
|
|
|
|
# L = Logical Dependency, R = Runtime Dependency
|
|
depends_on 'adwaita_icon_theme' # L
|
|
depends_on 'atk' # R
|
|
depends_on 'at_spi2_atk' # R
|
|
depends_on 'cairo' # R
|
|
depends_on 'cantarell_fonts' # L
|
|
depends_on 'cups' # R
|
|
depends_on 'docbook' => :build
|
|
depends_on 'fontconfig' # R
|
|
depends_on 'freetype' # R
|
|
depends_on 'fribidi' # R
|
|
depends_on 'gdk_pixbuf' # R
|
|
depends_on 'ghostscript' => :build
|
|
depends_on 'glib' # R
|
|
depends_on 'gnome_icon_theme' # L
|
|
depends_on 'gobject_introspection' => :build
|
|
depends_on 'graphene' => :build # Do we need this?
|
|
depends_on 'graphite' => :build # Do we need this?
|
|
depends_on 'harfbuzz' # R
|
|
depends_on 'hicolor_icon_theme' # L
|
|
depends_on 'iso_codes' => :build
|
|
depends_on 'json_glib' # R
|
|
depends_on 'libdeflate' => :build # Do we need this?
|
|
depends_on 'libepoxy' # R
|
|
depends_on 'libjpeg' => :build # Do we need this?
|
|
depends_on 'libsass' => :build
|
|
depends_on 'libspectre' => :build
|
|
depends_on 'libx11' # R
|
|
depends_on 'libxcomposite' # R
|
|
depends_on 'libxcursor' # R
|
|
depends_on 'libxdamage' # R
|
|
depends_on 'libxext' # R
|
|
depends_on 'libxfixes' # R
|
|
depends_on 'libxinerama' # R
|
|
depends_on 'libxi' # R
|
|
depends_on 'libxkbcommon' # R
|
|
depends_on 'libxrandr' # R
|
|
depends_on 'mesa' => :build
|
|
depends_on 'pango' # R
|
|
depends_on 'py3_six' => :build # Do we need this?
|
|
depends_on 'rest' # R
|
|
depends_on 'shared_mime_info' # L
|
|
depends_on 'valgrind' => :build
|
|
depends_on 'wayland' # R
|
|
depends_on 'xdg_base' # L
|
|
|
|
def self.patch
|
|
# Use locally build subprojects
|
|
@deps = %w[cairo librsvg]
|
|
@deps.each do |dep|
|
|
FileUtils.rm_rf "subprojects/#{dep}" if Dir.exist?("subprojects/#{dep}")
|
|
FileUtils.rm_rf "subprojects/#{dep}.wrap" if File.exist?("subprojects/#{dep}.wrap")
|
|
end
|
|
end
|
|
|
|
def self.build
|
|
system "meson #{CREW_MESON_OPTIONS} \
|
|
-Dbroadway_backend=true \
|
|
-Ddemos=false \
|
|
-Dexamples=false \
|
|
-Dgtk_doc=false \
|
|
builddir"
|
|
system 'meson configure builddir'
|
|
system 'ninja -C builddir'
|
|
@gtk3settings = <<~GTK3_CONFIG_HEREDOC
|
|
[Settings]
|
|
gtk-icon-theme-name = Adwaita
|
|
gtk-fallback-icon-theme = gnome
|
|
gtk-theme-name = Adwaita
|
|
gtk-font-name = Cantarell 11
|
|
gtk-application-prefer-dark-theme = false
|
|
GTK3_CONFIG_HEREDOC
|
|
end
|
|
|
|
def self.install
|
|
system "DESTDIR=#{CREW_DEST_DIR} ninja -C builddir install"
|
|
system "sed -i 's,null,,g' #{CREW_DEST_LIB_PREFIX}/pkgconfig/gtk*.pc"
|
|
FileUtils.mkdir_p "#{CREW_DEST_PREFIX}/etc/gtk-3.0"
|
|
File.write("#{CREW_DEST_PREFIX}/etc/gtk-3.0/settings.ini", @gtk3settings)
|
|
end
|
|
|
|
def self.postinstall
|
|
# generate schemas
|
|
system "#{CREW_PREFIX}/bin/glib-compile-schemas #{CREW_PREFIX}/share/glib-2.0/schemas"
|
|
# update mime database
|
|
system "#{CREW_PREFIX}/bin/update-mime-database #{CREW_PREFIX}/share/mime"
|
|
# update icon cache, but only if gdk_pixbuf is already installed.
|
|
@device = JSON.parse(File.read("#{CREW_CONFIG_PATH}device.json"), symbolize_names: true)
|
|
return unless @device[:installed_packages].any? { |elem| elem[:name] == 'gdk_pixbuf' }
|
|
|
|
system "#{CREW_PREFIX}/bin/gtk-update-icon-cache -ft #{CREW_PREFIX}/share/icons/* || true"
|
|
end
|
|
end
|