Better python packaging
This commit is contained in:
parent
51b06018c1
commit
4f3e7a536d
|
@ -1,3 +0,0 @@
|
|||
*
|
||||
!**/Makefile
|
||||
!.gitignore
|
|
@ -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
|
|
@ -0,0 +1 @@
|
|||
*/
|
|
@ -1,28 +0,0 @@
|
|||
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 $<
|
||||
|
||||
|
|
@ -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' >> $@
|
|
@ -0,0 +1,21 @@
|
|||
NAME=python
|
||||
AUTHOR=Thomas Hobson <thomas@hexf.me>
|
||||
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 $@
|
Loading…
Reference in New Issue