diff options
author | Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org> | 2021-11-28 08:17:27 +0100 |
---|---|---|
committer | Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org> | 2021-11-28 10:10:04 +0100 |
commit | ebb2dfa669477de53d8c78ea4a22cdbc11436c5b (patch) | |
tree | f8d4a171bf71783aa1a4af514172d211beb4b237 /libre | |
parent | a35e43fd72ad612428c58c7dbe61be5bf6633064 (diff) | |
download | abslibre-ebb2dfa669477de53d8c78ea4a22cdbc11436c5b.tar.gz abslibre-ebb2dfa669477de53d8c78ea4a22cdbc11436c5b.tar.bz2 abslibre-ebb2dfa669477de53d8c78ea4a22cdbc11436c5b.zip |
libre: netpbm: update to 10.73.36 by syncing with Arch Linux
According to Wikipedia: "GIF images are compressed using the
Lempel–Ziv–Welch (LZW) lossless data compression technique to reduce
the file size without degrading the visual quality. This compression
technique was patented in 1985. Controversy over the licensing
agreement between the software patent holder, Unisys, and CompuServe
in 1994 spurred the development of the Portable Network Graphics (PNG)
standard. By 2004 all the relevant patents had expired."[1].
So we can safely stop removing GIF related code on the basis of
patents alone.
[1]https://en.wikipedia.org/wiki/GIF
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
Diffstat (limited to 'libre')
-rw-r--r-- | libre/netpbm/PKGBUILD | 143 | ||||
-rw-r--r-- | libre/netpbm/netpbm-security-code.patch | 94 |
2 files changed, 137 insertions, 100 deletions
diff --git a/libre/netpbm/PKGBUILD b/libre/netpbm/PKGBUILD index d79440322..9bb74cbc2 100644 --- a/libre/netpbm/PKGBUILD +++ b/libre/netpbm/PKGBUILD @@ -1,12 +1,16 @@ # Maintainer: Omar Vega Ramos <ovruni@gnu.org.pe> # Contributor (Hyperbola): André Silva <emulatorman@hyperbola.info> +# Maintainer (Arch): +# parabola changes and rationale: +# - Added armv7h and i686 support +# - Removed nonfree parts pkgname=netpbm -pkgver=10.73.31 +pkgver=10.73.36 pkgrel=1 pkgrel+=.parabola1 pkgdesc="A toolkit for manipulation of graphic images" -pkgdesc+=", without nonfree parts and patent issues" +pkgdesc+=", without nonfree parts" arch=('x86_64') arch+=('i686' 'armv7h') license=('custom' 'BSD' 'GPL' 'LGPL') @@ -17,91 +21,35 @@ options=('!makeflags') # Get docs with: wget --recursive --relative -nH http://netpbm.sourceforge.net/doc/ source=(https://downloads.sourceforge.net/project/netpbm/super_stable/$pkgver/netpbm-$pkgver.tgz https://sources.archlinux.org/other/packages/netpbm/netpbm-doc-31Jan2014.tar.xz{,.sig} - netpbm-CAN-2005-2471.patch netpbm-security-code.patch netpbm-security-scripts.patch) -sha256sums=('584c95f1ccdcd66d5ca68d7d5501728ae1184cba324d713f6b2a3ca86424243b' + netpbm-CAN-2005-2471.patch netpbm-security-code.patch netpbm-security-scripts.patch + reproducible-man-gzip.patch use-source-date-epoch.patch) +sha256sums=('93b31b11b003082d5fd4037ae5c768b91ea7330b10247a25086c10b5dd71e445' '74bcf840ee643c6917330c382484010cb99c004a3fcf05391bebcac63815acb3' 'SKIP' '991aba7897e0710687369b4e2edfba1397ecd77d62578eac496afbc47b5ca970' - '2eaa0f842d90bb3dcbc66273d58ec9117b97029da231b141159e580e65b98eb0' - '2c397588d9cba2c40dee55c07713d5e77e0e04245db939fdc1962d7de4cf4a33') + '83d75a80ce999d8b69572e54f04c4d220c60b0d09f9e52d3236264535c3bf216' + '2c397588d9cba2c40dee55c07713d5e77e0e04245db939fdc1962d7de4cf4a33' + '8e3efdb4fcbfdc8e9a5c8e9663c7d6b9ecef3a2379ce38d2acc5669c339f6814' + '68055341833f482c6910a56c2fdfe046978a1a92fd8442a2a9209c82ce3e4d13') validpgpkeys=('5357F3B111688D88C1D88119FCF2CB179205AC90') -prepare() { - cd $pkgname-$pkgver - - # Removing hpcdtoppm/pcdindex (non comercial) - rm -rv converter/ppm/hpcdtoppm - - # Removing ppmtogif/giftopnm (patent restriction) - rm -v converter/other/giftopnm.c converter/ppm/ppmtogif.c - rm -v test/gif-quant-roundtrip.test test/gif-roundtrip.test test/all-in-place.ok - - # Removing programs without license information - rm -v other/pamchannel.c test/pamchannel.ok - rm -v converter/other/pamtopnm.c - rm -v converter/pbm/pbmto4425.c - rm -v converter/pbm/pbmtoln03.c - rm -v converter/pbm/pbmtolps.c - rm -v converter/pbm/pbmtopk.c - rm -v converter/pbm/pktopbm.c - rm -v converter/ppm/ppmtopjxl.c - rm -v converter/pgm/spottopgm.c - - rm -v test/avs-roundtrip.test test/facesaver-roundtrip.test test/ilbm-roundtrip.test test/pamchannel.test \ - test/pamditherbw.test test/pamenlarge.test test/pamfile.test test/pfm-roundtrip.test \ - test/pgmtoppm.test test/pict-roundtrip.test test/pnminvert.test test/pnmremap1.test \ - test/pnmremap2.test test/pnmtopnm-plain.test test/pnm-pam-roundtrip.test test/pnm-plain-roundtrip.test \ - test/ps-alt-roundtrip.test test/ps-roundtrip.test test/sbig-roundtrip.test test/st4-roundtrip.test \ - test/targa-roundtrip.test test/utahrle-roundtrip.test test/winicon-roundtrip.test test/xwd-roundtrip.test - - # Removing references about hpcdtoppm/pcdindex (non comercial) - sed -i 's/hpcdtoppm//g' converter/ppm/Makefile - sed -i 's/hpcdtoppm\.1//g' buildtools/manpage.mk - sed -i 's/pcdindex\.1//g' buildtools/manpage.mk - - # Removing references about ppmtogif/giftopnm (patent restriction) - sed -i 's/ppmtogif//g' converter/ppm/Makefile test/all-in-place.test - sed -i 's/ppmtogif\.1//g' buildtools/manpage.mk - sed -i 's/giftopnm//g' converter/other/Makefile test/all-in-place.test - sed -i 's/giftopnm\.1//g' buildtools/manpage.mk - sed -i '/giftopnm/d' converter/other/pnmtopalm/README - - # Removing references about programs without license information - sed -i 's/pamchannel//g' other/Makefile test/all-in-place.test - sed -i 's/pamchannel\.1//g' buildtools/manpage.mk - sed -i 's/pamchannel\.test//g' test/Test-Order - - sed -i 's/pamtopnm//g' converter/other/Makefile test/all-in-place.test - sed -i 's/pamtopnm\.1//g' buildtools/manpage.mk - sed -i '/pnmtopnm/d' netpbm.c +remove_program() { + file="$1" + progname="$(basename ${file} | sed 's/\.c$//')" - sed -i 's/pbmto4425//g' converter/pbm/Makefile test/all-in-place.test - sed -i 's/pbmto4425\.1//g' buildtools/manpage.mk - - sed -i 's/pbmtoln03//g' converter/pbm/Makefile test/all-in-place.test - sed -i 's/pbmtoln03\.1//g' buildtools/manpage.mk - - sed -i 's/pbmtolps//g' converter/pbm/Makefile test/all-in-place.test - sed -i 's/pbmtolps\.1//g' buildtools/manpage.mk - - sed -i 's/pbmtopk//g' converter/pbm/Makefile test/all-in-place.test - sed -i 's/pbmtopk\.1//g' buildtools/manpage.mk - - sed -i 's/pktopbm//g' converter/pbm/Makefile test/all-in-place.test - sed -i 's/pktopbm\.1//g' buildtools/manpage.mk - - sed -i 's/ppmtopjxl//g' converter/ppm/Makefile test/all-in-place.test - sed -i 's/ppmtopjxl\.1//g' buildtools/manpage.mk - - sed -i 's/spottopgm//g' converter/pgm/Makefile test/all-in-place.test - sed -i 's/spottopgm\.1//g' buildtools/manpage.mk + rm -v "${file}" + sed -i "s/${progname}//g" "$(dirname ${file})/Makefile" + sed -i "s/${progname}\.1//g" buildtools/manpage.mk +} - #Removing references about nonfree licenses part - sed -i '338,383d' doc/copyright_summary +prepare() { + cd $pkgname-$pkgver patch -p1 < ../netpbm-CAN-2005-2471.patch patch -p1 < ../netpbm-security-code.patch patch -p1 < ../netpbm-security-scripts.patch + patch -p1 < ../reproducible-man-gzip.patch + patch -p1 < ../use-source-date-epoch.patch sed -i 's|#!/usr/bin/python|#!/usr/bin/python2|' buildtools/makeman sed -i 's|@python|@python2|' buildtools/manpage.mk @@ -118,6 +66,49 @@ prepare() { sed -i 's|misc|share/netpbm|' common.mk sed -i 's|/link|/lib|' lib/Makefile sed -i 's|install.manwebmain install.manweb install.man|install.man|' GNUmakefile + + # Remove the converter/ppm/hpcdtoppm directory: + # - hpcdtoppm: as hpcdtoppm is not even redistributable, this hpcdtoppm only + # prints a message to steer users toward downloading "the real hpcdtoppm" + # which is nonfree + # - pcdovtoppm: no license information + rm -rv converter/ppm/hpcdtoppm + sed '/\.\/converter\/ppm\/hpcdtoppm \\/d' -i GNUmakefile + sed 's/hpcdtoppm//g' -i converter/ppm/Makefile + + # Removing programs without license information + remove_program converter/other/pamtopnm.c + remove_program converter/pbm/pbmto4425.c + remove_program converter/pbm/pbmtoln03.c + remove_program converter/pbm/pbmtolps.c + remove_program converter/pbm/pbmtopk.c + remove_program converter/pbm/pktopbm.c + remove_program converter/pgm/spottopgm.c + remove_program converter/ppm/ppmtogif.c + remove_program converter/ppm/ppmtopjxl.c + remove_program other/pamchannel.c + + # Tests have no license information + rm -v -rf test/ + # Remove test from "SUPPORT_SUBDIRS = urt icon buildtools test" + awk '{ + if ($1 != "SUPPORT_SUBDIRS") { + print $0 + } else { + for (i=1;i<=NF;i++) { + if($i != "test") { + printf $i " " + } + } + } + }' GNUmakefile > GNUmakefile.1 + mv -f GNUmakefile.1 GNUmakefile + + sed -i '/pnmtopnm/d' netpbm.c + + #Removing references about nonfree licenses part + sed -i '338,383d' doc/copyright_summary + } build() { diff --git a/libre/netpbm/netpbm-security-code.patch b/libre/netpbm/netpbm-security-code.patch index 18f7bd71a..8674eb7a0 100644 --- a/libre/netpbm/netpbm-security-code.patch +++ b/libre/netpbm/netpbm-security-code.patch @@ -240,6 +240,27 @@ index 9f7004a..60e8477 100644 *colsP = (((int)head.h_wide - ' ') << 6) + ((int)head.l_wide - ' '); *rowsP = (((int)head.h_high - ' ') << 6) + ((int) head.l_high - ' '); *padrightP = ( ( *colsP + pad - 1 ) / pad ) * pad - *colsP; +diff --git a/converter/pbm/pbmto4425.c b/converter/pbm/pbmto4425.c +index 1d97ac6..c4c8cbb 100644 +--- a/converter/pbm/pbmto4425.c ++++ b/converter/pbm/pbmto4425.c +@@ -2,6 +2,7 @@ + + #include "nstring.h" + #include "pbm.h" ++#include <string.h> + + static char bit_table[2][3] = { + {1, 4, 0x10}, +@@ -160,7 +161,7 @@ main(int argc, char * argv[]) { + xres = vmap_width * 2; + yres = vmap_height * 3; + +- vmap = malloc(vmap_width * vmap_height * sizeof(char)); ++ vmap = malloc3(vmap_width, vmap_height, sizeof(char)); + if(vmap == NULL) + { + pm_error( "Cannot allocate memory" ); diff --git a/converter/pbm/pbmtogem.c b/converter/pbm/pbmtogem.c index 9eab041..13b0257 100644 --- a/converter/pbm/pbmtogem.c @@ -337,6 +358,18 @@ index 14c6b85..362b70e 100644 putinit(xbmVersion); +diff --git a/converter/pbm/pktopbm.c b/converter/pbm/pktopbm.c +index 712f339..b6fcb02 100644 +--- a/converter/pbm/pktopbm.c ++++ b/converter/pbm/pktopbm.c +@@ -280,6 +280,7 @@ main(int argc, char *argv[]) { + if (flagbyte == 7) { /* long form preamble */ + integer packetlength = get32() ; /* character packet length */ + car = get32() ; /* character number */ ++ overflow_add(packetlength, pktopbm_pkloc); + endofpacket = packetlength + pktopbm_pkloc; + /* calculate end of packet */ + if ((car >= MAXPKCHAR) || !filename[car]) { diff --git a/converter/pbm/thinkjettopbm.l b/converter/pbm/thinkjettopbm.l index 5de4f2b..7f31de5 100644 --- a/converter/pbm/thinkjettopbm.l @@ -674,6 +707,43 @@ index d116773..fc84cac 100644 obuf = (unsigned char *) pm_allocrow(cols, sizeof(unsigned char)); cbuf = (unsigned char *) pm_allocrow(cols * 2, sizeof(unsigned char)); +diff --git a/converter/ppm/ppmtopjxl.c b/converter/ppm/ppmtopjxl.c +index ddf4963..b2c7e8e 100644 +--- a/converter/ppm/ppmtopjxl.c ++++ b/converter/ppm/ppmtopjxl.c +@@ -306,6 +306,9 @@ main(int argc, const char * argv[]) { + if (maxval > PCL_MAXVAL) + pm_error("color range too large; reduce with ppmcscale"); + ++ if (cols < 0 || rows < 0) ++ pm_error("negative size is not possible"); ++ + /* Figure out the colormap. */ + pm_message("Computing colormap..."); + chv = ppm_computecolorhist(pixels, cols, rows, MAXCOLORS, &colors); +@@ -325,6 +328,8 @@ main(int argc, const char * argv[]) { + case 0: /* direct mode (no palette) */ + bpp = bitsperpixel(maxval); /* bits per pixel */ + bpg = bpp; bpb = bpp; ++ overflow2(bpp, 3); ++ overflow_add(bpp*3, 7); + bpp = (bpp*3+7)>>3; /* bytes per pixel now */ + bpr = (bpp<<3)-bpg-bpb; + bpp *= cols; /* bytes per row now */ +@@ -334,9 +339,13 @@ main(int argc, const char * argv[]) { + case 3: case 7: pclindex++; + default: + bpp = 8/pclindex; ++ overflow_add(cols, bpp); ++ if(bpp == 0) ++ pm_error("assert: no bpp"); + bpp = (cols+bpp-1)/bpp; /* bytes per row */ + } + } ++ overflow2(bpp,2); + inrow = (char *)malloc((unsigned)bpp); + outrow = (char *)malloc((unsigned)bpp*2); + runcnt = (signed char *)malloc((unsigned)bpp); diff --git a/converter/ppm/ppmtowinicon.c b/converter/ppm/ppmtowinicon.c index c673798..af2b445 100644 --- a/converter/ppm/ppmtowinicon.c @@ -773,30 +843,6 @@ diff --git a/converter/ppm/ximtoppm.c b/converter/ppm/ximtoppm.c index ce5e639..a39b689 100644 --- a/converter/ppm/ximtoppm.c +++ b/converter/ppm/ximtoppm.c -@@ -117,6 +117,7 @@ ReadXimHeader(FILE * const in_fp, - header->bits_channel = atoi(a_head.bits_per_channel); - header->alpha_flag = atoi(a_head.alpha_channel); - if (strlen(a_head.author)) { -+ overflow_add(strlen(a_head.author),1); - if (!(header->author = calloc((unsigned int)strlen(a_head.author)+1, - 1))) { - pm_message("ReadXimHeader: can't calloc author string" ); -@@ -126,6 +127,7 @@ ReadXimHeader(FILE * const in_fp, - strncpy(header->author, a_head.author, strlen(a_head.author)); - } - if (strlen(a_head.date)) { -+ overflow_add(strlen(a_head.date),1); - if (!(header->date =calloc((unsigned int)strlen(a_head.date)+1,1))){ - pm_message("ReadXimHeader: can't calloc date string" ); - return(0); -@@ -134,6 +136,7 @@ ReadXimHeader(FILE * const in_fp, - strncpy(header->date, a_head.date, strlen(a_head.date)); - } - if (strlen(a_head.program)) { -+ overflow_add(strlen(a_head.program),1); - if (!(header->program = calloc( - (unsigned int)strlen(a_head.program) + 1, 1))) { - pm_message("ReadXimHeader: can't calloc program string" ); @@ -160,6 +163,7 @@ ReadXimHeader(FILE * const in_fp, if (header->nchannels == 3 && header->bits_channel == 8) header->ncolors = 0; |