From 36102f22b4ce36cc6ec7a455754549e5c12f431c Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Fri, 19 Feb 2021 17:32:35 +1300 Subject: [PATCH] Python 3.9.1 Package (but better) --- packages/.gitignore | 2 +- packages/Makefile | 12 +++++++----- packages/python/3.9.1/Makefile | 13 ++++++++----- 3 files changed, 16 insertions(+), 11 deletions(-) diff --git a/packages/.gitignore b/packages/.gitignore index 022537b..a9f5c08 100644 --- a/packages/.gitignore +++ b/packages/.gitignore @@ -1,3 +1,3 @@ * -!Makefile +!**/Makefile !.gitignore \ No newline at end of file diff --git a/packages/Makefile b/packages/Makefile index 52345bc..51218a8 100644 --- a/packages/Makefile +++ b/packages/Makefile @@ -2,14 +2,16 @@ LANG_NAME=$(or ${NAME},none) LANG_VERSION=$(or ${VERSION},0.0.0) LANG_AUTHOR=$(or ${AUTHOR},HexF ) LANG_DEPS=$(or ${DEPS}) -LANG_BINARY_FILES=$(or ${BINARY_FILES},) +LANG_COMPILED=$(or ${COMPILED}, false) -${LANG_NAME}-${LANG_VERSION}.pkg.tar.gz: pkg-info.json package.squashfs +LANG_PKG_TARGETS=pkg-info.json ${LANG_NAME}-${LANG_VERSION}/ ${LANG_NAME}-${LANG_VERSION}/environment run + +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 $@ $? -package.squashfs: ${LANG_BINARY_FILES} - mksquashfs $? $@ - %.json: %.jq jq '$(shell tr '\n' '|' < $<).' <<< "{}" > $@ diff --git a/packages/python/3.9.1/Makefile b/packages/python/3.9.1/Makefile index d77b69a..6854683 100644 --- a/packages/python/3.9.1/Makefile +++ b/packages/python/3.9.1/Makefile @@ -2,22 +2,25 @@ NAME=python VERSION=3.9.1 AUTHOR=Thomas Hobson DEPS= -BINARY_FILES=out/ run +COMPILED=false MAKE_JOBS=64 include ../../Makefile run: - echo "bin/python3.9 $*" > run + echo "python3.9 $*" > run -out/: Python-${VERSION}/ +python-${VERSION}/environment: + echo 'export PATH=$$PWD/python-${VERSION}/bin:$$PATH' > $@ + +python-${VERSION}/: Python-${VERSION}/ cd $< && ./configure --prefix / make -j${MAKE_JOBS} -C $< - DESTDIR=../out make -j${MAKE_JOBS} -C $< altinstall + DESTDIR=../$@ make -j${MAKE_JOBS} -C $< altinstall || true Python-${VERSION}.tgz: - curl "https://www.python.org/ftp/python/${VERSION}/Python-${VERSION}.tgz" -o $@ + curl "https://www.python.org/ftp/python/${VERSION}/$@" -o $@ %/: %.tgz tar xzvf $<