[babl] Fix push_web, add index_html generation. TODO: simplify this someday



commit 67130ba4893108b570f1e914bf0ddd9429d4db51
Author: Félix Piédallu <felix piedallu me>
Date:   Fri Dec 1 14:47:10 2017 +0100

    Fix push_web, add index_html generation. TODO: simplify this someday

 docs/meson.build  |   54 ++++++++++++++++++----------------------------------
 tools/meson.build |    4 +++
 2 files changed, 23 insertions(+), 35 deletions(-)
---
diff --git a/docs/meson.build b/docs/meson.build
index e021f71..98ca7a5 100644
--- a/docs/meson.build
+++ b/docs/meson.build
@@ -5,8 +5,9 @@ location= 'public_html/babl'
 scptarget = host + ':' + location + '/'
 
 
-# The patterns used for html creation in the babl build system
-# is very small, and should probably be documented in a tutorial.
+babl_css = files('babl.css')
+
+xml_insert = find_program(join_paths('tools', 'xml_insert.sh'))
 
 index_static_html = configure_file(
   input : 'index-static.html.in',
@@ -14,48 +15,31 @@ index_static_html = configure_file(
   configuration: conf,
 )
 
-babl_path_src = join_paths(meson.source_root() + 'extensions')
-babl_path_bin = join_paths(meson.build_root()  + 'extensions')
-
 index_html = custom_target('index.html',
   input : [
     index_static_html,
-    '../AUTHORS',
-    '../TODO',
-    '../NEWS',
+    join_paths(meson.source_root(), 'AUTHORS'),
+    join_paths(meson.source_root(), 'TODO'),
+    join_paths(meson.source_root(), 'NEWS'),
   ],
   output: [ 'index.html', ],
-  command: [
-    # cp $< $@
-    # (which mktemp > /dev/null 2>&1 && TMPFILE=`mktemp` || TMPFILE="/tmp/babl_build_tempfile" ;\
-    # export BABL_PATH="$(top_builddir)/extensions:$(top_builddir)/extensions/.libs"; $(babl_html_dump) > 
$$TMPFILE;\
-    # $(SHELL) $(top_srcdir)/docs/tools/xml_insert.sh $@ BablBase $$TMPFILE;\
-    # rm -f $$TMPFILE )
-    # echo -n "."
-    #
-    # $(SHELL) $(top_srcdir)/docs/tools/xml_insert.sh $@ AUTHORS $(top_srcdir)/AUTHORS
-    # $(SHELL) $(top_srcdir)/docs/tools/xml_insert.sh $@ TODO $(top_srcdir)/TODO
-    # $(SHELL) $(top_srcdir)/docs/tools/xml_insert.sh $@ NEWS $(top_srcdir)/NEWS
-    # echo " [OK]"
+  command: [ 'bash', '-c',
+    'BABL_PATH="' + join_paths(meson.build_root(), 'extensions') +'"'
+    +' '+ babl_html_dump.full_path() +' > ' + '@OUTPUT@.tmp'
+    +' && '+ 'cp '+ join_paths(meson.build_root(), meson.current_source_dir(), 'index-static.html') +' 
@OUTPUT@'
+    +' && '+ xml_insert.path() +' @OUTPUT@ BablBase @OUTPUT@.tmp'
+    +' && '+ xml_insert.path() +' @OUTPUT@ AUTHORS  '+ join_paths(meson.source_root(), 'AUTHORS')
+    +' && '+ xml_insert.path() +' @OUTPUT@ TODO     '+ join_paths(meson.source_root(), 'TODO')
+    +' && '+ xml_insert.path() +' @OUTPUT@ NEWS     '+ join_paths(meson.source_root(), 'NEWS')
   ],
 )
 
-babl_css = files('babl.css')
 
-custom_target('push_web.sh',
-  input : [
-    index_html,
-    index_static_html,
-    babl_css,
-    graphic_files_install,
-  ],
-  output: [
-    'push_web.sh',
-  ],
+
+run_target('push_web',
   command: [
-    'echo', '#!/bin/bash',
-    '\n' + 'scp', index_html, index_static_html, babl_css, scptarget,
-    '\n' + 'scp', graphic_files_install, scptarget + 'graphics/'
+    'scp', index_html, index_static_html, babl_css, scptarget,
+    '&&',
+    'scp', graphic_files_install, scptarget + 'graphics/'
   ],
-  capture: true,
 )
diff --git a/tools/meson.build b/tools/meson.build
index 0daf092..13b55d0 100644
--- a/tools/meson.build
+++ b/tools/meson.build
@@ -20,4 +20,8 @@ foreach tool_name : tool_names
     dependencies: [ math, thread, ],
     install: false,
   )
+
+  if tool_name == 'babl-html-dump'
+    babl_html_dump = tool
+  endif
 endforeach


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]