Skip to content
This repository has been archived by the owner on Jun 24, 2022. It is now read-only.

Commit

Permalink
Merge pull request #18 from trueroad/install-required-fonts
Browse files Browse the repository at this point in the history
Install required fonts
  • Loading branch information
PhilHolmes committed Aug 23, 2015
2 parents 775b850 + 89da436 commit 62763e0
Show file tree
Hide file tree
Showing 17 changed files with 527 additions and 20 deletions.
2 changes: 2 additions & 0 deletions gub/installer.py
Expand Up @@ -223,6 +223,8 @@ def strip_unnecessary_files (self):
'lib/fonts/[^hf]*',
'share/mkspecs',
'share/terminfo',
# GUB's internal fonts directory settings
'etc/fonts/conf.d/98-gub-fonts-dir.conf',
]

# FIXME: why are we removing these, we need these in a root image.
Expand Down
38 changes: 31 additions & 7 deletions gub/specs/fontconfig.py
Expand Up @@ -21,9 +21,15 @@ class Fontconfig (target.AutoBuild):
fonts within the system and select them according to requirements
specified by applications.'''

source = 'http://fontconfig.org/release/fontconfig-2.8.0.tar.gz'
source = 'http://fontconfig.org/release/fontconfig-2.11.1.tar.bz2'
patches = [
# This patch will be unnecessary from fontconfig-2.11.91.
'fontconfig-2.11.1-texgyre-aliases.patch',
# This patch will be unnecessary from fontconfig-2.11.91.
'fontconfig-2.11.1-new-urw-aliases.patch',
]
#source = 'git://anongit.freedesktop.org/git/fontconfig?branch=master&revision=' + version
dependencies = ['libtool', 'expat-devel', 'freetype-devel', 'tools::freetype', 'tools::pkg-config']
dependencies = ['libtool', 'expat-devel', 'freetype-devel', 'tools::freetype', 'tools::pkg-config', 'tools::bzip2']
# FIXME: system dir vs packaging install
## UGH - this breaks on Darwin!
## UGH2 - the added /cross/ breaks Cygwin; possibly need
Expand Down Expand Up @@ -86,7 +92,7 @@ def compile (self):
relax = ''
if 'stat' in misc.librestrict ():
relax = 'LIBRESTRICT_IGNORE=%(tools_prefix)s/bin/bash:%(tools_prefix)s/bin/make '
for i in ('fc-case', 'fc-lang', 'fc-glyphname', 'fc-arch'):
for i in ('fc-case', 'fc-lang', 'fc-glyphname'):
self.system ('''
cd %(builddir)s/%(i)s && %(relax)s make "CFLAGS=%(cflags)s" "LIBS=%(libs)s" CPPFLAGS= LD_LIBRARY_PATH=%(tools_prefix)s/lib LDFLAGS=-L%(tools_prefix)s/lib INCLUDES=
''', locals ())
Expand All @@ -97,8 +103,16 @@ def install (self):
set FONTCONFIG_PATH=$INSTALLER_PREFIX/etc/fonts
''',
'%(install_prefix)s/etc/relocate/fontconfig.reloc')


self.dump ('''<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<!-- GUB's internal fonts directory -->
<dir>%(system_prefix)s/share/fonts</dir>
<dir>%(tools_prefix)s/share/fonts</dir>
</fontconfig>
''',
'%(install_prefix)s/etc/fonts/conf.d/98-gub-fonts-dir.conf')

class Fontconfig__mingw (Fontconfig):
def patch (self):
Fontconfig.patch (self)
Expand Down Expand Up @@ -140,10 +154,20 @@ class Fontconfig__freebsd (Fontconfig__linux):
class Fontconfig__tools (tools.AutoBuild):
# FIXME: use mi to get to source?
#source = 'git://anongit.freedesktop.org/git/fontconfig?revision=' + version
source = 'http://fontconfig.org/release/fontconfig-2.8.0.tar.gz'
source = 'http://fontconfig.org/release/fontconfig-2.11.1.tar.bz2'
def patch (self):
self.dump ('\nAC_SUBST(LT_AGE)', '%(srcdir)s/configure.in', mode='a', permissions=octal.o755)
tools.AutoBuild.patch (self)
dependencies = ['libtool', 'freetype', 'expat', 'pkg-config']
dependencies = ['libtool', 'freetype', 'expat', 'pkg-config', 'bzip2']
make_flags = ('man_MANS=' # either this, or add something like tools::docbook-utils
+ ' DOCSRC="" ')
def install (self):
tools.AutoBuild.install (self)
self.dump ('''<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<!-- GUB's internal fonts directory -->
<dir>%(tools_prefix)s/share/fonts</dir>
</fontconfig>
''',
'%(install_prefix)s/etc/fonts/conf.d/98-gub-fonts-dir.conf')
14 changes: 14 additions & 0 deletions gub/specs/fonts-bitstream-charter.py
@@ -0,0 +1,14 @@
from gub import tools
from gub import build

class Fonts_bitstream_charter (build.BinaryBuild):
source = 'http://mirrors.ctan.org/fonts/charter.zip'
def install (self):
self.system ('mkdir -p %(install_prefix)s/share/fonts/type1/bitstream/charter')
self.system ('cp %(srcdir)s/charter/*.afm %(install_prefix)s/share/fonts/type1/bitstream/charter/')
self.system ('cp %(srcdir)s/charter/*.pf? %(install_prefix)s/share/fonts/type1/bitstream/charter/')
def package (self):
build.AutoBuild.package (self)

class Fonts_bitstream_charter__tools (tools.AutoBuild, Fonts_bitstream_charter):
pass
14 changes: 14 additions & 0 deletions gub/specs/fonts-bitstream-vera.py
@@ -0,0 +1,14 @@
from gub import tools
from gub import build

class Fonts_bitstream_vera (build.BinaryBuild):
source = 'http://ftp.gnome.org/pub/GNOME/sources/ttf-bitstream-vera/1.10/ttf-bitstream-vera-1.10.tar.bz2'
dependencies = ['tools::bzip2']
def install (self):
self.system ('mkdir -p %(install_prefix)s/share/fonts/truetype/bitstream/vera')
self.system ('cp %(srcdir)s/*.ttf %(install_prefix)s/share/fonts/truetype/bitstream/vera/')
def package (self):
build.AutoBuild.package (self)

class Fonts_bitstream_vera__tools (tools.AutoBuild, Fonts_bitstream_vera):
pass
14 changes: 14 additions & 0 deletions gub/specs/fonts-dejavu.py
@@ -0,0 +1,14 @@
from gub import tools
from gub import build

class Fonts_dejavu (build.BinaryBuild):
source = 'http://sourceforge.net/projects/dejavu/files/dejavu/2.35/dejavu-fonts-ttf-2.35.tar.bz2'
dependencies = ['tools::bzip2']
def install (self):
self.system ('mkdir -p %(install_prefix)s/share/fonts/truetype/dejavu')
self.system ('cp %(srcdir)s/ttf/*.ttf %(install_prefix)s/share/fonts/truetype/dejavu/')
def package (self):
build.AutoBuild.package (self)

class Fonts_dejavu__tools (tools.AutoBuild, Fonts_dejavu):
pass
13 changes: 13 additions & 0 deletions gub/specs/fonts-ipafont.py
@@ -0,0 +1,13 @@
from gub import tools
from gub import build

class Fonts_ipafont (build.BinaryBuild):
source = 'http://download.forest.impress.co.jp/pub/library/i/ipafont/10483/IPAfont00303.zip'
def install (self):
self.system ('mkdir -p %(install_prefix)s/share/fonts/opentype/ipafont')
self.system ('cp %(srcdir)s/IPAfont00303/*.ttf %(install_prefix)s/share/fonts/opentype/ipafont/')
def package (self):
build.AutoBuild.package (self)

class Fonts_ipafont__tools (tools.AutoBuild, Fonts_ipafont):
pass
13 changes: 13 additions & 0 deletions gub/specs/fonts-liberation.py
@@ -0,0 +1,13 @@
from gub import tools
from gub import build

class Fonts_liberation (build.BinaryBuild):
source = 'https://fedorahosted.org/releases/l/i/liberation-fonts/liberation-fonts-ttf-2.00.1.tar.gz'
def install (self):
self.system ('mkdir -p %(install_prefix)s/share/fonts/truetype/liberation')
self.system ('cp %(srcdir)s/*.ttf %(install_prefix)s/share/fonts/truetype/liberation/')
def package (self):
build.AutoBuild.package (self)

class Fonts_liberation__tools (tools.AutoBuild, Fonts_liberation):
pass
13 changes: 13 additions & 0 deletions gub/specs/fonts-libertine.py
@@ -0,0 +1,13 @@
from gub import tools
from gub import build

class Fonts_libertine (build.BinaryBuild):
source = 'http://sourceforge.net/projects/linuxlibertine/files/linuxlibertine/5.3.0/LinLibertineOTF_5.3.0_2012_07_02.tgz&strip=0'
def install (self):
self.system ('mkdir -p %(install_prefix)s/share/fonts/opentype/linux-libertine')
self.system ('cp %(srcdir)s/*.otf %(install_prefix)s/share/fonts/opentype/linux-libertine/')
def package (self):
build.AutoBuild.package (self)

class Fonts_libertine__tools (tools.AutoBuild, Fonts_libertine):
pass
14 changes: 14 additions & 0 deletions gub/specs/fonts-luximono.py
@@ -0,0 +1,14 @@
from gub import tools
from gub import build

class Fonts_luximono (build.BinaryBuild):
source = 'http://mirrors.ctan.org/fonts/LuxiMono.zip'
def install (self):
self.system ('mkdir -p %(install_prefix)s/share/fonts/type1/luximono')
self.system ('cp %(srcdir)s/LuxiMono/*.afm %(install_prefix)s/share/fonts/type1/luximono/')
self.system ('cp %(srcdir)s/LuxiMono/*.pf? %(install_prefix)s/share/fonts/type1/luximono/')
def package (self):
build.AutoBuild.package (self)

class Fonts_luximono__tools (tools.AutoBuild, Fonts_luximono):
pass
13 changes: 13 additions & 0 deletions gub/specs/fonts-texgyre.py
@@ -0,0 +1,13 @@
from gub import tools
from gub import build

class Fonts_texgyre (build.BinaryBuild):
source = 'http://www.gust.org.pl/projects/e-foundry/tex-gyre/whole/tg-2.005otf.zip'
def install (self):
self.system ('mkdir -p %(install_prefix)s/share/fonts/opentype/texgyre')
self.system ('cp %(srcdir)s/*.otf %(install_prefix)s/share/fonts/opentype/texgyre/')
def package (self):
build.AutoBuild.package (self)

class Fonts_texgyre__tools (tools.AutoBuild, Fonts_texgyre):
pass
14 changes: 14 additions & 0 deletions gub/specs/fonts-urw-core35.py
@@ -0,0 +1,14 @@
from gub import tools
from gub import build

class Fonts_urw_core35 (build.BinaryBuild):
source = 'git://git.ghostscript.com/urw-core35-fonts.git'
def install (self):
self.system ('mkdir -p %(install_prefix)s/share/fonts/type1/urw-core35')
self.system ('cp %(srcdir)s/*.afm %(install_prefix)s/share/fonts/type1/urw-core35/')
self.system ('cp %(srcdir)s/*.pf? %(install_prefix)s/share/fonts/type1/urw-core35/')
def package (self):
build.AutoBuild.package (self)

class Fonts_urw_core35__tools (tools.AutoBuild, Fonts_urw_core35):
pass
8 changes: 8 additions & 0 deletions gub/specs/lilypond-doc.py
Expand Up @@ -12,6 +12,14 @@ class LilyPond_doc (lilypond.LilyPond_base):
'tools::imagemagick',
'tools::rsync', # ugh, we depend on *rsync* !?
#'tools::texlive',
'tools::fonts-dejavu',
'tools::fonts-libertine',
'tools::fonts-bitstream-charter',
'tools::fonts-bitstream-vera',
'tools::fonts-liberation',
'tools::fonts-urw-core35',
'tools::fonts-luximono',
'tools::fonts-ipafont',
'system::makeinfo',
'system::zip',
])
Expand Down
11 changes: 11 additions & 0 deletions gub/specs/lilypond-test.py
Expand Up @@ -5,6 +5,17 @@
from gub.specs import lilypond

class LilyPond_test (lilypond.LilyPond_base):
dependencies = (lilypond.LilyPond_base.dependencies
+ [
'tools::fonts-dejavu',
'tools::fonts-libertine',
'tools::fonts-bitstream-charter',
'tools::fonts-bitstream-vera',
'tools::fonts-liberation',
'tools::fonts-urw-core35',
'tools::fonts-luximono',
'tools::fonts-ipafont',
])
@context.subst_method
def test_ball (self):
return '%(uploads)s/lilypond-%(version)s-%(build_number)s.test-output.tar.bz2'
Expand Down
4 changes: 2 additions & 2 deletions gub/specs/lilypond.py
Expand Up @@ -35,7 +35,7 @@ class LilyPond__simple (target.AutoBuild):
'guile-devel',
'pango-devel',
'python-devel',
'urw-fonts',
'tools::fonts-texgyre',

'tools::autoconf',
'tools::bison',
Expand All @@ -61,7 +61,7 @@ class LilyPond__simple (target.AutoBuild):
+ ' --enable-relocation'
+ ' --enable-rpath'
+ ' --disable-documentation'
+ ' --with-fonts-dir=%(system_prefix)s/share/fonts/default/Type1'
+ ' --with-texgyre-dir=%(tools_prefix)s/share/fonts/opentype/texgyre'
)
make_flags = ' TARGET_PYTHON=/usr/bin/python'

Expand Down

0 comments on commit 62763e0

Please sign in to comment.