update build system

This commit is contained in:
2025-04-29 16:49:48 -05:00
parent 6d8c55b4a6
commit 1611ccd07a
3 changed files with 38 additions and 28 deletions

33
Makefile Normal file
View File

@ -0,0 +1,33 @@
BUILDDIR := ./void-packages
TEMPLATES := $(shell find srcpkgs/* -maxdepth 0 -type d)
PACKAGES := $(addprefix $(BUILDDIR)/,$(notdir $(TEMPLATES)))
all: sync $(PACKAGES)
$(info TEMPLATES: $(TEMPLATES))
$(info PACKAGES: $(PACKAGES))
$(BUILDDIR)/%: srcpkgs/%
@echo "Building package: $<"
@rm -rf $(BUILDDIR)/srcpkgs/$<
@cp -ru $< $(BUILDDIR)/srcpkgs/
@-cd $(BUILDDIR) && ./xbps-src clean $<
@-cd $(BUILDDIR) && ./xbps-src pkg $< || echo "Warning: Failed to build $<"
@mkdir -p ./dest
@-cp -u $(BUILDDIR)/hostdir/binpkgs/*.xbps ./dest/
@-cp $(BUILDDIR)/hostdir/binpkgs/x86_64-repodata ./dest/
sync: sync-build
sync-fetch:
test -d $(BUILDDIR) || git clone --depth=1 https://github.com/void-linux/void-packages.git $^
sync-update: sync-fetch
@cd $(BUILDDIR) && git pull
sync-build: sync-update
@cd $(BUILDDIR) && ./xbps-src binary-bootstrap
sync-clean:
rm -rf $(BUILDDIR)
build-clean:
rm -rf ./dest
clean: sync-clean build-clean