tuxpaint: Fix unresolved symbols in plugins

This commit is contained in:
Tee KOBAYASHI 2022-05-04 20:38:16 +09:00 committed by xtkoba
parent 3507f1c5b3
commit c6b83d6cd3
3 changed files with 175 additions and 0 deletions

View File

@ -83,3 +83,21 @@
@# FIXME: The other man pages aren't localizable yet -bjk 2021.08.14
# Install the support files for macOS application bundle
@@ -1332,7 +1318,7 @@
macos_MAGIC_SDL_LIBS:=-L/usr/local/lib $(shell $(PKG_CONFIG) $(SDL_PCNAME) --libs) -lSDL_image -lSDL_ttf $(SDL_MIXER_LIB)
ios_MAGIC_SDL_LIBS:=$(shell $(PKG_CONFIG) $(SDL_PCNAME) --libs) -lSDL_image -lSDL_ttf $(SDL_MIXER_LIB)
beos_MAGIC_SDL_LIBS:=-L/usr/local/lib $(shell $(PKG_CONFIG) $(SDL_PCNAME) --libs) -lSDL_image -lSDL_ttf $(SDL_MIXER_LIB)
-linux_MAGIC_SDL_LIBS:=-L/usr/local/lib $(shell $(PKG_CONFIG) $(SDL_PCNAME) --libs) -lSDL_image -lSDL_ttf $(SDL_MIXER_LIB)
+linux_MAGIC_SDL_LIBS:=-L@TERMUX_PREFIX@/lib $(shell $(PKG_CONFIG) $(SDL_PCNAME) --libs) -lSDL_image -lSDL_ttf $(SDL_MIXER_LIB)
MAGIC_SDL_LIBS:=$($(OS)_MAGIC_SDL_LIBS)
windows_MAGIC_ARCH_LINKS=-lintl $(PNG)
@@ -1346,7 +1332,7 @@
macos_PLUGIN_LIBS:=$(MAGIC_SDL_LIBS) $(MAGIC_ARCH_LINKS)
ios_PLUGIN_LIBS:=$(MAGIC_SDL_LIBS) $(MAGIC_ARCH_LINKS)
beos_PLUGIN_LIBS:="$(MAGIC_SDL_LIBS) $(MAGIC_ARCH_LINKS) $(MAGIC_SDL_CPPFLAGS)"
-linux_PLUGIN_LIBS:=
+linux_PLUGIN_LIBS:=$(MAGIC_SDL_LIBS)
PLUGIN_LIBS:=$($(OS)_PLUGIN_LIBS)
#MAGIC_CFLAGS:=-g3 -O2 -fvisibility=hidden -fno-common -W -Wstrict-prototypes -Wmissing-prototypes -Wall $(MAGIC_SDL_CPPFLAGS) -Isrc/

View File

@ -3,6 +3,7 @@ TERMUX_PKG_DESCRIPTION="A free, award-winning drawing program for children ages
TERMUX_PKG_LICENSE="GPL-2.0"
TERMUX_PKG_MAINTAINER="@termux"
TERMUX_PKG_VERSION=0.9.27
TERMUX_PKG_REVISION=1
TERMUX_PKG_SRCURL=https://downloads.sourceforge.net/tuxpaint/tuxpaint-${TERMUX_PKG_VERSION}.tar.gz
TERMUX_PKG_SHA256=ab2b80e89df88228cd0ec0a6c90b49d543cb157aa38fb90cbd3a29f00140557a
TERMUX_PKG_DEPENDS="fribidi, glib, libandroid-wordexp, libcairo, libimagequant, libpaper, libpng, librsvg, sdl, sdl-gfx, sdl-image, sdl-mixer, sdl-pango, sdl-ttf, tuxpaint-data, zlib"

View File

@ -0,0 +1,156 @@
--- a/magic/src/confetti.c
+++ b/magic/src/confetti.c
@@ -31,8 +31,8 @@
void confetti_release(magic_api * api, int which,
SDL_Surface * canvas, SDL_Surface * snapshot, int x, int y, SDL_Rect * update_rect);
void confetti_shutdown(magic_api * api);
-inline char confetti_get_greater(const char what1, const char what2);
-inline char confetti_get_lesser(const char what1, const char what2);
+static inline char confetti_get_greater(const char what1, const char what2);
+static inline char confetti_get_lesser(const char what1, const char what2);
Uint32 confetti_get_new_color(void *ptr, SDL_Surface * canvas);
void confetti_click(magic_api * api, int which, int mode,
SDL_Surface * canvas, SDL_Surface * last, int x, int y, SDL_Rect * update_rect);
@@ -116,7 +116,7 @@
//private functions
-inline char confetti_get_greater(const char what1, const char what2)
+static inline char confetti_get_greater(const char what1, const char what2)
{
if (what1 > what2)
return what1;
@@ -124,7 +124,7 @@
return what2;
}
-inline char confetti_get_lesser(const char what1, const char what2)
+static inline char confetti_get_lesser(const char what1, const char what2)
{
if (what1 < what2)
return what1;
--- a/magic/src/fold.c
+++ b/magic/src/fold.c
@@ -60,7 +60,7 @@
void fold_drag(magic_api * api, int which, SDL_Surface * canvas,
SDL_Surface * snapshot, int ox, int oy, int x, int y, SDL_Rect * update_rect);
void fold_switchin(magic_api * api, int which, int mode, SDL_Surface * canvas);
-inline Uint8 fold_what_corner(int x, int y, SDL_Surface * canvas);
+static inline Uint8 fold_what_corner(int x, int y, SDL_Surface * canvas);
void fold_switchout(magic_api * api, int which, int mode, SDL_Surface * canvas);
Uint32 fold_api_version(void)
@@ -388,7 +388,7 @@
// Interactivity functions
-inline Uint8 fold_what_corner(int x, int y, SDL_Surface * canvas)
+static inline Uint8 fold_what_corner(int x, int y, SDL_Surface * canvas)
{
if (x >= canvas->w / 2)
{
--- a/magic/src/fretwork.c
+++ b/magic/src/fretwork.c
@@ -31,7 +31,7 @@
Mix_Chunk *fretwork_snd;
unsigned int img_w, img_h;
unsigned int fretwork_segments_x, fretwork_segments_y; //how many segments do we have?
-inline int fretwork_math_ceil(int x, int y); //ceil() in cstdlib returns float and is relative slow, so we'll use our one
+static inline int fretwork_math_ceil(int x, int y); //ceil() in cstdlib returns float and is relative slow, so we'll use our one
static Uint8 *fretwork_status_of_segments; //a place to store an info about bitmap used for selected segment
static char **fretwork_images; //the pathes to all the images needed
static unsigned int fretwork_segment_modified; //which segment was modified this time?
@@ -66,7 +66,7 @@
void fretwork_shutdown(magic_api * api);
void fretwork_switchin(magic_api * api, int which, int mode, SDL_Surface * canvas, SDL_Surface * snapshot);
void fretwork_switchout(magic_api * api, int which, int mode, SDL_Surface * canvas, SDL_Surface * snapshot);
-inline void fretwork_extract_coords_from_segment(unsigned int segment, Sint16 * x, Sint16 * y);
+static inline void fretwork_extract_coords_from_segment(unsigned int segment, Sint16 * x, Sint16 * y);
void fretwork_click(magic_api * api, int which, int mode,
SDL_Surface * canvas, SDL_Surface * snapshot, int x, int y, SDL_Rect * update_rect);
@@ -75,7 +75,7 @@
void fretwork_drag(magic_api * api, int which, SDL_Surface * canvas,
SDL_Surface * snapshot, int ox, int oy, int x, int y, SDL_Rect * update_rect);
static void fretwork_draw_wrapper(void *ptr, int which, SDL_Surface * canvas, SDL_Surface * last, int x, int y);
-inline unsigned int fretwork_get_segment(int x, int y);
+static inline unsigned int fretwork_get_segment(int x, int y);
SDL_Surface *fretwork_one, *fretwork_three, *fretwork_four, *fretwork_corner;
@@ -251,7 +251,7 @@
// Interactivity functions
-inline int fretwork_math_ceil(int x, int y)
+static inline int fretwork_math_ceil(int x, int y)
{
int temp;
@@ -262,7 +262,7 @@
return temp;
}
-inline unsigned int fretwork_get_segment(int x, int y)
+static inline unsigned int fretwork_get_segment(int x, int y)
{
int xx; //segments are numerated just like pixels
int yy; //in computer graphics: left upper (=1), ... ,right upper,
@@ -274,7 +274,7 @@
return (yy - 1) * fretwork_segments_x + xx;
}
-inline void fretwork_extract_coords_from_segment(unsigned int segment, Sint16 * x, Sint16 * y)
+static inline void fretwork_extract_coords_from_segment(unsigned int segment, Sint16 * x, Sint16 * y)
{
*x = ((segment % fretwork_segments_x) - 1) * img_w; //useful to set update_rect as small as possible
*y = (int)(segment / fretwork_segments_x) * img_h;
--- a/magic/src/rails.c
+++ b/magic/src/rails.c
@@ -25,7 +25,7 @@
Mix_Chunk *rails_snd;
unsigned int img_w, img_h;
unsigned int rails_segments_x, rails_segments_y; //how many segments do we have?
-inline int rails_math_ceil(int x, int y); //ceil() in cstdlib returns float and is relative slow, so we'll use our one
+static inline int rails_math_ceil(int x, int y); //ceil() in cstdlib returns float and is relative slow, so we'll use our one
static Uint8 *rails_status_of_segments; //a place to store an info about bitmap used for selected segment
static char **rails_images; //the pathes to all the images needed
static unsigned int rails_segment_modified; //which segment was modified this time?
@@ -53,8 +53,8 @@
void rails_shutdown(magic_api * api);
void rails_switchin(magic_api * api, int which, int mode, SDL_Surface * canvas);
void rails_switchout(magic_api * api, int which, int mode, SDL_Surface * canvas);
-inline unsigned int rails_get_segment(int x, int y);
-inline void rails_extract_coords_from_segment(unsigned int segment, Sint16 * x, Sint16 * y);
+static inline unsigned int rails_get_segment(int x, int y);
+static inline void rails_extract_coords_from_segment(unsigned int segment, Sint16 * x, Sint16 * y);
static void rails_flip(void *ptr, SDL_Surface * dest, SDL_Surface * src);
static void rails_flip_flop(void *ptr, SDL_Surface * dest, SDL_Surface * src);
static void rails_rotate(void *ptr, SDL_Surface * dest, SDL_Surface * src, unsigned int direction);
@@ -199,7 +199,7 @@
// Interactivity functions
-inline int rails_math_ceil(int x, int y)
+static inline int rails_math_ceil(int x, int y)
{
int temp;
@@ -211,7 +211,7 @@
return temp;
}
-inline unsigned int rails_get_segment(int x, int y)
+static inline unsigned int rails_get_segment(int x, int y)
{
int xx; //segments are numerated just like pixels
int yy; //in computer graphics: left upper (=1), ... ,right upper,
@@ -224,7 +224,7 @@
}
-inline void rails_extract_coords_from_segment(unsigned int segment, Sint16 * x, Sint16 * y)
+static inline void rails_extract_coords_from_segment(unsigned int segment, Sint16 * x, Sint16 * y)
{ //extracts the coords of the beginning and the segment
*x = ((segment % rails_segments_x) - 1) * img_w; //useful to set update_rect as small as possible
*y = (int)(segment / rails_segments_x) * img_h;