[PATCH] to fix non-root install issue

Teubel György tgyurci at gmail.com
Mon Aug 2 07:27:12 UTC 2021


Hi!

Use PREFIX instead of DESTDIR:

make PREFIX=~/.local install

PREFIX is the variable which is for setting the path where the
application files are expected to be and LIBDIR uses it alerady.  The
purpose of DESTDIR is to specify an alternative root path for the
installation step for package creation etc.

Best regards
György

Matt Taylor <matt at matthewjosephtaylor.com> ezt írta (időpont: 2021.
aug. 2., H, 1:56):
>
> New user, just getting setup and discovered this issue while
> attempting to install via the latest master to a non-root directory.
>
> Don't think it matters but FYI I'm on a Mac.
>
> I ran:
>
> ```console
> $ DESTDIR=~/local make install
> ```
>
> which lead to a an error:
>
> ```console
> $ pass init
> /Users/user-name/local/usr/bin/pass: line 249:
> /usr/lib/password-store/platform.sh: No such file or directory
> Password store initialized for p:, -l, path:, -n, pass, --
>
> ```
>
> Because line 249 contained:
>
> ```shell
> source "/usr/lib/password-store/platform.sh"
>
> ```
>
> I patched the file as so:
> ```patch
> diff --git a/Makefile b/Makefile
> index eac2291..51602c0 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -46,7 +46,7 @@ install: install-common
>         @install -v -d "$(DESTDIR)$(LIBDIR)/password-store" && install
> -m 0644 -v "$(PLATFORMFILE)"
> "$(DESTDIR)$(LIBDIR)/password-store/platform.sh"
>         @install -v -d "$(DESTDIR)$(LIBDIR)/password-store/extensions"
>         @install -v -d "$(DESTDIR)$(BINDIR)/"
> -       @trap 'rm -f src/.pass' EXIT; sed
> 's:.*PLATFORM_FUNCTION_FILE.*:source
> "$(LIBDIR)/password-store/platform.sh":;s:^SYSTEM_EXTENSION_DIR=.*:SYSTEM_EXTENSION_DIR="$(LIBDIR)/password-store/extensions":'
> src/password-store.sh > src/.pass && \
> +       @trap 'rm -f src/.pass' EXIT; sed
> 's:.*PLATFORM_FUNCTION_FILE.*:source
> "$(DESTDIR)$(LIBDIR)/password-store/platform.sh":;s:^SYSTEM_EXTENSION_DIR=.*:SYSTEM_EXTENSION_DIR="$(DESTDIR)$(LIBDIR)/password-store/extensions":'
> src/password-store.sh > src/.pass && \
>         install -v -d "$(DESTDIR)$(BINDIR)/" && install -m 0755 -v
> src/.pass "$(DESTDIR)$(BINDIR)/pass"
>  else
>  install: install-common
> ```
>
> A simple miss of prefixing `$(DESTDIR)` before `$(LIBDIR)`
>
> Re-ran the `make install` which fixed the sourcing from the wrong lib
> directory issue.
>
> I'm quite surprised that this wasn't found earlier, I guess most
> people install from packages?
>
> Thanks for creating such an awesome tool. :)
>
> Matt
> https://mjt.dev


More information about the Password-Store mailing list