gamemaker1/yeet

[FEAT]: Make contributing easier

bogdan-the-great opened this issue · 6 comments

Is your feature request related to a problem?

I'm trying to make this feature from #14, but I don't know how to build my script.

Describe the solution you'd like

Make a way to update/build script locally without the need to pull a release. This could be achieved by pulling the whole repo (without the archive), and making it more like an executable script, and less like a fully fledged program. A good example of this is an fff file manager, which has a Makefile, and on every change you just run make install, which replaces the installed one with the current one.

This would make it really easy to contribute to.

Working on it, right now this is my Makefile:

PREFIX ?= /usr
MANDIR ?= $(PREFIX)/share/man
DOCDIR ?= $(PREFIX)/share/doc/yeet
CACHEDIR ?= $(HOME)/.cache
SUDO ?= sudo
# Provided by the pacman package
MAKEPKG ?= makepkg -sfCci --noconfirm

all:
	@echo Run \'make install\' or \'make uninstall\'.

install:
	@# Create directories
	@$(SUDO) mkdir -p $(DESTDIR)$(PREFIX)/bin
	@$(SUDO) mkdir -p $(DESTDIR)$(MANDIR)/man8
	@$(SUDO) mkdir -p $(DESTDIR)$(DOCDIR)
	@$(SUDO) mkdir -p $(DESTDIR)$(PREFIX)/share/yeet

	@# Remove existing package-query and yeet
	@rm -rf $(CACHEDIR)/yeet/build/package-query
	@rm -rf $(CACHEDIR)/yeet/build/yeet

	@mkdir -p $(CACHEDIR)/yeet/build
	@echo Downloading package-query
	@cd $(CACHEDIR)/yeet/build/ && git clone https://aur.archlinux.org/package-query.git

	@# echo Building package-query...
	@# cd $(CACHEDIR)/yeet/build/package-query && makepkg -sfCci --noconfirm 

	@echo Installing yeet...
	@$(SUDO) cp -p yeet $(DESTDIR)$(PREFIX)/bin/yeet
	@$(SUDO) chmod 755 $(DESTDIR)$(PREFIX)/bin/yeet
	@$(SUDO) cp -p yeet.8 $(DESTDIR)$(MANDIR)/man8
	@$(SUDO) cp -p README.md $(DESTDIR)$(DOCDIR)
	@$(SUDO) cp -p yeet.example.conf $(DESTDIR)$(PREFIX)/share/yeet

uninstall:
	@echo Deleting everything connected with yeet, including cached packages!
	@$(SUDO) rm -rf $(DESTDIR)$(PREFIX)/bin/yeet
	@$(SUDO) rm -rf $(DESTDIR)$(MANDIR)/man8/yeet.8
	@$(SUDO) rm -rf $(DESTDIR)$(DOCDIR)
	@$(SUDO) rm -rf $(CACHEDIR)/yeet/build

The issue is with building the package-query - it loops, and I don't know how to stop it.

Hi,

Thanks for doing this!

I tried using the makefile, and it worked without looping at package-query. The only change I made to get it to run was adding .PHONY all install uninstall, otherwise it kept returning make: 'install' up to date.

Hi,

Thanks for doing this!

I tried using the makefile, and it worked without looping at package-query. The only change I made to get it to run was adding .PHONY all install uninstall, otherwise it kept returning make: 'install' up to date.

Will do, it didn't loop, because I commented it out, and it didn't compile the package-query, but you had it on your computer already.

Okay in the repo I added reinstall and package-query compiling works for me now.

Could you please also make this a separate PR, along with the numbered search one?

Merged as part of #17, thanks!