old makefiles
This commit is contained in:
parent
f9216b6dda
commit
23a0d0ad45
14
Makefile
Normal file
14
Makefile
Normal file
@ -0,0 +1,14 @@
|
||||
.PHONY: all subrecipes_png subrecipes_webp
|
||||
makeFileDir := $(dir $(abspath $(lastword $(MAKEFILE_LIST))))
|
||||
all: subrecipes_png subrecipes_webp
|
||||
true
|
||||
subrecipes_webp: stickers.json $(makeFileDir)/make.jq
|
||||
mkdir -p ./stickers
|
||||
jq -r -f make.jq --arg out_format '-f webp -preset:v icon -frames 1 ' --arg out_ext webp stickers.json > src/Makefile.webp.mk
|
||||
$(MAKE) -C src -f Makefile.webp.mk
|
||||
subrecipes_png: stickers.json $(makeFileDir)/make.jq
|
||||
mkdir -p ./stickers
|
||||
jq -r -f make.jq --arg out_format '-preset:v icon -frames 1' --arg out_ext png stickers.json > src/Makefile.png.mk
|
||||
$(MAKE) -C src -f Makefile.png.mk
|
||||
stickers.json:
|
||||
touch stickers.json
|
18
make.jq
Normal file
18
make.jq
Normal file
@ -0,0 +1,18 @@
|
||||
#!/usr/bin/env jq
|
||||
. as $stickers | [
|
||||
"allstickers_"+$out_ext+": " + ( [ $stickers[]| select(.disabled != "true") | "../stickers/sticker_"+.name+"."+$out_ext ] | join(" ")),
|
||||
($stickers[] | select(.disabled != "true") | [
|
||||
"../stickers/sticker_"+.name+"."+$out_ext + ": "+ ((.in[]| select(.format != "lavfi") | .input )|gsub("(\\s+)"; "\\ ")),
|
||||
"ffmpeg "
|
||||
+(if .in.base.format then "-f "+.in.base.format else "" end) +" -i "+ (.in.base.input|@sh)
|
||||
+ " -vf "
|
||||
+(if .colors and .colors.transparent then "geq=\\''"
|
||||
+"r=if(lt(alpha(X,Y),128),"+(.colors.transparent[0]|tostring)+",r(X,Y)):"
|
||||
+"g=if(lt(alpha(X,Y),128),"+(.colors.transparent[1]|tostring)+",g(X,Y)):"
|
||||
+"b=if(lt(alpha(X,Y),128),"+(.colors.transparent[2]|tostring)+",b(X,Y)):"
|
||||
+"a=alpha(X,Y)'\\'," else "" end)
|
||||
+"scale=w=512:h=512:force_original_aspect_ratio=decrease"
|
||||
+ " "
|
||||
+"-y -lossless 1 "+$out_format+" ../stickers/sticker_"+.name+"."+$out_ext
|
||||
] | join("\n\t"))
|
||||
] | join ("\n")
|
Loading…
Reference in New Issue
Block a user