Handbrake + deps (take 2) (#7696)

* new builds

* lint updates

* fix postinstall

* remove trailing whitespace
This commit is contained in:
Satadru Pramanik
2022-11-29 19:16:58 -05:00
committed by GitHub
parent 3fa45b6794
commit 3f4e0c76c0
5 changed files with 362 additions and 74 deletions

View File

@@ -3,7 +3,7 @@ require 'package'
class Glib < Package
description 'GLib provides the core application building blocks for libraries and applications written in C.'
homepage 'https://developer.gnome.org/glib'
@_ver = '2.74.1'
@_ver = '2.75.0'
@_ver_prelastdot = @_ver.rpartition('.')[0]
version @_ver
license 'LGPL-2.1'
@@ -12,23 +12,22 @@ class Glib < Package
git_hashtag @_ver
binary_url({
aarch64: 'https://gitlab.com/api/v4/projects/26210301/packages/generic/glib/2.74.1_armv7l/glib-2.74.1-chromeos-armv7l.tar.zst',
armv7l: 'https://gitlab.com/api/v4/projects/26210301/packages/generic/glib/2.74.1_armv7l/glib-2.74.1-chromeos-armv7l.tar.zst',
i686: 'https://gitlab.com/api/v4/projects/26210301/packages/generic/glib/2.74.1_i686/glib-2.74.1-chromeos-i686.tar.zst',
x86_64: 'https://gitlab.com/api/v4/projects/26210301/packages/generic/glib/2.74.1_x86_64/glib-2.74.1-chromeos-x86_64.tar.zst'
aarch64: 'https://gitlab.com/api/v4/projects/26210301/packages/generic/glib/2.75.0_armv7l/glib-2.75.0-chromeos-armv7l.tar.zst',
armv7l: 'https://gitlab.com/api/v4/projects/26210301/packages/generic/glib/2.75.0_armv7l/glib-2.75.0-chromeos-armv7l.tar.zst',
i686: 'https://gitlab.com/api/v4/projects/26210301/packages/generic/glib/2.75.0_i686/glib-2.75.0-chromeos-i686.tar.zst',
x86_64: 'https://gitlab.com/api/v4/projects/26210301/packages/generic/glib/2.75.0_x86_64/glib-2.75.0-chromeos-x86_64.tar.zst'
})
binary_sha256({
aarch64: '4793afd0f2cd2d168d52a112f18de001d7e308383937e18ec177b3751a7da3ab',
armv7l: '4793afd0f2cd2d168d52a112f18de001d7e308383937e18ec177b3751a7da3ab',
i686: 'c7a5a227d4744079333d6597297acab9fa4ce30cbb4341744b49a805a4655ae5',
x86_64: '67515679d697eb29fdff6ffff1392569636adcb6d51c542f56ddf02ce02c62d5'
aarch64: '5f78133dffb955b080d398fabc7297e27dbd2b83f367bb823492143676da1f3b',
armv7l: '5f78133dffb955b080d398fabc7297e27dbd2b83f367bb823492143676da1f3b',
i686: '6764c8f6870d8a889d84f3619da8d9c8b96d71f030097e0ac9f7ae0ad6db038a',
x86_64: 'd52ba0f8ce8f94ca54f42a4f16fa01049e5c504dd5d19638f99e385d68ebc8ae'
})
depends_on 'elfutils' # R
depends_on 'libffi' # R
depends_on 'pcre' # R
depends_on 'py3_pygments' => :build
depends_on 'py3_six' => :build
depends_on 'shared_mime_info' # L
depends_on 'util_linux' # R
depends_on 'zlibpkg' # R
@@ -39,7 +38,7 @@ class Glib < Package
gnome
def self.build
system "meson #{CREW_MESON_OPTIONS.gsub('strip=true', 'strip=false')} \
system "meson setup #{CREW_MESON_OPTIONS.gsub('strip=true', 'strip=false')} \
-Dselinux=disabled \
-Dsysprof=disabled \
-Dman=false \
@@ -51,5 +50,63 @@ class Glib < Package
def self.install
system "DESTDIR=#{CREW_DEST_DIR} ninja -C builddir install"
# Create libtool file. Needed by handbrake build.
return if File.file?("#{CREW_DEST_LIB_PREFIX}/#{@libname}.la")
@libname = name.to_s.start_with?('lib') ? name.downcase : "lib#{name.downcase}"
@libnames = Dir["#{CREW_DEST_LIB_PREFIX}/#{@libname}.so*"]
@libnames = Dir["#{CREW_DEST_LIB_PREFIX}/#{@libname}-*.so*"] if @libnames.empty?
@libnames.each do |s|
s.gsub!("#{CREW_DEST_LIB_PREFIX}/", '')
end
@dlname = @libnames.grep(/.so./).first
@libname = @dlname.gsub(/.so.\d+/, '')
@longest_libname = @libnames.max_by(&:length)
@libvars = @longest_libname.rpartition('.so.')[2].split('.')
@libtool_file = <<~LIBTOOLEOF
# #{@libname}.la - a libtool library file
# Generated by libtool (GNU libtool) (hacked up by Chromebrew)
#
# Please DO NOT delete this file!
# It is necessary for linking the library.
# The name that we can dlopen(3).
dlname='#{@dlname}'
# Names of this library.
library_names='#{@libnames.reverse.join(' ')}'
# The name of the static archive.
old_library='#{@libname}.a'
# Linker flags that cannot go in dependency_libs.
inherited_linker_flags=''
# Libraries that this one depends upon.
dependency_libs=''
# Names of additional weak libraries provided by this library
weak_library_names=''
# Version information for #{name}.
current=#{@libvars[1]}
age=#{@libvars[1]}
revision=#{@libvars[2]}
# Is this an already installed library?
installed=yes
# Should we warn about portability when linking against -modules?
shouldnotlink=no
# Files to dlopen/dlpreopen
dlopen=''
dlpreopen=''
# Directory that this library needs to be installed in:
libdir='#{CREW_LIB_PREFIX}'
LIBTOOLEOF
File.write("#{CREW_DEST_LIB_PREFIX}/#{@libname}.la", @libtool_file)
end
end