l_template_changes.patch 1.1 KB

12345678910111213141516171819202122232425262728293031323334
  1. --- template.orig 2020-11-08 13:32:52.531982000 +0600
  2. +++ template 2020-11-09 14:03:21.095200000 +0600
  3. @@ -38,2 +38,30 @@ CFLAGS="-I${XBPS_CROSS_BASE}/usr/include
  4. +# Liberation
  5. +# Some code has been taken from:
  6. +# https://git.parabola.nu/abslibre.git/tree/libre/hplip/PKGBUILD
  7. +post_patch() {
  8. + echo "Removing printers not supported with free drivers from the database"
  9. +
  10. + # based on https://devel.trisquel.info/trisquel/package-helpers/raw/master/helpers/make-hplip
  11. + # keep header license
  12. + sed '/\[/,99999d' data/models/models.dat > mktemp
  13. +
  14. + for model in $(grep '\[' data/models/models.dat | sed 's/\[//; s/\]//'); do
  15. + sed -n "/\[$model\]/,/^$/p;" data/models/models.dat > mktemp1
  16. + grep '^download=True' -q mktemp1 && continue
  17. + grep '^plugin=1' -q mktemp1 && continue
  18. + grep '^support-type=0' -q mktemp1 && continue
  19. + cat mktemp1 >> mktemp
  20. + done
  21. +
  22. + sed -i 's/plugin=2/plugin=0/g' mktemp
  23. +
  24. + cp mktemp data/models/models.dat
  25. +
  26. + rm -v mktemp{,1}
  27. +
  28. + # remove nonfree software recommendation - https://labs.parabola.nu/issues/893
  29. + sed -i 's/\, requires proprietary plugin//' $(grep -rlI '[,] requires proprietary plugin')
  30. +}
  31. +
  32. pre_configure() {