new package: tuxpaint

This commit is contained in:
Tee KOBAYASHI 2022-05-03 12:47:26 +09:00 committed by xtkoba
parent 7366ab781e
commit 608b002f68
5 changed files with 184 additions and 0 deletions

View File

@ -0,0 +1,85 @@
--- a/Makefile
+++ b/Makefile
@@ -19,7 +19,7 @@
# Need to know the OS
-SYSNAME:=$(shell uname -s)
+SYSNAME:=Linux
ifeq ($(findstring MINGW32, $(SYSNAME)),MINGW32)
OS:=windows
GPERF:=/usr/bin/gperf
@@ -169,14 +169,14 @@
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
ios_ARCH_CFLAGS:=-isysroot $(SDKROOT) -I$(SDKROOT)/usr/include -I$(HOSTROOT)/include $(MINVEROPT) -arch $(subst $() $(), -arch ,$(ARCHS)) -w -fPIC -DHAVE_STRCASESTR -DUNLINK_ONLY
beos_ARCH_CFLAGS:=
-linux_ARCH_CFLAGS:=
+linux_ARCH_CFLAGS:=$(CFLAGS) $(CPPFLAGS)
ARCH_CFLAGS:=$($(OS)_ARCH_CFLAGS)
windows_ARCH_LDFLAGS:=
macos_ARCH_LDFLAGS:=-isysroot $(SDKROOT) -L$(HOSTROOT)/lib -mmacosx-version-min=$(MINVER) -arch $(subst $() $(), -arch ,$(ARCHS))
ios_ARCH_LDFLAGS:=-isysroot $(SDKROOT) -L$(HOSTROOT)/lib $(MINVEROPT) -arch $(subst $() $(), -arch ,$(ARCHS))
beos_ARCH_LDFLAGS:=
-linux_ARCH_LDFLAGS:=
+linux_ARCH_LDFLAGS:=$(LDFLAGS)
ARCH_LDFLAGS:=$($(OS)_ARCH_LDFLAGS)
LDFLAGS:=$(ARCH_LDFLAGS)
@@ -205,7 +205,7 @@
windows_PREFIX:=/usr/local
macos_PREFIX:=Resources
ios_PREFIX:=.
-linux_PREFIX:=/usr/local
+linux_PREFIX:=@TERMUX_PREFIX@
PREFIX:=$($(OS)_PREFIX)
# Root directory to place files when creating packages.
@@ -242,8 +242,8 @@
MAGIC_PREFIX:=$(DESTDIR)$(LIBDIR)/lib$(LIBDIRSUFFIX)/tuxpaint/plugins
# Docs and man page:
-DOC_PREFIX:=$(DESTDIR)$(PREFIX)/share/doc/tuxpaint-$(VER_VERSION)
-DEVDOC_PREFIX:=$(DESTDIR)$(PREFIX)/share/doc/tuxpaint-$(VER_VERSION)/tuxpaint-dev
+DOC_PREFIX:=$(DESTDIR)$(PREFIX)/share/tuxpaint/doc
+DEVDOC_PREFIX:=$(DESTDIR)$(PREFIX)/share/tuxpaint/doc/tuxpaint-dev
MAN_PREFIX:=$(DESTDIR)$(PREFIX)/share/man
DEVMAN_PREFIX:=$(DESTDIR)$(PREFIX)/share/man
@@ -545,7 +545,7 @@
windows_ARCH_INSTALL:=install-dlls install-tpconf-i18n
macos_ARCH_INSTALL:=install-macbundle TuxPaint.dmg install-man install-importscript install-bash-completion
ios_ARCH_INSTALL:=install-iosbundle install-man install-importscript install-bash-completion
-linux_ARCH_INSTALL:=install-xdg install-man install-importscript install-bash-completion
+linux_ARCH_INSTALL:=install-man install-importscript
ARCH_INSTALL:=$($(OS)_ARCH_INSTALL)
# "make install" installs all of the various parts
@@ -1021,12 +1021,6 @@
@install -d $(DOC_PREFIX)/en/magic-docs
@cp -R magic/magic-docs/en/* $(DOC_PREFIX)/en/magic-docs/
@echo
- for l in `ls -d man/*.UTF-8 | cut -d '/' -f 2`; do \
- DEST=$(DOC_PREFIX)/$$l/magic-docs ; \
- echo "...Installing $$l Magic tool docs into $$DEST..." ; \
- install -d $$DEST ; \
- cp -R magic/magic-docs/$$l/* $$DEST/ ; \
- done
@chmod -R a=rX,g=rX,u=rwX $(DOC_PREFIX)
@@ -1050,14 +1044,6 @@
@gzip -f $(MAN_PREFIX)/man1/tp-magic-config.1
@chmod a+rx,g-w,o-w $(MAN_PREFIX)/man1/tp-magic-config.1.gz
@echo
- for l in `ls -d man/*.UTF-8 | cut -d '/' -f 2`; do \
- DEST=$(MAN_PREFIX)/$$l/man1 ; \
- echo "...Installing $$l man pages into $$DEST..." ; \
- install -d $$DEST ; \
- cp man/$$l/tuxpaint.1 $$DEST ; \
- gzip -f $$DEST/tuxpaint.1 ; \
- chmod a+rx,g-w,o-w $$DEST/tuxpaint.1.gz ; \
- done
@# FIXME: The other man pages aren't localizable yet -bjk 2021.08.14
# Install the support files for macOS application bundle

View File

@ -0,0 +1,36 @@
TERMUX_PKG_HOMEPAGE=https://tuxpaint.org/
TERMUX_PKG_DESCRIPTION="A free, award-winning drawing program for children ages 3 to 12"
TERMUX_PKG_LICENSE="GPL-2.0"
TERMUX_PKG_MAINTAINER="@termux"
TERMUX_PKG_VERSION=0.9.27
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"
TERMUX_PKG_BUILD_IN_SRC=true
TERMUX_PKG_HOSTBUILD=true
termux_step_host_build() {
local _PREFIX_FOR_BUILD=$TERMUX_PKG_HOSTBUILD_DIR/_prefix
# Need imagemagick that can handle SVG format.
local IMAGEMAGICK_BUILD_SH=$TERMUX_SCRIPTDIR/packages/imagemagick/build.sh
local IMAGEMAGICK_SRCURL=$(bash -c ". $IMAGEMAGICK_BUILD_SH; echo \$TERMUX_PKG_SRCURL")
local IMAGEMAGICK_SHA256=$(bash -c ". $IMAGEMAGICK_BUILD_SH; echo \$TERMUX_PKG_SHA256")
local IMAGEMAGICK_TARFILE=$TERMUX_PKG_CACHEDIR/$(basename $IMAGEMAGICK_SRCURL)
termux_download $IMAGEMAGICK_SRCURL $IMAGEMAGICK_TARFILE $IMAGEMAGICK_SHA256
mkdir -p imagemagick
cd imagemagick
tar xf $IMAGEMAGICK_TARFILE --strip-components=1
./configure --prefix=$_PREFIX_FOR_BUILD \
--with-jpeg \
--with-png \
--with-rsvg
make -j $TERMUX_MAKE_PROCESSES
make install
}
termux_step_pre_configure() {
export PATH=$TERMUX_PKG_HOSTBUILD_DIR/_prefix/bin:$PATH
LDFLAGS+=" -landroid-wordexp"
}

View File

@ -0,0 +1,41 @@
--- a/src/tuxpaint-import.sh
+++ b/src/tuxpaint-import.sh
@@ -52,14 +52,14 @@
# Determine preferred savedir
-# First, check /usr/local/etc/
-x=`grep -m 1 "^savedir=" /usr/local/etc/tuxpaint/tuxpaint.conf`
+# First, check @TERMUX_PREFIX@/local/etc/
+x=`grep -m 1 "^savedir=" @TERMUX_PREFIX@/local/etc/tuxpaint/tuxpaint.conf`
if test $? = 0 ; then
SAVEDIR=`echo $x | cut -d = -f 2-99`
fi
-# First, check /etc/
-x=`grep -m 1 "^savedir=" /etc/tuxpaint/tuxpaint.conf`
+# First, check @TERMUX_PREFIX@/etc/
+x=`grep -m 1 "^savedir=" @TERMUX_PREFIX@/etc/tuxpaint/tuxpaint.conf`
if test $? = 0 ; then
SAVEDIR=`echo $x | cut -d = -f 2-99`
fi
@@ -100,15 +100,15 @@
window_width=800
window_height=600
-# First, check /usr/local/etc/
-x=`grep -m 1 "^windowsize=" /usr/local/etc/tuxpaint/tuxpaint.conf`
+# First, check @TERMUX_PREFIX@/local/etc/
+x=`grep -m 1 "^windowsize=" @TERMUX_PREFIX@/local/etc/tuxpaint/tuxpaint.conf`
if test $? = 0 ; then
window_width=`echo $x | cut -d = -f 2 | cut -d x -f 1`
window_height=`echo $x | cut -d = -f 2 | cut -d x -f 2`
fi
-# First, check /etc/
-x=`grep -m 1 "^windowsize=" /etc/tuxpaint/tuxpaint.conf`
+# First, check @TERMUX_PREFIX@/etc/
+x=`grep -m 1 "^windowsize=" @TERMUX_PREFIX@/etc/tuxpaint/tuxpaint.conf`
if test $? = 0 ; then
window_width=`echo $x | cut -d = -f 2 | cut -d x -f 1`
window_height=`echo $x | cut -d = -f 2 | cut -d x -f 2`

View File

@ -0,0 +1,19 @@
--- a/src/tuxpaint.conf
+++ b/src/tuxpaint.conf
@@ -1,4 +1,4 @@
-# /etc/tuxpaint/tuxpaint.conf
+# @TERMUX_PREFIX@/etc/tuxpaint/tuxpaint.conf
#
# Configuration file for Tux Paint
# See tuxpaint(1) or run 'tuxpaint --help' for details on using Tux Paint
@@ -27,8 +27,8 @@
# (e.g., "windowed=yes" enables fullscreen mode.)
#
# In the system-wide Tux Paint configuration file
-# (e.g. "/etc/tuxpaint/tuxpaint.conf"
-# or "/usr/local/etc/tuxpaint/tuxpaint.conf")
+# (e.g. "@TERMUX_PREFIX@/etc/tuxpaint/tuxpaint.conf"
+# or "@TERMUX_PREFIX@/local/etc/tuxpaint/tuxpaint.conf")
# the default options are redundant.
#
# They are, however, useful to place in a user's personal confiugration file

View File

@ -0,0 +1,3 @@
TERMUX_SUBPKG_DESCRIPTION="Platform-independent data for tuxpaint"
TERMUX_SUBPKG_PLATFORM_INDEPENDENT=true
TERMUX_SUBPKG_INCLUDE="share/tuxpaint/"