pkg: relocate package files
This commit is contained in:
parent
5e400cb782
commit
98782b0a17
|
@ -8,11 +8,11 @@ In the example of NodeJS, we would call this `node`, after the main binary.
|
|||
|
||||
## Creating new languages
|
||||
|
||||
See [deno-1.7.5/](deno-1.7.5/) or any other directory for examples.
|
||||
See [deno/1.7.5/](deno/1.7.5/) or any other directory for examples.
|
||||
|
||||
1. Create a new branch on your fork of engineer-man/piston
|
||||
|
||||
2. Create a directory named `[language]-[version]`. See Naming Languages for how to determine the name for your language
|
||||
2. Create directories named `[language]/[version]`. See Naming Languages for how to determine the name for your language
|
||||
|
||||
3. Create a file named `build.sh`, adding a shebang for bash `#!/bin/bash` on the first line.
|
||||
In this file put any steps to compile the specified langauge.
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
PACKAGES=$(shell find * -maxdepth 0 -type d)
|
||||
PACKAGES=$(subst /,-,$(shell find * -maxdepth 1 -mindepth 1 -type d))
|
||||
BUILD_PLATFORM=$(or ${PLATFORM},baremetal-$(shell grep -oP "^ID=\K.+" /etc/os-release))
|
||||
|
||||
help:
|
||||
|
@ -9,14 +9,16 @@ help:
|
|||
|
||||
build build-all: $(addsuffix .pkg.tar.gz, ${PACKAGES})
|
||||
|
||||
%.pkg.tar.gz: %/ %/pkg-info.json
|
||||
cd $< && chmod +x ./build.sh && ./build.sh
|
||||
rm -f $@
|
||||
tar czf $@ $* --transform='s|$*||'
|
||||
|
||||
define PKG_RULE
|
||||
$(1).pkg.tar.gz: $(subst -,/,$(1))/ $(subst -,/,$(1))/pkg-info.json
|
||||
cd $$< && chmod +x ./build.sh && ./build.sh
|
||||
rm -f $$@
|
||||
tar czf $$@ $$< --transform='s|$$<||'
|
||||
endef
|
||||
|
||||
$(foreach pkg,$(PACKAGES),$(eval $(call PKG_RULE,$(pkg))))
|
||||
|
||||
%/pkg-info.json: %/metadata.json
|
||||
jq '.build_platform="${BUILD_PLATFORM}"' $< > $@
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue