[Xfce4-commits] <docs:master> Add api build script.

Nick Schermer noreply at xfce.org
Fri Jan 21 13:16:01 CET 2011


Updating branch refs/heads/master
         to 03f808a7de49de534ed1585fd89ef3eddfc61af3 (commit)
       from 404211d67f0fb41e169f450835b1c43efcf46303 (commit)

commit 03f808a7de49de534ed1585fd89ef3eddfc61af3
Author: Nick Schermer <nick at xfce.org>
Date:   Fri Jan 21 13:06:12 2011 +0100

    Add api build script.

 lib/tools/buildapi.sh |  101 +++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 101 insertions(+), 0 deletions(-)

diff --git a/lib/tools/buildapi.sh b/lib/tools/buildapi.sh
new file mode 100755
index 0000000..d4a2e72
--- /dev/null
+++ b/lib/tools/buildapi.sh
@@ -0,0 +1,101 @@
+#!/bin/sh
+
+gnome_base="http://library.gnome.org/devel"
+gtk_version="2.22.1"
+glib_version="2.26.1"
+atk_version="1.32.0"
+pango_version="1.28.3"
+gnome_fixxrefs="glib gobject atk pango gtk gdk gdk-pixbuf gio"
+
+# keep downloaded tarballs
+rm -rf /tmp/api/references
+mkdir -p /tmp/api/{references,clones,tarballs}
+
+# Download Gnome APIs
+wget -c -P /tmp/api/tarballs/ $gnome_base/glib/glib-html-$glib_version.tar.gz $gnome_base/gio/gio-html-$glib_version.tar.gz $gnome_base/gobject/gobject-html-$glib_version.tar.gz $gnome_base/atk/atk-html-$atk_version.tar.gz $gnome_base/pango/pango-html-$pango_version.tar.gz $gnome_base/gdk-pixbuf/gdk-pixbuf-html-$gtk_version.tar.gz $gnome_base/gdk/gdk-html-$gtk_version.tar.gz $gnome_base/gtk/gtk-html-$gtk_version.tar.gz
+
+# extract tarballs to references directory
+for name in $gnome_fixxrefs;
+do
+  tar -C /tmp/api/references/ -xf /tmp/api/tarballs/$name-html-*.tar.gz
+  mv /tmp/api/references/$name-html-* /tmp/api/references/$name
+  rm /tmp/api/tarballs/$name-html-*.tar.gz
+done
+
+function getfixxrefoptions ()
+{
+  # init result
+  result="\n\nFIXXREF_OPTIONS+="
+
+  # append all the directories
+  for dir in /tmp/api/references/*
+  do
+    result="$result\t \\ \n\t--extra-dir=$dir"
+  done
+
+  # add empty lines
+  result="$result\n\n"
+
+  # return
+  echo $result
+}
+
+function genref ()
+{
+  if [ ! -d /tmp/api/clones/$1 ]
+  then
+    git clone $3 /tmp/api/clones/$1
+  fi
+  cd /tmp/api/clones/$1 || exit 1
+
+  # cleanup
+  git clean -xfdq
+  git checkout $2/Makefile.am
+  git pull
+
+  # add another fixxref link in Makefile.am
+  
+  echo -e $(getfixxrefoptions) >> $2/Makefile.am
+
+  # build docs
+  ./autogen.sh --enable-gtk-doc && make
+
+  # fixup crosslinking to gnome urls and relative to
+  # xfce docs
+  for ref in $gnome_fixxrefs
+  do
+    sed -e "s,/tmp/api/references/$ref/,http://library.gnome.org/devel/$ref/stable/,g" -i $2/html/*
+  done
+  sed -e "s,/tmp/api/references/,../,g" -i $2/html/*
+
+  # copy the generated reference
+  cp -r $2/html /tmp/api/references/$1
+
+  # create tarball
+  cd /tmp/api/references/
+  rm /tmp/api/tarballs/$1-html.tar.bz2 &> /dev/null
+  tar -jcf /tmp/api/tarballs/$1-html.tar.bz2 $1
+
+  # cleanup
+  cd /tmp/api/clones/$1
+  git clean -xfdq
+}
+
+# xfce references to compile, follow buildchain
+genref "libxfce4util" "docs" "git://git.xfce.org/xfce/libxfce4util"
+genref "xfconf" "docs/reference" "git://git.xfce.org/xfce/xfconf"
+genref "exo" "docs/reference" "git://git.xfce.org/xfce/exo"
+genref "garcon" "docs/reference" "git://git.xfce.org/libs/garcon"
+genref "libxfce4ui" "docs" "git://git.xfce.org/xfce/libxfce4ui"
+genref "thunarx" "docs/reference/thunarx" "git://git.xfce.org/xfce/thunar"
+genref "tumbler" "docs/reference/tumbler" "git://git.xfce.org/apps/tumbler"
+genref "libxfce4panel" "docs/references" "git://git.xfce.org/xfce/xfce4-panel"
+
+# cleanup
+for name in $gnome_fixxrefs;
+do
+  rm -r /tmp/api/references/$name
+done
+
+echo
+echo "tarballs and references for docs.xfce.org are placed in /tmp/api/."



More information about the Xfce4-commits mailing list