mirror of
https://github.com/chromebrew/chromebrew.git
synced 2026-01-10 07:57:59 -05:00
97 lines
3.1 KiB
Ruby
97 lines
3.1 KiB
Ruby
require 'buildsystems/meson'
|
|
# build order: harfbuzz => freetype => fontconfig => cairo => pango
|
|
|
|
class Freetype < Meson
|
|
description 'FreeType is a freely available software library to render fonts.'
|
|
homepage 'https://freetype.org/'
|
|
version '2.13.2' # Update freetype in harfbuzz when updating freetype
|
|
license 'FTL or GPL-2+'
|
|
compatibility 'x86_64 aarch64 armv7l'
|
|
source_url 'https://gitlab.freedesktop.org/freetype/freetype.git'
|
|
git_hashtag "VER-#{version.tr('.', '-')}"
|
|
binary_compression 'tar.zst'
|
|
|
|
binary_sha256({
|
|
aarch64: '1910229405d27c90a8dabeba5be6ea3884bdf5bfe48a6a1978a7a40af7879246',
|
|
armv7l: '1910229405d27c90a8dabeba5be6ea3884bdf5bfe48a6a1978a7a40af7879246',
|
|
x86_64: '8136147b106facdb16d82bdf3683615d68da9fd8735cab9d8a47e7c564520eae'
|
|
})
|
|
|
|
depends_on 'brotli' # R
|
|
depends_on 'bzip2' # R
|
|
depends_on 'expat' => :build
|
|
depends_on 'gcc_lib' # R
|
|
depends_on 'glib' => :build
|
|
depends_on 'glibc' # R
|
|
depends_on 'graphite' => :build
|
|
depends_on 'harfbuzz' # R
|
|
depends_on 'libpng' # R
|
|
depends_on 'pcre' => :build
|
|
depends_on 'py3_docwriter' => :build
|
|
depends_on 'zlib' # R
|
|
|
|
meson_options '-Dharfbuzz=enabled'
|
|
|
|
def self.install
|
|
system "DESTDIR=#{CREW_DEST_DIR} samu -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) (Created 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
|