Files
chromebrew/packages/fcft.rb
Maximilian Downey Twiss f6dc1d8d4e Derive binary_url in package.rb (#7082)
* Add binary_compression value to each package

* Remove binary_url values and arrays

* Handle packages with empty binary_sha256 arrays (either missing binaries or not compiled by us)
2024-01-25 11:03:31 -05:00

56 lines
1.8 KiB
Ruby

# Adapted from Arch Linux fcft PKGBUILD at:
# https://aur.archlinux.org/cgit/aur.git/plain/PKGBUILD?h=fcft
require 'package'
class Fcft < Package
description 'Simple library for font loading and glyph rasterization using FontConfig, FreeType and pixman.'
homepage 'https://codeberg.org/dnkl/fcft'
version '2.5.1'
license 'MIT'
compatibility 'all'
source_url 'https://codeberg.org/dnkl/fcft.git'
git_hashtag version
binary_compression 'tpxz'
binary_sha256({
aarch64: '28f1176a8cece2b6e7464020871a1f543a01b387b107f7ff8eaec0bb525a2745',
armv7l: '28f1176a8cece2b6e7464020871a1f543a01b387b107f7ff8eaec0bb525a2745',
i686: '4cfd8382c087dba1f6fa1c1a1eb4f9c1afb925be0176b648f1dec512dc130f79',
x86_64: '4d5d098327ea62f4f4c9ea534e8f79346602f54acca4af2dc18e03be3b64c224'
})
depends_on 'freetype'
depends_on 'fontconfig'
depends_on 'harfbuzz'
depends_on 'utf8proc'
depends_on 'pixman'
depends_on 'tllist' => :build
def self.patch
# threads.h was introduced in glibc 2.28. This is a workaround for
# pre-M92 systems.
return unless LIBC_VERSION < '2.28'
system 'curl -Lf https://github.com/jtsiomb/c11threads/raw/19abeee43272002301ddece2f7d5df37394bb54f/c11threads.h -o threads.h'
abort 'Checksum mismatch. :/ Try again.'.lightred unless Digest::SHA256.hexdigest(File.read('threads.h')) == 'c945fd352449174d3b6107c715b622206ebb81694ac23239637439d78e33ee5a'
end
def self.build
system "meson setup #{CREW_MESON_OPTIONS} \
-Dgrapheme-shaping=enabled \
-Drun-shaping=enabled \
builddir"
system 'meson configure --no-pager builddir'
system 'samu -C builddir'
end
def self.check
system 'samu -C builddir test'
end
def self.install
system "DESTDIR=#{CREW_DEST_DIR} samu -C builddir install"
end
end