Python Package example

This commit is contained in:
Thomas Hobson 2021-02-19 16:09:56 +13:00
parent 3103721c8e
commit d57b1f0fd4
2 changed files with 39 additions and 0 deletions

22
packages/Makefile Normal file
View File

@ -0,0 +1,22 @@
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_NAME}-${LANG_VERSION}.pkg.tar.gz: pkg-info.json package.squashfs
tar czvf $@ $*
package.squashfs: ${LANG_BINARY_FILES}
mksquashfs $* $@
%.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)

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

@ -0,0 +1,17 @@
NAME=python
VERSION=3.9.1
AUTHOR=Thomas Hobson <thomas@hexf.me>
DEPS=
BINARY_FILES=
include ../../Makefile
bin:
Python-${VERSION}.tgz:
curl "https://www.python.org/ftp/python/${VERSION}/Python-${VERSION}.tgz" -O $@
%: %.tgz
tar xzvf $@