Stunkymonkey / nautilus-open-any-terminal

GNU General Public License v3.0
568 stars 59 forks source link

Makefile: respect DESTDIR #144

Closed WavyEbuilder closed 5 months ago

WavyEbuilder commented 7 months ago

Currently, the Makefile does not support DESTDIR. This pr fixes that.

WavyEbuilder commented 7 months ago

Good points, will fix now!

WavyEbuilder commented 7 months ago

Could I ask for a clarification on what you mean by "PREFIX is still set to $HOME/.local when not running as root"? I see a conditional setting that so I'm not too sure what needs changing.

lvxnull commented 7 months ago

If someone is running as non-root and sets DESTDIR to something, say /test/path, then the actual installation path will be /test/path/home/$USER/.local, which might be confusing. I think it would be better if instead PREFIX was set to /.local if running as non-root and DESTDIR is unset, otherwise to /usr, and default DESTDIR to $HOME if running as non-root.

WavyEbuilder commented 7 months ago

Ah thanks for that! I'll fix that now :)

lvxnull commented 7 months ago

I think you could just write export DESTDIR instead of passing it explicitly in arguments

WavyEbuilder commented 7 months ago

Will check and report back later

lvxnull commented 7 months ago

If someone is running as non-root and sets DESTDIR to something, say /test/path, then the actual installation path will be /test/path/home/$USER/.local, which might be confusing. I think it would be better if instead PREFIX was set to /.local if running as non-root and DESTDIR is unset, otherwise to /usr, and default DESTDIR to $HOME if running as non-root.

Alternatively, default PREFIX to /.local and DESTDIR to $HOME when not running as root regardless if DESTDIR was set or not. This might be easier to implement and still covers the majority of usecases of DESTDIR and PREFIX.

ifeq ($(shell id -u),0)
PREFIX ?= /usr
else
PREFIX ?= /.local
DESTDIR ?= $(HOME)
endif

export PREFIX
export DESTDIR
JulianVennen commented 5 months ago

Hey, is this PR still active?

lvxnull commented 5 months ago

I wanted to implement this feature sooner but i never found time to do it. Once im home I'll make a new PR.

On Fri, Apr 19, 2024, 13:22 Julian Vennen @.***> wrote:

Hey, is this PR still active?

— Reply to this email directly, view it on GitHub https://github.com/Stunkymonkey/nautilus-open-any-terminal/pull/144#issuecomment-2066366744, or unsubscribe https://github.com/notifications/unsubscribe-auth/AUV2BDJX5K2LLUS23EWRJCDY6D45ZAVCNFSM6AAAAABECFJLCKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANRWGM3DMNZUGQ . You are receiving this because you commented.Message ID: @.***>

lvxnull commented 5 months ago

Already implemented in #156

JulianVennen commented 5 months ago

Thanks :)