Adiciona tinyblocks-jpg (libjpeg, build condicional) e melhora o empacotamento AppImage
This commit is contained in:
1 parent
714186a1a1
commit
e36fbc43e1
6 files changed
+337
-7
No files matched your search
@@ -32,6 +32,7 @@ PNG_DIR := $(LIBDIR)/tinyblocks-png
|
||||
IMG_DIR := $(LIBDIR)/tinyblocks-image
|
||||
VG_DIR := $(LIBDIR)/tinyblocks-vg
|
||||
SVG_DIR := $(LIBDIR)/tinyblocks-svg
|
||||
JPG_DIR := $(LIBDIR)/tinyblocks-jpg
|
||||
API_DIR := $(LIBDIR)/tinyblocks-api
|
||||
LIBM_DIR := $(LIBDIR)/tinyblocks-libman
|
||||
ED_DIR := $(LIBDIR)/tinyblocks-editor
|
||||
@@ -87,12 +88,12 @@ LIB_LDFLAGS := -L$(ED_DIR)/build -L$(GX_DIR)/build -L$(SD_DIR)/build \
|
||||
.PHONY: all help debug release static shared example sdl2 clean run python-lib mcp-lib json \
|
||||
editor run-editor run-sdl2 mylib vector customappearance graphics sdl2-backend test-editor \
|
||||
appdir appimage run-appimage icon \
|
||||
test-toml test-plugin test-blueprint test-base64 test-curves test-ppm test-bmp test-png test-image test-vg test-svg \
|
||||
test-toml test-plugin test-blueprint test-base64 test-curves test-ppm test-bmp test-png test-image test-vg test-svg test-jpg \
|
||||
category-libs category-sos libs \
|
||||
lib-events lib-control lib-operators lib-variables lib-appearance lib-pen lib-fs \
|
||||
lib-environ \
|
||||
lib-editor lib-graphics lib-sdl2 lib-python lib-mcp lib-toml \
|
||||
lib-json lib-xml lib-csv lib-blueprint lib-base64 lib-curves lib-ppm lib-bmp lib-png lib-image lib-vg lib-svg lib-api lib-libman \
|
||||
lib-json lib-xml lib-csv lib-blueprint lib-base64 lib-curves lib-ppm lib-bmp lib-png lib-image lib-vg lib-svg lib-jpg lib-api lib-libman \
|
||||
test-libman test-environ
|
||||
|
||||
all: static example ## Compila a biblioteca estática e o exemplo hello (padrão)
|
||||
@@ -192,6 +193,9 @@ lib-vg:
|
||||
lib-svg: lib-vg lib-base64
|
||||
$(MAKE) -C $(SVG_DIR)
|
||||
|
||||
lib-jpg:
|
||||
$(MAKE) -C $(JPG_DIR)
|
||||
|
||||
lib-api:
|
||||
$(MAKE) -C $(API_DIR)
|
||||
|
||||
@@ -212,8 +216,8 @@ lib-mcp:
|
||||
|
||||
libs: static lib-events lib-control lib-operators lib-variables \
|
||||
lib-appearance lib-pen lib-fs lib-environ lib-graphics lib-sdl2 lib-toml \
|
||||
lib-json lib-xml lib-csv lib-blueprint lib-base64 lib-curves lib-ppm lib-bmp lib-png lib-image lib-vg lib-svg lib-api lib-libman lib-editor
|
||||
@echo "Libraries OK: category + graphics + sdl2 + toml + json + xml + csv + blueprint + base64 + curves + ppm + bmp + png + image + vg + svg + api + libman + editor"
|
||||
lib-json lib-xml lib-csv lib-blueprint lib-base64 lib-curves lib-ppm lib-bmp lib-png lib-image lib-vg lib-svg lib-jpg lib-api lib-libman lib-editor
|
||||
@echo "Libraries OK: category + graphics + sdl2 + toml + json + xml + csv + blueprint + base64 + curves + ppm + bmp + png + image + vg + svg + jpg + api + libman + editor"
|
||||
|
||||
category-libs: static $(foreach l,$(CAT_LIBS),lib-$(l)) ## Compila as libraries de categoria (.a/.so)
|
||||
@echo "Build category libs OK"
|
||||
@@ -264,7 +268,7 @@ run-editor: editor ## Compila e abre o editor visual
|
||||
|
||||
# ── Empacotamento AppImage ──────────────────────────────────────────────
|
||||
# Libraries com blocos (categoria) que vao empacotadas como extensoes.
|
||||
APPIMAGE_LIBS := $(CAT_LIBS) toml json xml csv blueprint base64 curves ppm bmp png image vg svg
|
||||
APPIMAGE_LIBS := $(CAT_LIBS) toml json xml csv blueprint base64 curves ppm bmp png image vg svg jpg
|
||||
|
||||
APP_NAME := TinyBlocks
|
||||
APP_VER := 0.1.0
|
||||
@@ -318,6 +322,12 @@ appdir: editor ## Monta o AppDir (build/TinyBlocks.AppDir) para o AppImage
|
||||
mkdir -p "$(APPDIR)/usr/share/tinyblocks/libraries/tinyblocks-$$l/build"; \
|
||||
cp "$$d/library.toml" "$(APPDIR)/usr/share/tinyblocks/libraries/tinyblocks-$$l/"; \
|
||||
cp "$$so" "$(APPDIR)/usr/share/tinyblocks/libraries/tinyblocks-$$l/build/"; \
|
||||
ldd "$$so" 2>/dev/null | awk '/=> \//{print $$3}' | while read dep; do \
|
||||
dn=$$(basename "$$dep"); \
|
||||
skip=0; \
|
||||
for ex in $(APPIMAGE_EXCLUDE); do case "$$dn" in $$ex*) skip=1;; esac; done; \
|
||||
[ $$skip -eq 0 ] && cp -L "$$dep" $(APPDIR)/usr/lib/ 2>/dev/null || true; \
|
||||
done; \
|
||||
done
|
||||
@echo "AppDir pronto: $(APPDIR)"
|
||||
|
||||
@@ -541,6 +551,23 @@ $(BUILD)/svg_test: tests/svg_test.c $(SVG_DIR)/src/tb_svg.c $(VG_DIR)/src/tb_vg.
|
||||
test-svg: $(BUILD)/svg_test ## Roda o teste da svg (ASan/UBSan)
|
||||
./$(BUILD)/svg_test
|
||||
|
||||
# -- Teste da library jpg (libjpeg; pulado se os headers faltarem) ---
|
||||
JPG_TEST_AVAILABLE := $(shell printf '#include <jpeglib.h>\nint main(void){return 0;}\n' | \
|
||||
$(CC) -xc - -ljpeg -o /dev/null >/dev/null 2>&1 && echo yes)
|
||||
ifeq ($(JPG_TEST_AVAILABLE),yes)
|
||||
$(BUILD)/jpg_test: tests/jpg_test.c $(JPG_DIR)/src/tb_jpg.c static
|
||||
@mkdir -p $(BUILD)
|
||||
$(CC) $(CFLAGS_DBG) -I$(JPG_DIR)/include $(JPG_DIR)/src/tb_jpg.c \
|
||||
tests/jpg_test.c -o $@ \
|
||||
-Wl,--start-group $(LIB_A) -Wl,--end-group -ljpeg
|
||||
|
||||
test-jpg: $(BUILD)/jpg_test ## Roda o teste da jpg (ASan/UBSan)
|
||||
./$(BUILD)/jpg_test
|
||||
else
|
||||
test-jpg: ## (libjpeg-dev ausente: teste ignorado)
|
||||
@echo "test-jpg: <jpeglib.h>/libjpeg-dev ausente - pulando"
|
||||
endif
|
||||
|
||||
# -- Teste de plugin .so standalone ---
|
||||
FS_SO := $(FS_DIR)/build/libtinyblocks-fs.so
|
||||
|
||||
@@ -557,7 +584,7 @@ clean: ## Remove os diretórios build/ (raiz e libraries)
|
||||
$(RM) -r $(BUILD)
|
||||
@for d in $(EV_DIR) $(CT_DIR) $(OP_DIR) $(VR_DIR) $(AP_DIR) $(PN_DIR) $(FS_DIR) \
|
||||
$(TOML_DIR) $(JSON_DIR) $(XML_DIR) $(CSV_DIR) $(BP_DIR) \
|
||||
$(B64_DIR) $(CV_DIR) $(PPM_DIR) $(BMP_DIR) $(PNG_DIR) $(IMG_DIR) $(VG_DIR) $(SVG_DIR) \
|
||||
$(B64_DIR) $(CV_DIR) $(PPM_DIR) $(BMP_DIR) $(PNG_DIR) $(IMG_DIR) $(VG_DIR) $(SVG_DIR) $(JPG_DIR) \
|
||||
$(API_DIR) $(LIBM_DIR) \
|
||||
$(ED_DIR) $(GX_DIR) $(SD_DIR) $(PY_DIR) $(MC_DIR); do \
|
||||
$(MAKE) -C $$d clean >/dev/null 2>&1 || true; \
|
||||
|
||||
Reference in new issue
Block a user