summaryrefslogtreecommitdiff
path: root/media-gfx/tic98
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
committerV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
commit4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch)
treeba5f07bf3f9d22d82e54a462313f5d244036c768 /media-gfx/tic98
reinit the tree, so we can have metadata
Diffstat (limited to 'media-gfx/tic98')
-rw-r--r--media-gfx/tic98/Manifest8
-rw-r--r--media-gfx/tic98/files/tic98-1.01-gentoo.diff205
-rw-r--r--media-gfx/tic98/files/tic98-1.01-glibc-2.10.patch20
-rw-r--r--media-gfx/tic98/files/tic98-1.01-macos.patch26
-rw-r--r--media-gfx/tic98/metadata.xml8
-rw-r--r--media-gfx/tic98/tic98-1.01-r3.ebuild45
6 files changed, 312 insertions, 0 deletions
diff --git a/media-gfx/tic98/Manifest b/media-gfx/tic98/Manifest
new file mode 100644
index 000000000000..0f8a9cc38358
--- /dev/null
+++ b/media-gfx/tic98/Manifest
@@ -0,0 +1,8 @@
+AUX tic98-1.01-gentoo.diff 5452 SHA256 b526d8dc6f4539074a40c5f24dbbc72d4974b6d8d7dae650dca1bae86f38c933 SHA512 89636f8dade2e9cf6a250b51e1b5a6ca11571e6e7216cfe36306e0004528493fc16c32d7de96f10aed1ae584e23ed2dcbca62e752c46ef2e554224b23e0fb91f WHIRLPOOL 2be9ccba3ff42526b448ade4a4609f32bfddd3279f71da3e3c2e3e6f3b389c9e214352a0dbe3a2c67bef27601926febd5617f3295193f717da1e3b0079fa0fe9
+AUX tic98-1.01-glibc-2.10.patch 624 SHA256 c5945652b7d44e7ba503e339263cb6b06b109e67537bb2b259399314907385db SHA512 282714f6f51e52a44440493acc510fa3c00274c42ef544526dd5ce35488022e18767bf53e6a5cce385d2d30c4b3caf53f9c61a65a64342456463c5a90a7da843 WHIRLPOOL 3093d316b9d57dc4425304adbd9365f0dae6be20ab34b8cf409f3a258be6c8887e95a255e4b05a6021e962ecab0a7b03ebf28f4e045355d518cde9446fda055d
+AUX tic98-1.01-macos.patch 643 SHA256 2c2a9970f1429fc04631a758ebd61b34e56d8770ff1de423b021dda453e6a1b2 SHA512 0ddc4616e4f4dfe16825199c4414d326ca8016a2df0052cbbc396a56e1f898cac5fa072bb4b400f800254e359d9fbdb87b86477f006c4d6a38bf0d71def2bc93 WHIRLPOOL 1656afe953638dc9ab2de07c3efe2418b07f51d766fc8cab4dc8e5580dd4877c5e8beb010d2d593207a832086b382225748e906ceecf0bdec82a6f0f1359e318
+DIST tic98-1.01.tar.bz2 99145 SHA256 0e65a851ccc6fb45652ed03760e5973bac494ac2f07a9a7cccc0e7ccafe06fa2 SHA512 3bb6c72f0a9ed199f2eb1ceb53a5552b384510a9f6ecdfabf7f79e815cb0511cf880a00bddf5b88b49ea416fbcf7fed5e84af1ee2fbed7c313b39ee042efa797 WHIRLPOOL 047dd5e382fef34c67c80cc91f968f6ce34c31ae2d308e7a0f9d6ebd8e1c486c2221052bc33e18111df91277451c0602d0ee6630c5005d40cbbc5b5ee589c887
+EBUILD tic98-1.01-r3.ebuild 1083 SHA256 246bf3d9bce0f2a35ff8d7e54162ec4bd775bbda7edfe03b8849db070ed21e4f SHA512 8b0408a2821b48dddb2e13fe1e9967062dab21a79ba7899fd79e28021a3cc07618b494c9c83c3662103ccea5b9280d2829877711a969271ed230cedb58da0dff WHIRLPOOL 7c5c5ec85152facdae73da02139da573a3d32d1eeb74a1992aeee297d4c619233db8fb1bd4fbdcd9c6aa78c0f79b06204dde31ed830b0d29ecad9c9b0311955c
+MISC ChangeLog 2526 SHA256 676060ed6422000f0a020100381638ce7f6d2135dcb287be1a0051fab68df536 SHA512 d796782711ae1f46092372c3a14073712d480a1a0d898746b185e68fdc570a91ecba5e63444925cd5635d03d778166b9da02fd68120026caeca912bf01faaeea WHIRLPOOL 2d3f7728f9f7d1d9c48b1ec62dd65e9a325ecf909a17ac490399b1272369722f5b0c09143809a77f84a829f2718bd20ac2e2843a40cde057c00f34620d149fd9
+MISC ChangeLog-2015 2537 SHA256 249b24b093409ade17c300c2f235b8a92cae315714bad5c59dc5963820e6f517 SHA512 640a05d38185001d3f44db9c2beab370c16255af0f876a443e8f980a637362d9c1111d9a76d66aed6841e3c37fa1ef699b08d13164a4d1750fef28adf379daa0 WHIRLPOOL eeaab894fac8b89b7640a0b92625e626d83d4909951dc95f56ab57a9e7ac95b9a07e615354a00ebf3189bd61641b0e472525d5bbf08be51524f511afa1862b60
+MISC metadata.xml 255 SHA256 3e7137870fc49956d79719e3dfe029775cbaaa097e85748c139713c46fcd1798 SHA512 b7bc93530a1726c2d4dfbc71ae29cfbb57712fd9fdd2e76fd52f35ab4368cba0497b50145d1527a3b79e465d459a380821bb1371a01c2e915dc9adc6c7fafd5f WHIRLPOOL 392188d7e069f1720be9329edfb31b11b176bf0c411023b2ceeaeabef1cacf842d70657a2a14ac2ddabbdad70a304275f3b587e9bcdfe77be63a0092e370252c
diff --git a/media-gfx/tic98/files/tic98-1.01-gentoo.diff b/media-gfx/tic98/files/tic98-1.01-gentoo.diff
new file mode 100644
index 000000000000..880dfa059545
--- /dev/null
+++ b/media-gfx/tic98/files/tic98-1.01-gentoo.diff
@@ -0,0 +1,205 @@
+diff -Nru tic98/Makefile tic98.gentoo/Makefile
+--- tic98/Makefile 1999-06-22 05:00:58.000000000 -0400
++++ tic98.gentoo/Makefile 2002-10-19 18:20:55.000000000 -0400
+@@ -1,4 +1,4 @@
+-BIN=/home/singlis/linux/bin
++BIN=/usr/bin
+ IMAGES=/home/ml/singlis
+ LIBTIC=
+ LIBS= -lm #-L/home/singlis/linux/lib -lccmalloc -ldl
+@@ -180,4 +180,4 @@
+ boundary.o getopt.o windowing.o
+ $(CC) -o $@ $^ $(LIBS)
+
+-
+\ No newline at end of file
++
+diff -Nru tic98/arithcode.c tic98.gentoo/arithcode.c
+--- tic98/arithcode.c 1999-06-21 21:48:40.000000000 -0400
++++ tic98.gentoo/arithcode.c 2002-10-19 18:19:20.000000000 -0400
+@@ -610,7 +610,7 @@
+ bits_to_go = 0;
+ }
+
+-#ifdef 0
++#ifdef none
+ void
+ arith_encode( unsigned int lbnd, unsigned int hbnd, unsigned int totl )
+ /* Arithmetically encode the range. */
+@@ -645,7 +645,7 @@
+ }
+
+
+-#ifdef 0
++#ifdef none
+ void arith_decode( unsigned int lbnd, unsigned int hbnd, unsigned int totl )
+ /* Arithmetically decode the range. */
+ {
+@@ -726,7 +726,7 @@
+
+
+
+-#ifdef 0
++#ifdef none
+
+ void
+ EncodeGammaSigned (int snum, int *pos, int *neg)
+diff -Nru tic98/b_gamma.c tic98.gentoo/b_gamma.c
+--- tic98/b_gamma.c 1999-06-21 21:48:41.000000000 -0400
++++ tic98.gentoo/b_gamma.c 2002-10-19 18:18:43.000000000 -0400
+@@ -187,7 +187,7 @@
+ }
+ }
+
+-#ifdef 0
++#ifdef none
+ void
+ b_gamma_encode_64(unsigned long num)
+ {
+diff -Nru tic98/docstrum.c tic98.gentoo/docstrum.c
+--- tic98/docstrum.c 1999-07-01 15:58:37.000000000 -0400
++++ tic98.gentoo/docstrum.c 2002-10-19 18:19:39.000000000 -0400
+@@ -672,7 +672,7 @@
+ calc_docstrum_spacing(list,neighs,0,&within,&between);
+
+ prune_neighbours_distance(neighs,len, 3*between);
+-#ifdef 0
++#ifdef none
+ prune_neighbours_angle_distance(neighs,len, 0,30, 6*within/*MIN(6*within,sqrt(2.0)*between)*/);
+ #endif
+
+diff -Nru tic98/ppmd_model.c tic98.gentoo/ppmd_model.c
+--- tic98/ppmd_model.c 1999-06-21 21:48:42.000000000 -0400
++++ tic98.gentoo/ppmd_model.c 2002-10-19 18:20:33.000000000 -0400
+@@ -496,7 +496,7 @@
+ arithmetic_encode( lbnd, hbnd, totl );
+ }
+
+-#ifdef 0
++#ifdef none
+ unsigned int
+ arith_decode_target (unsigned int totl)
+ /* Arithmetically decodes the target. */
+diff -Nru tic98.orig/page_features.c tic98/page_features.c
+--- tic98.orig/page_features.c 1999-06-22 03:48:42.000000000 +0200
++++ tic98/page_features.c 2005-08-02 19:47:09.485681960 +0200
+@@ -37,18 +37,17 @@
+ void
+ dump_header()
+ {
+- fprintf(stdout,"@arff 3
+-@relation features
+-@attribute 'Number' real
+-@attribute 'Area' real
+-@attribute 'Avg_area' real
+-@attribute 'Density' real
+-@attribute 'Aspect' real
+-@attribute 'Holes' real
+-@attribute 'Edges' real
+-@attribute 'class' string range ( {?} )
+-@data
+-");
++ fprintf(stdout,"@arff 3"
++"@relation features"
++"@attribute 'Number' real"
++"@attribute 'Area' real"
++"@attribute 'Avg_area' real"
++"@attribute 'Density' real"
++"@attribute 'Aspect' real"
++"@attribute 'Holes' real"
++"@attribute 'Edges' real"
++"@attribute 'class' string range ( {?} )"
++"@data");
+
+
+ }
+diff -ru tic98/main_tic.c tic98-new/main_tic.c
+--- tic98/main_tic.c Thu Jul 1 21:02:56 1999
++++ tic98-new/main_tic.c Fri Mar 16 11:43:56 2001
+@@ -11,6 +11,7 @@
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <string.h>
++#include <errno.h>
+
+ #include "arithcode.h"
+ #include "globals.h"
+@@ -96,8 +97,10 @@
+ marklistptr list=NULL,list2=NULL;
+ marktype copy;
+
+- if(marktype_readnamed(fn, image)!=0)
++ if(marktype_readnamed(fn, image)!=0) {
++ fprintf(stderr, "imagefn_to_list(): bad input file %s\n", fn);
+ return NULL;
++ }
+
+ *w=image->w;
+ *h=image->h;
+@@ -495,7 +498,10 @@
+
+ TimerStart(1);
+
+- freopen(outfilename[0],"wb",stdout);
++ if (! freopen(outfilename[0],"wb",stdout)) {
++ fprintf(stderr, "failed to open %s for writing: %s\n",
++ outfilename[0], strerror(errno));
++ }
+
+ tic98_init(&t);
+ tic98_start_encoding();
+@@ -503,8 +509,11 @@
+ for(i=0;i<num_in;i++){
+ int w,h,xx,yy,ok=0;
+ marktype image;
+- list=imagefn_to_list(&image,infilename[i], &w, &h);
+-
++ if (! (list=imagefn_to_list(&image,infilename[i], &w, &h))) {
++ fprintf(stderr, "cannot read file %s\n", infilename[i]);
++ exit(1);
++ }
++
+ tic98_num_encode(&t,NEW_PAGE);
+
+ for(xx=0;xx<image.w;xx++)
+@@ -560,7 +569,10 @@
+ newoutname=(char*)malloc(sizeof(char)*(strlen(outfilename[0])+10));
+ assert(newoutname);
+
+- freopen(infilename[0],"rb",stdin);
++ if (! freopen(infilename[0],"rb",stdin)) {
++ fprintf(stderr, "failed to open %s for reading: %s\n",
++ infilename[0], strerror(errno));
++ }
+
+ tic98_init(&t);
+ tic98_start_decoding();
+diff -ru tic98/marklist.c tic98-new/marklist.c
+--- tic98/marklist.c Thu Jul 1 21:56:19 1999
++++ tic98-new/marklist.c Fri Mar 16 11:44:20 2001
+@@ -94,11 +94,11 @@
+ magic = magic_popnamed (fn, &err) >> 16; /* only interested in first 2 bytes */
+
+ if (err != 0) {
+- return 1; /* failure */
+ fprintf (stderr, "error - can't open file '%s'\n", fn);
+- return 1;
++ return 1; /* failure */
+ }
+ if (!((magic == MAGIC_P1) || (magic == MAGIC_P4))) {
++ fprintf (stderr, "bad magic in file '%s'\n", fn);
+ return 1;
+ }
+ if (fn2) {
+diff -ru tic98/utils.c tic98-new/utils.c
+--- tic98/utils.c Tue Jun 22 02:48:43 1999
++++ tic98-new/utils.c Fri Mar 16 11:23:57 2001
+@@ -117,7 +117,7 @@
+ }
+ else{
+ *err=1;
+-/* error("magic_popnamed","can't open file",fn);*/
++ error("magic_popnamed","can't open file",fn);
+ return 0;
+ }
+ }
diff --git a/media-gfx/tic98/files/tic98-1.01-glibc-2.10.patch b/media-gfx/tic98/files/tic98-1.01-glibc-2.10.patch
new file mode 100644
index 000000000000..32caf5e43477
--- /dev/null
+++ b/media-gfx/tic98/files/tic98-1.01-glibc-2.10.patch
@@ -0,0 +1,20 @@
+--- tic98.orig/ppmd_enc.c 2009-07-05 14:15:53.000000000 +0200
++++ tic98/ppmd_enc.c 2009-07-05 14:18:47.000000000 +0200
+@@ -63,7 +63,7 @@
+ }
+
+ int
+-getline (FILE *fp, char *s, int max)
++tic98_getline (FILE *fp, char *s, int max)
+ /* Read line from FP into S; return its length (maximum length = MAX). */
+ {
+ int i;
+@@ -111,7 +111,7 @@
+ ppm_start_encoding (max_order, max_symbol);
+
+ /* Read in the integers */
+- while ((len = getline (fp, line, MAX_LINE)) != EOF)
++ while ((len = tic98_getline (fp, line, MAX_LINE)) != EOF)
+ {
+ count++;
+ if ((debugProgress) && ((count % debugProgress) == 0))
diff --git a/media-gfx/tic98/files/tic98-1.01-macos.patch b/media-gfx/tic98/files/tic98-1.01-macos.patch
new file mode 100644
index 000000000000..607e76f9416a
--- /dev/null
+++ b/media-gfx/tic98/files/tic98-1.01-macos.patch
@@ -0,0 +1,26 @@
+--- tic98/ppmd_hash.c.orig 2005-11-03 11:09:22.000000000 +0100
++++ tic98/ppmd_hash.c 2005-11-03 11:09:49.000000000 +0100
+@@ -2,7 +2,9 @@
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <assert.h>
++#ifndef __APPLE__
+ #include <malloc.h>
++#endif
+ #include "ppmd_hash.h"
+
+ #define HASH_NULL 0
+--- tic98/ppmd_model.c.orig 2005-11-03 11:07:09.000000000 +0100
++++ tic98/ppmd_model.c 2005-11-03 11:09:04.000000000 +0100
+@@ -1,7 +1,11 @@
+ /* PPM* model for arithmetic encoder. */
+ #include <stdio.h>
+ #include <assert.h>
++#ifndef __APPLE__
+ #include <malloc.h>
++#else
++#include <stdlib.h>
++#endif
+ #include "arithcode.h"
+ #include "ppmd_hash.h"
+
diff --git a/media-gfx/tic98/metadata.xml b/media-gfx/tic98/metadata.xml
new file mode 100644
index 000000000000..19bf1be2581e
--- /dev/null
+++ b/media-gfx/tic98/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer type="project">
+ <email>graphics@gentoo.org</email>
+ <name>Gentoo Graphics Project</name>
+</maintainer>
+</pkgmetadata>
diff --git a/media-gfx/tic98/tic98-1.01-r3.ebuild b/media-gfx/tic98/tic98-1.01-r3.ebuild
new file mode 100644
index 000000000000..f02741df8cff
--- /dev/null
+++ b/media-gfx/tic98/tic98-1.01-r3.ebuild
@@ -0,0 +1,45 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=4
+
+inherit eutils
+
+DESCRIPTION="compressor for black-and-white images, in particular scanned documents"
+HOMEPAGE="http://membled.com/work/mirror/tic98/"
+SRC_URI="http://membled.com/work/mirror/tic98/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 x86 ~amd64-linux ~x86-linux ~ppc-macos"
+IUSE=""
+
+RESTRICT="test"
+
+S="${WORKDIR}/${PN}"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${P}-macos.patch
+ epatch "${FILESDIR}"/${P}-gentoo.diff
+ epatch "${FILESDIR}"/${P}-glibc-2.10.patch
+
+ # respect CFLAGS and LDFLAGS
+ sed -i -e "s:CFLAGS= -O -Wall -Wno-unused:CFLAGS=${CFLAGS}:" \
+ -e "s:LIBS= -lm #-L/home/singlis/linux/lib -lccmalloc -ldl:LIBS= -lm ${LDFLAGS}:" \
+ -e "s:CC= gcc -pipe :CC=$(tc-getCC):" \
+ -e "s:CPP= gcc -pipe:CPP=$(tc-getCPP):" \
+ Makefile || die
+}
+
+src_compile() {
+ emake all
+ emake all2
+}
+
+src_install() {
+ dodir /usr/bin
+ emake BIN="${ED}"usr/bin install
+
+ # collision with media-gfx/netpbm, see bug #207534
+ rm "${ED}"/usr/bin/pbmclean || die
+}