Python 3.9.1 Package (but better)

This commit is contained in:
Thomas Hobson 2021-02-19 17:32:35 +13:00
parent e2c8427a7a
commit 36102f22b4
No known key found for this signature in database
GPG Key ID: 9F1FD9D87950DB6F
3 changed files with 16 additions and 11 deletions

2
packages/.gitignore vendored
View File

@ -1,3 +1,3 @@
*
!Makefile
!**/Makefile
!.gitignore

View File

@ -2,14 +2,16 @@ LANG_NAME=$(or ${NAME},none)
LANG_VERSION=$(or ${VERSION},0.0.0)
LANG_AUTHOR=$(or ${AUTHOR},HexF <thomas@hexf.me>)
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' '|' < $<).' <<< "{}" > $@

View File

@ -2,22 +2,25 @@ NAME=python
VERSION=3.9.1
AUTHOR=Thomas Hobson <thomas@hexf.me>
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 $<