ref: 21df0468347501db70c54bb2d005d8711c0873fb
parent: ccb4d1dcbe56987eaccd49bb56d1aabe5a2dfd13
author: Sigrid Solveig Haflínudóttir <ftrvxmtrx@gmail.com>
date: Wed Jun 2 07:42:41 EDT 2021
mkfile: add "deps" rule to install 3rd party stuff
--- a/README.md
+++ b/README.md
@@ -6,6 +6,11 @@
`./6.out my.pdf Root Pages Kids 0 Kids 0 Kids 0 Contents .` to dump a
specific object (text, images, fonts, etc).
+## Installation
+
+ mk deps # install additional decoders (jbig2, jpeg2000)
+ mk install
+
## TODO
* ASCIIHexDecode filter
--- a/mkfile
+++ b/mkfile
@@ -2,6 +2,7 @@
BIN=/$objtype/bin
TARG=pdffs
+PDIR=`{pwd}
OFILES=\
array.$O\
@@ -39,6 +40,16 @@
${OFILES:%.$O=%.c}\
mkfile\
-default:V: all
+default:V: all
+
+deps:V:
+ mkdir -p $PDIR/deps
+ cd $PDIR/deps
+ test -d jbig2 || git/clone https://git.sr.ht/~ft/jbig2
+ cd jbig2 && git/pull && mk install && mk clean
+ cd $PDIR/deps
+ test -d jp2 || git/clone https://git.sr.ht/~ft/jp2
+ cd jp2 && git/pull && mk install && mk clean
+ cd $PDIR
</sys/src/cmd/mkone