From 01560ae71436a5c2a29faf57383bad895af76337 Mon Sep 17 00:00:00 2001 From: Manuel Mendez Date: Fri, 28 Jun 2013 22:53:02 -0400 Subject: [PATCH] arch: add fontpatcher to archlinux/python-powerline. --- .../archlinux/python-powerline-git/.gitignore | 1 + packages/archlinux/python-powerline-git/PKGBUILD | 15 ++++++++++++++- .../python-powerline-git/fontpatcher.py.patch | 13 +++++++++++++ 3 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 packages/archlinux/python-powerline-git/fontpatcher.py.patch diff --git a/packages/archlinux/python-powerline-git/.gitignore b/packages/archlinux/python-powerline-git/.gitignore index 4ef5aeeb..cc7d5336 100644 --- a/packages/archlinux/python-powerline-git/.gitignore +++ b/packages/archlinux/python-powerline-git/.gitignore @@ -2,3 +2,4 @@ !.gitignore !PKGBUILD !*.install +!*.patch diff --git a/packages/archlinux/python-powerline-git/PKGBUILD b/packages/archlinux/python-powerline-git/PKGBUILD index c369879c..1395d37d 100644 --- a/packages/archlinux/python-powerline-git/PKGBUILD +++ b/packages/archlinux/python-powerline-git/PKGBUILD @@ -20,15 +20,22 @@ conflicts=('python2-powerline-git' 'powerline-git') install="${_gitname}.install" source=("${_gitname}::git://github.com/Lokaltog/${_gitname}.git#branch=${_gitbranch}" + "fontpatcher.py.patch" "${install}") sha256sums=('SKIP' - '7b1257cdacce60e19280f7d918e5f3aa6f13b519dff16ecc6f732c881ef63ca1') + '85576097662ab4203968b5fba1d59ec2653a390cdd4db9cee8ffa7bd4c5a7253' + '7b1257cdacce60e19280f7d918e5f3aa6f13b519dff16ecc6f732c881ef63ca1') pkgver() { cd "${_gitname}" echo "$(git rev-list --count ${_gitbranch}).$(git rev-parse --short ${_gitbranch})" } +prepare() { + cd "${srcdir}/${_gitname}" + patch -p1 < ../fontpatcher.py.patch +} + package() { cd "${_gitname}" python setup.py install --root="${pkgdir}" --optimize=1 || return 1 @@ -41,6 +48,12 @@ package() { install -m644 "font/10-powerline-symbols.conf" "${pkgdir}/etc/fonts/conf.avail/10-powerline-symbols.conf" ln -s "../conf.avail/10-powerline-symbols.conf" "${pkgdir}/etc/fonts/conf.d/10-powerline-symbols.conf" + msg2 "Installing fontpatcher..." + install -dm755 "${pkgdir}/usr/share/$_gitname" + install -dm755 "${pkgdir}/usr/bin" + install -m755 "font/fontpatcher.py" "${pkgdir}/usr/bin/" + install -m644 "font/fontpatcher-symbols.sfd" "${pkgdir}/usr/share/$_gitname" + msg2 "Installing vim plugin..." install -dm755 "${pkgdir}/usr/share/vim/vimfiles/plugin" install -m644 "powerline/bindings/vim/plugin/powerline.vim" "${pkgdir}/usr/share/vim/vimfiles/plugin/powerline.vim" diff --git a/packages/archlinux/python-powerline-git/fontpatcher.py.patch b/packages/archlinux/python-powerline-git/fontpatcher.py.patch new file mode 100644 index 00000000..fb394ce2 --- /dev/null +++ b/packages/archlinux/python-powerline-git/fontpatcher.py.patch @@ -0,0 +1,13 @@ +diff --git a/font/fontpatcher.py b/font/fontpatcher.py +index e2bbf2a..aa172f6 100755 +--- a/font/fontpatcher.py ++++ b/font/fontpatcher.py +@@ -21,7 +21,7 @@ except ImportError: + parser = argparse.ArgumentParser(description='Font patcher for Powerline. Requires FontForge with Python bindings. Stores the patched font as a new, renamed font file by default.') + parser.add_argument('target_fonts', help='font files to patch', metavar='font', nargs='+', type=argparse.FileType('rb')) + parser.add_argument('--no-rename', help='don\'t add " for Powerline" to the font name', default=True, action='store_false', dest='rename_font') +-parser.add_argument('--source-font', help='source symbol font', metavar='font', dest='source_font', default='{0}/fontpatcher-symbols.sfd'.format(sys.path[0]), type=argparse.FileType('rb')) ++parser.add_argument('--source-font', help='source symbol font', metavar='font', dest='source_font', default='/usr/share/powerline/fontpatcher-symbols.sfd', type=argparse.FileType('rb')) + args = parser.parse_args() + +