[hackers] [wmii] Add doc/mkfile for building wmii.pdf with an optional MAINFONT variable for building on systems without LinoType's Palatino font. || Kris Maglione

From: <hg_AT_suckless.org>
Date: Tue, 27 Sep 2011 08:14:20 +0200 (CEST)

changeset: 2809:f3d88385ea7c
tag: tip
user: Kris Maglione <kris_AT_suckless.org>
date: Tue Sep 27 02:13:58 2011 -0400
files: alternative_wmiircs/python/wmiirc.py doc/mkfile doc/wmii.tex
description:
Add doc/mkfile for building wmii.pdf with an optional MAINFONT variable for building on systems without LinoType's Palatino font.

diff -r 28bea80ed29d -r f3d88385ea7c alternative_wmiircs/python/wmiirc.py
--- a/alternative_wmiircs/python/wmiirc.py Fri Sep 23 20:35:20 2011 -0700
+++ b/alternative_wmiircs/python/wmiirc.py Tue Sep 27 02:13:58 2011 -0400
@@ -45,7 +45,7 @@
 wmii['border'] = 2
 
 def setbackground(color):
- call('xsetroot', '-solid', color)
+ call('xsetroot', '-solid', color, background=True)
 setbackground(background)
 
 terminal = 'wmiir', 'setsid', '@TERMINAL@'
diff -r 28bea80ed29d -r f3d88385ea7c doc/mkfile
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/doc/mkfile Tue Sep 27 02:13:58 2011 -0400
@@ -0,0 +1,33 @@
+MKSHELL=rc
+
+TARG = wmii.pdf
+SRC = ${TARG:%.pdf=%.tex}
+TEX = xelatex
+
+default:V: all
+all:V: $TARG
+
+# mk doesn't recognize nested `{}
+deps = `{ ash -c 'dep() { echo $1; for f in $(9 sed -n "s/.*\\include{([^}]+)}.*/\1.tex/p; s/.*\\input (.*)/\1.tex/p" $1); do dep $f; done; }; dep $SRC' }
+# `
+$TARG: $deps
+
+junk = aux idx ilg ind log toc out
+CLEAN = ${TARG:%.pdf=%}
+CLEAN = ${junk:%=$CLEAN.%} ${deps:%.tex=%.aux}
+clean:V:
+ rm -f $CLEAN
+
+%.pdf: %.tex mkfile
+ flag x +
+ if (~ $MAINFONT '')
+ fn tex { builtin $TEX $stem.tex }
+ if not
+ fn tex { builtin $TEX '\def\mainfont{'$"MAINFONT'}\input{'$stem.tex'}' }
+
+ tex
+ makeindex $stem
+ tex
+ rm -f $stem.out 2>/dev/null
+
+# vim:se ft=make:
diff -r 28bea80ed29d -r f3d88385ea7c doc/wmii.tex
--- a/doc/wmii.tex Fri Sep 23 20:35:20 2011 -0700
+++ b/doc/wmii.tex Tue Sep 27 02:13:58 2011 -0400
@@ -22,7 +22,11 @@
 \makeindex
 \let\primary=\textbf
 
-\setmainfont[Mapping=tex-text, Numbers=OldStyle]{Palatino LT Std}
+\ifx\mainfont\undefined
+ \def\mainfont{Palatino LT Std}
+\fi
+
+\setmainfont[Mapping=tex-text, Numbers=OldStyle]\mainfont
 \def\lining{\addfontfeature{Numbers=Lining}}
 
 \let\primary=\textbf
Received on Tue Sep 27 2011 - 08:14:20 CEST

This archive was generated by hypermail 2.2.0 : Tue Sep 27 2011 - 08:24:06 CEST