Files
chromebrew/packages/fontconfig.rb
Cassandra Watergate d6e779ccd3 Crew profile base (#5503)
* Make basic crew-profile-base package

* Use crew consts

* Upgrade to 0.0.2-pre2

* Convert aa* to cf*

* Docbook

* aa* to dz*

* docbook-xsl

* through fz* and fix environment variables

* through mz*

* through pz*

* through zz*

* fix crew-profile-base

* upgrade crew-profile-base

* major crew-profile-base changes

* Upgrade crew-profile-base and fix xdg-base

* fix sha256sum

* Remove stale files

* pkgsrc and sommelier

* Add crew-profile-base to core packages and ready for merging

* Bump versions

* prevent conflicts with #5494

* fix sha256sum

* fix fop

* profile.d is not ours

* fix bash

* Upgrade crew-profile-base to 0.0.1-pre6 and fix bash

* Remove self-referencing comment

* Add binaries, fix rust, fix #{@ver}

* move compatibility line

* add core mandb deps back

* File.exists? => File.exist?

* deduplicate @env

* update packages

* Fix gdk_pixbug source url

* Add binaries, use rubocop style fixes

* Update cf from 6.36.1-1 to 6.53.0

* fix sl

* fix depot tools

* remove apulse since it conflicts with pulseaudio.

* refactor crew_profile_base

* first tranche of builds

* go

* add cf

* hunspell

* transmission

* clean up dependency & env situation for gdk_pixbuf

* fix gettext

* fix nano

* fix intel-media-driver

* add zziplib for texlive

* fix texlive

* split fuse for flatpak

* fix flatpak

* delete rack (broken and unmaintained)

* fix packer completion

* modify and fix sl

* fix s

* fix stressng

* fix stack

* Add TMPDIR

* Remove TMPDIR from build files

* Fix aws2 version

* Go: remove extraneous dependency

* hunspell_fr_fr: use french in description

* intel media driver: remove case x86_64

* aws2: quickfix

* everything but texlive

* texlive

* fix stressng

* Delete pkgsrc.rb

* add back pkgsrc

Co-authored-by: Satadru Pramanik <satadru@gmail.com>
Co-authored-by: Ed Reel <edreel@gmail.com>
Co-authored-by: satmandu <satadru@umich.edu>
2021-04-08 21:49:18 -05:00

86 lines
3.2 KiB
Ruby

require 'package'
class Fontconfig < Package
description 'Fontconfig is a library for configuring and customizing font access.'
homepage 'https://www.freedesktop.org/software/fontconfig/front.html'
@_ver = '2.13.93'
version "#{@_ver}-2"
license 'MIT'
compatibility 'all'
source_url "https://github.com/freedesktop/fontconfig/archive/#{@_ver}.tar.gz"
source_sha256 'f8452c78d1a12f6966455b0d584f89553b13e970b40644c3650f690ec0b3b4fe'
binary_url({
aarch64: 'https://dl.bintray.com/chromebrew/chromebrew/fontconfig-2.13.93-2-chromeos-armv7l.tar.xz',
armv7l: 'https://dl.bintray.com/chromebrew/chromebrew/fontconfig-2.13.93-2-chromeos-armv7l.tar.xz',
i686: 'https://dl.bintray.com/chromebrew/chromebrew/fontconfig-2.13.93-2-chromeos-i686.tar.xz',
x86_64: 'https://dl.bintray.com/chromebrew/chromebrew/fontconfig-2.13.93-2-chromeos-x86_64.tar.xz'
})
binary_sha256({
aarch64: '0047a707a1fc8531fa6bfc6fa45f2aead43ece0e65d1eaad094e4e98f3e43ec0',
armv7l: '0047a707a1fc8531fa6bfc6fa45f2aead43ece0e65d1eaad094e4e98f3e43ec0',
i686: 'abef1aab53d6880c0f43fc188a6de1ca1bf9b60c20c3f6459cdbcb40b32cb80a',
x86_64: '762b2f4a1d0d593f7f4c5000b651e9d03e98b11759a113bac0c260cc45830391'
})
depends_on 'gperf'
depends_on 'freetype_sub'
depends_on 'jsonc'
depends_on 'util_linux'
depends_on 'graphite'
# Remove freetype and fontconfig before rebuilding this package.
def self.build
# Fix build failure from font directories not being writable.
@install_cache = <<~INSTALLCACHE_HEREDOC
#!/usr/bin/env python3
import sys
sys.exit()
INSTALLCACHE_HEREDOC
IO.write('install-cache', @install_cache, perm: 0o666)
system "meson #{CREW_MESON_LTO_OPTIONS} \
--localstatedir=#{CREW_PREFIX}/cache \
--default-library=both \
-Ddoc=disabled \
-Dfreetype2:harfbuzz=enabled \
-Dfreetype2:default_library=both \
builddir"
system 'meson configure builddir'
system 'ninja -C builddir'
end
def self.install
system "DESTDIR=#{CREW_DEST_DIR} ninja -C builddir install"
FileUtils.mkdir_p "#{CREW_DEST_PREFIX}/etc/fonts/conf.d"
FileUtils.mkdir_p "#{CREW_DEST_PREFIX}/cache/fontconfig"
@fonts_conf = <<~FONTCONF_HEREDOC
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "urn:fontconfig:fonts.dtd">
<fontconfig>
<description>Load local customization file</description>
<!-- Font directory list -->
<dir>/usr/local/share/fonts</dir>
<dir>~/.fonts</dir>
<!-- Font cache directory list -->
<cachedir>#{CREW_PREFIX}/cache/fontconfig</cachedir>
<cachedir>~/.fontconfig</cachedir>
</fontconfig>
FONTCONF_HEREDOC
IO.write("#{CREW_DEST_PREFIX}/etc/fonts/conf.d/52-chromebrew.conf", @fonts_conf, perm: 0o666)
FileUtils.mkdir_p "#{CREW_DEST_PREFIX}/etc/env.d/"
@env = <<~EOF
# Fontconfig configuration
export FONTCONFIG_PATH=#{CREW_PREFIX}/etc/fonts
EOF
IO.write("#{CREW_DEST_PREFIX}/etc/env.d/fontconfig", @env)
end
def self.postinstall
# The following postinstall fails if graphite isn't installed when fontconfig
# is being installed.
system "env FONTCONFIG_PATH=#{CREW_PREFIX}/etc/fonts fc-cache -fv || true"
end
end