branch: externals/gpr-mode commit 781e7993cc4ffdd48fe966d397b7755e95c439fb Author: Stephen Leake <stephen_le...@stephe-leake.org> Commit: Stephen Leake <stephen_le...@stephe-leake.org>
* install.sh: Just copy executable; clean up --- install.sh | 35 +++++++++++++++-------------------- 1 file changed, 15 insertions(+), 20 deletions(-) diff --git a/install.sh b/install.sh index 0f279215ac..2d37134cb6 100755 --- a/install.sh +++ b/install.sh @@ -1,31 +1,26 @@ #!/bin/sh # Install executables for Gpr mode. # +# $1 : optional <install dir> +# # See build.sh for build (must be run before install). -if type alr; then - echo "installing gpr-mode executables via Alire" +if [ x$1 = x ]; then + PREFIX=$HOME/.local + # as recommended by https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html +else + PREFIX=$1 +fi + +echo "installing gpr-mode executables to" $PREFIX/bin - if [ x$1 == x ]; then - echo "you must specify the install directory with 'install.sh <dir>'" - return 1 - fi - # IMPROVEME: when alr supports install, use that - cp emacs_gpr_mode*/bin/* $1 +# No need for gprinstall; we only need the executable -elif type gprbuild; then - echo "installing gpr-mode executables via gnat compiler" - - # $1 : optional --prefix=<dir> - # - # If you don't have write permission in the GNAT installation - # directory, you need to use --prefix=<dir>, or run with root priviledges. +if type alr; then + cp emacs_gpr_mode*/bin/* $PREFIX/bin - if [ -d ../wisi-4.1.? ]; then - WISI_DIR=`ls -d ../wisi-4.1.?` - fi - - gprinstall -f -p -P gpr_mode_wisi_parse.gpr -aP $WISI_DIR --install-name=gpr_mode_wisi_parse $1 +elif type gprbuild; then + cp bin/* $PREFIX/bin else echo "neither Alire nor gnat compiler found"