chiark / gitweb /
Enable ghostscript (#1135)
authorHenrik Grimler <henka20@hotmail.com>
Fri, 11 Aug 2017 11:25:55 +0000 (13:25 +0200)
committerFredrik Fornwall <fredrik@fornwall.net>
Fri, 11 Aug 2017 11:25:55 +0000 (13:25 +0200)
* Fix ghostscript for aarch64.

* ghostscript: fix arm header

* ghostscript: clean build script

* ghostscript: disable i686 and x86_64 for now and enable package!

* Add required build dependencies for ghostscript to setup scripts

* ghostscript: add libexpat as dependency

* ghostscript: add (untested) generated headers for x86_64 and i686

disabled-packages/ghostscript/build.sh [deleted file]
packages/ghostscript/arch-aarch64.h [new file with mode: 0644]
packages/ghostscript/arch-arm.h [moved from disabled-packages/ghostscript/arch-arm.h with 80% similarity]
packages/ghostscript/arch-i686.h [new file with mode: 0644]
packages/ghostscript/arch-x86_64.h [new file with mode: 0644]
packages/ghostscript/build.sh [new file with mode: 0644]
packages/ghostscript/configure.patch [moved from disabled-packages/ghostscript/configure.patch with 100% similarity]
packages/ghostscript/gserrors.h.patch [moved from disabled-packages/ghostscript/gserrors.h.patch with 100% similarity]
scripts/setup-archlinux.sh
scripts/setup-ubuntu.sh

diff --git a/disabled-packages/ghostscript/build.sh b/disabled-packages/ghostscript/build.sh
deleted file mode 100644 (file)
index 4c4cc6d..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-TERMUX_PKG_HOMEPAGE=http://www.ghostscript.com/
-TERMUX_PKG_DESCRIPTION="Interpreter for the PostScript language and for PDF"
-TERMUX_PKG_VERSION=9.21
-TERMUX_PKG_SRCURL=https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/download/gs${TERMUX_PKG_VERSION//.}/ghostpdl-${TERMUX_PKG_VERSION}.tar.gz
-TERMUX_PKG_SHA256=82abf56e96e27cf4d1b17c0671f9ab3c5222454131588a49d06c97a332988e8d
-TERMUX_PKG_DEPENDS="libandroid-support, libtiff, libjpeg-turbo, libpng"
-TERMUX_PKG_EXTRA_CONFIGURE_ARGS="--with-system-libtiff \
---enable-little-endian \
---without-x \
---with-arch_h=$TERMUX_PKG_BUILDER_DIR/arch-${TERMUX_ARCH}.h \
-CCAUX=gcc \
---build=$TERMUX_BUILD_TUPLE \
---without-pcl"
-
-#building with PCL gives:
-# /home/builder/.termux-build/ghostscript/src/pcl/pl/pl.mak:108: recipe for target 'obj/plver.h' failed
-# make: *** [obj/plver.h] Segmentation fault (core dumped)
-# make: *** Deleting file 'obj/plver.h'
-#See also: https://bugs.ghostscript.com/show_bug.cgi?id=695979
-
-termux_step_post_extract_package () {
-        rm -rdf $TERMUX_PKG_SRCDIR/jpeg
-       rm -rdf $TERMUX_PKG_SRCDIR/libpng
-       rm -rdf $TERMUX_PKG_SRCDIR/expat $TERMUX_PKG_SRCDIR/jasper $TERMUX_PKG_SRCDIR/freetype $TERMUX_PKG_SRCDIR/lcms $TERMUX_PKG_SRCDIR/tiff
-
-       if [ -f $PREFIX/include/libandroid-support/time.h ]; then
-           mv $PREFIX/include/libandroid-support/time.h $PREFIX/include/libandroid-support/time.h_
-       fi
-       # Patch needed to libandroid's time.h? ghostscript/src/base/stat_.h includes stat_.h which includes time.h which creates a loop.
-       # See http://stackoverflow.com/questions/14947691/c-system-file-bits-stat-h-suddenly-breaks-with-error-field-st-atim-has-inc
-}
-
-termux_step_post_make_install () {
-        if [ -f $PREFIX/include/libandroid-support/time.h_ ]; then
-            mv $PREFIX/include/libandroid-support/time.h_ $PREFIX/include/libandroid-support/time.h
-        fi
-}
diff --git a/packages/ghostscript/arch-aarch64.h b/packages/ghostscript/arch-aarch64.h
new file mode 100644 (file)
index 0000000..a05de29
--- /dev/null
@@ -0,0 +1,40 @@
+/* Parameters derived from machine and compiler architecture. */
+/* This file is generated mechanically by genarch.c. */
+
+        /* ---------------- Scalar alignments ---------------- */
+
+#define ARCH_ALIGN_SHORT_MOD 2
+#define ARCH_ALIGN_INT_MOD 4
+#define ARCH_ALIGN_LONG_MOD 8
+#define ARCH_ALIGN_PTR_MOD 8
+#define ARCH_ALIGN_FLOAT_MOD 4
+#define ARCH_ALIGN_DOUBLE_MOD 8
+
+        /* ---------------- Scalar sizes ---------------- */
+
+#define ARCH_LOG2_SIZEOF_CHAR 0
+#define ARCH_LOG2_SIZEOF_SHORT 1
+#define ARCH_LOG2_SIZEOF_INT 2
+#define ARCH_LOG2_SIZEOF_LONG 3
+#define ARCH_LOG2_SIZEOF_LONG_LONG 3
+#define ARCH_SIZEOF_GX_COLOR_INDEX 8
+#define ARCH_SIZEOF_PTR 8
+#define ARCH_SIZEOF_FLOAT 4
+#define ARCH_SIZEOF_DOUBLE 8
+#define ARCH_FLOAT_MANTISSA_BITS 24
+#define ARCH_DOUBLE_MANTISSA_BITS 53
+
+        /* ---------------- Unsigned max values ---------------- */
+
+#define ARCH_MAX_UCHAR ((unsigned char)0xff + (unsigned char)0)
+#define ARCH_MAX_USHORT ((unsigned short)0xffff + (unsigned short)0)
+#define ARCH_MAX_UINT ((unsigned int)~0 + (unsigned int)0)
+#define ARCH_MAX_ULONG ((unsigned long)~0L + (unsigned long)0)
+
+        /* ---------------- Miscellaneous ---------------- */
+
+#define ARCH_IS_BIG_ENDIAN 0
+#define ARCH_PTRS_ARE_SIGNED 0
+#define ARCH_FLOATS_ARE_IEEE 1
+#define ARCH_ARITH_RSHIFT 2
+#define ARCH_DIV_NEG_POS_TRUNCATES 1
similarity index 80%
rename from disabled-packages/ghostscript/arch-arm.h
rename to packages/ghostscript/arch-arm.h
index 05e1f69c0af0c9a15ed1d8952aa860bf8ce32551..e8772cd9588af45cc87fd68c4d1fac51ab3a0164 100644 (file)
@@ -1,7 +1,7 @@
 /* Parameters derived from machine and compiler architecture. */
 /* This file is generated mechanically by genarch.c. */
 
 /* Parameters derived from machine and compiler architecture. */
 /* This file is generated mechanically by genarch.c. */
 
-/* ---------------- Scalar alignments ---------------- */
+        /* ---------------- Scalar alignments ---------------- */
 
 #define ARCH_ALIGN_SHORT_MOD 2
 #define ARCH_ALIGN_INT_MOD 4
 
 #define ARCH_ALIGN_SHORT_MOD 2
 #define ARCH_ALIGN_INT_MOD 4
@@ -10,7 +10,7 @@
 #define ARCH_ALIGN_FLOAT_MOD 4
 #define ARCH_ALIGN_DOUBLE_MOD 8
 
 #define ARCH_ALIGN_FLOAT_MOD 4
 #define ARCH_ALIGN_DOUBLE_MOD 8
 
-/* ---------------- Scalar sizes ---------------- */
+        /* ---------------- Scalar sizes ---------------- */
 
 #define ARCH_LOG2_SIZEOF_CHAR 0
 #define ARCH_LOG2_SIZEOF_SHORT 1
 
 #define ARCH_LOG2_SIZEOF_CHAR 0
 #define ARCH_LOG2_SIZEOF_SHORT 1
 #define ARCH_FLOAT_MANTISSA_BITS 24
 #define ARCH_DOUBLE_MANTISSA_BITS 53
 
 #define ARCH_FLOAT_MANTISSA_BITS 24
 #define ARCH_DOUBLE_MANTISSA_BITS 53
 
-/* ---------------- Unsigned max values ---------------- */
+        /* ---------------- Unsigned max values ---------------- */
 
 #define ARCH_MAX_UCHAR ((unsigned char)0xff + (unsigned char)0)
 #define ARCH_MAX_USHORT ((unsigned short)0xffff + (unsigned short)0)
 #define ARCH_MAX_UINT ((unsigned int)~0 + (unsigned int)0)
 #define ARCH_MAX_ULONG ((unsigned long)~0L + (unsigned long)0)
 
 
 #define ARCH_MAX_UCHAR ((unsigned char)0xff + (unsigned char)0)
 #define ARCH_MAX_USHORT ((unsigned short)0xffff + (unsigned short)0)
 #define ARCH_MAX_UINT ((unsigned int)~0 + (unsigned int)0)
 #define ARCH_MAX_ULONG ((unsigned long)~0L + (unsigned long)0)
 
-/* ---------------- Miscellaneous ---------------- */
+        /* ---------------- Miscellaneous ---------------- */
 
 
-#define ARCH_IS_BIG_ENDIAN 1
+#define ARCH_IS_BIG_ENDIAN 0
 #define ARCH_PTRS_ARE_SIGNED 0
 #define ARCH_FLOATS_ARE_IEEE 1
 #define ARCH_ARITH_RSHIFT 2
 #define ARCH_DIV_NEG_POS_TRUNCATES 1
 #define ARCH_PTRS_ARE_SIGNED 0
 #define ARCH_FLOATS_ARE_IEEE 1
 #define ARCH_ARITH_RSHIFT 2
 #define ARCH_DIV_NEG_POS_TRUNCATES 1
-
diff --git a/packages/ghostscript/arch-i686.h b/packages/ghostscript/arch-i686.h
new file mode 100644 (file)
index 0000000..3ec8101
--- /dev/null
@@ -0,0 +1,40 @@
+/* Parameters derived from machine and compiler architecture. */
+/* This file is generated mechanically by genarch.c. */
+
+        /* ---------------- Scalar alignments ---------------- */
+
+#define ARCH_ALIGN_SHORT_MOD 2
+#define ARCH_ALIGN_INT_MOD 4
+#define ARCH_ALIGN_LONG_MOD 4
+#define ARCH_ALIGN_PTR_MOD 4
+#define ARCH_ALIGN_FLOAT_MOD 4
+#define ARCH_ALIGN_DOUBLE_MOD 4
+
+        /* ---------------- Scalar sizes ---------------- */
+
+#define ARCH_LOG2_SIZEOF_CHAR 0
+#define ARCH_LOG2_SIZEOF_SHORT 1
+#define ARCH_LOG2_SIZEOF_INT 2
+#define ARCH_LOG2_SIZEOF_LONG 2
+#define ARCH_LOG2_SIZEOF_LONG_LONG 3
+#define ARCH_SIZEOF_GX_COLOR_INDEX 8
+#define ARCH_SIZEOF_PTR 4
+#define ARCH_SIZEOF_FLOAT 4
+#define ARCH_SIZEOF_DOUBLE 8
+#define ARCH_FLOAT_MANTISSA_BITS 24
+#define ARCH_DOUBLE_MANTISSA_BITS 53
+
+        /* ---------------- Unsigned max values ---------------- */
+
+#define ARCH_MAX_UCHAR ((unsigned char)0xff + (unsigned char)0)
+#define ARCH_MAX_USHORT ((unsigned short)0xffff + (unsigned short)0)
+#define ARCH_MAX_UINT ((unsigned int)~0 + (unsigned int)0)
+#define ARCH_MAX_ULONG ((unsigned long)~0L + (unsigned long)0)
+
+        /* ---------------- Miscellaneous ---------------- */
+
+#define ARCH_IS_BIG_ENDIAN 0
+#define ARCH_PTRS_ARE_SIGNED 0
+#define ARCH_FLOATS_ARE_IEEE 1
+#define ARCH_ARITH_RSHIFT 2
+#define ARCH_DIV_NEG_POS_TRUNCATES 1
diff --git a/packages/ghostscript/arch-x86_64.h b/packages/ghostscript/arch-x86_64.h
new file mode 100644 (file)
index 0000000..a05de29
--- /dev/null
@@ -0,0 +1,40 @@
+/* Parameters derived from machine and compiler architecture. */
+/* This file is generated mechanically by genarch.c. */
+
+        /* ---------------- Scalar alignments ---------------- */
+
+#define ARCH_ALIGN_SHORT_MOD 2
+#define ARCH_ALIGN_INT_MOD 4
+#define ARCH_ALIGN_LONG_MOD 8
+#define ARCH_ALIGN_PTR_MOD 8
+#define ARCH_ALIGN_FLOAT_MOD 4
+#define ARCH_ALIGN_DOUBLE_MOD 8
+
+        /* ---------------- Scalar sizes ---------------- */
+
+#define ARCH_LOG2_SIZEOF_CHAR 0
+#define ARCH_LOG2_SIZEOF_SHORT 1
+#define ARCH_LOG2_SIZEOF_INT 2
+#define ARCH_LOG2_SIZEOF_LONG 3
+#define ARCH_LOG2_SIZEOF_LONG_LONG 3
+#define ARCH_SIZEOF_GX_COLOR_INDEX 8
+#define ARCH_SIZEOF_PTR 8
+#define ARCH_SIZEOF_FLOAT 4
+#define ARCH_SIZEOF_DOUBLE 8
+#define ARCH_FLOAT_MANTISSA_BITS 24
+#define ARCH_DOUBLE_MANTISSA_BITS 53
+
+        /* ---------------- Unsigned max values ---------------- */
+
+#define ARCH_MAX_UCHAR ((unsigned char)0xff + (unsigned char)0)
+#define ARCH_MAX_USHORT ((unsigned short)0xffff + (unsigned short)0)
+#define ARCH_MAX_UINT ((unsigned int)~0 + (unsigned int)0)
+#define ARCH_MAX_ULONG ((unsigned long)~0L + (unsigned long)0)
+
+        /* ---------------- Miscellaneous ---------------- */
+
+#define ARCH_IS_BIG_ENDIAN 0
+#define ARCH_PTRS_ARE_SIGNED 0
+#define ARCH_FLOATS_ARE_IEEE 1
+#define ARCH_ARITH_RSHIFT 2
+#define ARCH_DIV_NEG_POS_TRUNCATES 1
diff --git a/packages/ghostscript/build.sh b/packages/ghostscript/build.sh
new file mode 100644 (file)
index 0000000..3afc430
--- /dev/null
@@ -0,0 +1,17 @@
+TERMUX_PKG_HOMEPAGE=http://www.ghostscript.com/
+TERMUX_PKG_DESCRIPTION="Interpreter for the PostScript language and for PDF"
+TERMUX_PKG_VERSION=9.21
+TERMUX_PKG_SRCURL=https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/download/gs${TERMUX_PKG_VERSION//.}/ghostpdl-${TERMUX_PKG_VERSION}.tar.gz
+TERMUX_PKG_SHA256=82abf56e96e27cf4d1b17c0671f9ab3c5222454131588a49d06c97a332988e8d
+TERMUX_PKG_DEPENDS="libandroid-support, libtiff, libjpeg-turbo, libpng, libexpat"
+TERMUX_PKG_EXTRA_CONFIGURE_ARGS="--with-system-libtiff \
+--enable-little-endian \
+--without-x \
+--with-arch_h=$TERMUX_PKG_BUILDER_DIR/arch-${TERMUX_ARCH}.h \
+CCAUX=gcc \
+--build=$TERMUX_BUILD_TUPLE \
+--without-pcl"
+
+termux_step_post_extract_package () {
+        rm -rdf $TERMUX_PKG_SRCDIR/{jpeg,libpng,expat,jasper,freetype,lcms,tiff}
+}
index 895e16f462465d385c588532a496f6ccc3496adb..09e9a79027e70196bc1dd463d12cdd57f7992ea4 100755 (executable)
@@ -30,6 +30,8 @@ PACKAGES+=" scons"
 PACKAGES+=" texinfo"
 PACKAGES+=" xmlto"
 #PACKAGES+=" xutils-dev" # Provides 'makedepend' which the openssl build uses.
 PACKAGES+=" texinfo"
 PACKAGES+=" xmlto"
 #PACKAGES+=" xutils-dev" # Provides 'makedepend' which the openssl build uses.
+PACKAGES+=" expat" # Needed by ghostscript
+PACKAGES+=" libjpeg-turbo" # Needed by ghostscript
 
 sudo pacman -Syq --noconfirm $PACKAGES
 
 
 sudo pacman -Syq --noconfirm $PACKAGES
 
index 7a1678700f4c50fbd69e0318deb304d120c2bae8..5c1b0f722581468d1e880b12ae5d5df3a17fec26 100755 (executable)
@@ -34,6 +34,8 @@ PACKAGES+=" scons"
 PACKAGES+=" texinfo"
 PACKAGES+=" xmlto"
 PACKAGES+=" xutils-dev" # Provides 'makedepend' which the openssl build uses.
 PACKAGES+=" texinfo"
 PACKAGES+=" xmlto"
 PACKAGES+=" xutils-dev" # Provides 'makedepend' which the openssl build uses.
+PACKAGES+=" libexpat1-dev" # Needed by ghostscript
+PACKAGES+=" libjpeg-dev" # Needed by ghostscript
 
 DEBIAN_FRONTEND=noninteractive sudo apt-get install -yq $PACKAGES
 
 
 DEBIAN_FRONTEND=noninteractive sudo apt-get install -yq $PACKAGES