Automacao de empacotamento AppImage (make appimage)
- Makefile: alvos "appdir" (monta build/TinyBlocks.AppDir), "appimage"
(baixa o appimagetool e gera build/TinyBlocks-<ver>-x86_64.AppImage),
"run-appimage" e "icon".
- packaging/: tinyblocks.desktop, AppRun, tinyblocks.png (icone 256x256)
e make_icon.py (gera o icone sem dependencias externas).
- appdir:
* empacota o editor + SDL2/SDL2_ttf (com uma excludelist das libs do
sistema: glibc, X11/GL, som, dbus, systemd...);
* copia as libraries de extensao (.so + library.toml) para
usr/share/tinyblocks/libraries/<nome>/build;
- libman: tb_libman_scan_defaults agora tambem varre libraries ao lado do
executavel (usr/share/tinyblocks/libraries e usr/lib/...), de modo que o
AppImage acha suas extensoes mesmo rodando fora do repositorio.
Verificado: AppImage monta, abre o editor e carrega um .so empacotado
(TOML) pela tela "Escolha uma Extensao".
This commit is contained in:
1 parent
b29908e65b
commit
4de611cc1e
6 files changed
+206
No files matched your search
@@ -10,6 +10,7 @@
|
||||
#include <ctype.h>
|
||||
#include <dirent.h>
|
||||
#include <sys/stat.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <tinyblocks/tinyblocks.h>
|
||||
#include "tb_libman.h"
|
||||
@@ -124,9 +125,33 @@ int tb_libman_scan(const char* root, int max_depth) {
|
||||
return scan_dir(root, max_depth);
|
||||
}
|
||||
|
||||
/* Varre libraries ao lado do executavel (ex.: AppImage em
|
||||
* usr/bin/tinyblocks -> usr/share/tinyblocks/libraries). */
|
||||
static int scan_exe_roots(void) {
|
||||
char exe[TBLM_PATH_LEN];
|
||||
ssize_t k = readlink("/proc/self/exe", exe, sizeof(exe) - 1);
|
||||
if (k <= 0) return 0;
|
||||
exe[k] = 0;
|
||||
char* slash = strrchr(exe, '/');
|
||||
if (!slash) return 0;
|
||||
*slash = 0; /* diretorio do executavel */
|
||||
static const char* rels[] = {
|
||||
"/../share/tinyblocks/libraries",
|
||||
"/../lib/tinyblocks/libraries",
|
||||
};
|
||||
int n = 0;
|
||||
for (int i = 0; i < 2; i++) {
|
||||
char buf[TBLM_PATH_LEN];
|
||||
snprintf(buf, sizeof(buf), "%s%s", exe, rels[i]);
|
||||
n += tb_libman_scan(buf, 3);
|
||||
}
|
||||
return n;
|
||||
}
|
||||
|
||||
int tb_libman_scan_defaults(void) {
|
||||
int n = 0;
|
||||
n += tb_libman_scan("libraries", 3);
|
||||
n += scan_exe_roots();
|
||||
const char* home = getenv("HOME");
|
||||
if (home && home[0]) {
|
||||
char buf[TBLM_PATH_LEN];
|
||||
|
||||
Reference in new issue
Block a user