Compare commits

...

3 Commits

Author SHA1 Message Date
Thomas Hobson 36102f22b4
Python 3.9.1 Package (but better) 2021-02-19 17:32:35 +13:00
Thomas Hobson e2c8427a7a
Python 3.9.1 Package 2021-02-19 16:48:46 +13:00
Thomas Hobson d57b1f0fd4 Python Package example 2021-02-19 16:09:56 +13:00
3 changed files with 59 additions and 0 deletions

3
packages/.gitignore vendored Normal file
View File

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

28
packages/Makefile Normal file
View File

@ -0,0 +1,28 @@
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_COMPILED=$(or ${COMPILED}, false)
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 $@ $?
%.json: %.jq
jq '$(shell tr '\n' '|' < $<).' <<< "{}" > $@
pkg-info.jq:
echo '.language="${LANG_NAME}"' > pkg-info.jq
echo '.version="${LANG_VERSION}"' >> pkg-info.jq
echo '.author="${LANG_AUTHOR}"' >> pkg-info.jq
echo '.dependencies={}' >> pkg-info.jq
$(foreach dep, ${LANG_DEPS}, echo '.dependencies.$(word 1,$(subst =, ,${dep}))="$(word 2,$(subst =, ,${dep}))"' >> pkg-info.jq)
.PHONY: clean
clean:
rm -rf $(filter-out Makefile, $(wildcard *))

28
packages/python/3.9.1/Makefile vendored Normal file
View File

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