From efbdb54cce0b988a462180aa9357cd047355c468 Mon Sep 17 00:00:00 2001
From: Bill Kendrick
Date: Sun, 21 Mar 2021 12:21:59 -0700
Subject: [PATCH 1/9] Refresh docs after typo fix in OPTIONS
h/t Pere (https://sourceforge.net/p/tuxpaint/tuxpaint-docs/ci/a705453ca77762be42912dc692e48bd3e435afba/)
---
docs/en/OPTIONS.txt | 2 +-
docs/en/README.txt | 2 +-
docs/en/html/OPTIONS.html | 2 +-
docs/en/html/README.html | 2 +-
docs/es_ES.UTF-8/OPTIONS.txt | 2 +-
docs/es_ES.UTF-8/README.txt | 2 +-
docs/es_ES.UTF-8/html/OPTIONS.html | 2 +-
docs/es_ES.UTF-8/html/README.html | 2 +-
docs/fr_FR.UTF-8/OPTIONS.txt | 2 +-
docs/fr_FR.UTF-8/README.txt | 2 +-
docs/fr_FR.UTF-8/html/OPTIONS.html | 2 +-
docs/fr_FR.UTF-8/html/README.html | 2 +-
docs/gl_ES.UTF-8/README.txt | 2 +-
docs/gl_ES.UTF-8/html/README.html | 2 +-
docs/ja_JP.UTF-8/README.txt | 2 +-
docs/ja_JP.UTF-8/html/README.html | 2 +-
16 files changed, 16 insertions(+), 16 deletions(-)
diff --git a/docs/en/OPTIONS.txt b/docs/en/OPTIONS.txt
index 0515335a3..9192a1aa8 100644
--- a/docs/en/OPTIONS.txt
+++ b/docs/en/OPTIONS.txt
@@ -581,7 +581,7 @@ Windows Users
* [F4] jump mouse between "Tools", "Colors" and canvas
areas
* If mouse is within "Tools" section on the left, or
- "Colors" secton at the bottom:
+ "Colors" section at the bottom:
* [F7], [F8]: Move down/up between buttons,
respectively (Tools section, only)
* [F11], [F12]: Move to previous/next button,
diff --git a/docs/en/README.txt b/docs/en/README.txt
index 22fc665e0..0c8c25878 100644
--- a/docs/en/README.txt
+++ b/docs/en/README.txt
@@ -883,7 +883,7 @@ Using the import script, "tuxpaint-import"
Example:
$ tuxpaint-import grandma.jpg
- grandma.jpg -> /home/username/.tuxpaint/saved/20210311223141.png
+ grandma.jpg -> /home/username/.tuxpaint/saved/20210321122132.png
jpegtopnm: WRITING A PPM FILE
The first line ("tuxpaint-import grandma.jpg") is the command to run.
diff --git a/docs/en/html/OPTIONS.html b/docs/en/html/OPTIONS.html
index fe6be1fb9..e4fc81cb9 100644
--- a/docs/en/html/OPTIONS.html
+++ b/docs/en/html/OPTIONS.html
@@ -847,7 +847,7 @@ b>Label tools.
[F4] jump mouse between "Tools", "Colors" and canvas areas
- If mouse is within "Tools" section on the left, or "Colors" secton at the bottom:
+ - If mouse is within "Tools" section on the left, or "Colors" section at the bottom:
- [F7], [F8]: Move down/up between buttons, respectively (Tools section, only)
- [F11], [F12]: Move to previous/next button, respectively
diff --git a/docs/en/html/README.html b/docs/en/html/README.html
index 8d98618eb..17513d98c 100644
--- a/docs/en/html/README.html
+++ b/docs/en/html/README.html
@@ -1308,7 +1308,7 @@
$ tuxpaint-import grandma.jpg
grandma.jpg ->
- /home/username/.tuxpaint/saved/20210311223141.png
+ /home/username/.tuxpaint/saved/20210321122132.png
jpegtopnm: WRITING A PPM FILE
diff --git a/docs/es_ES.UTF-8/OPTIONS.txt b/docs/es_ES.UTF-8/OPTIONS.txt
index c10a620c7..762b5e456 100644
--- a/docs/es_ES.UTF-8/OPTIONS.txt
+++ b/docs/es_ES.UTF-8/OPTIONS.txt
@@ -581,7 +581,7 @@ Windows Users
* [F4] jump mouse between "Tools", "Colors" and canvas
areas
* If mouse is within "Tools" section on the left, or
- "Colors" secton at the bottom:
+ "Colors" section at the bottom:
* [F7], [F8]: Move down/up between buttons,
respectively (Tools section, only)
* [F11], [F12]: Move to previous/next button,
diff --git a/docs/es_ES.UTF-8/README.txt b/docs/es_ES.UTF-8/README.txt
index e8607a7b3..de21ab38b 100644
--- a/docs/es_ES.UTF-8/README.txt
+++ b/docs/es_ES.UTF-8/README.txt
@@ -883,7 +883,7 @@ Using the import script, "tuxpaint-import"
Example:
$ tuxpaint-import grandma.jpg
- grandma.jpg -> /home/username/.tuxpaint/saved/20210309212248.png
+ grandma.jpg -> /home/username/.tuxpaint/saved/20210321122132.png
jpegtopnm: WRITING A PPM FILE
The first line ("tuxpaint-import grandma.jpg") is the command to run.
diff --git a/docs/es_ES.UTF-8/html/OPTIONS.html b/docs/es_ES.UTF-8/html/OPTIONS.html
index de780cf9f..6069542fb 100644
--- a/docs/es_ES.UTF-8/html/OPTIONS.html
+++ b/docs/es_ES.UTF-8/html/OPTIONS.html
@@ -847,7 +847,7 @@ b>Label tools.
- [F4] jump mouse between "Tools", "Colors" and canvas areas
- - If mouse is within "Tools" section on the left, or "Colors" secton at the bottom:
+ - If mouse is within "Tools" section on the left, or "Colors" section at the bottom:
- [F7], [F8]: Move down/up between buttons, respectively (Tools section, only)
- [F11], [F12]: Move to previous/next button, respectively
diff --git a/docs/es_ES.UTF-8/html/README.html b/docs/es_ES.UTF-8/html/README.html
index 1c3222181..5d6f50946 100644
--- a/docs/es_ES.UTF-8/html/README.html
+++ b/docs/es_ES.UTF-8/html/README.html
@@ -1308,7 +1308,7 @@
$ tuxpaint-import grandma.jpg
grandma.jpg ->
- /home/username/.tuxpaint/saved/20210309212248.png
+ /home/username/.tuxpaint/saved/20210321122132.png
jpegtopnm: WRITING A PPM FILE
diff --git a/docs/fr_FR.UTF-8/OPTIONS.txt b/docs/fr_FR.UTF-8/OPTIONS.txt
index ea138b7d7..a75ac586a 100644
--- a/docs/fr_FR.UTF-8/OPTIONS.txt
+++ b/docs/fr_FR.UTF-8/OPTIONS.txt
@@ -581,7 +581,7 @@ Windows Users
* [F4] jump mouse between "Tools", "Colors" and canvas
areas
* If mouse is within "Tools" section on the left, or
- "Colors" secton at the bottom:
+ "Colors" section at the bottom:
* [F7], [F8]: Move down/up between buttons,
respectively (Tools section, only)
* [F11], [F12]: Move to previous/next button,
diff --git a/docs/fr_FR.UTF-8/README.txt b/docs/fr_FR.UTF-8/README.txt
index c40ebacf0..47a9ee8df 100644
--- a/docs/fr_FR.UTF-8/README.txt
+++ b/docs/fr_FR.UTF-8/README.txt
@@ -883,7 +883,7 @@ Using the import script, "tuxpaint-import"
Example:
$ tuxpaint-import grandma.jpg
- grandma.jpg -> /home/username/.tuxpaint/saved/20210309212248.png
+ grandma.jpg -> /home/username/.tuxpaint/saved/20210321122132.png
jpegtopnm: WRITING A PPM FILE
The first line ("tuxpaint-import grandma.jpg") is the command to run.
diff --git a/docs/fr_FR.UTF-8/html/OPTIONS.html b/docs/fr_FR.UTF-8/html/OPTIONS.html
index 26515f2b9..6bdb0e301 100644
--- a/docs/fr_FR.UTF-8/html/OPTIONS.html
+++ b/docs/fr_FR.UTF-8/html/OPTIONS.html
@@ -847,7 +847,7 @@ b>Label tools.
- [F4] jump mouse between "Tools", "Colors" and canvas areas
- - If mouse is within "Tools" section on the left, or "Colors" secton at the bottom:
+ - If mouse is within "Tools" section on the left, or "Colors" section at the bottom:
- [F7], [F8]: Move down/up between buttons, respectively (Tools section, only)
- [F11], [F12]: Move to previous/next button, respectively
diff --git a/docs/fr_FR.UTF-8/html/README.html b/docs/fr_FR.UTF-8/html/README.html
index 44ebfe1bc..d5b14f44f 100644
--- a/docs/fr_FR.UTF-8/html/README.html
+++ b/docs/fr_FR.UTF-8/html/README.html
@@ -1308,7 +1308,7 @@
$ tuxpaint-import grandma.jpg
grandma.jpg ->
- /home/username/.tuxpaint/saved/20210309212248.png
+ /home/username/.tuxpaint/saved/20210321122132.png
jpegtopnm: WRITING A PPM FILE
diff --git a/docs/gl_ES.UTF-8/README.txt b/docs/gl_ES.UTF-8/README.txt
index d3b71612e..7f0eed74a 100644
--- a/docs/gl_ES.UTF-8/README.txt
+++ b/docs/gl_ES.UTF-8/README.txt
@@ -913,7 +913,7 @@ Uso do script de importación, «tuxpaint-import»
Exemplo:
$ tuxpaint-import avoa.jpg
- avoa.jpg -> /home/username/.tuxpaint/saved/20210310223855.png
+ avoa.jpg -> /home/username/.tuxpaint/saved/20210321122132.png
jpegtopnm: WRITING A PPM FILE
A primeira liña («tuxpaint-import avoa.jpg») é a orde a executar. As
diff --git a/docs/gl_ES.UTF-8/html/README.html b/docs/gl_ES.UTF-8/html/README.html
index c498364e3..27402ece2 100644
--- a/docs/gl_ES.UTF-8/html/README.html
+++ b/docs/gl_ES.UTF-8/html/README.html
@@ -1308,7 +1308,7 @@
$ tuxpaint-import avoa.jpg
avoa.jpg ->
- /home/username/.tuxpaint/saved/20210310223855.png
+ /home/username/.tuxpaint/saved/20210321122132.png
jpegtopnm: WRITING A PPM FILE
diff --git a/docs/ja_JP.UTF-8/README.txt b/docs/ja_JP.UTF-8/README.txt
index 2cec4ce7a..9ef3ee493 100644
--- a/docs/ja_JP.UTF-8/README.txt
+++ b/docs/ja_JP.UTF-8/README.txt
@@ -617,7 +617,7 @@ Tux Paint の起動
Example:
$ tuxpaint-import おばあちゃん.jpg
- おばあちゃん.jpg -> /home/username/.tuxpaint/saved/20210310223804.png
+ おばあちゃん.jpg -> /home/username/.tuxpaint/saved/20210321122132.png
jpegtopnm: WRITING A PPM FILE
1行目 ("tuxpaint-import おばあちゃん.jpg") が実行するコマンドで、続く2行がプログラムの実行中の出力です。
diff --git a/docs/ja_JP.UTF-8/html/README.html b/docs/ja_JP.UTF-8/html/README.html
index 9290887ca..952971961 100644
--- a/docs/ja_JP.UTF-8/html/README.html
+++ b/docs/ja_JP.UTF-8/html/README.html
@@ -1308,7 +1308,7 @@
$ tuxpaint-import おばあちゃん.jpg
おばあちゃん.jpg ->
- /home/username/.tuxpaint/saved/20210310223804.png
+ /home/username/.tuxpaint/saved/20210321122132.png
jpegtopnm: WRITING A PPM FILE
From 39cc096ecec3eccff05f8c040ede0fb1df4c2c13 Mon Sep 17 00:00:00 2001
From: Mark Kim
Date: Sun, 21 Mar 2021 20:46:03 -0400
Subject: [PATCH 2/9] iOS port initial commit
Known Issues
------------
- No printing support.
- No typing support using the OS virtual keyboard. iOS needs to be signalled
to bring up the virtual keyboard when the text tool is active. We also may
need to do some finagling to make IM work with the virtual keyboard.
- OS language detection doesn't work yet.
- Quitting doesn't close the app. It just displays a black screen until it is
force-closed.
- Need to include cross-compilation instructions.
Possible Issues
---------------
- No text display. This is likely an issue with how pango and related
libraries were cross-compiled rather than an issue with Tux Paint code. From
the error output it appears to be a font rendering issue.
- SVG integration couldn't be tested because RSVG library has not yet be
cross-compiled successfully.
- Only tested under the iOS Simulator (and not on an actual iOS device yet.)
---
Makefile | 152 +++++++++++++++++++++++++++++++++++-------
ios/Info.plist | 39 +++++++++++
ios/PkgInfo | 1 +
ios/Splash.png | Bin 0 -> 91003 bytes
ios/Splash.storyboard | 40 +++++++++++
ios/tuxpaint.cfg | 4 ++
ios/tuxpaint.icns | Bin 0 -> 100268 bytes
src/fonts.c | 9 ++-
src/ios.c | 46 +++++++++++++
src/ios.h | 30 +++++++++
src/ios_print.h | 32 +++++++++
src/ios_print.m | 39 +++++++++++
src/macos.c | 32 +++++++--
src/macos.h | 27 +++++++-
src/platform.h | 45 +++++++++++++
src/tuxpaint.c | 35 ++++++----
16 files changed, 482 insertions(+), 49 deletions(-)
create mode 100644 ios/Info.plist
create mode 100644 ios/PkgInfo
create mode 100644 ios/Splash.png
create mode 100644 ios/Splash.storyboard
create mode 100644 ios/tuxpaint.cfg
create mode 100644 ios/tuxpaint.icns
create mode 100644 src/ios.c
create mode 100644 src/ios.h
create mode 100644 src/ios_print.h
create mode 100644 src/ios_print.m
create mode 100644 src/platform.h
diff --git a/Makefile b/Makefile
index a3d5fbb88..6566f17d4 100644
--- a/Makefile
+++ b/Makefile
@@ -38,6 +38,12 @@ else
ifeq ($(SYSNAME),Darwin)
OS:=macos
GPERF:=/usr/bin/gperf
+
+ CC:=$(shell xcrun -f clang)
+ ARCHS:=$(shell uname -m)
+ MINVER:=10.8
+ SDKROOT:=$(shell xcrun --show-sdk-path)
+ HOSTROOT:=/opt/local
else
ifeq ($(SYSNAME),BeOS)
OS:=beos
@@ -59,16 +65,67 @@ else
endif
endif
+# CROSS COMPILATION OVERRIDES
+#
+# Usage:
+# make HOST= HOSTROOT= [EXTRA_ARGS]
+#
+# may be one of:
+# iphoneos Build for the iphoneos, presumably on macOS.
+# iphonesimulator Build for the iphonesimulator, presumably on macOS.
+#
+# is the directory containing support files for building for :
+# /include Header files.
+# /lib Library files.
+# /lib/pkgconfig *.pc files.
+#
+ifdef HOST
+ ifndef HOSTROOT
+ $(error Must set HOSTROOT to cross compile)
+ endif
+ ifeq ($(wildcard $(HOSTROOT)/.),)
+ $(error Invalid HOSTROOT: $(HOSTROOT))
+ endif
+
+ ifeq ($(HOST),iphoneos)
+ OS:=iphoneos
+ CC:=$(shell xcrun --sdk iphoneos -f clang)
+ ARCHS:=arm64 armv7s armv7
+ MINVER:=9.0
+ SDKROOT:=$(shell xcrun --sdk iphoneos --show-sdk-path)
+ else ifeq ($(HOST),iphonesimulator)
+ OS:=iphonesimulator
+ CC:=$(shell xcrun --sdk iphonesimulator -f clang)
+ ARCHS:=$(shell uname -m)
+ MINVER:=9.0
+ SDKROOT:=$(shell xcrun --sdk iphonesimulator --show-sdk-path)
+ else
+ $(error Invalid HOST: $(HOST))
+ endif
+
+ # We set PKG_CONFIG_LIBDIR instead of PKG_CONFIG_PATH because we want to
+ # *change* where pkg-config looks for .pc files instead of adding to the
+ # default path which may have libraries that aren't for HOST.
+ export PKG_CONFIG_LIBDIR:=$(HOSTROOT)/lib/pkgconfig
+endif
+
# change to sdl-console to build a console version on Windows
SDL_PCNAME:=sdl
WINDRES:=windres
PKG_CONFIG:=pkg-config
+ifdef PKG_CONFIG_LIBDIR
+ # Cross compilation override
+ PKG_CONFIG:=PKG_CONFIG_LIBDIR=$(PKG_CONFIG_LIBDIR) $(PKG_CONFIG)
+endif
-# test if a library can be linked
-linktest = $(shell if $(CC) $(CPPFLAGS) $(CFLAGS) -o dummy.o dummy.c $(LDFLAGS) $(1) $(2) > /dev/null 2>&1; \
+# test if a pkg-config library exists or can be linked manually
+linktest = $(shell [ -n "$(1)" ] \
+ && $(PKG_CONFIG) --exists $(1) \
+ && $(PKG_CONFIG) --libs $(1) \
+ || if $(CC) $(CPPFLAGS) $(CFLAGS) -o dummy.o dummy.c $(LDFLAGS) $(2) $(3) > /dev/null 2>&1; \
then \
- echo "$(1)"; \
+ echo "$(2)"; \
fi ;)
# test compiler options
@@ -88,50 +145,59 @@ RAD_CMD:=$($(OS)_RAD_CMD)
windows_SO_TYPE:=dll
macos_SO_TYPE:=dylib
+iphoneos_SO_TYPE:=dylib
+iphonesimulator_SO_TYPE:=dylib
beos_SO_TYPE:=so
linux_SO_TYPE:=so
SO_TYPE:=$($(OS)_SO_TYPE)
-windows_LIBMINGW:=-lmingw32
+windows_LIBMINGW:=-L/usr/local/lib -lmingw32
LIBMINGW:=$($(OS)_LIBMINGW)
windows_EXE_EXT:=.exe
EXE_EXT:=$($(OS)_EXE_EXT)
-windows_BUNDLE:=
-macos_BUNDLE=./TuxPaint.app
-beos_BUNDLE:=
-linux_BUNDLE:=
+macos_BUNDLE:=./TuxPaint.app
+iphoneos_BUNDLE:=./TuxPaint-iphoneos.app
+iphonesimulator_BUNDLE:=./TuxPaint-iphonesimulator.app
BUNDLE:=$($(OS)_BUNDLE)
windows_ARCH_LIBS:=obj/win32_print.o obj/resource.o
macos_ARCH_LIBS:=src/macos_print.m obj/macos.o
+iphoneos_ARCH_LIBS:=src/ios_print.m obj/ios.o
+iphonesimulator_ARCH_LIBS:=src/ios_print.m obj/ios.o
beos_ARCH_LIBS:=obj/BeOS_print.o
linux_ARCH_LIBS:=obj/postscript_print.o
ARCH_LIBS:=$($(OS)_ARCH_LIBS)
windows_ARCH_CFLAGS:=
-macos_ARCH_CFLAGS:=-mmacosx-version-min=10.8 -isystem /opt/local/include -DHAVE_STRCASESTR -w -headerpad_max_install_names
+macos_ARCH_CFLAGS:=-isysroot $(SDKROOT) -I$(SDKROOT)/usr/include -I$(HOSTROOT)/include -mmacosx-version-min=$(MINVER) -arch $(subst $() $(), -arch ,$(ARCHS)) -w -headerpad_max_install_names -DHAVE_STRCASESTR
+iphoneos_ARCH_CFLAGS:=-isysroot $(SDKROOT) -I$(SDKROOT)/usr/include -I$(HOSTROOT)/include -miphoneos-version-min=$(MINVER) -arch $(subst $() $(), -arch ,$(ARCHS)) -w -fPIC -DHAVE_STRCASESTR -DUNLINK_ONLY
+iphonesimulator_ARCH_CFLAGS:=-isysroot $(SDKROOT) -I$(SDKROOT)/usr/include -I$(HOSTROOT)/include -mios-simulator-version-min=$(MINVER) -arch $(subst $() $(), -arch ,$(ARCHS)) -w -fPIC -DHAVE_STRCASESTR -DUNLINK_ONLY
beos_ARCH_CFLAGS:=
linux_ARCH_CFLAGS:=
ARCH_CFLAGS:=$($(OS)_ARCH_CFLAGS)
windows_ARCH_LDFLAGS:=
-macos_ARCH_LDFLAGS:=-L/opt/local/lib
+macos_ARCH_LDFLAGS:=-isysroot $(SDKROOT) -L$(HOSTROOT)/lib -mmacosx-version-min=$(MINVER) -arch $(subst $() $(), -arch ,$(ARCHS))
+iphoneos_ARCH_LDFLAGS:=-isysroot $(SDKROOT) -L$(HOSTROOT)/lib -miphoneos-version-min=$(MINVER) -arch $(subst $() $(), -arch ,$(ARCHS))
+iphonesimulator_ARCH_LDFLAGS:=-isysroot $(SDKROOT) -L$(HOSTROOT)/lib -mios-simulator-version-min=$(MINVER) -arch $(subst $() $(), -arch ,$(ARCHS))
beos_ARCH_LDFLAGS:=
linux_ARCH_LDFLAGS:=
ARCH_LDFLAGS:=$($(OS)_ARCH_LDFLAGS)
LDFLAGS:=$(ARCH_LDFLAGS)
-PAPER_LIB:=$(call linktest,-lpaper,)
-PNG:=$(call linktest,-lpng,)
-PNG:=$(if $(PNG),$(PNG),$(call linktest,-lpng12,))
+PAPER_LIB:=$(call linktest,,-lpaper,)
+PNG:=$(call linktest,libpng,-lpng,)
+PNG:=$(if $(PNG),$(PNG),$(call linktest,,-lpng12,))
FRIBIDI_LIB:=$(shell $(PKG_CONFIG) --libs fribidi)
FRIBIDI_CFLAGS:=$(shell $(PKG_CONFIG) --cflags fribidi)
windows_ARCH_LINKS:=-lgdi32 -lcomdlg32 $(PNG) -lz -lwinspool -lshlwapi $(FRIBIDI_LIB) -liconv -limagequant
macos_ARCH_LINKS:=$(FRIBIDI_LIB) -limagequant
+iphoneos_ARCH_LINKS=$(FRIBIDI_LIB) -limagequant -ljpeg -lbz2 $(shell $(PKG_CONFIG) --libs freetype2 libtiff-4 libwebp libffi harfbuzz libmpg123 ogg vorbisenc vorbisidec libxml-2.0 pangoft2 libpcre)
+iphonesimulator_ARCH_LINKS=$(FRIBIDI_LIB) -limagequant -ljpeg -lbz2 $(shell $(PKG_CONFIG) --libs freetype2 libtiff-4 libwebp libffi harfbuzz libmpg123 ogg vorbisenc vorbisidec libxml-2.0 pangoft2 libpcre)
beos_ARCH_LINKS:=-lintl $(PNG) -lz -lbe -lnetwork -liconv $(FRIBIDI_LIB) $(PAPER_LIB) $(STDC_LIB) -limagequant
linux_ARCH_LINKS:=$(PAPER_LIB) $(FRIBIDI_LIB) -limagequant
ARCH_LINKS:=$($(OS)_ARCH_LINKS)
@@ -143,18 +209,24 @@ linux_ARCH_HEADERS:=
ARCH_HEADERS:=$($(OS)_ARCH_HEADERS)
# Where things will go when ultimately installed:
-# For macOS, the prefix is relative to DESTDIR.
+# For macOS and iOS, the prefix is relative to DESTDIR.
windows_PREFIX:=/usr/local
macos_PREFIX:=Resources
+iphoneos_PREFIX:=Resources
+iphonesimulator_PREFIX:=Resources
linux_PREFIX:=/usr/local
PREFIX:=$($(OS)_PREFIX)
# Root directory to place files when creating packages.
# PKG_ROOT is the old name for this, and should be undefined.
-# macOS is set up as a bundle, with all files under 'Contents'.
+# macOS and iOS are set up as bundles, with all files under the bundle.
# "TuxPaint-1" is the OLPC XO name. Installing to ./ is bad!
ifeq ($(OS),macos)
DESTDIR:=$(BUNDLE)/Contents/
+else ifeq ($(OS),iphoneos)
+ DESTDIR:=$(BUNDLE)/
+else ifeq ($(OS),iphonesimulator)
+ DESTDIR:=$(BUNDLE)/
else ifeq ($(PREFIX),./)
DESTDIR:=TuxPaint-1
else
@@ -216,14 +288,18 @@ CURSOR_SHAPES:=LARGE
# CURSOR_SHAPES:=SMALL
# Libraries, paths, and flags:
-SDL_LIBS:=$(shell $(PKG_CONFIG) $(SDL_PCNAME) --libs) -lSDL_image -lSDL_ttf -lz $(PNG)
+SDL_LIBS:=$(shell $(PKG_CONFIG) $(SDL_PCNAME) --libs)
+SDL_LIBS+=$(call linktest,SDL_image,-lSDL_image,$(SDL_LIBS))
+SDL_LIBS+=$(call linktest,SDL_ttf,-lSDL_ttf,$(SDL_LIBS))
+SDL_LIBS+=$(call linktest,zlib,-lz,)
+SDL_LIBS+=$(call linktest,libpng,$(PNG),)
# Sound support
-SDL_MIXER_LIB:=$(call linktest,-lSDL_mixer,$(SDL_LIBS))
+SDL_MIXER_LIB:=$(call linktest,SDL_mixer,-lSDL_mixer,$(SDL_LIBS))
NOSOUNDFLAG:=$(if $(SDL_MIXER_LIB),,-DNOSOUND$(warning -lSDL_Mixer failed, no sound for you!))
# SDL Pango is needed to render complex scripts like Thai and Arabic
-SDL_PANGO_LIB:=$(call linktest,-lSDL_Pango,$(SDL_LIBS))
+SDL_PANGO_LIB:=$(call linktest,SDL_Pango,-lSDL_Pango,$(SDL_LIBS))
NOPANGOFLAG:=$(if $(SDL_PANGO_LIB),,-DNO_SDLPANGO$(warning -lSDL_Pango failed, no scripts for you!))
SDL_LIBS+=$(SDL_MIXER_LIB) $(SDL_PANGO_LIB)
@@ -478,6 +554,8 @@ trans:
windows_ARCH_INSTALL:=
macos_ARCH_INSTALL:=install-macbundle TuxPaint.dmg
+iphoneos_ARCH_INSTALL:=install-iosbundle
+iphonesimulator_ARCH_INSTALL:=install-iosbundle
linux_ARCH_INSTALL:=install-xdg
ARCH_INSTALL:=$($(OS)_ARCH_INSTALL)
@@ -1025,7 +1103,7 @@ install-man:
.PHONY: install-macbundle
install-macbundle:
@echo
- @echo "...Installing App Bundle Support Files..."
+ @echo "...Installing macOS App Bundle Support Files..."
@install -d -m 755 $(BUNDLE)/Contents/MacOS
@install -d -m 755 $(BUNDLE)/Contents/Resources
@install -d -m 755 $(BUNDLE)/Contents/lib
@@ -1035,6 +1113,20 @@ install-macbundle:
@install -m 644 macos/tuxpaint.icns $(BUNDLE)/Contents/Resources
@macos/build-app.sh
+# Install the support files for iOS application bundle
+.PHONY: install-iosbundle
+install-iosbundle:
+ @echo
+ @echo "...Installing iOS App Bundle Support Files..."
+ install -m 755 tuxpaint $(BUNDLE)
+ install -m 644 ios/PkgInfo $(BUNDLE)
+ install -m 644 ios/Info.plist $(BUNDLE)
+ install -m 644 ios/Info.plist $(BUNDLE)/Resources
+ install -m 644 ios/tuxpaint.icns $(BUNDLE)
+ install -m 644 ios/tuxpaint.cfg $(BUNDLE)
+ install -m 644 ios/Splash.png $(BUNDLE)
+ ibtool --compile $(BUNDLE)/Splash.storyboardc ios/Splash.storyboard
+
# Create DMG for macOS
TuxPaint.dmg:
@@ -1071,7 +1163,7 @@ obj/tuxpaint.o: src/tuxpaint.c \
src/tools.h src/titles.h src/colors.h src/shapes.h \
src/sounds.h src/tip_tux.h src/great.h \
src/tp_magic_api.h src/parse.h src/onscreen_keyboard.h \
- src/gifenc.h \
+ src/gifenc.h src/platform.h \
src/$(MOUSEDIR)/arrow.xbm src/$(MOUSEDIR)/arrow-mask.xbm \
src/$(MOUSEDIR)/hand.xbm src/$(MOUSEDIR)/hand-mask.xbm \
src/$(MOUSEDIR)/insertion.xbm \
@@ -1211,12 +1303,18 @@ obj/postscript_print.o: src/postscript_print.c \
@$(CC) $(CFLAGS) $(DEBUG_FLAGS) $(SDL_CFLAGS) $(DEFS) \
-c src/postscript_print.c -o obj/postscript_print.o
-obj/macos.o: src/macos.c src/macos.h src/debug.h
+obj/macos.o: src/macos.c src/macos.h src/platform.h src/debug.h
@echo
@echo "...Compiling macOS support..."
@$(CC) $(CFLAGS) $(DEBUG_FLAGS) $(SDL_CFLAGS) $(DEFS) \
-c src/macos.c -o obj/macos.o
+obj/ios.o: src/ios.c src/ios.h src/platform.h src/debug.h
+ @echo
+ @echo "...Compiling iOS support..."
+ @$(CC) $(CFLAGS) $(DEBUG_FLAGS) $(SDL_CFLAGS) $(DEFS) \
+ -c src/ios.c -o obj/ios.o
+
obj/resource.o: win32/resources.rc win32/resource.h
@echo
@echo "...Compiling win32 resources..."
@@ -1256,11 +1354,19 @@ obj:
######
MAGIC_SDL_CPPFLAGS:=$(shell $(PKG_CONFIG) $(SDL_PCNAME) --cflags)
-MAGIC_SDL_LIBS:=-L/usr/local/lib $(LIBMINGW) $(shell $(PKG_CONFIG) $(SDL_PCNAME) --libs) -lSDL_image -lSDL_ttf $(SDL_MIXER_LIB)
-MAGIC_ARCH_LINKS:=-lintl $(PNG)
+MAGIC_SDL_LIBS:=$(LIBMINGW) $(shell $(PKG_CONFIG) $(SDL_PCNAME) --libs) -lSDL_image -lSDL_ttf $(SDL_MIXER_LIB)
+windows_MAGIC_ARCH_LINKS=-lintl $(PNG)
+macos_MAGIC_ARCH_LINKS=-lintl $(PNG)
+iphoneos_MAGIC_ARCH_LINKS=-lintl -ljpeg $(PNG) $(shell $(PKG_CONFIG) --libs libtiff-4 libwebp libmpg123 ogg vorbisenc vorbisidec)
+iphonesimulator_MAGIC_ARCH_LINKS=-lintl -ljpeg $(PNG) $(shell $(PKG_CONFIG) --libs libtiff-4 libwebp libmpg123 ogg vorbisenc vorbisidec)
+beos_MAGIC_ARCH_LINKS=-lintl $(PNG)
+linux_MAGIC_ARCH_LINKS=-lintl $(PNG)
+MAGIC_ARCH_LINKS=$($(OS)_MAGIC_ARCH_LINKS)
windows_PLUGIN_LIBS:=$(MAGIC_SDL_LIBS) $(MAGIC_ARCH_LINKS)
macos_PLUGIN_LIBS:=$(MAGIC_SDL_LIBS) $(MAGIC_ARCH_LINKS)
+iphoneos_PLUGIN_LIBS:=$(MAGIC_SDL_LIBS) $(MAGIC_ARCH_LINKS)
+iphonesimulator_PLUGIN_LIBS:=$(MAGIC_SDL_LIBS) $(MAGIC_ARCH_LINKS)
beos_PLUGIN_LIBS:="$(MAGIC_SDL_LIBS) $(MAGIC_ARCH_LINKS) $(MAGIC_SDL_CPPFLAGS)"
linux_PLUGIN_LIBS:=
PLUGIN_LIBS:=$($(OS)_PLUGIN_LIBS)
diff --git a/ios/Info.plist b/ios/Info.plist
new file mode 100644
index 000000000..9ef560077
--- /dev/null
+++ b/ios/Info.plist
@@ -0,0 +1,39 @@
+
+
+
+
+ CFBundleDevelopmentRegion
+ English
+ CFBundleExecutable
+ tuxpaint
+ CFBundleGetInfoString
+ 0.9.26, Copyright 2009-2020, Tux Paint Development Team
+ CFBundleIconFile
+ tuxpaint.icns
+ CFBundleIdentifier
+ com.newbreedsoftware.tuxpaint
+ CFBundleInfoDictionaryVersion
+ 6.0
+ CFBundleName
+ Tux Paint
+ CFBundlePackageType
+ APPL
+ CFBundleShortVersionString
+ 0.9.26
+ CFBundleSignature
+ TXPT
+ CFBundleVersion
+ 2020-12-27
+ UISupportedInterfaceOrientations
+
+ UIInterfaceOrientationLandscapeLeft
+ UIInterfaceOrientationLandscapeRight
+
+ UIStatusBarHidden
+
+ UIViewControllerBasedStatusBarAppearance
+
+ UILaunchStoryboardName
+ Splash
+
+
diff --git a/ios/PkgInfo b/ios/PkgInfo
new file mode 100644
index 000000000..c00b87013
--- /dev/null
+++ b/ios/PkgInfo
@@ -0,0 +1 @@
+APPLTXPT
\ No newline at end of file
diff --git a/ios/Splash.png b/ios/Splash.png
new file mode 100644
index 0000000000000000000000000000000000000000..9db41423af7d4a775ba222159f4a16fa181d329b
GIT binary patch
literal 91003
zcmYJ41yoc~yY~+WGL#J6-QC?K9Rfp0w{({@42Xar-5?+!gA5_vp>!xAAT8b9^^Na)
z?{^Q(S|`?=nX~8F|EGTYy|$(jHU=36007u3$_hFF@QelkkeNWph%*cl0qFpM6z(7|
zudO04Pvh?CX6N8+3ji!h!ATk{3a==BgxbX@5HYC?8C%$@DyL%!mcN?(6vWwf)rTc`
zl(j@YXUI0sib+i#8TCQX7}K~UH8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