diff options
author | Mike Swanson | 2017-01-19 12:55:07 -0800 |
---|---|---|
committer | Mike Swanson | 2017-01-19 12:55:07 -0800 |
commit | 7b37d369c275e22dea795b132ecf13dcd2081ece (patch) | |
tree | 69d9518a940c3a8b454266fd1fcb7353de64dd85 | |
parent | 9bbddfc6fbff0267e41876554b532a9cb4df8078 (diff) | |
download | aur-7b37d369c275e22dea795b132ecf13dcd2081ece.tar.gz |
Fix building in the C locale.
-rw-r--r-- | .SRCINFO | 6 | ||||
-rw-r--r-- | 0001-man-docgen-simplecpp-Force-UTF-8-reading-and-writing.patch | 84 | ||||
-rw-r--r-- | PKGBUILD | 8 |
3 files changed, 93 insertions, 5 deletions
@@ -1,9 +1,9 @@ # Generated by mksrcinfo v8 -# Tue Dec 27 14:53:36 UTC 2016 +# Thu Jan 19 20:55:02 UTC 2017 pkgbase = crispy-doom pkgdesc = Vanilla-compatible enhanced Doom engine pkgver = 3.5 - pkgrel = 1 + pkgrel = 2 url = http://fabiangreffrath.github.io/crispy-doom install = crispy-doom.install arch = i686 @@ -18,7 +18,9 @@ pkgbase = crispy-doom optdepends = freedoom1: Free Ultimate Doom-compatible game (not vanilla compatible, but useful for mods) optdepends = freedoom2: Free Doom II/Final Doom-compatible game (not vanilla compatible, but useful for mods) source = https://github.com/fabiangreffrath/crispy-doom/archive/crispy-doom-3.5.tar.gz + source = 0001-man-docgen-simplecpp-Force-UTF-8-reading-and-writing.patch sha256sums = bbb257977b2c141591f12a1c335c861f81f012a8b5b5ac195159d19d532c73e3 + sha256sums = 53547aac735a88348aceb7fed70e0d7e6035601030ebafb9ce29fdb5f821028e pkgname = crispy-doom diff --git a/0001-man-docgen-simplecpp-Force-UTF-8-reading-and-writing.patch b/0001-man-docgen-simplecpp-Force-UTF-8-reading-and-writing.patch new file mode 100644 index 000000000000..7991fb66368e --- /dev/null +++ b/0001-man-docgen-simplecpp-Force-UTF-8-reading-and-writing.patch @@ -0,0 +1,84 @@ +From e44e012d063559e8a502d91f5b0916babd41b54b Mon Sep 17 00:00:00 2001 +From: Mike Swanson <mikeonthecomputer@gmail.com> +Date: Thu, 19 Jan 2017 12:48:35 -0800 +Subject: [PATCH] man/{docgen,simplecpp}: Force UTF-8 reading and writing + regardless of locale + +When encountering non-ASCII UTF-8 characters in source files (as +exists in Crispy Doom), the Python scripts would fail to work with +a UnicodeDecodeError if the locale was not a UTF-8 one (eg, the C +locale as encountered in chroot build environments). + +Let's just use UTF-8 on both open() and replace print() statements with +sys.stdout.buffer.write(). This guarantees that all input and output is +UTF-8 regardless. +--- + man/docgen | 10 +++++----- + man/simplecpp | 2 +- + 2 files changed, 6 insertions(+), 6 deletions(-) + +diff --git a/man/docgen b/man/docgen +index 510c2ba2..d40e5c7b 100755 +--- a/man/docgen ++++ b/man/docgen +@@ -300,7 +300,7 @@ class Parameter: + # Read list of wiki pages + + def read_wikipages(): +- f = open("wikipages") ++ f = open("wikipages", encoding='UTF-8') + + try: + for line in f: +@@ -356,7 +356,7 @@ def process_file(file): + + current_config_file = None + +- f = open(file) ++ f = open(file, encoding='UTF-8') + + try: + param = None +@@ -422,7 +422,7 @@ def process_files(path): + process_file(path) + + def print_template(template_file, content): +- f = open(template_file) ++ f = open(template_file, encoding='UTF-8') + + try: + for line in f: +@@ -432,7 +432,7 @@ def print_template(template_file, content): + print_template(filename, content) + else: + line = line.replace("@content", content) +- print(line.rstrip()) ++ sys.stdout.buffer.write(line.rstrip().encode('UTF-8')) + + finally: + f.close() +@@ -452,7 +452,7 @@ def wiki_output(targets, template): + read_wikipages() + + for t in targets: +- print(t.wiki_output()) ++ sys.stdout.buffer.write(t.wiki_output().encode('UTF-8')) + + def plaintext_output(targets, template_file): + +diff --git a/man/simplecpp b/man/simplecpp +index 4cb58a4c..d3590d6d 100755 +--- a/man/simplecpp ++++ b/man/simplecpp +@@ -76,7 +76,7 @@ def parse_stream(stream): + raise Exception("Mismatched #if in '%s'" % stream.name) + + def parse_file(filename): +- f = open(filename) ++ f = open(filename, encoding='UTF-8') + + try: + parse_stream(f) +-- +2.11.0 + @@ -3,7 +3,7 @@ pkgname=crispy-doom pkgdesc="Vanilla-compatible enhanced Doom engine" pkgver=3.5 -pkgrel=1 +pkgrel=2 arch=('i686' 'x86_64') url="http://fabiangreffrath.github.io/crispy-doom" license=('GPL2') @@ -13,8 +13,10 @@ optdepends=('freedm: Free deathmatch game' 'freedoom1: Free Ultimate Doom-compatible game (not vanilla compatible, but useful for mods)' 'freedoom2: Free Doom II/Final Doom-compatible game (not vanilla compatible, but useful for mods)') install=crispy-doom.install -source=(https://github.com/fabiangreffrath/$pkgname/archive/$pkgname-$pkgver.tar.gz) -sha256sums=('bbb257977b2c141591f12a1c335c861f81f012a8b5b5ac195159d19d532c73e3') +source=(https://github.com/fabiangreffrath/$pkgname/archive/$pkgname-$pkgver.tar.gz + 0001-man-docgen-simplecpp-Force-UTF-8-reading-and-writing.patch) +sha256sums=('bbb257977b2c141591f12a1c335c861f81f012a8b5b5ac195159d19d532c73e3' + '53547aac735a88348aceb7fed70e0d7e6035601030ebafb9ce29fdb5f821028e') prepare() { # GitHub's generated archive prefix kind of sucks. |