[141470] trunk/dports/textproc/barcode
cal at macports.org
cal at macports.org
Sat Dec 12 01:40:04 PST 2015
Revision: 141470
https://trac.macports.org/changeset/141470
Author: cal at macports.org
Date: 2015-10-19 10:56:17 -0700 (Mon, 19 Oct 2015)
Log Message:
-----------
barcode: update to 0.99
Additionally:
- Drop Debian patches that have neither been submitted upstream nor have
a good description of why they are necessary
- Apply patches that fix two build problems
- Reorganize the Portfile a bit, use modern checksums
- Rename the ${prefix}/bin/sample binary to ${prefix}/bin/barcode-sample
Modified Paths:
--------------
trunk/dports/textproc/barcode/Portfile
Added Paths:
-----------
trunk/dports/textproc/barcode/files/patch-Makefile.am-sample-may-need-replacement-calloc-from-libgnu.diff
trunk/dports/textproc/barcode/files/patch-barcode.h-library.h-avoid-global-declaration-in-header.diff
trunk/dports/textproc/barcode/files/patch-codeabar.c-correct-output.diff
Removed Paths:
-------------
trunk/dports/textproc/barcode/files/01-codabar.patch
trunk/dports/textproc/barcode/files/02-margin.patch
trunk/dports/textproc/barcode/files/03-oversize.patch
trunk/dports/textproc/barcode/files/Makefile.in.patch
trunk/dports/textproc/barcode/files/main.c.patch
Modified: trunk/dports/textproc/barcode/Portfile
===================================================================
--- trunk/dports/textproc/barcode/Portfile 2015-10-19 16:13:27 UTC (rev 141469)
+++ trunk/dports/textproc/barcode/Portfile 2015-10-19 17:56:17 UTC (rev 141470)
@@ -2,13 +2,15 @@
# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
PortSystem 1.0
+PortGroup gnu_info 1.0
name barcode
-version 0.98
-revision 2
-categories textproc print
+version 0.99
+checksums rmd160 44c1574c0a48efae2fc267aab914c03577a4ec4a \
+ sha256 7c031cf3eb811242f53664379aebbdd9fae0b7b26b5e5d584c31a9f338154b64
+
+homepage http://www.gnu.org/software/${name}/
license GPL-2+
-maintainers nomaintainer
description convert text strings to printed barcodes
long_description \
Main features of GNU Barcode: \
@@ -17,23 +19,27 @@
- PostScript and Encapsulated PostScript output \
- Accepts sizes and positions as inches, centimeters, millimeters \
- Can create tables of barcodes (to print labels on sticker pages)
-homepage http://www.gnu.org/software/${name}/
+
+categories textproc print
+maintainers nomaintainer
platforms darwin
+
master_sites gnu
-checksums md5 7f10c3307b84a19a4ab2fa4b3f2974da
-patch.pre_args -p1
-patchfiles Makefile.in.patch \
- 01-codabar.patch \
- 02-margin.patch \
- 03-oversize.patch \
- main.c.patch
+patchfiles patch-Makefile.am-sample-may-need-replacement-calloc-from-libgnu.diff \
+ patch-barcode.h-library.h-avoid-global-declaration-in-header.diff \
+ patch-codeabar.c-correct-output.diff
use_autoreconf yes
+autoreconf.args -fvi
destroot.destdir prefix=${destroot}${prefix} \
MAN1DIR=${destroot}${prefix}/share/man/man1 \
MAN3DIR=${destroot}${prefix}/share/man/man3 \
INFODIR=${destroot}${prefix}/share/info
+post-destroot {
+ file rename ${destroot}${prefix}/bin/sample ${destroot}${prefix}/bin/${name}-sample
+}
+
depends_lib port:libpaper
Deleted: trunk/dports/textproc/barcode/files/01-codabar.patch
===================================================================
--- trunk/dports/textproc/barcode/files/01-codabar.patch 2015-10-19 16:13:27 UTC (rev 141469)
+++ trunk/dports/textproc/barcode/files/01-codabar.patch 2015-10-19 17:56:17 UTC (rev 141470)
@@ -1,46 +0,0 @@
-Author: Chris Howie <crazycomputers at yahoo.com>
-Description: Following codabar specification (Closes: #320908).
-
-diff -Naurp barcode.orig/codabar.c barcode/codabar.c
---- barcode.orig/codabar.c 2009-07-16 21:49:31.000000000 +0000
-+++ barcode/codabar.c 2009-07-16 21:55:33.000000000 +0000
-@@ -29,10 +29,11 @@
-
- /* this is ordered in decades to simplify encoding */
- static char alphabet[] =
-- "0123456789" "-$:/.+ABCD";
-+ "0123456789" "-$:/.+ABCDTN*E";
-
- #define CODE_A 16
- #define CODE_B 17
-+#define CODE_T 20
-
- #define NARROW 12
- #define WIDE 14
-@@ -42,7 +43,8 @@ static char *patterns[] = {
- "1111133","1111331","1113113","3311111","1131131",
- "3111131","1311113","1311311","1331111","3113111",
- "1113311","1133111","3111313","3131113","3131311",
--"1131313","1133131","1313113","1113133","1113331" };
-+"1131313","1133131","1313113","1113133","1113331",
-+"1133131","1313113","1113133","1113331"};
-
- /*
- * Check that the text can be encoded. Returns 0 or -1.
-@@ -167,13 +169,13 @@ int Barcode_cbr_encode(struct Barcode_It
- }
- if (!startpresent) {
- if (usesum) {
-- /* if no start character specified, B is used as a stop char */
-- checksum += CODE_B;
-+ /* if no start character specified, T is used as a stop char */
-+ checksum += CODE_T;
- checksum = (checksum + 15) / 16 * 16 - checksum;
- add_one(ptr, checksum);
- ptr += strlen(ptr);
- }
-- add_one(ptr, CODE_B);
-+ add_one(ptr, CODE_T);
- }
- bc->partial = partial;
- bc->textinfo = textinfo;
Deleted: trunk/dports/textproc/barcode/files/02-margin.patch
===================================================================
--- trunk/dports/textproc/barcode/files/02-margin.patch 2015-10-19 16:13:27 UTC (rev 141469)
+++ trunk/dports/textproc/barcode/files/02-margin.patch 2015-10-19 17:56:17 UTC (rev 141470)
@@ -1,83 +0,0 @@
-Author: n/a
-Description: Adjusts correct margins.
-
-diff -Naurp barcode.orig/main.c barcode/main.c
---- barcode.orig/main.c 2009-07-16 21:49:31.000000000 +0000
-+++ barcode/main.c 2009-07-16 21:56:09.000000000 +0000
-@@ -419,7 +419,6 @@ char *strerror(int error)
- */
- int main(int argc, char **argv)
- {
-- struct Barcode_Item * bc;
- FILE *ifile = stdin;
- FILE *ofile = stdout;
- char *line;
-@@ -549,50 +548,37 @@ int main(int argc, char **argv)
- int ystep = (page_hei - ymargin0 - ymargin1)/lines;
- int x = columns, y = -1; /* position in the table, start off-page */
-
-- if (!ximargin) ximargin = BARCODE_DEFAULT_MARGIN;
-- if (!yimargin) yimargin = BARCODE_DEFAULT_MARGIN;
-- /* Assign default size unless -g did it (Joachim Reichelt) */
-- if ( !code_width && !code_height) {
-- code_width = xstep - 2*ximargin;
-- code_height = ystep - 2*yimargin;
-- }
--
- page=0;
-+
-+
- while ( (line = retrieve_input_string(ifile)) ) {
- x++; /* fit x and y */
- if (x >= columns) {
- x=0; y--;
- if (y<0) {
- y = lines-1; page++;
-- /* flush page */
-- if (ps && page > 1) fprintf(ofile, "showpage\n");
-- if (pcl && page > 1) fprintf(ofile, "\f");
-- /* new page */
-- if (ps) fprintf(ofile, "%%%%Page: %i %i\n\n",page,page);
-+ if (page>1) {
-+ if (ps) {
-+ fprintf(ofile, "showpage\n");
-+ fprintf(ofile, "%%%%Page: %i %i\n\n",page,page);
-+ }
-+ if (pcl) fprintf(ofile, "\f");
-+ }
- }
- }
-
- /*
-- * Create a barcode item. This allows to set the margin to 0, as
-- * we have [xy]imargin to use. But don't use Encode_and_Print(),
-- * unroll it here instead
-+ * Print this code, using the internal margins as spacing.
-+ * In order to remove the extra (default) margin, subtract it
-+ * in advance (dirty)
- */
-- bc = Barcode_Create(line);
-- if (!bc) {
-- fprintf(stderr, "%s: Barcode_Create(): %s\n", argv[0],
-- strerror(errno));
-- exit(1);
-- }
-- bc->margin = 0;
-- if ( (Barcode_Position(bc, code_width, code_height,
-- xmargin0 + ximargin + x * xstep,
-- ymargin0 + yimargin + y * ystep, 0.0) < 0)
-- || (Barcode_Encode(bc, flags) < 0)
-- || (Barcode_Print(bc, ofile, flags) < 0) ) {
-- fprintf(stderr, "%s: can't encode \"%s\": %s\n", argv[0],
-- line, strerror(bc->error));
-+ if (Barcode_Encode_and_Print(line, ofile,
-+ xstep - 2*ximargin, ystep - 2*yimargin,
-+ xmargin0 + ximargin + x * xstep - BARCODE_DEFAULT_MARGIN,
-+ ymargin0 + yimargin + y * ystep - BARCODE_DEFAULT_MARGIN,
-+ flags)<0) {
-+ fprintf(stderr, "%s: can't encode \"%s\"\n", argv[0], line);
- }
-- Barcode_Delete(bc);
- }
- if (ps) fprintf(ofile, "showpage\n\n%%%%Trailer\n\n");
- if (pcl) fprintf(ofile, "\f");
Deleted: trunk/dports/textproc/barcode/files/03-oversize.patch
===================================================================
--- trunk/dports/textproc/barcode/files/03-oversize.patch 2015-10-19 16:13:27 UTC (rev 141469)
+++ trunk/dports/textproc/barcode/files/03-oversize.patch 2015-10-19 17:56:17 UTC (rev 141470)
@@ -1,147 +0,0 @@
-Author: Paolo <oopla at users.sf.net>
-Description: Fixing oversized images (Closes: #320908).
-
-diff -Naurp barcode.orig/codabar.c barcode/codabar.c
---- barcode.orig/codabar.c 2009-07-16 21:49:31.000000000 +0000
-+++ barcode/codabar.c 2009-07-16 21:57:12.000000000 +0000
-@@ -165,6 +165,7 @@ int Barcode_cbr_encode(struct Barcode_It
- ptr += strlen(ptr);
- }
- }
-+ textptr[-1] = '\0'; /* overwrite last space */
- if (!startpresent) {
- if (usesum) {
- /* if no start character specified, B is used as a stop char */
-diff -Naurp barcode.orig/code128.c barcode/code128.c
---- barcode.orig/code128.c 2009-07-16 21:49:31.000000000 +0000
-+++ barcode/code128.c 2009-07-16 21:57:12.000000000 +0000
-@@ -142,6 +142,7 @@ int Barcode_128b_encode(struct Barcode_I
- textptr += strlen(textptr);
- textpos += SYMBOL_WID; /* width of each code */
- }
-+ textptr[-1] = '\0'; /* overwrite last space */
- /* Add the checksum, independent of BARCODE_NO_CHECKSUM */
- checksum %= 103;
- strcat(partial, codeset[checksum]);
-@@ -232,6 +233,7 @@ int Barcode_128c_encode(struct Barcode_I
- textptr += strlen(textptr);
- textpos += SYMBOL_WID; /* width of each code */
- }
-+ textptr[-1] = '\0'; /* overwrite last space */
- /* Add the checksum, independent of BARCODE_NO_CHECKSUM */
- checksum %= 103;
- strcat(partial, codeset[checksum]);
-@@ -492,6 +494,7 @@ int Barcode_128_encode(struct Barcode_It
- textptr += strlen(textptr);
- textpos += step;
- }
-+ textptr[-1] = '\0'; /* overwrite last space */
-
- bc->partial = partial;
- bc->textinfo = textinfo;
-@@ -593,6 +596,7 @@ int Barcode_128raw_encode(struct Barcode
- textpos += SYMBOL_WID; /* width of each code */
- i += n;
- }
-+ textptr[-1] = '\0'; /* overwrite last space */
- /* Add the checksum, independent of BARCODE_NO_CHECKSUM */
- checksum %= 103;
- strcat(partial, codeset[checksum]);
-diff -Naurp barcode.orig/code39.c barcode/code39.c
---- barcode.orig/code39.c 2009-07-16 21:49:31.000000000 +0000
-+++ barcode/code39.c 2009-07-16 21:57:12.000000000 +0000
-@@ -160,6 +160,7 @@ int Barcode_39_encode(struct Barcode_Ite
- textptr += strlen(textptr);
- ptr += strlen(ptr);
- }
-+ textptr[-1] = '\0'; /* overwrite last space */
- /* Add the checksum */
- if ( (bc->flags & BARCODE_NO_CHECKSUM)==0 ) {
- code = (strchr(alphabet, checkbet[checksum % 43]) - alphabet);
-diff -Naurp barcode.orig/code93.c barcode/code93.c
---- barcode.orig/code93.c 2009-07-16 21:49:31.000000000 +0000
-+++ barcode/code93.c 2009-07-16 21:57:12.000000000 +0000
-@@ -182,6 +182,7 @@ int Barcode_93_encode(struct Barcode_Ite
- */
- textpos += 9;
- }
-+ textptr[-1] = '\0'; /* overwrite last space */
- c_checksum=0;
- k_checksum=0;
-
-diff -Naurp barcode.orig/i25.c barcode/i25.c
---- barcode.orig/i25.c 2009-07-16 21:49:31.000000000 +0000
-+++ barcode/i25.c 2009-07-16 21:57:12.000000000 +0000
-@@ -153,6 +153,7 @@ int Barcode_i25_encode(struct Barcode_It
- textpos += 18; /* width of two codes */
- textptr += strlen(textptr);
- }
-+ textptr[-1] = '\0'; /* overwrite last space */
- strcat(partial, guard[1]);
-
- bc->partial = partial;
-diff -Naurp barcode.orig/msi.c barcode/msi.c
---- barcode.orig/msi.c 2009-07-16 21:49:31.000000000 +0000
-+++ barcode/msi.c 2009-07-16 21:57:12.000000000 +0000
-@@ -132,6 +132,7 @@ int Barcode_msi_encode(struct Barcode_It
- }
- }
- }
-+ textptr[-1] = '\0'; /* overwrite last space */
- /* Some implementations use a double checksum. Currently the only way
- * to print a barcode with double checksum is to put the checksum
- * digit printed below at the end of a code in the command line
-diff -Naurp barcode.orig/plessey.c barcode/plessey.c
---- barcode.orig/plessey.c 2009-07-16 21:49:31.000000000 +0000
-+++ barcode/plessey.c 2009-07-16 21:57:12.000000000 +0000
-@@ -140,6 +140,7 @@ int Barcode_pls_encode(struct Barcode_It
- checkptr[4*i+2] = (code >> 2) & 1;
- checkptr[4*i+3] = (code >> 3) & 1;
- }
-+ textptr[-1] = '\0'; /* overwrite last space */
- /* The CRC checksum is required */
- for (i=0; i < 4*strlen(text); i++) {
- int j;
-diff -Naurp barcode.orig/ps.c barcode/ps.c
---- barcode.orig/ps.c 2009-07-16 21:49:31.000000000 +0000
-+++ barcode/ps.c 2009-07-16 21:57:12.000000000 +0000
-@@ -146,11 +146,38 @@ int Barcode_ps_print(struct Barcode_Item
- fprintf(f, "%%!PS-Adobe-2.0\n");
- fprintf(f, "%%%%Creator: libbarcode\n");
- if (bc->flags & BARCODE_OUT_EPS) {
-+ int bboxw;
-+ bboxw=bc->xoff + bc->width + 2* bc->margin;
-+ if (!(bc->flags & BARCODE_NO_ASCII)) {
-+ ptr = strrchr(bc->textinfo,' ');
-+ /*fprintf(stderr, "bc->textinfo=%s\n",bc->textinfo);*/
-+ if (ptr == NULL) {
-+ fprintf(stderr,
-+ "barcode: last char: impossible data: NULL\n");
-+ } else {
-+ /*fprintf(stderr, "ptr=%s\n",ptr);*/
-+ if (sscanf(ptr, "%lf:%lf:%c", &f1, &f2, &c) != 3) {
-+ fprintf(stderr,
-+ "barcode: last char: impossible data: %s\n", ptr);
-+ } else {
-+ /* Both the backslash and the two parens are special */
-+ if (c!='\\' && c!=')' && c!='(') {
-+ f1=bc->xoff + (f1+f2) * scalef + bc->margin;
-+ if (f1 > bboxw) bboxw=f1;
-+ }
-+ }
-+ }
-+ }
- fprintf(f, "%%%%BoundingBox: %i %i %i %i\n",
- bc->xoff,
- bc->yoff,
-- bc->xoff + bc->width + 2* bc->margin,
-+ bboxw,
- bc->yoff + bc->height + 2* bc->margin);
-+ /* fprintf(f, "%%DEBUG: bc->width=%i bc->height=%i bc->margin=%i "
-+ "scalef=%6.2f barlen=%6.2f bc->partial=%c\n",
-+ bc->width, bc->height, bc->margin,
-+ scalef, (double)barlen, (char)bc->partial[0]);
-+ */
- }
- fprintf(f, "%%%%EndComments\n");
- if (bc->flags & BARCODE_OUT_PS) {
Deleted: trunk/dports/textproc/barcode/files/Makefile.in.patch
===================================================================
--- trunk/dports/textproc/barcode/files/Makefile.in.patch 2015-10-19 16:13:27 UTC (rev 141469)
+++ trunk/dports/textproc/barcode/files/Makefile.in.patch 2015-10-19 17:56:17 UTC (rev 141470)
@@ -1,17 +0,0 @@
---- a/Makefile.in.orig 2012-02-03 15:32:12.000000000 +0100
-+++ b/Makefile.in 2012-02-03 15:32:39.000000000 +0100
-@@ -3,12 +3,12 @@
- #
-
- CC = @CC@
--CFLAGS = @CFLAGS@ @DEFS@ @NO_GETOPT@ @NO_LIBPAPER@ @NO_STRERROR@
-+CFLAGS = @CFLAGS@ @CPPFLAGS@ @DEFS@ @NO_GETOPT@ @NO_LIBPAPER@ @NO_STRERROR@
- RANLIB = @RANLIB@
-
- INSTALL = @INSTALL@
-
--LDFLAGS = -L. -l$(TARGET) @LIBPAPER@
-+LDFLAGS = -L. -l$(TARGET) @LIBPAPER@ @LDFLAGS@
-
- prefix = @prefix@
- BINDIR = $(prefix)/bin
Deleted: trunk/dports/textproc/barcode/files/main.c.patch
===================================================================
--- trunk/dports/textproc/barcode/files/main.c.patch 2015-10-19 16:13:27 UTC (rev 141469)
+++ trunk/dports/textproc/barcode/files/main.c.patch 2015-10-19 17:56:17 UTC (rev 141470)
@@ -1,12 +0,0 @@
---- barcode-0.98/main.c.orig 2002-03-02 08:31:07.000000000 +1100
-+++ barcode-0.98/main.c 2012-07-16 12:40:37.000000000 +1000
-@@ -299,6 +299,9 @@ int get_page_geometry(void *arg)
- int n;
- double dpw, dph; /* page width, height in mm or inches */
- static char tmpstr[20];
-+ if (!arg) {
-+ return -1;
-+ }
- page_name = arg; /* if undecipherable, we won't run the program :) */
- /*
- * try to decode a "mm" string (eg. "210mmx297mm" or "210x297mm")
Added: trunk/dports/textproc/barcode/files/patch-Makefile.am-sample-may-need-replacement-calloc-from-libgnu.diff
===================================================================
--- trunk/dports/textproc/barcode/files/patch-Makefile.am-sample-may-need-replacement-calloc-from-libgnu.diff (rev 0)
+++ trunk/dports/textproc/barcode/files/patch-Makefile.am-sample-may-need-replacement-calloc-from-libgnu.diff 2015-10-19 17:56:17 UTC (rev 141470)
@@ -0,0 +1,14 @@
+The sample binary will fail to link on systems that need a replacement for
+calloc because their implementation isn't GNU-calloc compatible. For example,
+OS X is affected by this.
+
+Signed-off-by: Clemens Lang <cal at macports.org>
+Upstream-Status: Pending
+--- Makefile.am.orig 2015-10-19 19:14:29.000000000 +0200
++++ Makefile.am 2015-10-19 19:14:36.000000000 +0200
+@@ -38,4 +38,4 @@
+
+
+ sample_SOURCES = sample.c
+-sample_LDADD = libbarcode.la
++sample_LDADD = libbarcode.la lib/libgnu.la
Added: trunk/dports/textproc/barcode/files/patch-barcode.h-library.h-avoid-global-declaration-in-header.diff
===================================================================
--- trunk/dports/textproc/barcode/files/patch-barcode.h-library.h-avoid-global-declaration-in-header.diff (rev 0)
+++ trunk/dports/textproc/barcode/files/patch-barcode.h-library.h-avoid-global-declaration-in-header.diff 2015-10-19 17:56:17 UTC (rev 141470)
@@ -0,0 +1,28 @@
+Providing a global declaration without "extern" in a header adds a symbol with
+that name to every compilation unit that includes the header. Consequently,
+some compilers (e.g., clang) fail to link more than one of these compilation
+units because there are two versions of the "streaming" symbol. Fix this by
+moving the declaration to pcl.c and keeping changing the one in the header to
+be extern.
+
+Upstream-Status: Pending
+--- ./barcode.h 2013-03-29 16:51:07.000000000 -0500
++++ ./barcode.h 2015-08-16 16:06:23.000000000 -0500
+@@ -123,6 +123,6 @@
+ }
+ #endif
+
+-int streaming;
++extern int streaming;
+
+ #endif /* _BARCODE_H_ */
+--- ./pcl.c 2013-03-29 17:23:31.000000000 -0500
++++ ./pcl.c 2015-08-16 16:07:06.000000000 -0500
+@@ -29,6 +29,7 @@
+
+ #define SHRINK_AMOUNT 0.15 /* shrink the bars to account for ink spreading */
+
++int streaming;
+
+ /*
+ * How do the "partial" and "textinfo" strings work? See file "ps.c"
Added: trunk/dports/textproc/barcode/files/patch-codeabar.c-correct-output.diff
===================================================================
--- trunk/dports/textproc/barcode/files/patch-codeabar.c-correct-output.diff (rev 0)
+++ trunk/dports/textproc/barcode/files/patch-codeabar.c-correct-output.diff 2015-10-19 17:56:17 UTC (rev 141470)
@@ -0,0 +1,38 @@
+Hi, with this correction, output barcodes match what I'm seeing with other
+codabar outputs. Found in Debian:
+
+Author: Chris Howie <crazycomputers at yahoo.com>
+Description: Following codabar specification (Closes: #320908).
+Upstream-Status: Submitted [http://lists.gnu.org/archive/html/bug-barcode/2014-01/msg00000.html]
+--- codabar.c.orig 2015-10-19 19:48:14.000000000 +0200
++++ codabar.c 2015-10-19 19:49:50.000000000 +0200
+@@ -28,10 +28,11 @@
+
+ /* this is ordered in decades to simplify encoding */
+ static char alphabet[] =
+- "0123456789" "-$:/.+ABCD";
++ "0123456789" "-$:/.+ABCDTN*E";
+
+ #define CODE_A 16
+ #define CODE_B 17
++#define CODE_T 20
+
+ #define NARROW 12
+ #define WIDE 14
+@@ -167,13 +168,13 @@
+ }
+ if (!startpresent) {
+ if (usesum) {
+- /* if no start character specified, B is used as a stop char */
+- checksum += CODE_B;
++ /* if no start character specified, T is used as a stop char */
++ checksum += CODE_T;
+ checksum = (checksum + 15) / 16 * 16 - checksum;
+ add_one(ptr, checksum);
+ ptr += strlen(ptr);
+ }
+- add_one(ptr, CODE_B);
++ add_one(ptr, CODE_T);
+ }
+ bc->partial = partial;
+ bc->textinfo = textinfo;
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/macports-changes/attachments/20151212/0a6517bc/attachment-0001.html>
More information about the macports-changes
mailing list