about summary refs log tree commit diff
diff options
context:
space:
mode:
authorPatryk Niedźwiedziński <pniedzwiedzinski19@gmail.com>2021-03-14 22:07:42 +0100
committerPatryk Niedźwiedziński <pniedzwiedzinski19@gmail.com>2021-03-14 22:07:42 +0100
commit33188b1a0246ae57fa478b501786cf292b4d1904 (patch)
tree9ae9785a04188a6f1628128fe5c8c3ca7a70480e
parent1de036cff919915636e8c64e61dacdea5629d281 (diff)
downloadkronika-33188b1a0246ae57fa478b501786cf292b4d1904.tar.gz
kronika-33188b1a0246ae57fa478b501786cf292b4d1904.zip
Add compile tool
-rw-r--r--.gitignore3
-rwxr-xr-xgen1
-rwxr-xr-xtools/compile29
3 files changed, 33 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index c2c33db..9c7a479 100644
--- a/.gitignore
+++ b/.gitignore
@@ -10,3 +10,6 @@ wpisy/kronika.html
 node_modules
 package-lock.json
 *.in
+
+lowdown*
+cpio*
diff --git a/gen b/gen
index afefc9e..121a3e7 100755
--- a/gen
+++ b/gen
@@ -18,5 +18,6 @@ for f in `find wpisy/kronika/20* -name '*.md' | sort -r`; do
 done
 echo "</div>" >> wpisy/kronika.html
 
+./tools/compile
 
 ./ssg5 wpisy dest "19 PDH Puszcza" "https://19.niedzwiedzinski.cyou"
diff --git a/tools/compile b/tools/compile
new file mode 100755
index 0000000..b28d1ea
--- /dev/null
+++ b/tools/compile
@@ -0,0 +1,29 @@
+#!/bin/sh
+## Automated script for compiling lowdown
+
+# node_modules is cached by netlify
+mkdir -p node_modules
+
+## lowdown
+if [ ! -f node_modules/lowdown ]; then
+  wget https://kristaps.bsd.lv/lowdown/snapshots/lowdown.tar.gz
+  tar xf lowdown.tar.gz
+  cd lowdown-*
+  ./configure
+  make
+  cp lowdown ../node_modules
+  cd ..
+fi
+
+
+## cpio
+if [ ! -f node_modules/cpio ]; then
+  wget https://ftp.gnu.org/gnu/cpio/cpio-2.13.tar.gz
+  tar xf cpio-2.13.tar.gz
+  cd cpio-2.13
+  ./configure --prefix=$PWD/out
+  make
+  make install
+  cp -r out ../node_modules/cpio_src
+  ln -s ../node_modules/cpio ../node_modules/cpio_src/bin/cpio
+fi