diff --git a/packages/.gitignore b/packages/.gitignore deleted file mode 100644 index a9f5c08..0000000 --- a/packages/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -* -!**/Makefile -!.gitignore \ No newline at end of file diff --git a/packages/Makefile b/packages/common.mk similarity index 78% rename from packages/Makefile rename to packages/common.mk index 3ef4592..8305faf 100644 --- a/packages/Makefile +++ b/packages/common.mk @@ -10,7 +10,7 @@ ifeq (${LANG_COMPILED}, true) ${LANG_NAME}-${LANG_VERSION}.pkg.tar.gz: $(LANG_PKG_TARGETS) compile endif ${LANG_NAME}-${LANG_VERSION}.pkg.tar.gz: $(LANG_PKG_TARGETS) - tar czvf $@ $? + tar czf $@ $? %.json: %.jq jq '$(shell tr '\n' '|' < $<).' <<< "{}" > $@ @@ -25,9 +25,16 @@ pkg-info.jq: %.asc: % gpg --detach-sig --armor --output $@ $< +%/: %.tgz + tar xzf $< + .PHONY: clean clean: rm -rf $(filter-out Makefile, $(wildcard *)) + +,PHONY: cleanup +cleanup: + rm -rf $(filter-out ${LANG_NAME}-${LANG_VERSION}.pkg.tar.gz.asc, $(filter-out ${LANG_NAME}-${LANG_VERSION}.pkg.tar.gz, $(filter-out Makefile, $(wildcard *)))) .PHONY: sign sign: ${LANG_NAME}-${LANG_VERSION}.pkg.tar.gz.asc \ No newline at end of file diff --git a/packages/python/.gitignore b/packages/python/.gitignore new file mode 100644 index 0000000..0a00d70 --- /dev/null +++ b/packages/python/.gitignore @@ -0,0 +1 @@ +*/ \ No newline at end of file diff --git a/packages/python/3.9.1/Makefile b/packages/python/3.9.1/Makefile deleted file mode 100644 index 6854683..0000000 --- a/packages/python/3.9.1/Makefile +++ /dev/null @@ -1,28 +0,0 @@ -NAME=python -VERSION=3.9.1 -AUTHOR=Thomas Hobson -DEPS= -COMPILED=false - -MAKE_JOBS=64 - -include ../../Makefile - -run: - echo "python3.9 $*" > run - -python-${VERSION}/environment: - echo 'export PATH=$$PWD/python-${VERSION}/bin:$$PATH' > $@ - -python-${VERSION}/: Python-${VERSION}/ - cd $< && ./configure --prefix / - make -j${MAKE_JOBS} -C $< - DESTDIR=../$@ make -j${MAKE_JOBS} -C $< altinstall || true - -Python-${VERSION}.tgz: - curl "https://www.python.org/ftp/python/${VERSION}/$@" -o $@ - -%/: %.tgz - tar xzvf $< - - diff --git a/packages/python/Makefile b/packages/python/Makefile new file mode 100644 index 0000000..4e1ab09 --- /dev/null +++ b/packages/python/Makefile @@ -0,0 +1,24 @@ +LANGUAGE=python +VERSIONS=2.7.1 3.9.1 + +.PHONY: build sign cleanup clean +build: $(patsubst %,%/${LANGUAGE}-%.pkg.tar.gz,${VERSIONS}) +sign: $(patsubst %,%/${LANGUAGE}-%.pkg.tar.gz.asc,${VERSIONS}) +clean: + rm -rf ${VERSIONS} +cleanup: $(patsubst %,%/cleanup,${VERSIONS}) + + +%/cleanup: %/Makefile + $(MAKE) -C $(shell dirname $<) cleanup + rm $(shell dirname $<)/Makefile + +%/${LANGUAGE}-%.pkg.tar.gz.asc: %/Makefile + $(MAKE) -C $(shell dirname $<) sign +%/${LANGUAGE}-%.pkg.tar.gz: %/Makefile + $(MAKE) -C $(shell dirname $<) + +%/Makefile: + @mkdir -p $(shell dirname $@) + @echo 'VERSION=$(patsubst %/Makefile,%,$@)' > $@ + @echo 'include ../base.mk' >> $@ diff --git a/packages/python/base.mk b/packages/python/base.mk new file mode 100644 index 0000000..bcb11d1 --- /dev/null +++ b/packages/python/base.mk @@ -0,0 +1,21 @@ +NAME=python +AUTHOR=Thomas Hobson +DEPS= +#VERSION= +COMPILED=false + +include ../../common.mk + +run: + echo 'python$(shell grep -oP "\d+.\d+"<<<${VERSION}) $$*' > run + +python-${VERSION}/environment: + echo 'export PATH=$$PWD/${NAME}-${VERSION}/bin:$$PATH' > $@ + +python-${VERSION}/: Python-${VERSION}/ + cd $< && ./configure --prefix / + $(MAKE) -j$(or ${MAKE_JOBS},64) -C $< + DESTDIR=../$@ $(MAKE) -j$(or ${MAKE_JOBS},64) -C $< altinstall || true + +Python-${VERSION}.tgz: + curl "https://www.python.org/ftp/python/${VERSION}/$@" -o $@ \ No newline at end of file