Build para Windows: make exe (MinGW + pacotes do MSYS2)
make exe gera build/win-x86_64/TinyBlocks/TinyBlocks.exe com as DLLs e o zip; make run-exe abre no Wine. As dependencias (SDL2, SDL2_ttf, libpng, freetype, openssl, zlib, regex) vem dos pacotes MinGW do MSYS2, com as dependencias resolvidas pelo indice do repositorio (packaging/windows/msys2_deps.py). O POSIX que falta fica em packaging/windows/compat (dlfcn, pwd, uname, mkdir, sysconf, setenv, readlink de /proc/self/exe, strndup, getline, open_memstream). No Windows uma DLL nao ve os simbolos do .exe, entao o editor, os modulos dele (TB_ED_STATIC_MODULES) e as libraries de extensao (TB_STATIC_EXTRAS) entram no executavel; TB_STATIC_BUILD deixa o TB_API vazio. Socket e servidor MCP ganham uma camada sobre o Winsock; o kernel do GEMM so usa target_clones no ELF. O pacote leva a fonte DejaVu (procurada ao lado do executavel pelo SDL2 e pela opentype) e os certificados raiz (certs/ca-bundle.crt, carregados pela ssl). Testado no Wine 9: interface, HTTPS com verificacao, tensor, informacoes do sistema e grafico em PNG. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
829bc67142
commit
7538d48a13
21 files changed
+820
-61
No files matched your search
@@ -48,7 +48,7 @@ static void eval_handle_noop(TinyBlocks_Block* self, TinyBlocks* rt) {
|
||||
* Fonte TTF - cache por tamanho
|
||||
* === */
|
||||
#define FONT_CACHE_CAP 8
|
||||
#define FONT_SEARCH_COUNT 6
|
||||
#define FONT_SEARCH_COUNT 9
|
||||
|
||||
typedef struct { int size; TTF_Font* font; } FontEntry;
|
||||
|
||||
@@ -62,13 +62,27 @@ static const char* s_font_paths[FONT_SEARCH_COUNT] = {
|
||||
"/usr/share/fonts/truetype/liberation/LiberationSans-Regular.ttf",
|
||||
"/usr/share/fonts/truetype/ubuntu/Ubuntu-R.ttf",
|
||||
"/System/Library/Fonts/Helvetica.ttc",
|
||||
"C:/Windows/Fonts/DejaVuSans.ttf",
|
||||
"C:/Windows/Fonts/segoeui.ttf",
|
||||
"C:/Windows/Fonts/arial.ttf",
|
||||
};
|
||||
|
||||
/* A fonte que vai junto do programa (pacote Windows, AppImage):
|
||||
<pasta do executavel>/fonts/DejaVuSans.ttf */
|
||||
static TTF_Font* bundled_font(int size) {
|
||||
char* base = SDL_GetBasePath();
|
||||
if (!base) return NULL;
|
||||
char path[1024];
|
||||
snprintf(path, sizeof(path), "%sfonts/DejaVuSans.ttf", base);
|
||||
SDL_free(base);
|
||||
return TTF_OpenFont(path, size);
|
||||
}
|
||||
|
||||
static TTF_Font* get_font(int size) {
|
||||
for (int i = 0; i < s_font_cache_n; i++)
|
||||
if (s_font_cache[i].size == size) return s_font_cache[i].font;
|
||||
|
||||
TTF_Font* f = NULL;
|
||||
TTF_Font* f = bundled_font(size);
|
||||
for (int i = 0; i < FONT_SEARCH_COUNT && !f; i++)
|
||||
f = TTF_OpenFont(s_font_paths[i], size);
|
||||
|
||||
|
||||
Reference in new issue
Block a user