diff --git a/packages/povray/Makefile.in.patch b/packages/povray/Makefile.in.patch new file mode 100644 index 000000000..28d358f46 --- /dev/null +++ b/packages/povray/Makefile.in.patch @@ -0,0 +1,42 @@ +--- a/Makefile.in ++++ b/Makefile.in +@@ -429,8 +429,6 @@ + povlibdir = @datadir@/@PACKAGE@-@VERSION_BASE@ + povdocdir = @datadir@/doc/@PACKAGE@-@VERSION_BASE@ + povconfdir = @sysconfdir@/@PACKAGE@/@VERSION_BASE@ +-povuser = $(HOME)/.@PACKAGE@ +-povconfuser = $(povuser)/@VERSION_BASE@ + povinstall = $(top_builddir)/install.log + + # Directories to build. +@@ -1127,19 +1125,6 @@ + for f in $$filelist ; do \ + $(INSTALL_DATA) $(top_srcdir)/doc/$$f $(DESTDIR)$(povdocdir)/$$f && echo "$(DESTDIR)$(povdocdir)/$$f" >> $(povinstall); \ + done +- @echo "Creating user directories..."; \ +- for p in $(povuser) $(povconfuser) ; do \ +- $(mkdir_p) $$p && chown $(povowner) $$p && chgrp $(povgroup) $$p && printf "%s\n" "$$p" "`cat $(povinstall)`" > $(povinstall); \ +- done +- @echo "Copying user configuration and INI files..."; \ +- for f in povray.conf povray.ini ; do \ +- if test -f $(povconfuser)/$$f; then \ +- echo "Creating backup of $(povconfuser)/$$f"; \ +- mv -f $(povconfuser)/$$f $(povconfuser)/$$f.bak; \ +- fi; \ +- done; \ +- $(INSTALL_DATA) $(top_srcdir)/povray.conf $(povconfuser)/povray.conf && chown $(povowner) $(povconfuser)/povray.conf && chgrp $(povgroup) $(povconfuser)/povray.conf && echo "$(povconfuser)/povray.conf" >> $(povinstall); \ +- $(INSTALL_DATA) $(top_builddir)/povray.ini $(povconfuser)/povray.ini && chown $(povowner) $(povconfuser)/povray.ini && chgrp $(povgroup) $(povconfuser)/povray.ini && echo "$(povconfuser)/povray.ini" >> $(povinstall) + + # Remove data, config, and empty folders for 'make uninstall'. + # Use 'hook' instead of 'local' so as to properly remove *empty* folders (e.g. scripts). +@@ -1164,10 +1149,6 @@ + rm -f $(DESTDIR)$(povconfdir)/povray.ini; \ + rmdir $(DESTDIR)$(povconfdir); \ + rmdir $(DESTDIR)$(sysconfdir)/@PACKAGE@; \ +- rm -f $(povconfuser)/povray.conf; \ +- rm -f $(povconfuser)/povray.ini; \ +- rmdir $(povconfuser); \ +- rmdir $(povuser); \ + fi; \ + echo "Uninstall finished" + diff --git a/packages/povray/build.sh b/packages/povray/build.sh new file mode 100644 index 000000000..6367ee66e --- /dev/null +++ b/packages/povray/build.sh @@ -0,0 +1,39 @@ +TERMUX_PKG_HOMEPAGE=https://www.povray.org/ +TERMUX_PKG_DESCRIPTION="The Persistence of Vision Raytracer" +TERMUX_PKG_LICENSE="AGPL-V3" +TERMUX_PKG_MAINTAINER="@termux" +TERMUX_PKG_VERSION=3.8.0-beta.2 +TERMUX_PKG_SRCURL=https://github.com/POV-Ray/povray/releases/download/v${TERMUX_PKG_VERSION}/povunix-v${TERMUX_PKG_VERSION}-src.tar.gz +TERMUX_PKG_SHA256=4717c9bed114deec47cf04a8175cc4060dafc159f26e7896480a60f4411ca5ad +TERMUX_PKG_DEPENDS="boost, libjpeg-turbo, libpng, libtiff, zlib" + +TERMUX_PKG_EXTRA_CONFIGURE_ARGS=" +--disable-debug +--disable-dependency-tracking +--disable-optimiz +--disable-optimiz-arch +--disable-strip +--enable-io-restrictions +--with-boost=$TERMUX_PREFIX/lib +--with-boost-libdir=$TERMUX_PREFIX/lib +--without-libmkl +--without-libsdl +--without-openexr +--without-x +ax_cv_c_compiler_vendor=clang +ax_cv_cxx_compiler_vendor=clang +COMPILED_BY=Termux +" + +termux_step_create_debscripts() { + echo "#!$TERMUX_PREFIX/bin/sh" > postinst + echo "povconfuser=\$HOME/.povray/3.8" >> postinst + echo "mkdir -p \$povconfuser/" >> postinst + echo "for f in povray.conf povray.ini; do" >> postinst + echo " if [ ! -f \$povconfuser/\$f ]; then" >> postinst + echo " cp \$TERMUX_PREFIX/etc/povray/3.8/\$f \$povconfuser/" >> postinst + echo " fi" >> postinst + echo "done" >> postinst + echo "exit 0" >> postinst + chmod 0755 postinst +} diff --git a/packages/povray/configure.patch b/packages/povray/configure.patch new file mode 100644 index 000000000..614228175 --- /dev/null +++ b/packages/povray/configure.patch @@ -0,0 +1,140 @@ +--- a/configure ++++ b/configure +@@ -10490,7 +10490,7 @@ + do + LIBS=$SAVED_LIBS + LIBS="$LIBS $extralib" +- if test "$cross_compiling" = yes; then : ++ if false; then : + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: cross-compiling" >&5 + $as_echo "cross-compiling" >&6; } # FIXME +@@ -10515,7 +10515,7 @@ + } + + _ACEOF +-if ac_fn_cxx_try_run "$LINENO"; then : ++if ac_fn_cxx_try_link "$LINENO"; then : + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 + $as_echo "yes" >&6; } +@@ -10777,7 +10777,7 @@ + # check library version, update LIBS + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libz version >= $required_libz_version" >&5 + $as_echo_n "checking for libz version >= $required_libz_version... " >&6; } +- if test "$cross_compiling" = yes; then : ++ if false; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: cross-compiling, forced" >&5 + $as_echo "cross-compiling, forced" >&6; } + +@@ -10797,9 +10797,9 @@ + + + _ACEOF +-if ac_fn_cxx_try_run "$LINENO"; then : ++if ac_fn_cxx_try_link "$LINENO"; then : + +- ax_check_lib_version=`eval $ac_try 2>&1` ++ ax_check_lib_version= + + + +@@ -10831,7 +10831,7 @@ + + + +- if test "$ax_compare_version" = "true" ; then ++ if true ; then + ax_check_lib="ok" + else ax_check_lib="bad" + fi +@@ -10963,7 +10963,7 @@ + # check library version, update LIBS + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libpng version >= $required_libpng_version" >&5 + $as_echo_n "checking for libpng version >= $required_libpng_version... " >&6; } +- if test "$cross_compiling" = yes; then : ++ if false; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: cross-compiling, forced" >&5 + $as_echo "cross-compiling, forced" >&6; } + +@@ -10983,9 +10983,9 @@ + + + _ACEOF +-if ac_fn_cxx_try_run "$LINENO"; then : ++if ac_fn_cxx_try_link "$LINENO"; then : + +- ax_check_lib_version=`eval $ac_try 2>&1` ++ ax_check_lib_version= + + + +@@ -11017,7 +11017,7 @@ + + + +- if test "$ax_compare_version" = "true" ; then ++ if true ; then + ax_check_lib="ok" + else ax_check_lib="bad" + fi +@@ -11164,7 +11164,7 @@ + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libjpeg version >= $required_libjpeg_version" >&5 + $as_echo_n "checking for libjpeg version >= $required_libjpeg_version... " >&6; } + fi +- if test "$cross_compiling" = yes; then : ++ if false; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: cross-compiling, forced" >&5 + $as_echo "cross-compiling, forced" >&6; } + +@@ -11182,9 +11182,9 @@ + + + _ACEOF +-if ac_fn_cxx_try_run "$LINENO"; then : ++if ac_fn_cxx_try_link "$LINENO"; then : + +- ax_check_libjpeg_version=`eval $ac_try 2>&1` ++ ax_check_libjpeg_version= + + + +@@ -11216,7 +11216,7 @@ + + + +- if test "$ax_compare_version" = "true" ; then ++ if true ; then + ax_check_libjpeg="ok" + else ax_check_libjpeg="bad" + fi +@@ -11348,7 +11348,7 @@ + # check library version, update LIBS + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libtiff version >= $required_libtiff_version" >&5 + $as_echo_n "checking for libtiff version >= $required_libtiff_version... " >&6; } +- if test "$cross_compiling" = yes; then : ++ if false; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: cross-compiling, forced" >&5 + $as_echo "cross-compiling, forced" >&6; } + +@@ -11377,9 +11377,9 @@ + + + _ACEOF +-if ac_fn_cxx_try_run "$LINENO"; then : ++if ac_fn_cxx_try_link "$LINENO"; then : + +- ax_check_libtiff_version=`eval $ac_try 2>&1` ++ ax_check_libtiff_version= + + + +@@ -11411,7 +11411,7 @@ + + + +- if test "$ax_compare_version" = "true" ; then ++ if true ; then + ax_check_libtiff="ok" + else ax_check_libtiff="bad" + fi diff --git a/packages/povray/povray.conf.patch b/packages/povray/povray.conf.patch new file mode 100644 index 000000000..bec7c762d --- /dev/null +++ b/packages/povray/povray.conf.patch @@ -0,0 +1,9 @@ +--- a/povray.conf ++++ b/povray.conf +@@ -93,5 +93,5 @@ + read* = %INSTALLDIR%/scenes + read* = %INSTALLDIR%/../../etc + read* = %HOME% +-read+write* = /tmp ++read+write* = @TERMUX_PREFIX@/tmp + read+write = . diff --git a/packages/povray/source-base-platformbase.cpp.patch b/packages/povray/source-base-platformbase.cpp.patch new file mode 100644 index 000000000..5326b3fc1 --- /dev/null +++ b/packages/povray/source-base-platformbase.cpp.patch @@ -0,0 +1,22 @@ +--- a/source/base/platformbase.cpp ++++ b/source/base/platformbase.cpp +@@ -62,16 +62,16 @@ + + UCS2String DefaultPlatformBase::GetTemporaryPath() + { +- return ASCIItoUCS2String("/tmp/"); ++ return ASCIItoUCS2String("@TERMUX_PREFIX@/tmp/"); + } + + UCS2String DefaultPlatformBase::CreateTemporaryFile() + { + static int cnt = 0; +- char buffer[32]; ++ char buffer[] = "@TERMUX_PREFIX@/tmp/povXXXXXXXX.dat"; + + cnt++; +- sprintf(buffer, "/tmp/pov%08x.dat", cnt); ++ sprintf(buffer, "@TERMUX_PREFIX@/tmp/pov%08x.dat", cnt); + + FILE *f = fopen(buffer, "wb"); + if (f != nullptr) diff --git a/packages/povray/vfe-unix-unixoptions.cpp.patch b/packages/povray/vfe-unix-unixoptions.cpp.patch new file mode 100644 index 000000000..56394dc1b --- /dev/null +++ b/packages/povray/vfe-unix-unixoptions.cpp.patch @@ -0,0 +1,11 @@ +--- a/vfe/unix/unixoptions.cpp ++++ b/vfe/unix/unixoptions.cpp +@@ -156,7 +156,7 @@ + if (path.length() == 0) + { + struct stat s; +- path = "/tmp/"; ++ path = "@TERMUX_PREFIX@/tmp/"; + if (stat (path.c_str(), &s) == 0 && S_ISDIR (s.st_mode) && (s.st_mode & S_IRWXU) == S_IRWXU) + return path; + path = unix_getcwd();