From 55ccbaf5c2d844168e8edc289f24157591c89efc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karl=20Lind=C3=A9n?= Date: Sat, 11 Apr 2015 22:11:49 +0200 Subject: [PATCH 1/6] rename html_docs_*_dir variables to the shorter and unambiguous html_*_dir --- wscript | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/wscript b/wscript index ac98fe9b..83f427ec 100644 --- a/wscript +++ b/wscript @@ -736,16 +736,16 @@ def build(bld): #bld.add_subdirs('tests') if bld.env['BUILD_DOXYGEN_DOCS'] == True: - html_docs_source_dir = "build/default/html" + html_source_dir = "build/default/html" if bld.cmd == 'install': share_dir = bld.options.destdir + bld.env['PREFIX'] + '/share/jack-audio-connection-kit' - html_docs_install_dir = share_dir + '/reference/html/' - if os.path.isdir(html_docs_install_dir): + html_install_dir = share_dir + '/reference/html/' + if os.path.isdir(html_install_dir): Logs.pprint('CYAN', "Removing old doxygen documentation installation...") - shutil.rmtree(html_docs_install_dir) + shutil.rmtree(html_install_dir) Logs.pprint('CYAN', "Removing old doxygen documentation installation done.") Logs.pprint('CYAN', "Installing doxygen documentation...") - shutil.copytree(html_docs_source_dir, html_docs_install_dir) + shutil.copytree(html_source_dir, html_install_dir) Logs.pprint('CYAN', "Installing doxygen documentation done.") elif bld.cmd =='uninstall': Logs.pprint('CYAN', "Uninstalling doxygen documentation...") @@ -753,12 +753,12 @@ def build(bld): shutil.rmtree(share_dir) Logs.pprint('CYAN', "Uninstalling doxygen documentation done.") elif bld.cmd =='clean': - if os.access(html_docs_source_dir, os.R_OK): + if os.access(html_source_dir, os.R_OK): Logs.pprint('CYAN', "Removing doxygen generated documentation...") - shutil.rmtree(html_docs_source_dir) + shutil.rmtree(html_source_dir) Logs.pprint('CYAN', "Removing doxygen generated documentation done.") elif bld.cmd =='build': - if not os.access(html_docs_source_dir, os.R_OK): + if not os.access(html_source_dir, os.R_OK): os.popen(bld.env.DOXYGEN).read() else: Logs.pprint('CYAN', "doxygen documentation already built.") From 5f85e9731d6cd3d753aa227dfc8cfe920ce0296c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karl=20Lind=C3=A9n?= Date: Sat, 11 Apr 2015 22:15:34 +0200 Subject: [PATCH 2/6] rename the html_source_dir variable to html_build_dir (the directory contains built files, not sources) --- wscript | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/wscript b/wscript index 83f427ec..11319d44 100644 --- a/wscript +++ b/wscript @@ -736,7 +736,7 @@ def build(bld): #bld.add_subdirs('tests') if bld.env['BUILD_DOXYGEN_DOCS'] == True: - html_source_dir = "build/default/html" + html_build_dir = "build/default/html" if bld.cmd == 'install': share_dir = bld.options.destdir + bld.env['PREFIX'] + '/share/jack-audio-connection-kit' html_install_dir = share_dir + '/reference/html/' @@ -745,7 +745,7 @@ def build(bld): shutil.rmtree(html_install_dir) Logs.pprint('CYAN', "Removing old doxygen documentation installation done.") Logs.pprint('CYAN', "Installing doxygen documentation...") - shutil.copytree(html_source_dir, html_install_dir) + shutil.copytree(html_build_dir, html_install_dir) Logs.pprint('CYAN', "Installing doxygen documentation done.") elif bld.cmd =='uninstall': Logs.pprint('CYAN', "Uninstalling doxygen documentation...") @@ -753,12 +753,12 @@ def build(bld): shutil.rmtree(share_dir) Logs.pprint('CYAN', "Uninstalling doxygen documentation done.") elif bld.cmd =='clean': - if os.access(html_source_dir, os.R_OK): + if os.access(html_build_dir, os.R_OK): Logs.pprint('CYAN', "Removing doxygen generated documentation...") - shutil.rmtree(html_source_dir) + shutil.rmtree(html_build_dir) Logs.pprint('CYAN', "Removing doxygen generated documentation done.") elif bld.cmd =='build': - if not os.access(html_source_dir, os.R_OK): + if not os.access(html_build_dir, os.R_OK): os.popen(bld.env.DOXYGEN).read() else: Logs.pprint('CYAN', "doxygen documentation already built.") From 66c37eb9f2d1e629428038e67519d7af41302fc5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karl=20Lind=C3=A9n?= Date: Sat, 11 Apr 2015 23:42:45 +0200 Subject: [PATCH 3/6] fix install with doxygen by generating doxyfile from doxyfile.in and letting waf do most of the process --- doxyfile => doxyfile.in | 34 +++++++++++++++++----------------- wscript | 34 ++++++++++++++++++++++++++++------ 2 files changed, 45 insertions(+), 23 deletions(-) rename doxyfile => doxyfile.in (98%) diff --git a/doxyfile b/doxyfile.in similarity index 98% rename from doxyfile rename to doxyfile.in index 9df45905..7ac57162 100644 --- a/doxyfile +++ b/doxyfile.in @@ -574,22 +574,22 @@ WARN_LOGFILE = # directories like "/usr/src/myproject". Separate the files or directories # with spaces. -INPUT = common \ - posix \ - macosx \ - macosx/coreaudio/ \ - macosx/coremidi/ \ - linux \ - linux/alsa \ - linux/alsarawmidi \ - linux/firewire \ - linux/freebob \ - windows \ - windows/portaudio \ - windows/winmme \ - solaris \ - solaris/oss \ - common/jack/ +INPUT = @SRCDIR@/common \ + @SRCDIR@/posix \ + @SRCDIR@/macosx \ + @SRCDIR@/macosx/coreaudio/ \ + @SRCDIR@/macosx/coremidi/ \ + @SRCDIR@/linux \ + @SRCDIR@/linux/alsa \ + @SRCDIR@/linux/alsarawmidi \ + @SRCDIR@/linux/firewire \ + @SRCDIR@/linux/freebob \ + @SRCDIR@/windows \ + @SRCDIR@/windows/portaudio \ + @SRCDIR@/windows/winmme \ + @SRCDIR@/solaris \ + @SRCDIR@/solaris/oss \ + @SRCDIR@/common/jack/ # This tag can be used to specify the character encoding of the source files # that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is @@ -789,7 +789,7 @@ GENERATE_HTML = YES # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `html' will be used as the default path. -HTML_OUTPUT = +HTML_OUTPUT = @HTML_BUILD_DIR@ # The HTML_FILE_EXTENSION tag can be used to specify the file extension for # each generated HTML page (for example: .htm,.php,.asp). If it is left blank diff --git a/wscript b/wscript index 11319d44..b53ad3e3 100644 --- a/wscript +++ b/wscript @@ -736,7 +736,34 @@ def build(bld): #bld.add_subdirs('tests') if bld.env['BUILD_DOXYGEN_DOCS'] == True: - html_build_dir = "build/default/html" + html_build_dir = bld.path.find_or_declare('html').abspath() + + bld( + features = 'subst', + source = 'doxyfile.in', + target = 'doxyfile', + HTML_BUILD_DIR = html_build_dir, + SRCDIR = bld.srcnode.abspath() + ) + + # There are two reasons for logging to doxygen.log and using it as + # target in the build rule (rather than html_build_dir): + # (1) reduce the noise when running the build + # (2) waf has a regular file to check for a timestamp. If the directory + # is used instead waf will rebuild the doxygen target (even upon + # install). + def doxygen(task): + doxyfile = task.inputs[0].abspath() + logfile = task.outputs[0].abspath() + cmd = '%s %s &> %s' % (task.env.DOXYGEN, doxyfile, logfile) + return task.exec_command(cmd) + + bld( + rule = doxygen, + source = 'doxyfile', + target = 'doxygen.log' + ) + if bld.cmd == 'install': share_dir = bld.options.destdir + bld.env['PREFIX'] + '/share/jack-audio-connection-kit' html_install_dir = share_dir + '/reference/html/' @@ -757,11 +784,6 @@ def build(bld): Logs.pprint('CYAN', "Removing doxygen generated documentation...") shutil.rmtree(html_build_dir) Logs.pprint('CYAN', "Removing doxygen generated documentation done.") - elif bld.cmd =='build': - if not os.access(html_build_dir, os.R_OK): - os.popen(bld.env.DOXYGEN).read() - else: - Logs.pprint('CYAN', "doxygen documentation already built.") def dist_hook(): os.remove('svnversion_regenerate.sh') From ad5d803a2c2e1adbffd5fd9518287db23a43ef93 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karl=20Lind=C3=A9n?= Date: Sat, 11 Apr 2015 23:48:20 +0200 Subject: [PATCH 4/6] do not hardcode version in doxyfile.in, subst it from waf instead --- doxyfile.in | 2 +- wscript | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/doxyfile.in b/doxyfile.in index 7ac57162..9c5e1680 100644 --- a/doxyfile.in +++ b/doxyfile.in @@ -31,7 +31,7 @@ PROJECT_NAME = "Jack2" # This could be handy for archiving the generated documentation or # if some version control system is used. -PROJECT_NUMBER = 1.9.11 +PROJECT_NUMBER = @VERSION@ # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) # base path where the generated documentation will be put. diff --git a/wscript b/wscript index b53ad3e3..b16b345c 100644 --- a/wscript +++ b/wscript @@ -743,7 +743,8 @@ def build(bld): source = 'doxyfile.in', target = 'doxyfile', HTML_BUILD_DIR = html_build_dir, - SRCDIR = bld.srcnode.abspath() + SRCDIR = bld.srcnode.abspath(), + VERSION = VERSION ) # There are two reasons for logging to doxygen.log and using it as From aa118070e46363352b748523c5abec376cb2cd68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karl=20Lind=C3=A9n?= Date: Sat, 11 Apr 2015 23:54:17 +0200 Subject: [PATCH 5/6] fix uninstall with doxygen by moving definition of share_dir and html_install_dir --- wscript | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wscript b/wscript index b16b345c..ffc741ab 100644 --- a/wscript +++ b/wscript @@ -765,9 +765,9 @@ def build(bld): target = 'doxygen.log' ) + share_dir = bld.options.destdir + bld.env['PREFIX'] + '/share/jack-audio-connection-kit' + html_install_dir = share_dir + '/reference/html/' if bld.cmd == 'install': - share_dir = bld.options.destdir + bld.env['PREFIX'] + '/share/jack-audio-connection-kit' - html_install_dir = share_dir + '/reference/html/' if os.path.isdir(html_install_dir): Logs.pprint('CYAN', "Removing old doxygen documentation installation...") shutil.rmtree(html_install_dir) From e869769b3c2634edb9d14c89b6c6710c7b44ddfc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karl=20Lind=C3=A9n?= Date: Sun, 12 Apr 2015 00:26:34 +0200 Subject: [PATCH 6/6] add the --htmldir option and install HTML docs into it if given --- wscript | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/wscript b/wscript index ffc741ab..e1ffd641 100644 --- a/wscript +++ b/wscript @@ -406,6 +406,7 @@ def options(opt): opt.tool_options('compiler_cc') # install directories + opt.add_option('--htmldir', type='string', default=None, help="HTML documentation directory [Default: /share/jack-audio-connection-kit/reference/html/") opt.add_option('--libdir', type='string', help="Library directory [Default: /lib]") opt.add_option('--libdir32', type='string', help="32bit Library directory [Default: /lib32]") opt.add_option('--mandir', type='string', help="Manpage directory [Default: /share/man/man1]") @@ -546,6 +547,13 @@ def configure(conf): conf.env['BINDIR'] = conf.env['PREFIX'] + '/bin' + if Options.options.htmldir: + conf.env['HTMLDIR'] = Options.options.htmldir + else: + # set to None here so that the doxygen code can find out the highest + # directory to remove upon install + conf.env['HTMLDIR'] = None + if Options.options.libdir: conf.env['LIBDIR'] = Options.options.libdir else: @@ -765,8 +773,17 @@ def build(bld): target = 'doxygen.log' ) - share_dir = bld.options.destdir + bld.env['PREFIX'] + '/share/jack-audio-connection-kit' - html_install_dir = share_dir + '/reference/html/' + # Determine where to install HTML documentation. Since share_dir is the + # highest directory the uninstall routine should remove, there is no + # better candidate for share_dir, but the requested HTML directory if + # --htmldir is given. + if bld.env['HTMLDIR']: + html_install_dir = bld.options.destdir + bld.env['HTMLDIR'] + share_dir = html_install_dir + else: + share_dir = bld.options.destdir + bld.env['PREFIX'] + '/share/jack-audio-connection-kit' + html_install_dir = share_dir + '/reference/html/' + if bld.cmd == 'install': if os.path.isdir(html_install_dir): Logs.pprint('CYAN', "Removing old doxygen documentation installation...")