From 3688540f00237e5d8e711afd8541d218a931111b Mon Sep 17 00:00:00 2001 From: Juan Jose Garcia-Ripoll Date: Sun, 20 Dec 2020 18:33:54 +0100 Subject: [PATCH] Add options to build PDF-TOOLS and package it. --- emacs-build.sh | 4 +- extras/pdf-tools.sh | 132 ++++++++++++++++++++++++++++++++++++++++++++ extras/tools.sh | 19 ++++++- 3 files changed, 153 insertions(+), 2 deletions(-) create mode 100644 extras/pdf-tools.sh diff --git a/emacs-build.sh b/emacs-build.sh index 92e8d38..ab3db07 100644 --- a/emacs-build.sh +++ b/emacs-build.sh @@ -29,6 +29,7 @@ # . extras/tools.sh +. extras/pdf-tools.sh function write_help () { cat < $pdf_tools_log_file 2>&1 +} + +function pdf_tools_build () +{ + echo Building PDF-TOOLS into directory $pdf_tools_build_dir + make -C $pdf_tools_build_dir > $pdf_tools_log_file 2>&1 +} + +function pdf_tools_byte_compile () +{ + local lispdir="$pdf_tools_install_dir/share/emacs/site-lisp/" + cd $lispdir + $emacs_install_dir/bin/emacs -Q -batch -L . -f batch-byte-compile *.el || echo Failed +} + +function pdf_tools_install () +{ + local lispdir="$pdf_tools_install_dir/share/emacs/site-lisp/pdf-tools" + local bindir="$pdf_tools_install_dir/bin" + local docdir="$pdf_tools_install_dir/share/doc/pdf-tools" + echo Installing PDF-TOOLS into directory $pdf_tools_install_dir + mkdir -p $bindir $lispdir $docdir \ + && cp $pdf_tools_source_dir/{README*,COPYING*,NEWS} $docdir/ \ + && cp -rf $pdf_tools_source_dir/lisp/* $lispdir \ + && cp $pdf_tools_build_dir/epdfinfo.exe $bindir +} + +function pdf_tools_package () +{ + package_dependencies "$pdf_tools_zip_file" "`pdf_tools_dependencies`" \ + && cd "$pdf_tools_install_dir" \ + && zip -9r "$pdf_tools_zip_file" * +} diff --git a/extras/tools.sh b/extras/tools.sh index 1e1de0b..9968639 100644 --- a/extras/tools.sh +++ b/extras/tools.sh @@ -3,6 +3,24 @@ function errcho () echo $@ >&2 } +function elements_not_in_list () +{ + output="" + for element in $1; do + for other in $2; do + found="" + if test "$element" = "$other"; then + found="$element" + break + fi + done + if test -z "$found"; then + output="$element $output" + fi + done + echo $output +} + function clone_repo () { # Download a Git repo @@ -44,7 +62,6 @@ function clone_repo () return $? } - function full_dependency_list () { # Given a list of packages, print a list of all dependencies