Skip to content

Commit

Permalink
Merge pull request #145 from chrisws/12_24
Browse files Browse the repository at this point in the history
12 24
  • Loading branch information
chrisws committed Jun 4, 2022
2 parents c410df4 + b085b21 commit 7634e03
Show file tree
Hide file tree
Showing 12 changed files with 101 additions and 7 deletions.
7 changes: 7 additions & 0 deletions src/common/plugins.c
Expand Up @@ -210,6 +210,13 @@ static int slib_find_path(char *path, const char *file) {
result = sys_search_path(rel_path, file, path);
}
}
// find in AppImage
if (!result && getenv("APPDIR")) {
char rel_path[PATH_SIZE];
strlcpy(rel_path, getenv("APPDIR"), PATH_SIZE);
strlcat(rel_path, "/usr/lib", PATH_SIZE);
result = sys_search_path(rel_path, file, path);
}
// find in modpath
if (!result && opt_modpath[0]) {
result = sys_search_path(opt_modpath, file, path);
Expand Down
Expand Up @@ -792,7 +792,7 @@ private String getExternalStorage() {
} else if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
// https://commonsware.com/blog/2019/06/07/death-external-storage-end-saga.html
File[] dirs = getExternalMediaDirs();
result = dirs[0].getAbsolutePath();
result = dirs != null && dirs.length > 0 ? dirs[0].getAbsolutePath() : getInternalStorage();
} else {
result = getInternalStorage();
}
Expand Down
2 changes: 1 addition & 1 deletion src/platform/android/jni/display.cpp
Expand Up @@ -86,7 +86,7 @@ void Canvas::fillRect(int left, int top, int width, int height, pixel_t drawColo
break;
} else if (posY >= dtY) {
pixel_t *line = getLine(posY);
for (int x = 0; x < width; x++) {
for (int x = 0; x < width && line; x++) {
int posX = x + left;
if (posX == _w) {
break;
Expand Down
7 changes: 6 additions & 1 deletion src/platform/console/Makefile.am
@@ -1,5 +1,5 @@
# SmallBASIC command line version
# Copyright(C) 2001-2018 Chris Warren-Smith.
# Copyright(C) 2001-2022 Chris Warren-Smith.
#
# This program is distributed under the terms of the GPL v2.0 or later
# Download the GNU Public License (GPL) from www.gnu.org
Expand All @@ -25,6 +25,11 @@ endif

sbasic_DEPENDENCIES = $(top_srcdir)/src/common/libsb_common.a

iconsdir = $(datadir)/icons/hicolor/128x128/apps
icons_DATA = ../../../images/sb-desktop-128x128.png
desktopdir = $(datadir)/applications
desktop_DATA = io.github.smallbasic.desktop

TEST_DIR=../../../samples/distro-examples/tests
UNIT_TESTS=array break byref eval-test iifs matrices metaa ongoto \
uds hash pass1 call_tau short-circuit strings stack-test \
Expand Down
24 changes: 24 additions & 0 deletions src/platform/console/io.github.smallbasic.appdata.xml
@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<component type="desktop-application">
<id>io.github.smallbasic</id>
<name>SmallBASIC</name>
<summary>SmallBASIC is a fast and easy to learn BASIC language interpreter ideal for everyday calculations, scripts and prototypes</summary>
<metadata_license>MIT</metadata_license>
<project_license>GPL-2.0-or-later</project_license>
<description>
<p>
SmallBASIC is a fast and easy to learn BASIC language interpreter ideal for everyday calculations, scripts and prototypes.
SmallBASIC includes trigonometric, matrices and algebra functions, a built in IDE, a powerful string library, system,
sound, and graphic commands along with structured programming syntax. SmallBASIC is licensed under the GPL.
</p>
</description>
<launchable type="desktop-id">io.github.smallbasic.desktop</launchable>
<screenshots>
<screenshot type="default">
<image>https://smallbasic.github.io/images/screenshots/sbasic.png</image>
</screenshot>
<screenshot>
<image>https://smallbasic.github.io/images/screenshots/gold.png</image>
</screenshot>
</screenshots>
</component>
10 changes: 10 additions & 0 deletions src/platform/console/io.github.smallbasic.desktop
@@ -0,0 +1,10 @@
[Desktop Entry]
Name=SmallBASIC
Exec=sbasic
Icon=sb-desktop-128x128
Terminal=true
Type=Application
Categories=Development
MimeType=application/bas
NoDisplay=false

2 changes: 1 addition & 1 deletion src/platform/fltk/Makefile.am
Expand Up @@ -49,7 +49,7 @@ sbasici_DEPENDENCIES = $(top_srcdir)/src/common/libsb_common.a
iconsdir = $(datadir)/icons/hicolor/128x128/apps
icons_DATA = ../../../images/sb-desktop-128x128.png
desktopdir = $(datadir)/applications
desktop_DATA = smallbasic.desktop
desktop_DATA = io.github.smallbasic.desktop

if WITH_WIN32
sbasici_LDADD += win.res
Expand Down
24 changes: 24 additions & 0 deletions src/platform/fltk/io.github.smallbasic.appdata.xml
@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<component type="desktop-application">
<id>io.github.smallbasic</id>
<name>SmallBASIC</name>
<summary>SmallBASIC is a fast and easy to learn BASIC language interpreter ideal for everyday calculations, scripts and prototypes</summary>
<metadata_license>MIT</metadata_license>
<project_license>GPL-2.0-or-later</project_license>
<description>
<p>
SmallBASIC is a fast and easy to learn BASIC language interpreter ideal for everyday calculations, scripts and prototypes.
SmallBASIC includes trigonometric, matrices and algebra functions, a built in IDE, a powerful string library, system,
sound, and graphic commands along with structured programming syntax. SmallBASIC is licensed under the GPL.
</p>
</description>
<launchable type="desktop-id">io.github.smallbasic.desktop</launchable>
<screenshots>
<screenshot type="default">
<image>https://smallbasic.github.io/images/screenshots/sbasici.png</image>
</screenshot>
<screenshot>
<image>https://smallbasic.github.io/images/screenshots/bb.gif</image>
</screenshot>
</screenshots>
</component>
Expand Up @@ -4,6 +4,6 @@ Exec=sbasici
Icon=sb-desktop-128x128
Terminal=false
Type=Application
Categories=Development;
Categories=Development
MimeType=application/bas
NoDisplay=false
2 changes: 1 addition & 1 deletion src/platform/sdl/Makefile.am
Expand Up @@ -38,7 +38,7 @@ sbasicg_DEPENDENCIES = $(top_srcdir)/src/common/libsb_common.a
iconsdir = $(datadir)/icons/hicolor/128x128/apps
icons_DATA = ../../../images/sb-desktop-128x128.png
desktopdir = $(datadir)/applications
desktop_DATA = smallbasic.desktop
desktop_DATA = io.github.smallbasic.desktop

if WITH_WIN32
sbasicg_LDADD += win.res
Expand Down
24 changes: 24 additions & 0 deletions src/platform/sdl/io.github.smallbasic.appdata.xml
@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<component type="desktop-application">
<id>io.github.smallbasic</id>
<name>SmallBASIC</name>
<summary>SmallBASIC is a fast and easy to learn BASIC language interpreter ideal for everyday calculations, scripts and prototypes</summary>
<metadata_license>MIT</metadata_license>
<project_license>GPL-2.0-or-later</project_license>
<description>
<p>
SmallBASIC is a fast and easy to learn BASIC language interpreter ideal for everyday calculations, scripts and prototypes.
SmallBASIC includes trigonometric, matrices and algebra functions, a built in IDE, a powerful string library, system,
sound, and graphic commands along with structured programming syntax. SmallBASIC is licensed under the GPL.
</p>
</description>
<launchable type="desktop-id">io.github.smallbasic.desktop</launchable>
<screenshots>
<screenshot type="default">
<image>https://smallbasic.github.io/images/screenshots/sbasicg.png</image>
</screenshot>
<screenshot>
<image>https://smallbasic.github.io/images/screenshots/bowling.png</image>
</screenshot>
</screenshots>
</component>
Expand Up @@ -4,6 +4,6 @@ Exec=sbasicg
Icon=sb-desktop-128x128
Terminal=false
Type=Application
Categories=Development;
Categories=Development
MimeType=application/bas
NoDisplay=false

0 comments on commit 7634e03

Please sign in to comment.