AppImage build!
This commit is contained in:
parent
02ccaef5b7
commit
e5a812fcdf
5
.gitignore
vendored
5
.gitignore
vendored
@ -1,4 +1,5 @@
|
|||||||
.vscode
|
.vscode
|
||||||
|
AppImage
|
||||||
.venv
|
.venv
|
||||||
.history
|
.history
|
||||||
.backup*
|
.backup*
|
||||||
@ -12,3 +13,7 @@ auth.h
|
|||||||
tests
|
tests
|
||||||
rpylib.so
|
rpylib.so
|
||||||
rd
|
rd
|
||||||
|
bin
|
||||||
|
claude.sh
|
||||||
|
grok.sh
|
||||||
|
ollama.sh
|
||||||
|
4
AppRun
Executable file
4
AppRun
Executable file
@ -0,0 +1,4 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
HERE="$(dirname "$(readlink -f "$0")")"
|
||||||
|
export LD_LIBRARY_PATH="$HERE/usr/lib:$LD_LIBRARY_PATH"
|
||||||
|
exec "$HERE/usr/bin/r" "$@"
|
29
Makefile
29
Makefile
@ -1,8 +1,8 @@
|
|||||||
all: build build_rd build_free build_rpylib run build_mingw
|
all: build build_rpylib run build_mingw
|
||||||
|
|
||||||
# Variables for compiler and flags
|
# Variables for compiler and flags
|
||||||
CC = gcc
|
CC = gcc
|
||||||
CFLAGS = -Ofast -Werror -Wall -lreadline -lncurses -lcurl -lssl -lcrypto -ljson-c -lm -lsqlite3
|
CFLAGS = -Ofast -Werror -Wall -lreadline -lncurses -lcurl -lgnutls -ljson-c -lsqlite3 -lm $(pkg-config --cflags --libs gnutls gmp) -lnettle -lssl -lcrypto
|
||||||
|
|
||||||
# MinGW Variables
|
# MinGW Variables
|
||||||
MINGW_CC = x86_64-w64-mingw32-gcc # Change to x86_64-w64-mingw32-gcc for 64-bit
|
MINGW_CC = x86_64-w64-mingw32-gcc # Change to x86_64-w64-mingw32-gcc for 64-bit
|
||||||
@ -10,17 +10,24 @@ MINGW_CFLAGS = -Ofast -Werror -Wall -lreadline -lcurl -lssl -lcrypto -ljson-c -l
|
|||||||
|
|
||||||
# Targets
|
# Targets
|
||||||
build:
|
build:
|
||||||
$(CC) main.c $(CFLAGS) -o r
|
$(CC) main.c $(CFLAGS) -o bin/r
|
||||||
|
-@rm -rf AppImage
|
||||||
|
mkdir -p AppImage
|
||||||
|
mkdir -p AppImage/usr
|
||||||
|
mkdir -p AppImage/usr/bin
|
||||||
|
mkdir -p AppImage/lib
|
||||||
|
cp AppRun AppImage/AppRun
|
||||||
|
cp r.desktop AppImage/r.desktop
|
||||||
|
cp r.png AppImage/r.png
|
||||||
|
cp bin/r AppImage/usr/bin/r
|
||||||
|
./collect_so_files.sh
|
||||||
|
#./prepare_app_image AppImage/usr/bin/r AppImage
|
||||||
|
appimagetool-x86_64.AppImage AppImage
|
||||||
|
mv r-x86_64.AppImage r
|
||||||
|
|
||||||
|
publish:
|
||||||
-@publish r
|
-@publish r
|
||||||
|
|
||||||
build_free:
|
|
||||||
$(CC) -DOLLAMA main.c $(CFLAGS) -o rf
|
|
||||||
@publish rf
|
|
||||||
|
|
||||||
build_rd:
|
|
||||||
$(CC) -DRD main.c $(CFLAGS) -o rd
|
|
||||||
publish rd
|
|
||||||
|
|
||||||
build_rpylib:
|
build_rpylib:
|
||||||
$(CC) -shared -o rpylib.so -fPIC rpylib.c -lpython3.12 `python3-config --includes` -I/usr/include/CL -ljson-c -lcurl -lsqlite3
|
$(CC) -shared -o rpylib.so -fPIC rpylib.c -lpython3.12 `python3-config --includes` -I/usr/include/CL -ljson-c -lcurl -lsqlite3
|
||||||
publish rpylib.so
|
publish rpylib.so
|
||||||
|
27
collect_so_files.sh
Executable file
27
collect_so_files.sh
Executable file
@ -0,0 +1,27 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
# Script: collect_so_files.sh
|
||||||
|
|
||||||
|
BINARY="AppImage/usr/bin/r"
|
||||||
|
LIB_DIR="AppImage/usr/lib"
|
||||||
|
mkdir -p "$LIB_DIR"
|
||||||
|
|
||||||
|
# Function to copy a library and its dependencies
|
||||||
|
copy_with_deps() {
|
||||||
|
local lib="$1"
|
||||||
|
if [ -f "$lib" ] && [ ! -f "$LIB_DIR/$(basename "$lib")" ]; then
|
||||||
|
cp "$lib" "$LIB_DIR/"
|
||||||
|
echo "Copied: $lib"
|
||||||
|
# Recursively check dependencies of this library
|
||||||
|
ldd "$lib" | grep -o '/[^ ]\+' | while read -r dep; do
|
||||||
|
if [ -f "$dep" ]; then
|
||||||
|
copy_with_deps "$dep"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# Start with the binary’s dependencies
|
||||||
|
ldd "$BINARY" | grep -o '/[^ ]\+' | while read -r lib; do
|
||||||
|
copy_with_deps "$lib"
|
||||||
|
done
|
||||||
|
|
6
r.desktop
Normal file
6
r.desktop
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
[Desktop Entry]
|
||||||
|
Name=r
|
||||||
|
Exec=usr/bin/r
|
||||||
|
Type=Application
|
||||||
|
Icon=r
|
||||||
|
Categories=Utility;
|
1
tools.h
1
tools.h
@ -368,6 +368,7 @@ char *tool_function_linux_terminal(char *command) {
|
|||||||
perror("popen failed");
|
perror("popen failed");
|
||||||
return strdup("Popen failed!");
|
return strdup("Popen failed!");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
while (fgets(buffer, sizeof(buffer), fp) != NULL) {
|
while (fgets(buffer, sizeof(buffer), fp) != NULL) {
|
||||||
size_t chunk_size = strlen(buffer);
|
size_t chunk_size = strlen(buffer);
|
||||||
|
Loading…
Reference in New Issue
Block a user