Use gdk_rectangle_intersect() in pan-view
[geeqie.git] / doc / create-doxygen-lua-api.sh
index 84f7199..4c3402f 100755 (executable)
@@ -1,7 +1,7 @@
-#!/bin/bash
+#!/bin/sh
 
 #**********************************************************************
-# Copyright (C) 2021 - The Geeqie Team
+# Copyright (C) 2022 - The Geeqie Team
 #
 # Author: Colin Clark
 #
@@ -21,7 +21,7 @@
 #**********************************************************************
 
 ## @file
-## @brief This script will create the Lua API html document, which is part of
+## @brief Create the Lua API html document, which is part of
 ## the Geeqie Help file.
 ##
 ## It is run during the generation of the help files.
 ## that are useful as part of an API description.
 ##
 
+if ! command -v doxygen > /dev/null
+then
+       printf '%s\n' "doxygen not installed"
+       exit 1
+fi
+
 export PROJECT="Geeqie"
-export VERSION=$(git tag --list v[1-9]* | tail -1)
-export SRCDIR="$PWD/.."
-export DOCDIR="$PWD/html/lua-api"
+VERSION=$(git tag --list v[1-9]* | tail -1)
+export VERSION
+export SRCDIR="$1"
+export DOCDIR="$2"
 export INLINE_SOURCES=NO
 export STRIP_CODE_COMMENTS=YES
 
-TMPFILE=$(mktemp "$TMPDIR/geeqie.XXXXXXXX") || exit 1
+TMPFILE=$(mktemp "${TMPDIR:-/tmp}/geeqie.XXXXXXXXXX") || exit 1
 
 # Modify the Geeqie doxygen.conf file to produce
 # only the data needed for the lua API document
@@ -65,7 +72,7 @@ BEGIN {
                }
        else if ($1 == "FILE_PATTERNS")
                {
-               print "FILE_PATTERNS = lua.c"
+               print "FILE_PATTERNS = lua.cc"
                FILE_PATTERNS_found = "TRUE"
                next
                }
@@ -93,7 +100,7 @@ BEGIN {
                {print}
                }
 }
-' ../doxygen.conf > "$TMPFILE"
+' "$SRCDIR"/doxygen.conf > "$TMPFILE"
 
 doxygen "$TMPFILE"