template 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  1. # Template file for 'netpbm'
  2. pkgname=netpbm
  3. # from http://svn.code.sf.net/p/netpbm/code/advanced/doc/HISTORY
  4. version=10.92.00
  5. revision=1
  6. _githash=4c361c0a7638b4f068e8b524e4ff43374a286018
  7. _githash_guide=2ab5fffd17f1e979ce63db9212331e51f53811fc
  8. create_wrksrc=yes
  9. build_wrksrc="netpbm-mirror-${_githash}"
  10. hostmakedepends="pkg-config perl python flex"
  11. makedepends="libX11-devel libjpeg-turbo-devel libpng-devel libxml2-devel
  12. tiff-devel zlib-devel"
  13. short_desc="Toolkit for manipulation of graphic images"
  14. maintainer="Leah Neukirchen <leah@vuxu.org>"
  15. license="BSD-3-Clause,GPL-2.0-only,custom:netpbm"
  16. homepage="http://netpbm.sourceforge.net/"
  17. distfiles="https://github.com/leahneukirchen/netpbm-mirror/archive/${_githash}.tar.gz
  18. https://github.com/leahneukirchen/netpbm-mirror/archive/${_githash_guide}.tar.gz"
  19. checksum="fec87c54b7ff7aeb78f9e2bd48f658821c58b86a41332d9c547b31f2ea8f2593
  20. 542a9532d5c0a81ff47b3a65529670f51f45da4939150a8545e2f3a4af5b120b"
  21. post_extract() {
  22. cd $build_wrksrc
  23. for p in ${FILESDIR}/*.patch; do
  24. patch -Np1 -i $p
  25. done
  26. cd ../netpbm-mirror-${_githash_guide}
  27. sed -i 's/ id="pammixmulti"//g' pammixmulti.html
  28. }
  29. # Liberation
  30. # Some commands have been taken from:
  31. # https://git.parabola.nu/abslibre.git/tree/libre/netpbm
  32. post_patch() {
  33. # Removing hpcdtoppm/pcdindex (non comercial)
  34. rm -rv converter/ppm/hpcdtoppm
  35. # Removing ppmtogif/giftopnm (patent restriction)
  36. rm -v converter/other/giftopnm.c converter/ppm/ppmtogif.c
  37. rm -v test/gif-quant-roundtrip.test test/gif-roundtrip.test test/all-in-place.ok
  38. # Removing programs without license information
  39. rm -v other/pamchannel.c test/pamchannel.ok
  40. rm -v converter/other/pamtopnm.c
  41. rm -v converter/pbm/pbmto4425.c
  42. rm -v converter/pbm/pbmtoln03.c
  43. rm -v converter/pbm/pbmtolps.c
  44. rm -v converter/pbm/pbmtopk.c
  45. rm -v converter/pbm/pktopbm.c
  46. rm -v converter/ppm/ppmtopjxl.c
  47. rm -v converter/pgm/spottopgm.c
  48. rm -v test/avs-roundtrip.test test/facesaver-roundtrip.test test/ilbm-roundtrip.test test/pamchannel.test \
  49. test/pamditherbw.test test/pamenlarge.test test/pamfile.test test/pfm-roundtrip.test \
  50. test/pgmtoppm.test test/pict-roundtrip.test test/pnminvert.test test/pnmremap1.test \
  51. test/pnmremap2.test test/pnmtopnm-plain.test test/pnm-pam-roundtrip.test test/pnm-plain-roundtrip.test \
  52. test/ps-alt-roundtrip.test test/ps-roundtrip.test test/sbig-roundtrip.test test/st4-roundtrip.test \
  53. test/targa-roundtrip.test test/utahrle-roundtrip.test test/winicon-roundtrip.test test/xwd-roundtrip.test
  54. # Removing references about hpcdtoppm/pcdindex (non comercial)
  55. sed -i 's/hpcdtoppm//g' converter/ppm/Makefile
  56. sed -i 's/hpcdtoppm\.1//g' buildtools/manpage.mk
  57. sed -i 's/pcdindex\.1//g' buildtools/manpage.mk
  58. # Removing references about ppmtogif/giftopnm (patent restriction)
  59. sed -i 's/ppmtogif//g' converter/ppm/Makefile test/all-in-place.test
  60. sed -i 's/ppmtogif\.1//g' buildtools/manpage.mk
  61. sed -i 's/giftopnm//g' converter/other/Makefile test/all-in-place.test
  62. sed -i 's/giftopnm\.1//g' buildtools/manpage.mk
  63. sed -i '/giftopnm/d' converter/other/pnmtopalm/README
  64. # Removing references about programs without license information
  65. sed -i 's/pamchannel//g' other/Makefile test/all-in-place.test
  66. sed -i 's/pamchannel\.1//g' buildtools/manpage.mk
  67. sed -i 's/pamchannel\.test//g' test/Test-Order
  68. sed -i 's/pamtopnm//g' converter/other/Makefile test/all-in-place.test
  69. sed -i 's/pamtopnm\.1//g' buildtools/manpage.mk
  70. sed -i '/pnmtopnm/d' netpbm.c
  71. sed -i 's/pbmto4425//g' converter/pbm/Makefile test/all-in-place.test
  72. sed -i 's/pbmto4425\.1//g' buildtools/manpage.mk
  73. sed -i 's/pbmtoln03//g' converter/pbm/Makefile test/all-in-place.test
  74. sed -i 's/pbmtoln03\.1//g' buildtools/manpage.mk
  75. sed -i 's/pbmtolps//g' converter/pbm/Makefile test/all-in-place.test
  76. sed -i 's/pbmtolps\.1//g' buildtools/manpage.mk
  77. sed -i 's/pbmtopk//g' converter/pbm/Makefile test/all-in-place.test
  78. sed -i 's/pbmtopk\.1//g' buildtools/manpage.mk
  79. sed -i 's/pktopbm//g' converter/pbm/Makefile test/all-in-place.test
  80. sed -i 's/pktopbm\.1//g' buildtools/manpage.mk
  81. sed -i 's/ppmtopjxl//g' converter/ppm/Makefile test/all-in-place.test
  82. sed -i 's/ppmtopjxl\.1//g' buildtools/manpage.mk
  83. sed -i 's/spottopgm//g' converter/pgm/Makefile test/all-in-place.test
  84. sed -i 's/spottopgm\.1//g' buildtools/manpage.mk
  85. #Removing references about nonfree licenses part
  86. sed -i '338,383d' doc/copyright_summary
  87. }
  88. do_configure() {
  89. local endian bitsperlong
  90. cat config.mk.in ${FILESDIR}/config.mk >config.mk
  91. if [ "$XBPS_TARGET_MACHINE" = "i686" -o "$XBPS_TARGET_MACHINE" = "x86_64" ]; then
  92. echo "WANT_SSE = Y" >>config.mk
  93. fi
  94. sed -i 's|misc|share/netpbm|' common.mk
  95. sed -i 's|/link|/lib|' lib/Makefile
  96. sed -i 's|/sharedlink|/lib|' lib/Makefile
  97. sed -i 's|install.manwebmain install.manweb install.man|install.man|' GNUmakefile
  98. if [ "$CROSS_BUILD" ]; then
  99. # Patch buildutils/endiangen.c to return the endianess
  100. # and word size for the target architecture
  101. # XXX: perhaps add XBPS_ENDIAN to common/cross-profiles/*.sh
  102. case "$XBPS_TARGET_MACHINE" in
  103. ppc|ppc-musl|ppc64|ppc64-musl) endian="ENDIAN_BIG";;
  104. *) endian="ENDIAN_LITTLE";;
  105. esac
  106. # XXX: perhaps add XBPS_BITSPERLONG to common/cross-files/*.sh
  107. case "$XBPS_TARGET_MACHINE" in
  108. aarch64*|x86_64*|ppc64*) bitsperlong="64";;
  109. *) bitsperlong="32";;
  110. esac
  111. vsed -i buildtools/endiangen.c \
  112. -e "s;byteOrder();$endian;" \
  113. -e "s;bitsPerLong();$bitsperlong;"
  114. # ... now build the tools for the host
  115. CC=$CC_host CFLAGS="$CFLAGS_host" \
  116. LD=$LD_host LDFLAGS="$LDFLAGS_host" \
  117. make -C buildtools
  118. fi
  119. }
  120. do_build() {
  121. make ${makejobs} CC=$CC CFLAGS="$CFLAGS" LDFLAGS_FOR_BUILD=
  122. make MAKEMAN="${PWD}/buildtools/makeman" USERGUIDE=. \
  123. -C ../netpbm-mirror-${_githash_guide} \
  124. -f "${PWD}/buildtools/manpage.mk" manpages
  125. }
  126. do_install() {
  127. make pkgdir=$DESTDIR/usr PKGMANDIR=share/man install-run install-dev
  128. vmkdir usr/share/man/man1
  129. vmkdir usr/share/man/man3
  130. vmkdir usr/share/man/man5
  131. make MAKEMAN="${PWD}/buildtools/makeman" MANDIR="$DESTDIR/usr/share/man" USERGUIDE=. \
  132. -C ../netpbm-mirror-${_githash_guide} \
  133. -f "${PWD}/buildtools/manpage.mk" installman
  134. vlicense doc/copyright_summary LICENSE
  135. }
  136. libnetpbm_package() {
  137. replaces="${sourcepkg}<10.66.03_2"
  138. short_desc+=" - runtime libraries"
  139. pkg_install() {
  140. vmove usr/lib/*.so.*
  141. }
  142. }
  143. libnetpbm-devel_package() {
  144. replaces="${sourcepkg}<10.66.03_2"
  145. depends="libnetpbm>=${version}_${revision}"
  146. short_desc+=" - development files"
  147. pkg_install() {
  148. vmove usr/include
  149. vmove usr/lib/*.so
  150. }
  151. }