aboutsummaryrefslogtreecommitdiff
path: root/gnu/packages/patches
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/packages/patches')
-rw-r--r--gnu/packages/patches/beets-python-3.7-fix.patch57
-rw-r--r--gnu/packages/patches/debops-constants-for-external-program-names.patch276
-rw-r--r--gnu/packages/patches/debops-debops-defaults-fall-back-to-less.patch45
-rw-r--r--gnu/packages/patches/freeimage-CVE-2015-0852.patch129
-rw-r--r--gnu/packages/patches/freeimage-CVE-2016-5684.patch34
-rw-r--r--gnu/packages/patches/freeimage-fix-build-with-gcc-5.patch1453
-rw-r--r--gnu/packages/patches/freeimage-unbundle.patch167
-rw-r--r--gnu/packages/patches/glm-restore-install-target.patch574
-rw-r--r--gnu/packages/patches/idris-test-no-node.patch61
-rw-r--r--gnu/packages/patches/ilmbase-fix-tests.patch12
-rw-r--r--gnu/packages/patches/ilmbase-openexr-pkg-config.patch40
-rw-r--r--gnu/packages/patches/p11-kit-jks-timestamps.patch42
12 files changed, 1071 insertions, 1819 deletions
diff --git a/gnu/packages/patches/beets-python-3.7-fix.patch b/gnu/packages/patches/beets-python-3.7-fix.patch
deleted file mode 100644
index 43707cd9d0..0000000000
--- a/gnu/packages/patches/beets-python-3.7-fix.patch
+++ /dev/null
@@ -1,57 +0,0 @@
-Fix compatibility issue with Python 3.7:
-
-https://github.com/beetbox/beets/issues/2978
-
-Patch copied from upstream source repository:
-
-https://github.com/beetbox/beets/commit/15d44f02a391764da1ce1f239caef819f08beed8
-
-From 15d44f02a391764da1ce1f239caef819f08beed8 Mon Sep 17 00:00:00 2001
-From: Adrian Sampson <adrian@radbox.org>
-Date: Sun, 22 Jul 2018 12:34:19 -0400
-Subject: [PATCH] Fix Python 3.7 compatibility (#2978)
-
----
- beets/autotag/hooks.py | 8 +++++++-
- docs/changelog.rst | 2 ++
- 2 files changed, 9 insertions(+), 1 deletion(-)
-
-diff --git a/beets/autotag/hooks.py b/beets/autotag/hooks.py
-index 3615a9333..1c62a54c5 100644
---- a/beets/autotag/hooks.py
-+++ b/beets/autotag/hooks.py
-@@ -31,6 +31,12 @@
-
- log = logging.getLogger('beets')
-
-+# The name of the type for patterns in re changed in Python 3.7.
-+try:
-+ Pattern = re._pattern_type
-+except AttributeError:
-+ Pattern = re.Pattern
-+
-
- # Classes used to represent candidate options.
-
-@@ -433,7 +439,7 @@ def _eq(self, value1, value2):
- be a compiled regular expression, in which case it will be
- matched against `value2`.
- """
-- if isinstance(value1, re._pattern_type):
-+ if isinstance(value1, Pattern):
- return bool(value1.match(value2))
- return value1 == value2
-
-#diff --git a/docs/changelog.rst b/docs/changelog.rst
-#index be6de2904..d487f31f5 100644
-#--- a/docs/changelog.rst
-#+++ b/docs/changelog.rst
-#@@ -19,6 +19,8 @@ New features:
-#
-# Fixes:
-#
-#+* Fix compatibility Python 3.7 and its change to a name in the ``re`` module.
-#+ :bug:`2978`
-# * R128 normalization tags are now properly deleted from files when the values
-# are missing.
-# Thanks to :user:`autrimpo`.
diff --git a/gnu/packages/patches/debops-constants-for-external-program-names.patch b/gnu/packages/patches/debops-constants-for-external-program-names.patch
new file mode 100644
index 0000000000..b3b34ed323
--- /dev/null
+++ b/gnu/packages/patches/debops-constants-for-external-program-names.patch
@@ -0,0 +1,276 @@
+From 78d5cddafebb28e2e54efeb781495b5607ddb356 Mon Sep 17 00:00:00 2001
+From: Hartmut Goebel <h.goebel@crazy-compilers.com>
+Date: Thu, 8 Aug 2019 15:19:48 +0200
+Subject: [PATCH] Scripts: Use constants for external program names.
+
+This makes it much, much easier to replace the program
+with one using an absolute path. This is necessary for
+e.g. Guix to keep references to these external programs.
+---
+ bin/debops | 10 +++++++---
+ bin/debops-padlock | 21 +++++++++++++++------
+ bin/debops-task | 7 +++++--
+ bin/debops-update | 18 +++++++++++-------
+ debops/__init__.py | 17 ++++++++++++-----
+ debops/cmds/__init__.py | 6 +++++-
+ 6 files changed, 55 insertions(+), 24 deletions(-)
+
+diff --git a/bin/debops b/bin/debops
+index 2b7ad3f88..caaeb892f 100755
+--- a/bin/debops
++++ b/bin/debops
+@@ -59,6 +59,10 @@ ConfigFileHeader = """\
+ # You can manipulate the contents of this file via `.debops.cfg`.
+ """
+
++# External programms used. List here for easy substitution for
++# hard-coded paths.
++ANSIBLE_PLAYBOOK = 'ansible-playbook'
++
+
+ def write_config(filename, config):
+ cfgparser = configparser.ConfigParser()
+@@ -131,7 +135,7 @@ def gen_ansible_cfg(filename, config, project_root, playbooks_path,
+ os.path.join(playbooks_path, "roles"),
+ "/etc/ansible/roles")))
+
+- ansible_version_out = subprocess.check_output(["ansible-playbook",
++ ansible_version_out = subprocess.check_output([ANSIBLE_PLAYBOOK,
+ "--version"]).decode()
+
+ # Get first line and split by spaces to get second 'word'.
+@@ -197,7 +201,7 @@ def main(cmd_args):
+ playbooks_path = '/nonexistent'
+
+ # Make sure required commands are present
+- require_commands('ansible-playbook')
++ require_commands(ANSIBLE_PLAYBOOK)
+
+ # Check if user specified a potential playbook name as the first
+ # argument. If yes, use it as the playbook name and remove it from
+@@ -256,7 +260,7 @@ def main(cmd_args):
+ print("Running Ansible playbooks:")
+ for element in play_list:
+ print(element)
+- return subprocess.call(['ansible-playbook'] + play_list + arg_list)
++ return subprocess.call([ANSIBLE_PLAYBOOK] + play_list + arg_list)
+ finally:
+ if revert_unlock:
+ padlock_lock(encfs_encrypted)
+diff --git a/bin/debops-padlock b/bin/debops-padlock
+index bfdfb8e06..2a97716cd 100755
+--- a/bin/debops-padlock
++++ b/bin/debops-padlock
+@@ -67,6 +67,14 @@ devrandom = os.environ.get('DEVRANDOM', "/dev/urandom")
+
+ SCRIPT_FILENAME = 'padlock-script'
+
++# External programms used. List here for easy substitution for
++# hard-coded paths.
++ENCFS = 'encfs'
++FIND = 'find'
++FUSERMOUNT = 'fusermount'
++UMOUNT = 'umount'
++GPG = 'gpg'
++
+ # ---- DebOps environment setup ----
+
+
+@@ -80,9 +88,9 @@ def main(subcommand_func, **kwargs):
+ # Make sure required commands are present
+ # OS X compatibility
+ if sys.platform == 'darwin':
+- require_commands('encfs', 'find', 'umount', 'gpg')
++ require_commands(ENCFS, FIND, UMOUNT, GPG)
+ else:
+- require_commands('encfs', 'find', 'fusermount', 'gpg')
++ require_commands(ENCFS, FIND, FUSERMOUNT, GPG)
+
+ inventory_path = find_inventorypath(project_root, required=False)
+ # If inventory hasn't been found automatically, assume it's the default
+@@ -121,7 +129,7 @@ def init(encfs_decrypted, encfs_encrypted, recipients):
+ # Generate a random password and encrypt it with GPG keys of recipients.
+ print("Generating a random", ENCFS_KEYFILE_LENGTH, "char password")
+ pwd = gen_pwd()
+- gpg = subprocess.Popen(['gpg', '--encrypt', '--armor',
++ gpg = subprocess.Popen([GPG, '--encrypt', '--armor',
+ '--output', encfs_keyfile] + recipients,
+ stdin=subprocess.PIPE)
+ gpg.communicate(pwd.encode('utf-8'))
+@@ -133,9 +141,10 @@ def init(encfs_decrypted, encfs_encrypted, recipients):
+ # NB2: We can not use padlock_unlock here, because the config file
+ # does not yet exist.
+ encfs = subprocess.Popen([
+- 'encfs', encfs_encrypted, encfs_decrypted,
++ ENCFS, encfs_encrypted, encfs_decrypted,
+ '--extpass',
+- 'gpg --decrypt --no-mdc-warning --output - '+shquote(encfs_keyfile)],
++ GPG + ' --decrypt --no-mdc-warning --output - '
++ + shquote(encfs_keyfile)],
+ stdin=subprocess.PIPE)
+ encfs.communicate(('p\n'+pwd).encode('utf-8'))
+
+@@ -154,7 +163,7 @@ def init(encfs_decrypted, encfs_encrypted, recipients):
+
+ # Protect the EncFS configuration file by also encrypting it with
+ # the GPG keys of recipients.
+- subprocess.call(['gpg', '--encrypt', '--armor',
++ subprocess.call([GPG, '--encrypt', '--armor',
+ '--output', encfs_configfile+'.asc']
+ + recipients + [encfs_configfile])
+ os.remove(encfs_configfile)
+diff --git a/bin/debops-task b/bin/debops-task
+index 223e5f834..dc31ad4e6 100755
+--- a/bin/debops-task
++++ b/bin/debops-task
+@@ -49,11 +49,14 @@ project_root = find_debops_project(required=True)
+ # todo: need to decide on semantics!
+ # config = read_config(project_root)
+
++# External programms used. List here for easy substitution for
++# hard-coded paths.
++ANSIBLE = 'ansible'
+
+ # ---- Main script ----
+
+ # Make sure required commands are present
+-require_commands('ansible')
++require_commands(ANSIBLE)
+
+ ansible_inventory = find_inventorypath(project_root)
+
+@@ -71,5 +74,5 @@ if INSECURE:
+ os.environ['ANSIBLE_HOST_KEY_CHECKING'] = 'False'
+
+ # Run ansible with custom environment
+-cmd = ['ansible'] + module + sys.argv[1:]
++cmd = [ANSIBLE] + module + sys.argv[1:]
+ subprocess.call(cmd)
+diff --git a/bin/debops-update b/bin/debops-update
+index 88c5e2c82..cc7e57cb0 100755
+--- a/bin/debops-update
++++ b/bin/debops-update
+@@ -90,6 +90,10 @@ GALAXY_REQUIREMENTS = "galaxy/requirements.txt"
+ # Default Ansible Galaxy user account name
+ GALAXY_ACCOUNT = "debops"
+
++# External programms used. List here for easy substitution for
++# hard-coded paths.
++GIT = 'git'
++
+
+ # ---- Functions ----
+
+@@ -137,7 +141,7 @@ def clone_git_repository(repo_uri, branch, destination, dry_run=False):
+ if dry_run:
+ print("Cloning '%s' to %s..." % (repo_uri, destination))
+ else:
+- subprocess.call(['git', 'clone', '--quiet', '--branch', branch,
++ subprocess.call([GIT, 'clone', '--quiet', '--branch', branch,
+ repo_uri, destination])
+
+
+@@ -152,22 +156,22 @@ def update_git_repository(path, dry_run=False, remote_uri=False):
+ os.chdir(path)
+
+ if dry_run:
+- subprocess.call(['git', 'fetch'])
+- subprocess.call(['git', 'diff', 'HEAD', 'origin', '--stat'])
++ subprocess.call([GIT, 'fetch'])
++ subprocess.call([GIT, 'diff', 'HEAD', 'origin', '--stat'])
+ else:
+ # Get the current sha of the head branch
+ current_sha = subprocess.check_output(
+- ['git', 'rev-parse', 'HEAD']).strip()
++ [GIT, 'rev-parse', 'HEAD']).strip()
+
+ # Fetch it silently and store the new sha
+- subprocess.call(['git', 'fetch', '--quiet'])
++ subprocess.call([GIT, 'fetch', '--quiet'])
+ fetch_sha = subprocess.check_output(
+- ['git', 'rev-parse', 'FETCH_HEAD']).strip()
++ [GIT, 'rev-parse', 'FETCH_HEAD']).strip()
+
+ if current_sha != fetch_sha:
+ print()
+ print('--')
+- subprocess.call(['git', 'merge', fetch_sha])
++ subprocess.call([GIT, 'merge', fetch_sha])
+
+ if remote_uri:
+ compare_uri = (remote_uri + '/compare/' + current_sha[:7]
+diff --git a/debops/__init__.py b/debops/__init__.py
+index 1c2cedcb0..da8430e41 100644
+--- a/debops/__init__.py
++++ b/debops/__init__.py
+@@ -93,6 +93,13 @@ ENCFS_KEYFILE = ".encfs6.keyfile"
+ # Length of the random EncFS password stored in encrypted keyfile
+ ENCFS_KEYFILE_LENGTH = 256
+
++# External programms used. List here for easy substitution for
++# hard-coded paths.
++ENCFS = 'encfs'
++FUSERMOUNT = 'fusermount'
++UMOUNT = 'umount'
++GPG = 'gpg'
++
+
+ # ---- Functions ----
+
+@@ -180,9 +187,9 @@ def padlock_lock(encrypted_path):
+ return False
+ # OS X compatibility
+ if sys.platform == 'darwin':
+- subprocess.call(['umount', decrypted_path])
++ subprocess.call([UMOUNT, decrypted_path])
+ else:
+- subprocess.call(['fusermount', '-u', decrypted_path])
++ subprocess.call([FUSERMOUNT, '-u', decrypted_path])
+ return True
+
+
+@@ -237,14 +244,14 @@ def padlock_unlock(encrypted_path):
+ # Start encfs. It will wait for input on the `configfile` named
+ # pipe.
+ encfs = subprocess.Popen([
+- 'encfs', encrypted_path, decrypted_path,
++ ENCFS, encrypted_path, decrypted_path,
+ '--extpass',
+- 'gpg --decrypt --no-mdc-warning --output - %s' % shquote(keyfile)])
++ GPG + ' --decrypt --no-mdc-warning --output - %s' % shquote(keyfile)])
+ # now decrypt the config and write it into the named pipe
+ with open(configfile, 'w') as fh:
+ # NB: gpg must write to stdout to avoid it is asking whether
+ # the file should be overwritten
+- subprocess.Popen(['gpg',
++ subprocess.Popen([GPG,
+ '--decrypt', '--no-mdc-warning', '--output', '-',
+ crypted_configfile], stdout=fh).wait()
+ encfs.wait()
+diff --git a/debops/cmds/__init__.py b/debops/cmds/__init__.py
+index b221fa191..9fabf43a5 100644
+--- a/debops/cmds/__init__.py
++++ b/debops/cmds/__init__.py
+@@ -55,6 +55,10 @@ SCRIPT_NAME = os.path.basename(sys.argv[0])
+ # command line)
+ INSECURE = bool(os.environ.get('INSECURE', False))
+
++# External programms used. List here for easy substitution for
++# hard-coded paths.
++WHICH = 'which'
++
+
+ def error_msg(message, severity="Error"):
+ """
+@@ -70,7 +74,7 @@ def require_commands(*cmd_names):
+ Check if required commands exist.
+ """
+ def command_exists(cmd_name):
+- which = "where" if platform.system() == "Windows" else "which"
++ which = "where" if platform.system() == "Windows" else WHICH
+ return not subprocess.call([which, cmd_name],
+ stdout=DEVNULL, stderr=subprocess.STDOUT)
+
+--
+2.21.0
+
diff --git a/gnu/packages/patches/debops-debops-defaults-fall-back-to-less.patch b/gnu/packages/patches/debops-debops-defaults-fall-back-to-less.patch
new file mode 100644
index 0000000000..bbb6b7c08e
--- /dev/null
+++ b/gnu/packages/patches/debops-debops-defaults-fall-back-to-less.patch
@@ -0,0 +1,45 @@
+From 5059daf8bd59a83f520c14731173ea76ce8b8661 Mon Sep 17 00:00:00 2001
+From: Hartmut Goebel <h.goebel@crazy-compilers.com>
+Date: Sun, 8 Sep 2019 13:09:15 +0200
+Subject: [PATCH] [debops-defaults] If `view` is not available, try less, etc.
+
+---
+ bin/debops-defaults | 21 +++++++++++++++------
+ 1 file changed, 15 insertions(+), 6 deletions(-)
+
+diff --git a/bin/debops-defaults b/bin/debops-defaults
+index 9dd87fe0a..3e3db4c41 100755
+--- a/bin/debops-defaults
++++ b/bin/debops-defaults
+@@ -96,13 +96,22 @@ def main(role_list):
+ config = read_config(project_root)
+ playbooks_path = find_playbookpath(config, project_root, required=True)
+
+- # Make sure required commands are present
+- require_commands('view')
+-
+- if sys.stdout.isatty():
++ # Check if one of the output commands is present
++ sys.stdout = io.BytesIO() # suppress error message, if any
++ for cmd_args in (('view', '+set ft=yaml', '-'),
++ ('less', '-'),
++ ('more', '-')):
++ try:
++ require_commands(cmd_args[0])
++ break
++ except SystemExit:
++ # this command was not found
++ cmd_args = None
++ sys.stdout = sys.__stdout__
++
++ if cmd_args and sys.stdout.isatty():
+ # if script is run as standalone, redirect to view
+- view = subprocess.Popen(['view', '+set ft=yaml', '-'],
+- stdin=subprocess.PIPE)
++ view = subprocess.Popen(cmd_args, stdin=subprocess.PIPE)
+ try:
+ aggregate_defaults(playbooks_path, role_list, view.stdin)
+ except IOError as e:
+--
+2.21.0
+
diff --git a/gnu/packages/patches/freeimage-CVE-2015-0852.patch b/gnu/packages/patches/freeimage-CVE-2015-0852.patch
deleted file mode 100644
index 34d538e925..0000000000
--- a/gnu/packages/patches/freeimage-CVE-2015-0852.patch
+++ /dev/null
@@ -1,129 +0,0 @@
-Copied from Debian.
-
-Description: fix integer overflow
-Origin: upstream
- http://freeimage.cvs.sourceforge.net/viewvc/freeimage/FreeImage/Source/FreeImage/PluginPCX.cpp?view=patch&r1=1.17&r2=1.18&pathrev=MAIN
- http://freeimage.cvs.sourceforge.net/viewvc/freeimage/FreeImage/Source/FreeImage/PluginPCX.cpp?view=patch&r1=1.18&r2=1.19&pathrev=MAIN
-Bug-Debian: https://bugs.debian.org/797165
-Last-Update: 2015-09-14
----
-This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
-Index: freeimage/Source/FreeImage/PluginPCX.cpp
-===================================================================
---- freeimage.orig/Source/FreeImage/PluginPCX.cpp
-+++ freeimage/Source/FreeImage/PluginPCX.cpp
-@@ -347,12 +347,14 @@ Load(FreeImageIO *io, fi_handle handle,
-
- try {
- // check PCX identifier
--
-- long start_pos = io->tell_proc(handle);
-- BOOL validated = pcx_validate(io, handle);
-- io->seek_proc(handle, start_pos, SEEK_SET);
-- if(!validated) {
-- throw FI_MSG_ERROR_MAGIC_NUMBER;
-+ // (note: should have been already validated using FreeImage_GetFileType but check again)
-+ {
-+ long start_pos = io->tell_proc(handle);
-+ BOOL validated = pcx_validate(io, handle);
-+ io->seek_proc(handle, start_pos, SEEK_SET);
-+ if(!validated) {
-+ throw FI_MSG_ERROR_MAGIC_NUMBER;
-+ }
- }
-
- // process the header
-@@ -366,20 +368,38 @@ Load(FreeImageIO *io, fi_handle handle,
- SwapHeader(&header);
- #endif
-
-- // allocate a new DIB
-+ // process the window
-+ const WORD *window = header.window; // left, upper, right,lower pixel coord.
-+ const int left = window[0];
-+ const int top = window[1];
-+ const int right = window[2];
-+ const int bottom = window[3];
-
-- unsigned width = header.window[2] - header.window[0] + 1;
-- unsigned height = header.window[3] - header.window[1] + 1;
-- unsigned bitcount = header.bpp * header.planes;
--
-- if (bitcount == 24) {
-- dib = FreeImage_AllocateHeader(header_only, width, height, bitcount, FI_RGBA_RED_MASK, FI_RGBA_GREEN_MASK, FI_RGBA_BLUE_MASK);
-- } else {
-- dib = FreeImage_AllocateHeader(header_only, width, height, bitcount);
-+ // check image size
-+ if((left >= right) || (top >= bottom)) {
-+ throw FI_MSG_ERROR_PARSING;
- }
-
-- // if the dib couldn't be allocated, throw an error
-+ const unsigned width = right - left + 1;
-+ const unsigned height = bottom - top + 1;
-+ const unsigned bitcount = header.bpp * header.planes;
-+
-+ // allocate a new DIB
-+ switch(bitcount) {
-+ case 1:
-+ case 4:
-+ case 8:
-+ dib = FreeImage_AllocateHeader(header_only, width, height, bitcount);
-+ break;
-+ case 24:
-+ dib = FreeImage_AllocateHeader(header_only, width, height, bitcount, FI_RGBA_RED_MASK, FI_RGBA_GREEN_MASK, FI_RGBA_BLUE_MASK);
-+ break;
-+ default:
-+ throw FI_MSG_ERROR_DIB_MEMORY;
-+ break;
-+ }
-
-+ // if the dib couldn't be allocated, throw an error
- if (!dib) {
- throw FI_MSG_ERROR_DIB_MEMORY;
- }
-@@ -426,19 +446,23 @@ Load(FreeImageIO *io, fi_handle handle,
-
- if (palette_id == 0x0C) {
- BYTE *cmap = (BYTE*)malloc(768 * sizeof(BYTE));
-- io->read_proc(cmap, 768, 1, handle);
-
-- pal = FreeImage_GetPalette(dib);
-- BYTE *pColormap = &cmap[0];
-+ if(cmap) {
-+ io->read_proc(cmap, 768, 1, handle);
-
-- for(int i = 0; i < 256; i++) {
-- pal[i].rgbRed = pColormap[0];
-- pal[i].rgbGreen = pColormap[1];
-- pal[i].rgbBlue = pColormap[2];
-- pColormap += 3;
-+ pal = FreeImage_GetPalette(dib);
-+ BYTE *pColormap = &cmap[0];
-+
-+ for(int i = 0; i < 256; i++) {
-+ pal[i].rgbRed = pColormap[0];
-+ pal[i].rgbGreen = pColormap[1];
-+ pal[i].rgbBlue = pColormap[2];
-+ pColormap += 3;
-+ }
-+
-+ free(cmap);
- }
-
-- free(cmap);
- }
-
- // wrong palette ID, perhaps a gray scale is needed ?
-@@ -466,9 +490,9 @@ Load(FreeImageIO *io, fi_handle handle,
- // calculate the line length for the PCX and the DIB
-
- // length of raster line in bytes
-- unsigned linelength = header.bytes_per_line * header.planes;
-+ const unsigned linelength = header.bytes_per_line * header.planes;
- // length of DIB line (rounded to DWORD) in bytes
-- unsigned pitch = FreeImage_GetPitch(dib);
-+ const unsigned pitch = FreeImage_GetPitch(dib);
-
- // run-length encoding ?
-
diff --git a/gnu/packages/patches/freeimage-CVE-2016-5684.patch b/gnu/packages/patches/freeimage-CVE-2016-5684.patch
deleted file mode 100644
index 2fc02d7b0d..0000000000
--- a/gnu/packages/patches/freeimage-CVE-2016-5684.patch
+++ /dev/null
@@ -1,34 +0,0 @@
-From: Debian Science Maintainers
- <debian-science-maintainers@lists.alioth.debian.org>
-Date: Mon, 10 Oct 2016 08:22:44 +0100
-Subject: CVE-2016-5684
-
----
- Source/FreeImage/PluginXPM.cpp | 7 ++++++-
- 1 file changed, 6 insertions(+), 1 deletion(-)
-
-diff --git a/Source/FreeImage/PluginXPM.cpp b/Source/FreeImage/PluginXPM.cpp
-index a698321..cc7bd07 100644
---- a/Source/FreeImage/PluginXPM.cpp
-+++ b/Source/FreeImage/PluginXPM.cpp
-@@ -181,6 +181,11 @@ Load(FreeImageIO *io, fi_handle handle, int page, int flags, void *data) {
- }
- free(str);
-
-+ // check info string
-+ if((width <= 0) || (height <= 0) || (colors <= 0) || (cpp <= 0)) {
-+ throw "Improperly formed info string";
-+ }
-+
- if (colors > 256) {
- dib = FreeImage_AllocateHeader(header_only, width, height, 24, FI_RGBA_RED_MASK, FI_RGBA_GREEN_MASK, FI_RGBA_BLUE_MASK);
- } else {
-@@ -193,7 +198,7 @@ Load(FreeImageIO *io, fi_handle handle, int page, int flags, void *data) {
- FILE_RGBA rgba;
-
- str = ReadString(io, handle);
-- if(!str)
-+ if(!str || (strlen(str) < (size_t)cpp))
- throw "Error reading color strings";
-
- std::string chrs(str,cpp); //create a string for the color chars using the first cpp chars
diff --git a/gnu/packages/patches/freeimage-fix-build-with-gcc-5.patch b/gnu/packages/patches/freeimage-fix-build-with-gcc-5.patch
deleted file mode 100644
index 2c9f2c3357..0000000000
--- a/gnu/packages/patches/freeimage-fix-build-with-gcc-5.patch
+++ /dev/null
@@ -1,1453 +0,0 @@
-The original patch was downloaded from here:
-https://chromium-review.googlesource.com/c/297211
-
-The paths, file names, and line endings have been adapted.
-
-From eebaf97f5a1cb713d81d311308d8a48c124e5aef Mon Sep 17 00:00:00 2001
-From: James Zern <jzern@google.com>
-Date: Wed, 02 Sep 2015 23:21:13 -0700
-Subject: [PATCH] dsp/mips: add whitespace around stringizing operator
-
-fixes compile with gcc 5.1
-BUG=259
-
-Change-Id: Ideb39c6290ab8569b1b6cc835bea11c822d0286c
----
-
-diff --git a/Source/LibWebP/src/dsp/dsp.dec_mips_dsp_r2.c b/Source/LibWebP/src/dsp/dsp.dec_mips_dsp_r2.c
-index 6590f43..40e4d82 100644
---- a/Source/LibWebP/src/dsp/dsp.dec_mips_dsp_r2.c
-+++ b/Source/LibWebP/src/dsp/dsp.dec_mips_dsp_r2.c
-@@ -548,10 +548,10 @@
- // TEMP3 = SRC[D + D1 * BPS]
- #define LOAD_4_BYTES(TEMP0, TEMP1, TEMP2, TEMP3, \
- A, A1, B, B1, C, C1, D, D1, SRC) \
-- "lbu %["#TEMP0"], "#A"+"#A1"*"XSTR(BPS)"(%["#SRC"]) \n\t" \
-- "lbu %["#TEMP1"], "#B"+"#B1"*"XSTR(BPS)"(%["#SRC"]) \n\t" \
-- "lbu %["#TEMP2"], "#C"+"#C1"*"XSTR(BPS)"(%["#SRC"]) \n\t" \
-- "lbu %["#TEMP3"], "#D"+"#D1"*"XSTR(BPS)"(%["#SRC"]) \n\t" \
-+ "lbu %[" #TEMP0 "], " #A "+" #A1 "*"XSTR(BPS)"(%[" #SRC "]) \n\t" \
-+ "lbu %[" #TEMP1 "], " #B "+" #B1 "*"XSTR(BPS)"(%[" #SRC "]) \n\t" \
-+ "lbu %[" #TEMP2 "], " #C "+" #C1 "*"XSTR(BPS)"(%[" #SRC "]) \n\t" \
-+ "lbu %[" #TEMP3 "], " #D "+" #D1 "*"XSTR(BPS)"(%[" #SRC "]) \n\t" \
-
- static void SimpleHFilter16(uint8_t* p, int stride, int thresh) {
- int i;
-@@ -623,8 +623,8 @@
- // DST[A * BPS] = TEMP0
- // DST[B + C * BPS] = TEMP1
- #define STORE_8_BYTES(TEMP0, TEMP1, A, B, C, DST) \
-- "usw %["#TEMP0"], "#A"*"XSTR(BPS)"(%["#DST"]) \n\t" \
-- "usw %["#TEMP1"], "#B"+"#C"*"XSTR(BPS)"(%["#DST"]) \n\t"
-+ "usw %[" #TEMP0 "], " #A "*"XSTR(BPS)"(%[" #DST "]) \n\t" \
-+ "usw %[" #TEMP1 "], " #B "+" #C "*"XSTR(BPS)"(%[" #DST "]) \n\t"
-
- static void VE4(uint8_t* dst) { // vertical
- const uint8_t* top = dst - BPS;
-@@ -725,8 +725,8 @@
- // TEMP0 = SRC[A * BPS]
- // TEMP1 = SRC[B + C * BPS]
- #define LOAD_8_BYTES(TEMP0, TEMP1, A, B, C, SRC) \
-- "ulw %["#TEMP0"], "#A"*"XSTR(BPS)"(%["#SRC"]) \n\t" \
-- "ulw %["#TEMP1"], "#B"+"#C"*"XSTR(BPS)"(%["#SRC"]) \n\t"
-+ "ulw %[" #TEMP0 "], " #A "*"XSTR(BPS)"(%[" #SRC "]) \n\t" \
-+ "ulw %[" #TEMP1 "], " #B "+" #C "*"XSTR(BPS)"(%[" #SRC "]) \n\t"
-
- static void LD4(uint8_t* dst) { // Down-Left
- int temp0, temp1, temp2, temp3, temp4;
-@@ -873,24 +873,24 @@
- #define CLIPPING(SIZE) \
- "preceu.ph.qbl %[temp2], %[temp0] \n\t" \
- "preceu.ph.qbr %[temp0], %[temp0] \n\t" \
--".if "#SIZE" == 8 \n\t" \
-+".if " #SIZE " == 8 \n\t" \
- "preceu.ph.qbl %[temp3], %[temp1] \n\t" \
- "preceu.ph.qbr %[temp1], %[temp1] \n\t" \
- ".endif \n\t" \
- "addu.ph %[temp2], %[temp2], %[dst_1] \n\t" \
- "addu.ph %[temp0], %[temp0], %[dst_1] \n\t" \
--".if "#SIZE" == 8 \n\t" \
-+".if " #SIZE " == 8 \n\t" \
- "addu.ph %[temp3], %[temp3], %[dst_1] \n\t" \
- "addu.ph %[temp1], %[temp1], %[dst_1] \n\t" \
- ".endif \n\t" \
- "shll_s.ph %[temp2], %[temp2], 7 \n\t" \
- "shll_s.ph %[temp0], %[temp0], 7 \n\t" \
--".if "#SIZE" == 8 \n\t" \
-+".if " #SIZE " == 8 \n\t" \
- "shll_s.ph %[temp3], %[temp3], 7 \n\t" \
- "shll_s.ph %[temp1], %[temp1], 7 \n\t" \
- ".endif \n\t" \
- "precrqu_s.qb.ph %[temp0], %[temp2], %[temp0] \n\t" \
--".if "#SIZE" == 8 \n\t" \
-+".if " #SIZE " == 8 \n\t" \
- "precrqu_s.qb.ph %[temp1], %[temp3], %[temp1] \n\t" \
- ".endif \n\t"
-
-@@ -899,7 +899,7 @@
- int dst_1 = ((int)(DST)[-1] << 16) + (DST)[-1]; \
- int temp0, temp1, temp2, temp3; \
- __asm__ volatile ( \
-- ".if "#SIZE" < 8 \n\t" \
-+ ".if " #SIZE " < 8 \n\t" \
- "ulw %[temp0], 0(%[top]) \n\t" \
- "subu.ph %[dst_1], %[dst_1], %[top_1] \n\t" \
- CLIPPING(4) \
-@@ -911,7 +911,7 @@
- CLIPPING(8) \
- "usw %[temp0], 0(%[dst]) \n\t" \
- "usw %[temp1], 4(%[dst]) \n\t" \
-- ".if "#SIZE" == 16 \n\t" \
-+ ".if " #SIZE " == 16 \n\t" \
- "ulw %[temp0], 8(%[top]) \n\t" \
- "ulw %[temp1], 12(%[top]) \n\t" \
- CLIPPING(8) \
-diff --git a/Source/LibWebP/src/dsp/dsp.enc_mips32.c b/Source/LibWebP/src/dsp/dsp.enc_mips32.c
-index c5837f1..b50e08b 100644
---- a/Source/LibWebP/src/dsp/dsp.enc_mips32.c
-+++ b/Source/LibWebP/src/dsp/dsp.enc_mips32.c
-@@ -31,26 +31,26 @@
- // TEMP0..TEMP3 - registers for corresponding tmp elements
- // TEMP4..TEMP5 - temporary registers
- #define VERTICAL_PASS(A, B, C, D, TEMP4, TEMP0, TEMP1, TEMP2, TEMP3) \
-- "lh %[temp16], "#A"(%[temp20]) \n\t" \
-- "lh %[temp18], "#B"(%[temp20]) \n\t" \
-- "lh %[temp17], "#C"(%[temp20]) \n\t" \
-- "lh %[temp19], "#D"(%[temp20]) \n\t" \
-- "addu %["#TEMP4"], %[temp16], %[temp18] \n\t" \
-- "subu %[temp16], %[temp16], %[temp18] \n\t" \
-- "mul %["#TEMP0"], %[temp17], %[kC2] \n\t" \
-- "mul %[temp18], %[temp19], %[kC1] \n\t" \
-- "mul %[temp17], %[temp17], %[kC1] \n\t" \
-- "mul %[temp19], %[temp19], %[kC2] \n\t" \
-- "sra %["#TEMP0"], %["#TEMP0"], 16 \n\n" \
-- "sra %[temp18], %[temp18], 16 \n\n" \
-- "sra %[temp17], %[temp17], 16 \n\n" \
-- "sra %[temp19], %[temp19], 16 \n\n" \
-- "subu %["#TEMP2"], %["#TEMP0"], %[temp18] \n\t" \
-- "addu %["#TEMP3"], %[temp17], %[temp19] \n\t" \
-- "addu %["#TEMP0"], %["#TEMP4"], %["#TEMP3"] \n\t" \
-- "addu %["#TEMP1"], %[temp16], %["#TEMP2"] \n\t" \
-- "subu %["#TEMP2"], %[temp16], %["#TEMP2"] \n\t" \
-- "subu %["#TEMP3"], %["#TEMP4"], %["#TEMP3"] \n\t"
-+ "lh %[temp16], " #A "(%[temp20]) \n\t" \
-+ "lh %[temp18], " #B "(%[temp20]) \n\t" \
-+ "lh %[temp17], " #C "(%[temp20]) \n\t" \
-+ "lh %[temp19], " #D "(%[temp20]) \n\t" \
-+ "addu %[" #TEMP4 "], %[temp16], %[temp18] \n\t" \
-+ "subu %[temp16], %[temp16], %[temp18] \n\t" \
-+ "mul %[" #TEMP0 "], %[temp17], %[kC2] \n\t" \
-+ "mul %[temp18], %[temp19], %[kC1] \n\t" \
-+ "mul %[temp17], %[temp17], %[kC1] \n\t" \
-+ "mul %[temp19], %[temp19], %[kC2] \n\t" \
-+ "sra %[" #TEMP0 "], %[" #TEMP0 "], 16 \n\n" \
-+ "sra %[temp18], %[temp18], 16 \n\n" \
-+ "sra %[temp17], %[temp17], 16 \n\n" \
-+ "sra %[temp19], %[temp19], 16 \n\n" \
-+ "subu %[" #TEMP2 "], %[" #TEMP0 "], %[temp18] \n\t" \
-+ "addu %[" #TEMP3 "], %[temp17], %[temp19] \n\t" \
-+ "addu %[" #TEMP0 "], %[" #TEMP4 "], %[" #TEMP3 "] \n\t" \
-+ "addu %[" #TEMP1 "], %[temp16], %[" #TEMP2 "] \n\t" \
-+ "subu %[" #TEMP2 "], %[temp16], %[" #TEMP2 "] \n\t" \
-+ "subu %[" #TEMP3 "], %[" #TEMP4 "], %[" #TEMP3 "] \n\t"
-
- // macro for one horizontal pass in ITransformOne
- // MUL and STORE macros inlined
-@@ -58,59 +58,59 @@
- // temp0..temp15 holds tmp[0]..tmp[15]
- // A - offset in bytes to load from ref and store to dst buffer
- // TEMP0, TEMP4, TEMP8 and TEMP12 - registers for corresponding tmp elements
--#define HORIZONTAL_PASS(A, TEMP0, TEMP4, TEMP8, TEMP12) \
-- "addiu %["#TEMP0"], %["#TEMP0"], 4 \n\t" \
-- "addu %[temp16], %["#TEMP0"], %["#TEMP8"] \n\t" \
-- "subu %[temp17], %["#TEMP0"], %["#TEMP8"] \n\t" \
-- "mul %["#TEMP0"], %["#TEMP4"], %[kC2] \n\t" \
-- "mul %["#TEMP8"], %["#TEMP12"], %[kC1] \n\t" \
-- "mul %["#TEMP4"], %["#TEMP4"], %[kC1] \n\t" \
-- "mul %["#TEMP12"], %["#TEMP12"], %[kC2] \n\t" \
-- "sra %["#TEMP0"], %["#TEMP0"], 16 \n\t" \
-- "sra %["#TEMP8"], %["#TEMP8"], 16 \n\t" \
-- "sra %["#TEMP4"], %["#TEMP4"], 16 \n\t" \
-- "sra %["#TEMP12"], %["#TEMP12"], 16 \n\t" \
-- "subu %[temp18], %["#TEMP0"], %["#TEMP8"] \n\t" \
-- "addu %[temp19], %["#TEMP4"], %["#TEMP12"] \n\t" \
-- "addu %["#TEMP0"], %[temp16], %[temp19] \n\t" \
-- "addu %["#TEMP4"], %[temp17], %[temp18] \n\t" \
-- "subu %["#TEMP8"], %[temp17], %[temp18] \n\t" \
-- "subu %["#TEMP12"], %[temp16], %[temp19] \n\t" \
-- "lw %[temp20], 0(%[args]) \n\t" \
-- "sra %["#TEMP0"], %["#TEMP0"], 3 \n\t" \
-- "sra %["#TEMP4"], %["#TEMP4"], 3 \n\t" \
-- "sra %["#TEMP8"], %["#TEMP8"], 3 \n\t" \
-- "sra %["#TEMP12"], %["#TEMP12"], 3 \n\t" \
-- "lbu %[temp16], 0+"XSTR(BPS)"*"#A"(%[temp20]) \n\t" \
-- "lbu %[temp17], 1+"XSTR(BPS)"*"#A"(%[temp20]) \n\t" \
-- "lbu %[temp18], 2+"XSTR(BPS)"*"#A"(%[temp20]) \n\t" \
-- "lbu %[temp19], 3+"XSTR(BPS)"*"#A"(%[temp20]) \n\t" \
-- "addu %["#TEMP0"], %[temp16], %["#TEMP0"] \n\t" \
-- "addu %["#TEMP4"], %[temp17], %["#TEMP4"] \n\t" \
-- "addu %["#TEMP8"], %[temp18], %["#TEMP8"] \n\t" \
-- "addu %["#TEMP12"], %[temp19], %["#TEMP12"] \n\t" \
-- "slt %[temp16], %["#TEMP0"], $zero \n\t" \
-- "slt %[temp17], %["#TEMP4"], $zero \n\t" \
-- "slt %[temp18], %["#TEMP8"], $zero \n\t" \
-- "slt %[temp19], %["#TEMP12"], $zero \n\t" \
-- "movn %["#TEMP0"], $zero, %[temp16] \n\t" \
-- "movn %["#TEMP4"], $zero, %[temp17] \n\t" \
-- "movn %["#TEMP8"], $zero, %[temp18] \n\t" \
-- "movn %["#TEMP12"], $zero, %[temp19] \n\t" \
-- "addiu %[temp20], $zero, 255 \n\t" \
-- "slt %[temp16], %["#TEMP0"], %[temp20] \n\t" \
-- "slt %[temp17], %["#TEMP4"], %[temp20] \n\t" \
-- "slt %[temp18], %["#TEMP8"], %[temp20] \n\t" \
-- "slt %[temp19], %["#TEMP12"], %[temp20] \n\t" \
-- "movz %["#TEMP0"], %[temp20], %[temp16] \n\t" \
-- "movz %["#TEMP4"], %[temp20], %[temp17] \n\t" \
-- "lw %[temp16], 8(%[args]) \n\t" \
-- "movz %["#TEMP8"], %[temp20], %[temp18] \n\t" \
-- "movz %["#TEMP12"], %[temp20], %[temp19] \n\t" \
-- "sb %["#TEMP0"], 0+"XSTR(BPS)"*"#A"(%[temp16]) \n\t" \
-- "sb %["#TEMP4"], 1+"XSTR(BPS)"*"#A"(%[temp16]) \n\t" \
-- "sb %["#TEMP8"], 2+"XSTR(BPS)"*"#A"(%[temp16]) \n\t" \
-- "sb %["#TEMP12"], 3+"XSTR(BPS)"*"#A"(%[temp16]) \n\t"
-+#define HORIZONTAL_PASS(A, TEMP0, TEMP4, TEMP8, TEMP12) \
-+ "addiu %[" #TEMP0 "], %[" #TEMP0 "], 4 \n\t" \
-+ "addu %[temp16], %[" #TEMP0 "], %[" #TEMP8 "] \n\t" \
-+ "subu %[temp17], %[" #TEMP0 "], %[" #TEMP8 "] \n\t" \
-+ "mul %[" #TEMP0 "], %[" #TEMP4 "], %[kC2] \n\t" \
-+ "mul %[" #TEMP8 "], %[" #TEMP12 "], %[kC1] \n\t" \
-+ "mul %[" #TEMP4 "], %[" #TEMP4 "], %[kC1] \n\t" \
-+ "mul %[" #TEMP12 "], %[" #TEMP12 "], %[kC2] \n\t" \
-+ "sra %[" #TEMP0 "], %[" #TEMP0 "], 16 \n\t" \
-+ "sra %[" #TEMP8 "], %[" #TEMP8 "], 16 \n\t" \
-+ "sra %[" #TEMP4 "], %[" #TEMP4 "], 16 \n\t" \
-+ "sra %[" #TEMP12 "], %[" #TEMP12 "], 16 \n\t" \
-+ "subu %[temp18], %[" #TEMP0 "], %[" #TEMP8 "] \n\t" \
-+ "addu %[temp19], %[" #TEMP4 "], %[" #TEMP12 "] \n\t" \
-+ "addu %[" #TEMP0 "], %[temp16], %[temp19] \n\t" \
-+ "addu %[" #TEMP4 "], %[temp17], %[temp18] \n\t" \
-+ "subu %[" #TEMP8 "], %[temp17], %[temp18] \n\t" \
-+ "subu %[" #TEMP12 "], %[temp16], %[temp19] \n\t" \
-+ "lw %[temp20], 0(%[args]) \n\t" \
-+ "sra %[" #TEMP0 "], %[" #TEMP0 "], 3 \n\t" \
-+ "sra %[" #TEMP4 "], %[" #TEMP4 "], 3 \n\t" \
-+ "sra %[" #TEMP8 "], %[" #TEMP8 "], 3 \n\t" \
-+ "sra %[" #TEMP12 "], %[" #TEMP12 "], 3 \n\t" \
-+ "lbu %[temp16], 0+"XSTR(BPS)"*" #A "(%[temp20]) \n\t" \
-+ "lbu %[temp17], 1+"XSTR(BPS)"*" #A "(%[temp20]) \n\t" \
-+ "lbu %[temp18], 2+"XSTR(BPS)"*" #A "(%[temp20]) \n\t" \
-+ "lbu %[temp19], 3+"XSTR(BPS)"*" #A "(%[temp20]) \n\t" \
-+ "addu %[" #TEMP0 "], %[temp16], %[" #TEMP0 "] \n\t" \
-+ "addu %[" #TEMP4 "], %[temp17], %[" #TEMP4 "] \n\t" \
-+ "addu %[" #TEMP8 "], %[temp18], %[" #TEMP8 "] \n\t" \
-+ "addu %[" #TEMP12 "], %[temp19], %[" #TEMP12 "] \n\t" \
-+ "slt %[temp16], %[" #TEMP0 "], $zero \n\t" \
-+ "slt %[temp17], %[" #TEMP4 "], $zero \n\t" \
-+ "slt %[temp18], %[" #TEMP8 "], $zero \n\t" \
-+ "slt %[temp19], %[" #TEMP12 "], $zero \n\t" \
-+ "movn %[" #TEMP0 "], $zero, %[temp16] \n\t" \
-+ "movn %[" #TEMP4 "], $zero, %[temp17] \n\t" \
-+ "movn %[" #TEMP8 "], $zero, %[temp18] \n\t" \
-+ "movn %[" #TEMP12 "], $zero, %[temp19] \n\t" \
-+ "addiu %[temp20], $zero, 255 \n\t" \
-+ "slt %[temp16], %[" #TEMP0 "], %[temp20] \n\t" \
-+ "slt %[temp17], %[" #TEMP4 "], %[temp20] \n\t" \
-+ "slt %[temp18], %[" #TEMP8 "], %[temp20] \n\t" \
-+ "slt %[temp19], %[" #TEMP12 "], %[temp20] \n\t" \
-+ "movz %[" #TEMP0 "], %[temp20], %[temp16] \n\t" \
-+ "movz %[" #TEMP4 "], %[temp20], %[temp17] \n\t" \
-+ "lw %[temp16], 8(%[args]) \n\t" \
-+ "movz %[" #TEMP8 "], %[temp20], %[temp18] \n\t" \
-+ "movz %[" #TEMP12 "], %[temp20], %[temp19] \n\t" \
-+ "sb %[" #TEMP0 "], 0+"XSTR(BPS)"*" #A "(%[temp16]) \n\t" \
-+ "sb %[" #TEMP4 "], 1+"XSTR(BPS)"*" #A "(%[temp16]) \n\t" \
-+ "sb %[" #TEMP8 "], 2+"XSTR(BPS)"*" #A "(%[temp16]) \n\t" \
-+ "sb %[" #TEMP12 "], 3+"XSTR(BPS)"*" #A "(%[temp16]) \n\t"
-
- // Does one or two inverse transforms.
- static WEBP_INLINE void ITransformOne(const uint8_t* ref, const int16_t* in,
-@@ -161,9 +161,9 @@
- // K - offset in bytes (kZigzag[n] * 4)
- // N - offset in bytes (n * 2)
- #define QUANTIZE_ONE(J, K, N) \
-- "lh %[temp0], "#J"(%[ppin]) \n\t" \
-- "lhu %[temp1], "#J"(%[ppsharpen]) \n\t" \
-- "lw %[temp2], "#K"(%[ppzthresh]) \n\t" \
-+ "lh %[temp0], " #J "(%[ppin]) \n\t" \
-+ "lhu %[temp1], " #J "(%[ppsharpen]) \n\t" \
-+ "lw %[temp2], " #K "(%[ppzthresh]) \n\t" \
- "sra %[sign], %[temp0], 15 \n\t" \
- "xor %[coeff], %[temp0], %[sign] \n\t" \
- "subu %[coeff], %[coeff], %[sign] \n\t" \
-@@ -172,9 +172,9 @@
- "addiu %[temp5], $zero, 0 \n\t" \
- "addiu %[level], $zero, 0 \n\t" \
- "beqz %[temp4], 2f \n\t" \
-- "lhu %[temp1], "#J"(%[ppiq]) \n\t" \
-- "lw %[temp2], "#K"(%[ppbias]) \n\t" \
-- "lhu %[temp3], "#J"(%[ppq]) \n\t" \
-+ "lhu %[temp1], " #J "(%[ppiq]) \n\t" \
-+ "lw %[temp2], " #K "(%[ppbias]) \n\t" \
-+ "lhu %[temp3], " #J "(%[ppq]) \n\t" \
- "mul %[level], %[coeff], %[temp1] \n\t" \
- "addu %[level], %[level], %[temp2] \n\t" \
- "sra %[level], %[level], 17 \n\t" \
-@@ -184,8 +184,8 @@
- "subu %[level], %[level], %[sign] \n\t" \
- "mul %[temp5], %[level], %[temp3] \n\t" \
- "2: \n\t" \
-- "sh %[temp5], "#J"(%[ppin]) \n\t" \
-- "sh %[level], "#N"(%[pout]) \n\t"
-+ "sh %[temp5], " #J "(%[ppin]) \n\t" \
-+ "sh %[level], " #N "(%[pout]) \n\t"
-
- static int QuantizeBlock(int16_t in[16], int16_t out[16],
- const VP8Matrix* const mtx) {
-@@ -253,39 +253,39 @@
- // A - offset in bytes to load from a and b buffers
- // E..H - offsets in bytes to store first results to tmp buffer
- // E1..H1 - offsets in bytes to store second results to tmp buffer
--#define HORIZONTAL_PASS(A, E, F, G, H, E1, F1, G1, H1) \
-- "lbu %[temp0], 0+"XSTR(BPS)"*"#A"(%[a]) \n\t" \
-- "lbu %[temp1], 1+"XSTR(BPS)"*"#A"(%[a]) \n\t" \
-- "lbu %[temp2], 2+"XSTR(BPS)"*"#A"(%[a]) \n\t" \
-- "lbu %[temp3], 3+"XSTR(BPS)"*"#A"(%[a]) \n\t" \
-- "lbu %[temp4], 0+"XSTR(BPS)"*"#A"(%[b]) \n\t" \
-- "lbu %[temp5], 1+"XSTR(BPS)"*"#A"(%[b]) \n\t" \
-- "lbu %[temp6], 2+"XSTR(BPS)"*"#A"(%[b]) \n\t" \
-- "lbu %[temp7], 3+"XSTR(BPS)"*"#A"(%[b]) \n\t" \
-- "addu %[temp8], %[temp0], %[temp2] \n\t" \
-- "subu %[temp0], %[temp0], %[temp2] \n\t" \
-- "addu %[temp2], %[temp1], %[temp3] \n\t" \
-- "subu %[temp1], %[temp1], %[temp3] \n\t" \
-- "addu %[temp3], %[temp4], %[temp6] \n\t" \
-- "subu %[temp4], %[temp4], %[temp6] \n\t" \
-- "addu %[temp6], %[temp5], %[temp7] \n\t" \
-- "subu %[temp5], %[temp5], %[temp7] \n\t" \
-- "addu %[temp7], %[temp8], %[temp2] \n\t" \
-- "subu %[temp2], %[temp8], %[temp2] \n\t" \
-- "addu %[temp8], %[temp0], %[temp1] \n\t" \
-- "subu %[temp0], %[temp0], %[temp1] \n\t" \
-- "addu %[temp1], %[temp3], %[temp6] \n\t" \
-- "subu %[temp3], %[temp3], %[temp6] \n\t" \
-- "addu %[temp6], %[temp4], %[temp5] \n\t" \
-- "subu %[temp4], %[temp4], %[temp5] \n\t" \
-- "sw %[temp7], "#E"(%[tmp]) \n\t" \
-- "sw %[temp2], "#H"(%[tmp]) \n\t" \
-- "sw %[temp8], "#F"(%[tmp]) \n\t" \
-- "sw %[temp0], "#G"(%[tmp]) \n\t" \
-- "sw %[temp1], "#E1"(%[tmp]) \n\t" \
-- "sw %[temp3], "#H1"(%[tmp]) \n\t" \
-- "sw %[temp6], "#F1"(%[tmp]) \n\t" \
-- "sw %[temp4], "#G1"(%[tmp]) \n\t"
-+#define HORIZONTAL_PASS(A, E, F, G, H, E1, F1, G1, H1) \
-+ "lbu %[temp0], 0+"XSTR(BPS)"*" #A "(%[a]) \n\t" \
-+ "lbu %[temp1], 1+"XSTR(BPS)"*" #A "(%[a]) \n\t" \
-+ "lbu %[temp2], 2+"XSTR(BPS)"*" #A "(%[a]) \n\t" \
-+ "lbu %[temp3], 3+"XSTR(BPS)"*" #A "(%[a]) \n\t" \
-+ "lbu %[temp4], 0+"XSTR(BPS)"*" #A "(%[b]) \n\t" \
-+ "lbu %[temp5], 1+"XSTR(BPS)"*" #A "(%[b]) \n\t" \
-+ "lbu %[temp6], 2+"XSTR(BPS)"*" #A "(%[b]) \n\t" \
-+ "lbu %[temp7], 3+"XSTR(BPS)"*" #A "(%[b]) \n\t" \
-+ "addu %[temp8], %[temp0], %[temp2] \n\t" \
-+ "subu %[temp0], %[temp0], %[temp2] \n\t" \
-+ "addu %[temp2], %[temp1], %[temp3] \n\t" \
-+ "subu %[temp1], %[temp1], %[temp3] \n\t" \
-+ "addu %[temp3], %[temp4], %[temp6] \n\t" \
-+ "subu %[temp4], %[temp4], %[temp6] \n\t" \
-+ "addu %[temp6], %[temp5], %[temp7] \n\t" \
-+ "subu %[temp5], %[temp5], %[temp7] \n\t" \
-+ "addu %[temp7], %[temp8], %[temp2] \n\t" \
-+ "subu %[temp2], %[temp8], %[temp2] \n\t" \
-+ "addu %[temp8], %[temp0], %[temp1] \n\t" \
-+ "subu %[temp0], %[temp0], %[temp1] \n\t" \
-+ "addu %[temp1], %[temp3], %[temp6] \n\t" \
-+ "subu %[temp3], %[temp3], %[temp6] \n\t" \
-+ "addu %[temp6], %[temp4], %[temp5] \n\t" \
-+ "subu %[temp4], %[temp4], %[temp5] \n\t" \
-+ "sw %[temp7], " #E "(%[tmp]) \n\t" \
-+ "sw %[temp2], " #H "(%[tmp]) \n\t" \
-+ "sw %[temp8], " #F "(%[tmp]) \n\t" \
-+ "sw %[temp0], " #G "(%[tmp]) \n\t" \
-+ "sw %[temp1], " #E1 "(%[tmp]) \n\t" \
-+ "sw %[temp3], " #H1 "(%[tmp]) \n\t" \
-+ "sw %[temp6], " #F1 "(%[tmp]) \n\t" \
-+ "sw %[temp4], " #G1 "(%[tmp]) \n\t"
-
- // macro for one vertical pass in Disto4x4 (TTransform)
- // two calls of function TTransform are merged into single one
-@@ -300,10 +300,10 @@
- // A1..D1 - offsets in bytes to load second results from tmp buffer
- // E..H - offsets in bytes to load from w buffer
- #define VERTICAL_PASS(A, B, C, D, A1, B1, C1, D1, E, F, G, H) \
-- "lw %[temp0], "#A1"(%[tmp]) \n\t" \
-- "lw %[temp1], "#C1"(%[tmp]) \n\t" \
-- "lw %[temp2], "#B1"(%[tmp]) \n\t" \
-- "lw %[temp3], "#D1"(%[tmp]) \n\t" \
-+ "lw %[temp0], " #A1 "(%[tmp]) \n\t" \
-+ "lw %[temp1], " #C1 "(%[tmp]) \n\t" \
-+ "lw %[temp2], " #B1 "(%[tmp]) \n\t" \
-+ "lw %[temp3], " #D1 "(%[tmp]) \n\t" \
- "addu %[temp8], %[temp0], %[temp1] \n\t" \
- "subu %[temp0], %[temp0], %[temp1] \n\t" \
- "addu %[temp1], %[temp2], %[temp3] \n\t" \
-@@ -324,18 +324,18 @@
- "subu %[temp1], %[temp1], %[temp5] \n\t" \
- "subu %[temp0], %[temp0], %[temp6] \n\t" \
- "subu %[temp8], %[temp8], %[temp7] \n\t" \
-- "lhu %[temp4], "#E"(%[w]) \n\t" \
-- "lhu %[temp5], "#F"(%[w]) \n\t" \
-- "lhu %[temp6], "#G"(%[w]) \n\t" \
-- "lhu %[temp7], "#H"(%[w]) \n\t" \
-+ "lhu %[temp4], " #E "(%[w]) \n\t" \
-+ "lhu %[temp5], " #F "(%[w]) \n\t" \
-+ "lhu %[temp6], " #G "(%[w]) \n\t" \
-+ "lhu %[temp7], " #H "(%[w]) \n\t" \
- "madd %[temp4], %[temp3] \n\t" \
- "madd %[temp5], %[temp1] \n\t" \
- "madd %[temp6], %[temp0] \n\t" \
- "madd %[temp7], %[temp8] \n\t" \
-- "lw %[temp0], "#A"(%[tmp]) \n\t" \
-- "lw %[temp1], "#C"(%[tmp]) \n\t" \
-- "lw %[temp2], "#B"(%[tmp]) \n\t" \
-- "lw %[temp3], "#D"(%[tmp]) \n\t" \
-+ "lw %[temp0], " #A "(%[tmp]) \n\t" \
-+ "lw %[temp1], " #C "(%[tmp]) \n\t" \
-+ "lw %[temp2], " #B "(%[tmp]) \n\t" \
-+ "lw %[temp3], " #D "(%[tmp]) \n\t" \
- "addu %[temp8], %[temp0], %[temp1] \n\t" \
- "subu %[temp0], %[temp0], %[temp1] \n\t" \
- "addu %[temp1], %[temp2], %[temp3] \n\t" \
-@@ -412,71 +412,71 @@
- // temp0..temp15 holds tmp[0]..tmp[15]
- // A - offset in bytes to load from src and ref buffers
- // TEMP0..TEMP3 - registers for corresponding tmp elements
--#define HORIZONTAL_PASS(A, TEMP0, TEMP1, TEMP2, TEMP3) \
-- "lw %["#TEMP1"], 0(%[args]) \n\t" \
-- "lw %["#TEMP2"], 4(%[args]) \n\t" \
-- "lbu %[temp16], 0+"XSTR(BPS)"*"#A"(%["#TEMP1"]) \n\t" \
-- "lbu %[temp17], 0+"XSTR(BPS)"*"#A"(%["#TEMP2"]) \n\t" \
-- "lbu %[temp18], 1+"XSTR(BPS)"*"#A"(%["#TEMP1"]) \n\t" \
-- "lbu %[temp19], 1+"XSTR(BPS)"*"#A"(%["#TEMP2"]) \n\t" \
-- "subu %[temp20], %[temp16], %[temp17] \n\t" \
-- "lbu %[temp16], 2+"XSTR(BPS)"*"#A"(%["#TEMP1"]) \n\t" \
-- "lbu %[temp17], 2+"XSTR(BPS)"*"#A"(%["#TEMP2"]) \n\t" \
-- "subu %["#TEMP0"], %[temp18], %[temp19] \n\t" \
-- "lbu %[temp18], 3+"XSTR(BPS)"*"#A"(%["#TEMP1"]) \n\t" \
-- "lbu %[temp19], 3+"XSTR(BPS)"*"#A"(%["#TEMP2"]) \n\t" \
-- "subu %["#TEMP1"], %[temp16], %[temp17] \n\t" \
-- "subu %["#TEMP2"], %[temp18], %[temp19] \n\t" \
-- "addu %["#TEMP3"], %[temp20], %["#TEMP2"] \n\t" \
-- "subu %["#TEMP2"], %[temp20], %["#TEMP2"] \n\t" \
-- "addu %[temp20], %["#TEMP0"], %["#TEMP1"] \n\t" \
-- "subu %["#TEMP0"], %["#TEMP0"], %["#TEMP1"] \n\t" \
-- "mul %[temp16], %["#TEMP2"], %[c5352] \n\t" \
-- "mul %[temp17], %["#TEMP2"], %[c2217] \n\t" \
-- "mul %[temp18], %["#TEMP0"], %[c5352] \n\t" \
-- "mul %[temp19], %["#TEMP0"], %[c2217] \n\t" \
-- "addu %["#TEMP1"], %["#TEMP3"], %[temp20] \n\t" \
-- "subu %[temp20], %["#TEMP3"], %[temp20] \n\t" \
-- "sll %["#TEMP0"], %["#TEMP1"], 3 \n\t" \
-- "sll %["#TEMP2"], %[temp20], 3 \n\t" \
-- "addiu %[temp16], %[temp16], 1812 \n\t" \
-- "addiu %[temp17], %[temp17], 937 \n\t" \
-- "addu %[temp16], %[temp16], %[temp19] \n\t" \
-- "subu %[temp17], %[temp17], %[temp18] \n\t" \
-- "sra %["#TEMP1"], %[temp16], 9 \n\t" \
-- "sra %["#TEMP3"], %[temp17], 9 \n\t"
-+#define HORIZONTAL_PASS(A, TEMP0, TEMP1, TEMP2, TEMP3) \
-+ "lw %[" #TEMP1 "], 0(%[args]) \n\t" \
-+ "lw %[" #TEMP2 "], 4(%[args]) \n\t" \
-+ "lbu %[temp16], 0+"XSTR(BPS)"*" #A "(%[" #TEMP1 "]) \n\t" \
-+ "lbu %[temp17], 0+"XSTR(BPS)"*" #A "(%[" #TEMP2 "]) \n\t" \
-+ "lbu %[temp18], 1+"XSTR(BPS)"*" #A "(%[" #TEMP1 "]) \n\t" \
-+ "lbu %[temp19], 1+"XSTR(BPS)"*" #A "(%[" #TEMP2 "]) \n\t" \
-+ "subu %[temp20], %[temp16], %[temp17] \n\t" \
-+ "lbu %[temp16], 2+"XSTR(BPS)"*" #A "(%[" #TEMP1 "]) \n\t" \
-+ "lbu %[temp17], 2+"XSTR(BPS)"*" #A "(%[" #TEMP2 "]) \n\t" \
-+ "subu %[" #TEMP0 "], %[temp18], %[temp19] \n\t" \
-+ "lbu %[temp18], 3+"XSTR(BPS)"*" #A "(%[" #TEMP1 "]) \n\t" \
-+ "lbu %[temp19], 3+"XSTR(BPS)"*" #A "(%[" #TEMP2 "]) \n\t" \
-+ "subu %[" #TEMP1 "], %[temp16], %[temp17] \n\t" \
-+ "subu %[" #TEMP2 "], %[temp18], %[temp19] \n\t" \
-+ "addu %[" #TEMP3 "], %[temp20], %[" #TEMP2 "] \n\t" \
-+ "subu %[" #TEMP2 "], %[temp20], %[" #TEMP2 "] \n\t" \
-+ "addu %[temp20], %[" #TEMP0 "], %[" #TEMP1 "] \n\t" \
-+ "subu %[" #TEMP0 "], %[" #TEMP0 "], %[" #TEMP1 "] \n\t" \
-+ "mul %[temp16], %[" #TEMP2 "], %[c5352] \n\t" \
-+ "mul %[temp17], %[" #TEMP2 "], %[c2217] \n\t" \
-+ "mul %[temp18], %[" #TEMP0 "], %[c5352] \n\t" \
-+ "mul %[temp19], %[" #TEMP0 "], %[c2217] \n\t" \
-+ "addu %[" #TEMP1 "], %[" #TEMP3 "], %[temp20] \n\t" \
-+ "subu %[temp20], %[" #TEMP3 "], %[temp20] \n\t" \
-+ "sll %[" #TEMP0 "], %[" #TEMP1 "], 3 \n\t" \
-+ "sll %[" #TEMP2 "], %[temp20], 3 \n\t" \
-+ "addiu %[temp16], %[temp16], 1812 \n\t" \
-+ "addiu %[temp17], %[temp17], 937 \n\t" \
-+ "addu %[temp16], %[temp16], %[temp19] \n\t" \
-+ "subu %[temp17], %[temp17], %[temp18] \n\t" \
-+ "sra %[" #TEMP1 "], %[temp16], 9 \n\t" \
-+ "sra %[" #TEMP3 "], %[temp17], 9 \n\t"
-
- // macro for one vertical pass in FTransform
- // temp0..temp15 holds tmp[0]..tmp[15]
- // A..D - offsets in bytes to store to out buffer
- // TEMP0, TEMP4, TEMP8 and TEMP12 - registers for corresponding tmp elements
--#define VERTICAL_PASS(A, B, C, D, TEMP0, TEMP4, TEMP8, TEMP12) \
-- "addu %[temp16], %["#TEMP0"], %["#TEMP12"] \n\t" \
-- "subu %[temp19], %["#TEMP0"], %["#TEMP12"] \n\t" \
-- "addu %[temp17], %["#TEMP4"], %["#TEMP8"] \n\t" \
-- "subu %[temp18], %["#TEMP4"], %["#TEMP8"] \n\t" \
-- "mul %["#TEMP8"], %[temp19], %[c2217] \n\t" \
-- "mul %["#TEMP12"], %[temp18], %[c2217] \n\t" \
-- "mul %["#TEMP4"], %[temp19], %[c5352] \n\t" \
-- "mul %[temp18], %[temp18], %[c5352] \n\t" \
-- "addiu %[temp16], %[temp16], 7 \n\t" \
-- "addu %["#TEMP0"], %[temp16], %[temp17] \n\t" \
-- "sra %["#TEMP0"], %["#TEMP0"], 4 \n\t" \
-- "addu %["#TEMP12"], %["#TEMP12"], %["#TEMP4"] \n\t" \
-- "subu %["#TEMP4"], %[temp16], %[temp17] \n\t" \
-- "sra %["#TEMP4"], %["#TEMP4"], 4 \n\t" \
-- "addiu %["#TEMP8"], %["#TEMP8"], 30000 \n\t" \
-- "addiu %["#TEMP12"], %["#TEMP12"], 12000 \n\t" \
-- "addiu %["#TEMP8"], %["#TEMP8"], 21000 \n\t" \
-- "subu %["#TEMP8"], %["#TEMP8"], %[temp18] \n\t" \
-- "sra %["#TEMP12"], %["#TEMP12"], 16 \n\t" \
-- "sra %["#TEMP8"], %["#TEMP8"], 16 \n\t" \
-- "addiu %[temp16], %["#TEMP12"], 1 \n\t" \
-- "movn %["#TEMP12"], %[temp16], %[temp19] \n\t" \
-- "sh %["#TEMP0"], "#A"(%[temp20]) \n\t" \
-- "sh %["#TEMP4"], "#C"(%[temp20]) \n\t" \
-- "sh %["#TEMP8"], "#D"(%[temp20]) \n\t" \
-- "sh %["#TEMP12"], "#B"(%[temp20]) \n\t"
-+#define VERTICAL_PASS(A, B, C, D, TEMP0, TEMP4, TEMP8, TEMP12) \
-+ "addu %[temp16], %[" #TEMP0 "], %[" #TEMP12 "] \n\t" \
-+ "subu %[temp19], %[" #TEMP0 "], %[" #TEMP12 "] \n\t" \
-+ "addu %[temp17], %[" #TEMP4 "], %[" #TEMP8 "] \n\t" \
-+ "subu %[temp18], %[" #TEMP4 "], %[" #TEMP8 "] \n\t" \
-+ "mul %[" #TEMP8 "], %[temp19], %[c2217] \n\t" \
-+ "mul %[" #TEMP12 "], %[temp18], %[c2217] \n\t" \
-+ "mul %[" #TEMP4 "], %[temp19], %[c5352] \n\t" \
-+ "mul %[temp18], %[temp18], %[c5352] \n\t" \
-+ "addiu %[temp16], %[temp16], 7 \n\t" \
-+ "addu %[" #TEMP0 "], %[temp16], %[temp17] \n\t" \
-+ "sra %[" #TEMP0 "], %[" #TEMP0 "], 4 \n\t" \
-+ "addu %[" #TEMP12 "], %[" #TEMP12 "], %[" #TEMP4 "] \n\t" \
-+ "subu %[" #TEMP4 "], %[temp16], %[temp17] \n\t" \
-+ "sra %[" #TEMP4 "], %[" #TEMP4 "], 4 \n\t" \
-+ "addiu %[" #TEMP8 "], %[" #TEMP8 "], 30000 \n\t" \
-+ "addiu %[" #TEMP12 "], %[" #TEMP12 "], 12000 \n\t" \
-+ "addiu %[" #TEMP8 "], %[" #TEMP8 "], 21000 \n\t" \
-+ "subu %[" #TEMP8 "], %[" #TEMP8 "], %[temp18] \n\t" \
-+ "sra %[" #TEMP12 "], %[" #TEMP12 "], 16 \n\t" \
-+ "sra %[" #TEMP8 "], %[" #TEMP8 "], 16 \n\t" \
-+ "addiu %[temp16], %[" #TEMP12 "], 1 \n\t" \
-+ "movn %[" #TEMP12 "], %[temp16], %[temp19] \n\t" \
-+ "sh %[" #TEMP0 "], " #A "(%[temp20]) \n\t" \
-+ "sh %[" #TEMP4 "], " #C "(%[temp20]) \n\t" \
-+ "sh %[" #TEMP8 "], " #D "(%[temp20]) \n\t" \
-+ "sh %[" #TEMP12 "], " #B "(%[temp20]) \n\t"
-
- static void FTransform(const uint8_t* src, const uint8_t* ref, int16_t* out) {
- int temp0, temp1, temp2, temp3, temp4, temp5, temp6, temp7, temp8;
-@@ -516,14 +516,14 @@
- #if !defined(WORK_AROUND_GCC)
-
- #define GET_SSE_INNER(A, B, C, D) \
-- "lbu %[temp0], "#A"(%[a]) \n\t" \
-- "lbu %[temp1], "#A"(%[b]) \n\t" \
-- "lbu %[temp2], "#B"(%[a]) \n\t" \
-- "lbu %[temp3], "#B"(%[b]) \n\t" \
-- "lbu %[temp4], "#C"(%[a]) \n\t" \
-- "lbu %[temp5], "#C"(%[b]) \n\t" \
-- "lbu %[temp6], "#D"(%[a]) \n\t" \
-- "lbu %[temp7], "#D"(%[b]) \n\t" \
-+ "lbu %[temp0], " #A "(%[a]) \n\t" \
-+ "lbu %[temp1], " #A "(%[b]) \n\t" \
-+ "lbu %[temp2], " #B "(%[a]) \n\t" \
-+ "lbu %[temp3], " #B "(%[b]) \n\t" \
-+ "lbu %[temp4], " #C "(%[a]) \n\t" \
-+ "lbu %[temp5], " #C "(%[b]) \n\t" \
-+ "lbu %[temp6], " #D "(%[a]) \n\t" \
-+ "lbu %[temp7], " #D "(%[b]) \n\t" \
- "subu %[temp0], %[temp0], %[temp1] \n\t" \
- "subu %[temp2], %[temp2], %[temp3] \n\t" \
- "subu %[temp4], %[temp4], %[temp5] \n\t" \
-diff --git a/Source/LibWebP/src/dsp/dsp.enc_mips_dsp_r2.c b/Source/LibWebP/src/dsp/dsp.enc_mips_dsp_r2.c
-index 56db07c..44f6fd2 100644
---- a/Source/LibWebP/src/dsp/dsp.enc_mips_dsp_r2.c
-+++ b/Source/LibWebP/src/dsp/dsp.enc_mips_dsp_r2.c
-@@ -27,25 +27,25 @@
- // I - input (macro doesn't change it)
- #define ADD_SUB_HALVES_X4(O0, O1, O2, O3, O4, O5, O6, O7, \
- I0, I1, I2, I3, I4, I5, I6, I7) \
-- "addq.ph %["#O0"], %["#I0"], %["#I1"] \n\t" \
-- "subq.ph %["#O1"], %["#I0"], %["#I1"] \n\t" \
-- "addq.ph %["#O2"], %["#I2"], %["#I3"] \n\t" \
-- "subq.ph %["#O3"], %["#I2"], %["#I3"] \n\t" \
-- "addq.ph %["#O4"], %["#I4"], %["#I5"] \n\t" \
-- "subq.ph %["#O5"], %["#I4"], %["#I5"] \n\t" \
-- "addq.ph %["#O6"], %["#I6"], %["#I7"] \n\t" \
-- "subq.ph %["#O7"], %["#I6"], %["#I7"] \n\t"
-+ "addq.ph %[" #O0 "], %[" #I0 "], %[" #I1 "] \n\t" \
-+ "subq.ph %[" #O1 "], %[" #I0 "], %[" #I1 "] \n\t" \
-+ "addq.ph %[" #O2 "], %[" #I2 "], %[" #I3 "] \n\t" \
-+ "subq.ph %[" #O3 "], %[" #I2 "], %[" #I3 "] \n\t" \
-+ "addq.ph %[" #O4 "], %[" #I4 "], %[" #I5 "] \n\t" \
-+ "subq.ph %[" #O5 "], %[" #I4 "], %[" #I5 "] \n\t" \
-+ "addq.ph %[" #O6 "], %[" #I6 "], %[" #I7 "] \n\t" \
-+ "subq.ph %[" #O7 "], %[" #I6 "], %[" #I7 "] \n\t"
-
- // IO - input/output
- #define ABS_X8(IO0, IO1, IO2, IO3, IO4, IO5, IO6, IO7) \
-- "absq_s.ph %["#IO0"], %["#IO0"] \n\t" \
-- "absq_s.ph %["#IO1"], %["#IO1"] \n\t" \
-- "absq_s.ph %["#IO2"], %["#IO2"] \n\t" \
-- "absq_s.ph %["#IO3"], %["#IO3"] \n\t" \
-- "absq_s.ph %["#IO4"], %["#IO4"] \n\t" \
-- "absq_s.ph %["#IO5"], %["#IO5"] \n\t" \
-- "absq_s.ph %["#IO6"], %["#IO6"] \n\t" \
-- "absq_s.ph %["#IO7"], %["#IO7"] \n\t"
-+ "absq_s.ph %[" #IO0 "], %[" #IO0 "] \n\t" \
-+ "absq_s.ph %[" #IO1 "], %[" #IO1 "] \n\t" \
-+ "absq_s.ph %[" #IO2 "], %[" #IO2 "] \n\t" \
-+ "absq_s.ph %[" #IO3 "], %[" #IO3 "] \n\t" \
-+ "absq_s.ph %[" #IO4 "], %[" #IO4 "] \n\t" \
-+ "absq_s.ph %[" #IO5 "], %[" #IO5 "] \n\t" \
-+ "absq_s.ph %[" #IO6 "], %[" #IO6 "] \n\t" \
-+ "absq_s.ph %[" #IO7 "], %[" #IO7 "] \n\t"
-
- // dpa.w.ph $ac0 temp0 ,temp1
- // $ac += temp0[31..16] * temp1[31..16] + temp0[15..0] * temp1[15..0]
-@@ -56,15 +56,15 @@
- #define MUL_HALF(O0, I0, I1, I2, I3, I4, I5, I6, I7, \
- I8, I9, I10, I11, I12, I13, I14, I15) \
- "mult $ac0, $zero, $zero \n\t" \
-- "dpa.w.ph $ac0, %["#I2"], %["#I0"] \n\t" \
-- "dpax.w.ph $ac0, %["#I5"], %["#I6"] \n\t" \
-- "dpa.w.ph $ac0, %["#I8"], %["#I9"] \n\t" \
-- "dpax.w.ph $ac0, %["#I11"], %["#I4"] \n\t" \
-- "dpa.w.ph $ac0, %["#I12"], %["#I7"] \n\t" \
-- "dpax.w.ph $ac0, %["#I13"], %["#I1"] \n\t" \
-- "dpa.w.ph $ac0, %["#I14"], %["#I3"] \n\t" \
-- "dpax.w.ph $ac0, %["#I15"], %["#I10"] \n\t" \
-- "mflo %["#O0"], $ac0 \n\t"
-+ "dpa.w.ph $ac0, %[" #I2 "], %[" #I0 "] \n\t" \
-+ "dpax.w.ph $ac0, %[" #I5 "], %[" #I6 "] \n\t" \
-+ "dpa.w.ph $ac0, %[" #I8 "], %[" #I9 "] \n\t" \
-+ "dpax.w.ph $ac0, %[" #I11 "], %[" #I4 "] \n\t" \
-+ "dpa.w.ph $ac0, %[" #I12 "], %[" #I7 "] \n\t" \
-+ "dpax.w.ph $ac0, %[" #I13 "], %[" #I1 "] \n\t" \
-+ "dpa.w.ph $ac0, %[" #I14 "], %[" #I3 "] \n\t" \
-+ "dpax.w.ph $ac0, %[" #I15 "], %[" #I10 "] \n\t" \
-+ "mflo %[" #O0 "], $ac0 \n\t"
-
- #define OUTPUT_EARLY_CLOBBER_REGS_17() \
- OUTPUT_EARLY_CLOBBER_REGS_10(), \
-@@ -77,69 +77,69 @@
- // A - offset in bytes to load from src and ref buffers
- // TEMP0..TEMP3 - registers for corresponding tmp elements
- #define HORIZONTAL_PASS(A, TEMP0, TEMP1, TEMP2, TEMP3) \
-- "lw %["#TEMP0"], 0(%[args]) \n\t" \
-- "lw %["#TEMP1"], 4(%[args]) \n\t" \
-- "lw %["#TEMP2"], "XSTR(BPS)"*"#A"(%["#TEMP0"]) \n\t" \
-- "lw %["#TEMP3"], "XSTR(BPS)"*"#A"(%["#TEMP1"]) \n\t" \
-- "preceu.ph.qbl %["#TEMP0"], %["#TEMP2"] \n\t" \
-- "preceu.ph.qbl %["#TEMP1"], %["#TEMP3"] \n\t" \
-- "preceu.ph.qbr %["#TEMP2"], %["#TEMP2"] \n\t" \
-- "preceu.ph.qbr %["#TEMP3"], %["#TEMP3"] \n\t" \
-- "subq.ph %["#TEMP0"], %["#TEMP0"], %["#TEMP1"] \n\t" \
-- "subq.ph %["#TEMP2"], %["#TEMP2"], %["#TEMP3"] \n\t" \
-- "rotr %["#TEMP0"], %["#TEMP0"], 16 \n\t" \
-- "addq.ph %["#TEMP1"], %["#TEMP2"], %["#TEMP0"] \n\t" \
-- "subq.ph %["#TEMP3"], %["#TEMP2"], %["#TEMP0"] \n\t" \
-- "seh %["#TEMP0"], %["#TEMP1"] \n\t" \
-- "sra %[temp16], %["#TEMP1"], 16 \n\t" \
-- "seh %[temp19], %["#TEMP3"] \n\t" \
-- "sra %["#TEMP3"], %["#TEMP3"], 16 \n\t" \
-- "subu %["#TEMP2"], %["#TEMP0"], %[temp16] \n\t" \
-- "addu %["#TEMP0"], %["#TEMP0"], %[temp16] \n\t" \
-- "mul %[temp17], %[temp19], %[c2217] \n\t" \
-- "mul %[temp18], %["#TEMP3"], %[c5352] \n\t" \
-- "mul %["#TEMP1"], %[temp19], %[c5352] \n\t" \
-- "mul %[temp16], %["#TEMP3"], %[c2217] \n\t" \
-- "sll %["#TEMP2"], %["#TEMP2"], 3 \n\t" \
-- "sll %["#TEMP0"], %["#TEMP0"], 3 \n\t" \
-- "subu %["#TEMP3"], %[temp17], %[temp18] \n\t" \
-- "addu %["#TEMP1"], %[temp16], %["#TEMP1"] \n\t" \
-- "addiu %["#TEMP3"], %["#TEMP3"], 937 \n\t" \
-- "addiu %["#TEMP1"], %["#TEMP1"], 1812 \n\t" \
-- "sra %["#TEMP3"], %["#TEMP3"], 9 \n\t" \
-- "sra %["#TEMP1"], %["#TEMP1"], 9 \n\t"
-+ "lw %[" #TEMP0 "], 0(%[args]) \n\t" \
-+ "lw %[" #TEMP1 "], 4(%[args]) \n\t" \
-+ "lw %[" #TEMP2 "], "XSTR(BPS)"*" #A "(%[" #TEMP0 "]) \n\t" \
-+ "lw %[" #TEMP3 "], "XSTR(BPS)"*" #A "(%[" #TEMP1 "]) \n\t" \
-+ "preceu.ph.qbl %[" #TEMP0 "], %[" #TEMP2 "] \n\t" \
-+ "preceu.ph.qbl %[" #TEMP1 "], %[" #TEMP3 "] \n\t" \
-+ "preceu.ph.qbr %[" #TEMP2 "], %[" #TEMP2 "] \n\t" \
-+ "preceu.ph.qbr %[" #TEMP3 "], %[" #TEMP3 "] \n\t" \
-+ "subq.ph %[" #TEMP0 "], %[" #TEMP0 "], %[" #TEMP1 "] \n\t" \
-+ "subq.ph %[" #TEMP2 "], %[" #TEMP2 "], %[" #TEMP3 "] \n\t" \
-+ "rotr %[" #TEMP0 "], %[" #TEMP0 "], 16 \n\t" \
-+ "addq.ph %[" #TEMP1 "], %[" #TEMP2 "], %[" #TEMP0 "] \n\t" \
-+ "subq.ph %[" #TEMP3 "], %[" #TEMP2 "], %[" #TEMP0 "] \n\t" \
-+ "seh %[" #TEMP0 "], %[" #TEMP1 "] \n\t" \
-+ "sra %[temp16], %[" #TEMP1 "], 16 \n\t" \
-+ "seh %[temp19], %[" #TEMP3 "] \n\t" \
-+ "sra %[" #TEMP3 "], %[" #TEMP3 "], 16 \n\t" \
-+ "subu %[" #TEMP2 "], %[" #TEMP0 "], %[temp16] \n\t" \
-+ "addu %[" #TEMP0 "], %[" #TEMP0 "], %[temp16] \n\t" \
-+ "mul %[temp17], %[temp19], %[c2217] \n\t" \
-+ "mul %[temp18], %[" #TEMP3 "], %[c5352] \n\t" \
-+ "mul %[" #TEMP1 "], %[temp19], %[c5352] \n\t" \
-+ "mul %[temp16], %[" #TEMP3 "], %[c2217] \n\t" \
-+ "sll %[" #TEMP2 "], %[" #TEMP2 "], 3 \n\t" \
-+ "sll %[" #TEMP0 "], %[" #TEMP0 "], 3 \n\t" \
-+ "subu %[" #TEMP3 "], %[temp17], %[temp18] \n\t" \
-+ "addu %[" #TEMP1 "], %[temp16], %[" #TEMP1 "] \n\t" \
-+ "addiu %[" #TEMP3 "], %[" #TEMP3 "], 937 \n\t" \
-+ "addiu %[" #TEMP1 "], %[" #TEMP1 "], 1812 \n\t" \
-+ "sra %[" #TEMP3 "], %[" #TEMP3 "], 9 \n\t" \
-+ "sra %[" #TEMP1 "], %[" #TEMP1 "], 9 \n\t"
-
- // macro for one vertical pass in FTransform
- // temp0..temp15 holds tmp[0]..tmp[15]
- // A..D - offsets in bytes to store to out buffer
- // TEMP0, TEMP4, TEMP8 and TEMP12 - registers for corresponding tmp elements
- #define VERTICAL_PASS(A, B, C, D, TEMP0, TEMP4, TEMP8, TEMP12) \
-- "addu %[temp16], %["#TEMP0"], %["#TEMP12"] \n\t" \
-- "subu %[temp19], %["#TEMP0"], %["#TEMP12"] \n\t" \
-- "addu %[temp17], %["#TEMP4"], %["#TEMP8"] \n\t" \
-- "subu %[temp18], %["#TEMP4"], %["#TEMP8"] \n\t" \
-- "mul %["#TEMP8"], %[temp19], %[c2217] \n\t" \
-- "mul %["#TEMP12"], %[temp18], %[c2217] \n\t" \
-- "mul %["#TEMP4"], %[temp19], %[c5352] \n\t" \
-- "mul %[temp18], %[temp18], %[c5352] \n\t" \
-- "addiu %[temp16], %[temp16], 7 \n\t" \
-- "addu %["#TEMP0"], %[temp16], %[temp17] \n\t" \
-- "sra %["#TEMP0"], %["#TEMP0"], 4 \n\t" \
-- "addu %["#TEMP12"], %["#TEMP12"], %["#TEMP4"] \n\t" \
-- "subu %["#TEMP4"], %[temp16], %[temp17] \n\t" \
-- "sra %["#TEMP4"], %["#TEMP4"], 4 \n\t" \
-- "addiu %["#TEMP8"], %["#TEMP8"], 30000 \n\t" \
-- "addiu %["#TEMP12"], %["#TEMP12"], 12000 \n\t" \
-- "addiu %["#TEMP8"], %["#TEMP8"], 21000 \n\t" \
-- "subu %["#TEMP8"], %["#TEMP8"], %[temp18] \n\t" \
-- "sra %["#TEMP12"], %["#TEMP12"], 16 \n\t" \
-- "sra %["#TEMP8"], %["#TEMP8"], 16 \n\t" \
-- "addiu %[temp16], %["#TEMP12"], 1 \n\t" \
-- "movn %["#TEMP12"], %[temp16], %[temp19] \n\t" \
-- "sh %["#TEMP0"], "#A"(%[temp20]) \n\t" \
-- "sh %["#TEMP4"], "#C"(%[temp20]) \n\t" \
-- "sh %["#TEMP8"], "#D"(%[temp20]) \n\t" \
-- "sh %["#TEMP12"], "#B"(%[temp20]) \n\t"
-+ "addu %[temp16], %[" #TEMP0 "], %[" #TEMP12 "] \n\t" \
-+ "subu %[temp19], %[" #TEMP0 "], %[" #TEMP12 "] \n\t" \
-+ "addu %[temp17], %[" #TEMP4 "], %[" #TEMP8 "] \n\t" \
-+ "subu %[temp18], %[" #TEMP4 "], %[" #TEMP8 "] \n\t" \
-+ "mul %[" #TEMP8 "], %[temp19], %[c2217] \n\t" \
-+ "mul %[" #TEMP12 "], %[temp18], %[c2217] \n\t" \
-+ "mul %[" #TEMP4 "], %[temp19], %[c5352] \n\t" \
-+ "mul %[temp18], %[temp18], %[c5352] \n\t" \
-+ "addiu %[temp16], %[temp16], 7 \n\t" \
-+ "addu %[" #TEMP0 "], %[temp16], %[temp17] \n\t" \
-+ "sra %[" #TEMP0 "], %[" #TEMP0 "], 4 \n\t" \
-+ "addu %[" #TEMP12 "], %[" #TEMP12 "], %[" #TEMP4 "] \n\t" \
-+ "subu %[" #TEMP4 "], %[temp16], %[temp17] \n\t" \
-+ "sra %[" #TEMP4 "], %[" #TEMP4 "], 4 \n\t" \
-+ "addiu %[" #TEMP8 "], %[" #TEMP8 "], 30000 \n\t" \
-+ "addiu %[" #TEMP12 "], %[" #TEMP12 "], 12000 \n\t" \
-+ "addiu %[" #TEMP8 "], %[" #TEMP8 "], 21000 \n\t" \
-+ "subu %[" #TEMP8 "], %[" #TEMP8 "], %[temp18] \n\t" \
-+ "sra %[" #TEMP12 "], %[" #TEMP12 "], 16 \n\t" \
-+ "sra %[" #TEMP8 "], %[" #TEMP8 "], 16 \n\t" \
-+ "addiu %[temp16], %[" #TEMP12 "], 1 \n\t" \
-+ "movn %[" #TEMP12 "], %[temp16], %[temp19] \n\t" \
-+ "sh %[" #TEMP0 "], " #A "(%[temp20]) \n\t" \
-+ "sh %[" #TEMP4 "], " #C "(%[temp20]) \n\t" \
-+ "sh %[" #TEMP8 "], " #D "(%[temp20]) \n\t" \
-+ "sh %[" #TEMP12 "], " #B "(%[temp20]) \n\t"
-
- static void FTransform(const uint8_t* src, const uint8_t* ref, int16_t* out) {
- const int c2217 = 2217;
-@@ -329,11 +329,11 @@
- // Intra predictions
-
- #define FILL_PART(J, SIZE) \
-- "usw %[value], 0+"#J"*"XSTR(BPS)"(%[dst]) \n\t" \
-- "usw %[value], 4+"#J"*"XSTR(BPS)"(%[dst]) \n\t" \
-- ".if "#SIZE" == 16 \n\t" \
-- "usw %[value], 8+"#J"*"XSTR(BPS)"(%[dst]) \n\t" \
-- "usw %[value], 12+"#J"*"XSTR(BPS)"(%[dst]) \n\t" \
-+ "usw %[value], 0+" #J "*"XSTR(BPS)"(%[dst]) \n\t" \
-+ "usw %[value], 4+" #J "*"XSTR(BPS)"(%[dst]) \n\t" \
-+ ".if " #SIZE " == 16 \n\t" \
-+ "usw %[value], 8+" #J "*"XSTR(BPS)"(%[dst]) \n\t" \
-+ "usw %[value], 12+" #J "*"XSTR(BPS)"(%[dst]) \n\t" \
- ".endif \n\t"
-
- #define FILL_8_OR_16(DST, VALUE, SIZE) do { \
-@@ -348,7 +348,7 @@
- FILL_PART( 5, SIZE) \
- FILL_PART( 6, SIZE) \
- FILL_PART( 7, SIZE) \
-- ".if "#SIZE" == 16 \n\t" \
-+ ".if " #SIZE " == 16 \n\t" \
- FILL_PART( 8, 16) \
- FILL_PART( 9, 16) \
- FILL_PART(10, 16) \
-@@ -425,7 +425,7 @@
- CLIPPING() \
- "usw %[temp0], 0(%[dst]) \n\t" \
- "usw %[temp1], 4(%[dst]) \n\t" \
-- ".if "#SIZE" == 16 \n\t" \
-+ ".if " #SIZE " == 16 \n\t" \
- "ulw %[temp0], 8(%[top]) \n\t" \
- "ulw %[temp1], 12(%[top]) \n\t" \
- CLIPPING() \
-@@ -1060,8 +1060,8 @@
- #if !defined(WORK_AROUND_GCC)
-
- #define GET_SSE_INNER(A) \
-- "lw %[temp0], "#A"(%[a]) \n\t" \
-- "lw %[temp1], "#A"(%[b]) \n\t" \
-+ "lw %[temp0], " #A "(%[a]) \n\t" \
-+ "lw %[temp1], " #A "(%[b]) \n\t" \
- "preceu.ph.qbr %[temp2], %[temp0] \n\t" \
- "preceu.ph.qbl %[temp0], %[temp0] \n\t" \
- "preceu.ph.qbr %[temp3], %[temp1] \n\t" \
-@@ -1185,28 +1185,28 @@
- // N - offset in bytes (n * 2)
- // N1 - offset in bytes ((n + 1) * 2)
- #define QUANTIZE_ONE(J, K, N, N1) \
-- "ulw %[temp1], "#J"(%[ppin]) \n\t" \
-- "ulw %[temp2], "#J"(%[ppsharpen]) \n\t" \
-- "lhu %[temp3], "#K"(%[ppzthresh]) \n\t" \
-- "lhu %[temp6], "#K"+4(%[ppzthresh]) \n\t" \
-+ "ulw %[temp1], " #J "(%[ppin]) \n\t" \
-+ "ulw %[temp2], " #J "(%[ppsharpen]) \n\t" \
-+ "lhu %[temp3], " #K "(%[ppzthresh]) \n\t" \
-+ "lhu %[temp6], " #K "+4(%[ppzthresh]) \n\t" \
- "absq_s.ph %[temp4], %[temp1] \n\t" \
- "ins %[temp3], %[temp6], 16, 16 \n\t" \
- "addu.ph %[coeff], %[temp4], %[temp2] \n\t" \
- "shra.ph %[sign], %[temp1], 15 \n\t" \
- "li %[level], 0x10001 \n\t" \
- "cmp.lt.ph %[temp3], %[coeff] \n\t" \
-- "lhu %[temp1], "#J"(%[ppiq]) \n\t" \
-+ "lhu %[temp1], " #J "(%[ppiq]) \n\t" \
- "pick.ph %[temp5], %[level], $0 \n\t" \
-- "lw %[temp2], "#K"(%[ppbias]) \n\t" \
-+ "lw %[temp2], " #K "(%[ppbias]) \n\t" \
- "beqz %[temp5], 0f \n\t" \
-- "lhu %[temp3], "#J"(%[ppq]) \n\t" \
-+ "lhu %[temp3], " #J "(%[ppq]) \n\t" \
- "beq %[temp5], %[level], 1f \n\t" \
- "andi %[temp5], %[temp5], 0x1 \n\t" \
- "andi %[temp4], %[coeff], 0xffff \n\t" \
- "beqz %[temp5], 2f \n\t" \
- "mul %[level], %[temp4], %[temp1] \n\t" \
-- "sh $0, "#J"+2(%[ppin]) \n\t" \
-- "sh $0, "#N1"(%[pout]) \n\t" \
-+ "sh $0, " #J "+2(%[ppin]) \n\t" \
-+ "sh $0, " #N1 "(%[pout]) \n\t" \
- "addu %[level], %[level], %[temp2] \n\t" \
- "sra %[level], %[level], 17 \n\t" \
- "slt %[temp4], %[max_level], %[level] \n\t" \
-@@ -1216,15 +1216,15 @@
- "subu %[level], %[level], %[temp6] \n\t" \
- "mul %[temp5], %[level], %[temp3] \n\t" \
- "or %[ret], %[ret], %[level] \n\t" \
-- "sh %[level], "#N"(%[pout]) \n\t" \
-- "sh %[temp5], "#J"(%[ppin]) \n\t" \
-+ "sh %[level], " #N "(%[pout]) \n\t" \
-+ "sh %[temp5], " #J "(%[ppin]) \n\t" \
- "j 3f \n\t" \
- "2: \n\t" \
-- "lhu %[temp1], "#J"+2(%[ppiq]) \n\t" \
-+ "lhu %[temp1], " #J "+2(%[ppiq]) \n\t" \
- "srl %[temp5], %[coeff], 16 \n\t" \
- "mul %[level], %[temp5], %[temp1] \n\t" \
-- "lw %[temp2], "#K"+4(%[ppbias]) \n\t" \
-- "lhu %[temp3], "#J"+2(%[ppq]) \n\t" \
-+ "lw %[temp2], " #K "+4(%[ppbias]) \n\t" \
-+ "lhu %[temp3], " #J "+2(%[ppq]) \n\t" \
- "addu %[level], %[level], %[temp2] \n\t" \
- "sra %[level], %[level], 17 \n\t" \
- "srl %[temp6], %[sign], 16 \n\t" \
-@@ -1233,20 +1233,20 @@
- "xor %[level], %[level], %[temp6] \n\t" \
- "subu %[level], %[level], %[temp6] \n\t" \
- "mul %[temp5], %[level], %[temp3] \n\t" \
-- "sh $0, "#J"(%[ppin]) \n\t" \
-- "sh $0, "#N"(%[pout]) \n\t" \
-+ "sh $0, " #J "(%[ppin]) \n\t" \
-+ "sh $0, " #N "(%[pout]) \n\t" \
- "or %[ret], %[ret], %[level] \n\t" \
-- "sh %[temp5], "#J"+2(%[ppin]) \n\t" \
-- "sh %[level], "#N1"(%[pout]) \n\t" \
-+ "sh %[temp5], " #J "+2(%[ppin]) \n\t" \
-+ "sh %[level], " #N1 "(%[pout]) \n\t" \
- "j 3f \n\t" \
- "1: \n\t" \
-- "lhu %[temp1], "#J"(%[ppiq]) \n\t" \
-- "lw %[temp2], "#K"(%[ppbias]) \n\t" \
-- "ulw %[temp3], "#J"(%[ppq]) \n\t" \
-+ "lhu %[temp1], " #J "(%[ppiq]) \n\t" \
-+ "lw %[temp2], " #K "(%[ppbias]) \n\t" \
-+ "ulw %[temp3], " #J "(%[ppq]) \n\t" \
- "andi %[temp5], %[coeff], 0xffff \n\t" \
- "srl %[temp0], %[coeff], 16 \n\t" \
-- "lhu %[temp6], "#J"+2(%[ppiq]) \n\t" \
-- "lw %[coeff], "#K"+4(%[ppbias]) \n\t" \
-+ "lhu %[temp6], " #J "+2(%[ppiq]) \n\t" \
-+ "lw %[coeff], " #K "+4(%[ppbias]) \n\t" \
- "mul %[level], %[temp5], %[temp1] \n\t" \
- "mul %[temp4], %[temp0], %[temp6] \n\t" \
- "addu %[level], %[level], %[temp2] \n\t" \
-@@ -1259,15 +1259,15 @@
- "subu.ph %[level], %[level], %[sign] \n\t" \
- "mul.ph %[temp3], %[level], %[temp3] \n\t" \
- "or %[ret], %[ret], %[level] \n\t" \
-- "sh %[level], "#N"(%[pout]) \n\t" \
-+ "sh %[level], " #N "(%[pout]) \n\t" \
- "srl %[level], %[level], 16 \n\t" \
-- "sh %[level], "#N1"(%[pout]) \n\t" \
-- "usw %[temp3], "#J"(%[ppin]) \n\t" \
-+ "sh %[level], " #N1 "(%[pout]) \n\t" \
-+ "usw %[temp3], " #J "(%[ppin]) \n\t" \
- "j 3f \n\t" \
- "0: \n\t" \
-- "sh $0, "#N"(%[pout]) \n\t" \
-- "sh $0, "#N1"(%[pout]) \n\t" \
-- "usw $0, "#J"(%[ppin]) \n\t" \
-+ "sh $0, " #N "(%[pout]) \n\t" \
-+ "sh $0, " #N1 "(%[pout]) \n\t" \
-+ "usw $0, " #J "(%[ppin]) \n\t" \
- "3: \n\t"
-
- static int QuantizeBlock(int16_t in[16], int16_t out[16],
-@@ -1326,37 +1326,37 @@
- // A, B, C, D - offset in bytes to load from in buffer
- // TEMP0, TEMP1 - registers for corresponding tmp elements
- #define HORIZONTAL_PASS_WHT(A, B, C, D, TEMP0, TEMP1) \
-- "lh %["#TEMP0"], "#A"(%[in]) \n\t" \
-- "lh %["#TEMP1"], "#B"(%[in]) \n\t" \
-- "lh %[temp8], "#C"(%[in]) \n\t" \
-- "lh %[temp9], "#D"(%[in]) \n\t" \
-- "ins %["#TEMP1"], %["#TEMP0"], 16, 16 \n\t" \
-+ "lh %[" #TEMP0 "], " #A "(%[in]) \n\t" \
-+ "lh %[" #TEMP1 "], " #B "(%[in]) \n\t" \
-+ "lh %[temp8], " #C "(%[in]) \n\t" \
-+ "lh %[temp9], " #D "(%[in]) \n\t" \
-+ "ins %[" #TEMP1 "], %[" #TEMP0 "], 16, 16 \n\t" \
- "ins %[temp9], %[temp8], 16, 16 \n\t" \
-- "subq.ph %[temp8], %["#TEMP1"], %[temp9] \n\t" \
-- "addq.ph %[temp9], %["#TEMP1"], %[temp9] \n\t" \
-- "precrq.ph.w %["#TEMP0"], %[temp8], %[temp9] \n\t" \
-+ "subq.ph %[temp8], %[" #TEMP1 "], %[temp9] \n\t" \
-+ "addq.ph %[temp9], %[" #TEMP1 "], %[temp9] \n\t" \
-+ "precrq.ph.w %[" #TEMP0 "], %[temp8], %[temp9] \n\t" \
- "append %[temp8], %[temp9], 16 \n\t" \
-- "subq.ph %["#TEMP1"], %["#TEMP0"], %[temp8] \n\t" \
-- "addq.ph %["#TEMP0"], %["#TEMP0"], %[temp8] \n\t" \
-- "rotr %["#TEMP1"], %["#TEMP1"], 16 \n\t"
-+ "subq.ph %[" #TEMP1 "], %[" #TEMP0 "], %[temp8] \n\t" \
-+ "addq.ph %[" #TEMP0 "], %[" #TEMP0 "], %[temp8] \n\t" \
-+ "rotr %[" #TEMP1 "], %[" #TEMP1 "], 16 \n\t"
-
- // macro for one vertical pass in FTransformWHT
- // temp0..temp7 holds tmp[0]..tmp[15]
- // A, B, C, D - offsets in bytes to store to out buffer
- // TEMP0, TEMP2, TEMP4 and TEMP6 - registers for corresponding tmp elements
- #define VERTICAL_PASS_WHT(A, B, C, D, TEMP0, TEMP2, TEMP4, TEMP6) \
-- "addq.ph %[temp8], %["#TEMP0"], %["#TEMP4"] \n\t" \
-- "addq.ph %[temp9], %["#TEMP2"], %["#TEMP6"] \n\t" \
-- "subq.ph %["#TEMP2"], %["#TEMP2"], %["#TEMP6"] \n\t" \
-- "subq.ph %["#TEMP6"], %["#TEMP0"], %["#TEMP4"] \n\t" \
-- "addqh.ph %["#TEMP0"], %[temp8], %[temp9] \n\t" \
-- "subqh.ph %["#TEMP4"], %["#TEMP6"], %["#TEMP2"] \n\t" \
-- "addqh.ph %["#TEMP2"], %["#TEMP2"], %["#TEMP6"] \n\t" \
-- "subqh.ph %["#TEMP6"], %[temp8], %[temp9] \n\t" \
-- "usw %["#TEMP0"], "#A"(%[out]) \n\t" \
-- "usw %["#TEMP2"], "#B"(%[out]) \n\t" \
-- "usw %["#TEMP4"], "#C"(%[out]) \n\t" \
-- "usw %["#TEMP6"], "#D"(%[out]) \n\t"
-+ "addq.ph %[temp8], %[" #TEMP0 "], %[" #TEMP4 "] \n\t" \
-+ "addq.ph %[temp9], %[" #TEMP2 "], %[" #TEMP6 "] \n\t" \
-+ "subq.ph %[" #TEMP2 "], %[" #TEMP2 "], %[" #TEMP6 "] \n\t" \
-+ "subq.ph %[" #TEMP6 "], %[" #TEMP0 "], %[" #TEMP4 "] \n\t" \
-+ "addqh.ph %[" #TEMP0 "], %[temp8], %[temp9] \n\t" \
-+ "subqh.ph %[" #TEMP4 "], %[" #TEMP6 "], %[" #TEMP2 "] \n\t" \
-+ "addqh.ph %[" #TEMP2 "], %[" #TEMP2 "], %[" #TEMP6 "] \n\t" \
-+ "subqh.ph %[" #TEMP6 "], %[temp8], %[temp9] \n\t" \
-+ "usw %[" #TEMP0 "], " #A "(%[out]) \n\t" \
-+ "usw %[" #TEMP2 "], " #B "(%[out]) \n\t" \
-+ "usw %[" #TEMP4 "], " #C "(%[out]) \n\t" \
-+ "usw %[" #TEMP6 "], " #D "(%[out]) \n\t"
-
- static void FTransformWHT(const int16_t* in, int16_t* out) {
- int temp0, temp1, temp2, temp3, temp4;
-@@ -1385,10 +1385,10 @@
- // convert 8 coeffs at time
- // A, B, C, D - offsets in bytes to load from out buffer
- #define CONVERT_COEFFS_TO_BIN(A, B, C, D) \
-- "ulw %[temp0], "#A"(%[out]) \n\t" \
-- "ulw %[temp1], "#B"(%[out]) \n\t" \
-- "ulw %[temp2], "#C"(%[out]) \n\t" \
-- "ulw %[temp3], "#D"(%[out]) \n\t" \
-+ "ulw %[temp0], " #A "(%[out]) \n\t" \
-+ "ulw %[temp1], " #B "(%[out]) \n\t" \
-+ "ulw %[temp2], " #C "(%[out]) \n\t" \
-+ "ulw %[temp3], " #D "(%[out]) \n\t" \
- "absq_s.ph %[temp0], %[temp0] \n\t" \
- "absq_s.ph %[temp1], %[temp1] \n\t" \
- "absq_s.ph %[temp2], %[temp2] \n\t" \
-diff --git a/Source/LibWebP/src/dsp/dsp.filters_mips_dsp_r2.c b/Source/LibWebP/src/dsp/dsp.filters_mips_dsp_r2.c
-index 66f807d..8134af5 100644
---- a/Source/LibWebP/src/dsp/dsp.filters_mips_dsp_r2.c
-+++ b/Source/LibWebP/src/dsp/dsp.filters_mips_dsp_r2.c
-@@ -48,7 +48,7 @@
- "srl %[temp0], %[length], 0x2 \n\t" \
- "beqz %[temp0], 4f \n\t" \
- " andi %[temp6], %[length], 0x3 \n\t" \
-- ".if "#INVERSE" \n\t" \
-+ ".if " #INVERSE " \n\t" \
- "lbu %[temp1], -1(%[src]) \n\t" \
- "1: \n\t" \
- "lbu %[temp2], 0(%[src]) \n\t" \
-@@ -84,7 +84,7 @@
- "lbu %[temp1], -1(%[src]) \n\t" \
- "lbu %[temp2], 0(%[src]) \n\t" \
- "addiu %[src], %[src], 1 \n\t" \
-- ".if "#INVERSE" \n\t" \
-+ ".if " #INVERSE " \n\t" \
- "addu %[temp3], %[temp1], %[temp2] \n\t" \
- "sb %[temp3], -1(%[src]) \n\t" \
- ".else \n\t" \
-@@ -131,7 +131,7 @@
- "ulw %[temp3], 4(%[src]) \n\t" \
- "ulw %[temp4], 4(%[pred]) \n\t" \
- "addiu %[src], %[src], 8 \n\t" \
-- ".if "#INVERSE" \n\t" \
-+ ".if " #INVERSE " \n\t" \
- "addu.qb %[temp5], %[temp1], %[temp2] \n\t" \
- "addu.qb %[temp6], %[temp3], %[temp4] \n\t" \
- ".else \n\t" \
-@@ -152,7 +152,7 @@
- "lbu %[temp2], 0(%[pred]) \n\t" \
- "addiu %[src], %[src], 1 \n\t" \
- "addiu %[pred], %[pred], 1 \n\t" \
-- ".if "#INVERSE" \n\t" \
-+ ".if " #INVERSE " \n\t" \
- "addu %[temp3], %[temp1], %[temp2] \n\t" \
- ".else \n\t" \
- "subu %[temp3], %[temp1], %[temp2] \n\t" \
-@@ -177,7 +177,7 @@
- __asm__ volatile ( \
- "lbu %[temp1], 0(%[src]) \n\t" \
- "lbu %[temp2], 0(%[pred]) \n\t" \
-- ".if "#INVERSE" \n\t" \
-+ ".if " #INVERSE " \n\t" \
- "addu %[temp3], %[temp1], %[temp2] \n\t" \
- ".else \n\t" \
- "subu %[temp3], %[temp1], %[temp2] \n\t" \
-diff --git a/Source/LibWebP/src/dsp/dsp.lossless_mips32.c b/Source/LibWebP/src/dsp/dsp.lossless_mips32.c
-index 8ae5958..cdf0e26 100644
---- a/Source/LibWebP/src/dsp/dsp.lossless_mips32.c
-+++ b/Source/LibWebP/src/dsp/dsp.lossless_mips32.c
-
-@@ -278,28 +278,28 @@
- // literal_ and successive histograms could be unaligned
- // so we must use ulw and usw
- #define ADD_TO_OUT(A, B, C, D, E, P0, P1, P2) \
-- "ulw %[temp0], "#A"(%["#P0"]) \n\t" \
-- "ulw %[temp1], "#B"(%["#P0"]) \n\t" \
-- "ulw %[temp2], "#C"(%["#P0"]) \n\t" \
-- "ulw %[temp3], "#D"(%["#P0"]) \n\t" \
-- "ulw %[temp4], "#A"(%["#P1"]) \n\t" \
-- "ulw %[temp5], "#B"(%["#P1"]) \n\t" \
-- "ulw %[temp6], "#C"(%["#P1"]) \n\t" \
-- "ulw %[temp7], "#D"(%["#P1"]) \n\t" \
-+ "ulw %[temp0], " #A "(%[" #P0 "]) \n\t" \
-+ "ulw %[temp1], " #B "(%[" #P0 "]) \n\t" \
-+ "ulw %[temp2], " #C "(%[" #P0 "]) \n\t" \
-+ "ulw %[temp3], " #D "(%[" #P0 "]) \n\t" \
-+ "ulw %[temp4], " #A "(%[" #P1 "]) \n\t" \
-+ "ulw %[temp5], " #B "(%[" #P1 "]) \n\t" \
-+ "ulw %[temp6], " #C "(%[" #P1 "]) \n\t" \
-+ "ulw %[temp7], " #D "(%[" #P1 "]) \n\t" \
- "addu %[temp4], %[temp4], %[temp0] \n\t" \
- "addu %[temp5], %[temp5], %[temp1] \n\t" \
- "addu %[temp6], %[temp6], %[temp2] \n\t" \
- "addu %[temp7], %[temp7], %[temp3] \n\t" \
-- "addiu %["#P0"], %["#P0"], 16 \n\t" \
-- ".if "#E" == 1 \n\t" \
-- "addiu %["#P1"], %["#P1"], 16 \n\t" \
-+ "addiu %[" #P0 "], %[" #P0 "], 16 \n\t" \
-+ ".if " #E " == 1 \n\t" \
-+ "addiu %[" #P1 "], %[" #P1 "], 16 \n\t" \
- ".endif \n\t" \
-- "usw %[temp4], "#A"(%["#P2"]) \n\t" \
-- "usw %[temp5], "#B"(%["#P2"]) \n\t" \
-- "usw %[temp6], "#C"(%["#P2"]) \n\t" \
-- "usw %[temp7], "#D"(%["#P2"]) \n\t" \
-- "addiu %["#P2"], %["#P2"], 16 \n\t" \
-- "bne %["#P0"], %[LoopEnd], 1b \n\t" \
-+ "usw %[temp4], " #A "(%[" #P2 "]) \n\t" \
-+ "usw %[temp5], " #B "(%[" #P2 "]) \n\t" \
-+ "usw %[temp6], " #C "(%[" #P2 "]) \n\t" \
-+ "usw %[temp7], " #D "(%[" #P2 "]) \n\t" \
-+ "addiu %[" #P2 "], %[" #P2 "], 16 \n\t" \
-+ "bne %[" #P0 "], %[LoopEnd], 1b \n\t" \
- ".set pop \n\t" \
-
- #define ASM_END_COMMON_0 \
-diff --git a/Source/LibWebP/src/dsp/dsp.lossless_mips_dsp_r2.c b/Source/LibWebP/src/dsp/dsp.lossless_mips_dsp_r2.c
-index ad55f2c..90aed7f 100644
---- a/Source/LibWebP/src/dsp/dsp.lossless_mips_dsp_r2.c
-+++ b/Source/LibWebP/src/dsp/dsp.lossless_mips_dsp_r2.c
-@@ -29,14 +29,14 @@
- for (x = 0; x < (width >> 2); ++x) { \
- int tmp1, tmp2, tmp3, tmp4; \
- __asm__ volatile ( \
-- ".ifc "#TYPE", uint8_t \n\t" \
-+ ".ifc " #TYPE ", uint8_t \n\t" \
- "lbu %[tmp1], 0(%[src]) \n\t" \
- "lbu %[tmp2], 1(%[src]) \n\t" \
- "lbu %[tmp3], 2(%[src]) \n\t" \
- "lbu %[tmp4], 3(%[src]) \n\t" \
- "addiu %[src], %[src], 4 \n\t" \
- ".endif \n\t" \
-- ".ifc "#TYPE", uint32_t \n\t" \
-+ ".ifc " #TYPE ", uint32_t \n\t" \
- "lw %[tmp1], 0(%[src]) \n\t" \
- "lw %[tmp2], 4(%[src]) \n\t" \
- "lw %[tmp3], 8(%[src]) \n\t" \
-@@ -55,7 +55,7 @@
- "lwx %[tmp2], %[tmp2](%[color_map]) \n\t" \
- "lwx %[tmp3], %[tmp3](%[color_map]) \n\t" \
- "lwx %[tmp4], %[tmp4](%[color_map]) \n\t" \
-- ".ifc "#TYPE", uint8_t \n\t" \
-+ ".ifc " #TYPE ", uint8_t \n\t" \
- "ext %[tmp1], %[tmp1], 8, 8 \n\t" \
- "ext %[tmp2], %[tmp2], 8, 8 \n\t" \
- "ext %[tmp3], %[tmp3], 8, 8 \n\t" \
-@@ -66,7 +66,7 @@
- "sb %[tmp4], 3(%[dst]) \n\t" \
- "addiu %[dst], %[dst], 4 \n\t" \
- ".endif \n\t" \
-- ".ifc "#TYPE", uint32_t \n\t" \
-+ ".ifc " #TYPE ", uint32_t \n\t" \
- "sw %[tmp1], 0(%[dst]) \n\t" \
- "sw %[tmp2], 4(%[dst]) \n\t" \
- "sw %[tmp3], 8(%[dst]) \n\t" \
-diff --git a/Source/LibWebP/src/dsp/mips_macro.h b/Source/LibWebP/src/dsp/mips_macro.h
-index 4cfb23c..e09d2c4 100644
---- a/Source/LibWebP/src/dsp/mips_macro.h
-+++ b/Source/LibWebP/src/dsp/mips_macro.h
-@@ -25,25 +25,25 @@
- // I - input (macro doesn't change it)
- #define ADD_SUB_HALVES(O0, O1, \
- I0, I1) \
-- "addq.ph %["#O0"], %["#I0"], %["#I1"] \n\t" \
-- "subq.ph %["#O1"], %["#I0"], %["#I1"] \n\t"
-+ "addq.ph %[" #O0 "], %[" #I0 "], %[" #I1 "] \n\t" \
-+ "subq.ph %[" #O1 "], %[" #I0 "], %[" #I1 "] \n\t"
-
- // O - output
- // I - input (macro doesn't change it)
- // I[0/1] - offset in bytes
- #define LOAD_IN_X2(O0, O1, \
- I0, I1) \
-- "lh %["#O0"], "#I0"(%[in]) \n\t" \
-- "lh %["#O1"], "#I1"(%[in]) \n\t"
-+ "lh %[" #O0 "], " #I0 "(%[in]) \n\t" \
-+ "lh %[" #O1 "], " #I1 "(%[in]) \n\t"
-
- // I0 - location
- // I1..I9 - offsets in bytes
- #define LOAD_WITH_OFFSET_X4(O0, O1, O2, O3, \
- I0, I1, I2, I3, I4, I5, I6, I7, I8, I9) \
-- "ulw %["#O0"], "#I1"+"XSTR(I9)"*"#I5"(%["#I0"]) \n\t" \
-- "ulw %["#O1"], "#I2"+"XSTR(I9)"*"#I6"(%["#I0"]) \n\t" \
-- "ulw %["#O2"], "#I3"+"XSTR(I9)"*"#I7"(%["#I0"]) \n\t" \
-- "ulw %["#O3"], "#I4"+"XSTR(I9)"*"#I8"(%["#I0"]) \n\t"
-+ "ulw %[" #O0 "], " #I1 "+"XSTR(I9)"*" #I5 "(%[" #I0 "]) \n\t" \
-+ "ulw %[" #O1 "], " #I2 "+"XSTR(I9)"*" #I6 "(%[" #I0 "]) \n\t" \
-+ "ulw %[" #O2 "], " #I3 "+"XSTR(I9)"*" #I7 "(%[" #I0 "]) \n\t" \
-+ "ulw %[" #O3 "], " #I4 "+"XSTR(I9)"*" #I8 "(%[" #I0 "]) \n\t"
-
- // O - output
- // IO - input/output
-@@ -51,42 +51,42 @@
- #define MUL_SHIFT_SUM(O0, O1, O2, O3, O4, O5, O6, O7, \
- IO0, IO1, IO2, IO3, \
- I0, I1, I2, I3, I4, I5, I6, I7) \
-- "mul %["#O0"], %["#I0"], %[kC2] \n\t" \
-- "mul %["#O1"], %["#I0"], %[kC1] \n\t" \
-- "mul %["#O2"], %["#I1"], %[kC2] \n\t" \
-- "mul %["#O3"], %["#I1"], %[kC1] \n\t" \
-- "mul %["#O4"], %["#I2"], %[kC2] \n\t" \
-- "mul %["#O5"], %["#I2"], %[kC1] \n\t" \
-- "mul %["#O6"], %["#I3"], %[kC2] \n\t" \
-- "mul %["#O7"], %["#I3"], %[kC1] \n\t" \
-- "sra %["#O0"], %["#O0"], 16 \n\t" \
-- "sra %["#O1"], %["#O1"], 16 \n\t" \
-- "sra %["#O2"], %["#O2"], 16 \n\t" \
-- "sra %["#O3"], %["#O3"], 16 \n\t" \
-- "sra %["#O4"], %["#O4"], 16 \n\t" \
-- "sra %["#O5"], %["#O5"], 16 \n\t" \
-- "sra %["#O6"], %["#O6"], 16 \n\t" \
-- "sra %["#O7"], %["#O7"], 16 \n\t" \
-- "addu %["#IO0"], %["#IO0"], %["#I4"] \n\t" \
-- "addu %["#IO1"], %["#IO1"], %["#I5"] \n\t" \
-- "subu %["#IO2"], %["#IO2"], %["#I6"] \n\t" \
-- "subu %["#IO3"], %["#IO3"], %["#I7"] \n\t"
-+ "mul %[" #O0 "], %[" #I0 "], %[kC2] \n\t" \
-+ "mul %[" #O1 "], %[" #I0 "], %[kC1] \n\t" \
-+ "mul %[" #O2 "], %[" #I1 "], %[kC2] \n\t" \
-+ "mul %[" #O3 "], %[" #I1 "], %[kC1] \n\t" \
-+ "mul %[" #O4 "], %[" #I2 "], %[kC2] \n\t" \
-+ "mul %[" #O5 "], %[" #I2 "], %[kC1] \n\t" \
-+ "mul %[" #O6 "], %[" #I3 "], %[kC2] \n\t" \
-+ "mul %[" #O7 "], %[" #I3 "], %[kC1] \n\t" \
-+ "sra %[" #O0 "], %[" #O0 "], 16 \n\t" \
-+ "sra %[" #O1 "], %[" #O1 "], 16 \n\t" \
-+ "sra %[" #O2 "], %[" #O2 "], 16 \n\t" \
-+ "sra %[" #O3 "], %[" #O3 "], 16 \n\t" \
-+ "sra %[" #O4 "], %[" #O4 "], 16 \n\t" \
-+ "sra %[" #O5 "], %[" #O5 "], 16 \n\t" \
-+ "sra %[" #O6 "], %[" #O6 "], 16 \n\t" \
-+ "sra %[" #O7 "], %[" #O7 "], 16 \n\t" \
-+ "addu %[" #IO0 "], %[" #IO0 "], %[" #I4 "] \n\t" \
-+ "addu %[" #IO1 "], %[" #IO1 "], %[" #I5 "] \n\t" \
-+ "subu %[" #IO2 "], %[" #IO2 "], %[" #I6 "] \n\t" \
-+ "subu %[" #IO3 "], %[" #IO3 "], %[" #I7 "] \n\t"
-
- // O - output
- // I - input (macro doesn't change it)
- #define INSERT_HALF_X2(O0, O1, \
- I0, I1) \
-- "ins %["#O0"], %["#I0"], 16, 16 \n\t" \
-- "ins %["#O1"], %["#I1"], 16, 16 \n\t"
-+ "ins %[" #O0 "], %[" #I0 "], 16, 16 \n\t" \
-+ "ins %[" #O1 "], %[" #I1 "], 16, 16 \n\t"
-
- // O - output
- // I - input (macro doesn't change it)
- #define SRA_16(O0, O1, O2, O3, \
- I0, I1, I2, I3) \
-- "sra %["#O0"], %["#I0"], 16 \n\t" \
-- "sra %["#O1"], %["#I1"], 16 \n\t" \
-- "sra %["#O2"], %["#I2"], 16 \n\t" \
-- "sra %["#O3"], %["#I3"], 16 \n\t"
-+ "sra %[" #O0 "], %[" #I0 "], 16 \n\t" \
-+ "sra %[" #O1 "], %[" #I1 "], 16 \n\t" \
-+ "sra %[" #O2 "], %[" #I2 "], 16 \n\t" \
-+ "sra %[" #O3 "], %[" #I3 "], 16 \n\t"
-
- // temp0[31..16 | 15..0] = temp8[31..16 | 15..0] + temp12[31..16 | 15..0]
- // temp1[31..16 | 15..0] = temp8[31..16 | 15..0] - temp12[31..16 | 15..0]
-@@ -96,22 +96,22 @@
- // I - input (macro doesn't change it)
- #define SHIFT_R_SUM_X2(O0, O1, O2, O3, O4, O5, O6, O7, \
- I0, I1, I2, I3, I4, I5, I6, I7) \
-- "addq.ph %["#O0"], %["#I0"], %["#I4"] \n\t" \
-- "subq.ph %["#O1"], %["#I0"], %["#I4"] \n\t" \
-- "addq.ph %["#O2"], %["#I1"], %["#I5"] \n\t" \
-- "subq.ph %["#O3"], %["#I1"], %["#I5"] \n\t" \
-- "addq.ph %["#O4"], %["#I2"], %["#I6"] \n\t" \
-- "subq.ph %["#O5"], %["#I2"], %["#I6"] \n\t" \
-- "addq.ph %["#O6"], %["#I3"], %["#I7"] \n\t" \
-- "subq.ph %["#O7"], %["#I3"], %["#I7"] \n\t" \
-- "shra.ph %["#O0"], %["#O0"], 3 \n\t" \
-- "shra.ph %["#O1"], %["#O1"], 3 \n\t" \
-- "shra.ph %["#O2"], %["#O2"], 3 \n\t" \
-- "shra.ph %["#O3"], %["#O3"], 3 \n\t" \
-- "shra.ph %["#O4"], %["#O4"], 3 \n\t" \
-- "shra.ph %["#O5"], %["#O5"], 3 \n\t" \
-- "shra.ph %["#O6"], %["#O6"], 3 \n\t" \
-- "shra.ph %["#O7"], %["#O7"], 3 \n\t"
-+ "addq.ph %[" #O0 "], %[" #I0 "], %[" #I4 "] \n\t" \
-+ "subq.ph %[" #O1 "], %[" #I0 "], %[" #I4 "] \n\t" \
-+ "addq.ph %[" #O2 "], %[" #I1 "], %[" #I5 "] \n\t" \
-+ "subq.ph %[" #O3 "], %[" #I1 "], %[" #I5 "] \n\t" \
-+ "addq.ph %[" #O4 "], %[" #I2 "], %[" #I6 "] \n\t" \
-+ "subq.ph %[" #O5 "], %[" #I2 "], %[" #I6 "] \n\t" \
-+ "addq.ph %[" #O6 "], %[" #I3 "], %[" #I7 "] \n\t" \
-+ "subq.ph %[" #O7 "], %[" #I3 "], %[" #I7 "] \n\t" \
-+ "shra.ph %[" #O0 "], %[" #O0 "], 3 \n\t" \
-+ "shra.ph %[" #O1 "], %[" #O1 "], 3 \n\t" \
-+ "shra.ph %[" #O2 "], %[" #O2 "], 3 \n\t" \
-+ "shra.ph %[" #O3 "], %[" #O3 "], 3 \n\t" \
-+ "shra.ph %[" #O4 "], %[" #O4 "], 3 \n\t" \
-+ "shra.ph %[" #O5 "], %[" #O5 "], 3 \n\t" \
-+ "shra.ph %[" #O6 "], %[" #O6 "], 3 \n\t" \
-+ "shra.ph %[" #O7 "], %[" #O7 "], 3 \n\t"
-
- // precrq.ph.w temp0, temp8, temp2
- // temp0 = temp8[31..16] | temp2[31..16]
-@@ -123,14 +123,14 @@
- #define PACK_2_HALVES_TO_WORD(O0, O1, O2, O3, \
- IO0, IO1, IO2, IO3, \
- I0, I1, I2, I3) \
-- "precrq.ph.w %["#O0"], %["#I0"], %["#IO0"] \n\t" \
-- "precrq.ph.w %["#O1"], %["#I1"], %["#IO1"] \n\t" \
-- "ins %["#IO0"], %["#I0"], 16, 16 \n\t" \
-- "ins %["#IO1"], %["#I1"], 16, 16 \n\t" \
-- "precrq.ph.w %["#O2"], %["#I2"], %["#IO2"] \n\t" \
-- "precrq.ph.w %["#O3"], %["#I3"], %["#IO3"] \n\t" \
-- "ins %["#IO2"], %["#I2"], 16, 16 \n\t" \
-- "ins %["#IO3"], %["#I3"], 16, 16 \n\t"
-+ "precrq.ph.w %[" #O0 "], %[" #I0 "], %[" #IO0 "] \n\t" \
-+ "precrq.ph.w %[" #O1 "], %[" #I1 "], %[" #IO1 "] \n\t" \
-+ "ins %[" #IO0 "], %[" #I0 "], 16, 16 \n\t" \
-+ "ins %[" #IO1 "], %[" #I1 "], 16, 16 \n\t" \
-+ "precrq.ph.w %[" #O2 "], %[" #I2 "], %[" #IO2 "] \n\t" \
-+ "precrq.ph.w %[" #O3 "], %[" #I3 "], %[" #IO3 "] \n\t" \
-+ "ins %[" #IO2 "], %[" #I2 "], 16, 16 \n\t" \
-+ "ins %[" #IO3 "], %[" #I3 "], 16, 16 \n\t"
-
- // preceu.ph.qbr temp0, temp8
- // temp0 = 0 | 0 | temp8[23..16] | temp8[7..0]
-@@ -140,14 +140,14 @@
- // I - input (macro doesn't change it)
- #define CONVERT_2_BYTES_TO_HALF(O0, O1, O2, O3, O4, O5, O6, O7, \
- I0, I1, I2, I3) \
-- "preceu.ph.qbr %["#O0"], %["#I0"] \n\t" \
-- "preceu.ph.qbl %["#O1"], %["#I0"] \n\t" \
-- "preceu.ph.qbr %["#O2"], %["#I1"] \n\t" \
-- "preceu.ph.qbl %["#O3"], %["#I1"] \n\t" \
-- "preceu.ph.qbr %["#O4"], %["#I2"] \n\t" \
-- "preceu.ph.qbl %["#O5"], %["#I2"] \n\t" \
-- "preceu.ph.qbr %["#O6"], %["#I3"] \n\t" \
-- "preceu.ph.qbl %["#O7"], %["#I3"] \n\t"
-+ "preceu.ph.qbr %[" #O0 "], %[" #I0 "] \n\t" \
-+ "preceu.ph.qbl %[" #O1 "], %[" #I0 "] \n\t" \
-+ "preceu.ph.qbr %[" #O2 "], %[" #I1 "] \n\t" \
-+ "preceu.ph.qbl %[" #O3 "], %[" #I1 "] \n\t" \
-+ "preceu.ph.qbr %[" #O4 "], %[" #I2 "] \n\t" \
-+ "preceu.ph.qbl %[" #O5 "], %[" #I2 "] \n\t" \
-+ "preceu.ph.qbr %[" #O6 "], %[" #I3 "] \n\t" \
-+ "preceu.ph.qbl %[" #O7 "], %[" #I3 "] \n\t"
-
- // temp0[31..16 | 15..0] = temp0[31..16 | 15..0] + temp8[31..16 | 15..0]
- // temp0[31..16 | 15..0] = temp0[31..16 <<(s) 7 | 15..0 <<(s) 7]
-@@ -160,30 +160,30 @@
- #define STORE_SAT_SUM_X2(IO0, IO1, IO2, IO3, IO4, IO5, IO6, IO7, \
- I0, I1, I2, I3, I4, I5, I6, I7, \
- I8, I9, I10, I11, I12, I13) \
-- "addq.ph %["#IO0"], %["#IO0"], %["#I0"] \n\t" \
-- "addq.ph %["#IO1"], %["#IO1"], %["#I1"] \n\t" \
-- "addq.ph %["#IO2"], %["#IO2"], %["#I2"] \n\t" \
-- "addq.ph %["#IO3"], %["#IO3"], %["#I3"] \n\t" \
-- "addq.ph %["#IO4"], %["#IO4"], %["#I4"] \n\t" \
-- "addq.ph %["#IO5"], %["#IO5"], %["#I5"] \n\t" \
-- "addq.ph %["#IO6"], %["#IO6"], %["#I6"] \n\t" \
-- "addq.ph %["#IO7"], %["#IO7"], %["#I7"] \n\t" \
-- "shll_s.ph %["#IO0"], %["#IO0"], 7 \n\t" \
-- "shll_s.ph %["#IO1"], %["#IO1"], 7 \n\t" \
-- "shll_s.ph %["#IO2"], %["#IO2"], 7 \n\t" \
-- "shll_s.ph %["#IO3"], %["#IO3"], 7 \n\t" \
-- "shll_s.ph %["#IO4"], %["#IO4"], 7 \n\t" \
-- "shll_s.ph %["#IO5"], %["#IO5"], 7 \n\t" \
-- "shll_s.ph %["#IO6"], %["#IO6"], 7 \n\t" \
-- "shll_s.ph %["#IO7"], %["#IO7"], 7 \n\t" \
-- "precrqu_s.qb.ph %["#IO0"], %["#IO1"], %["#IO0"] \n\t" \
-- "precrqu_s.qb.ph %["#IO2"], %["#IO3"], %["#IO2"] \n\t" \
-- "precrqu_s.qb.ph %["#IO4"], %["#IO5"], %["#IO4"] \n\t" \
-- "precrqu_s.qb.ph %["#IO6"], %["#IO7"], %["#IO6"] \n\t" \
-- "usw %["#IO0"], "XSTR(I13)"*"#I9"(%["#I8"]) \n\t" \
-- "usw %["#IO2"], "XSTR(I13)"*"#I10"(%["#I8"]) \n\t" \
-- "usw %["#IO4"], "XSTR(I13)"*"#I11"(%["#I8"]) \n\t" \
-- "usw %["#IO6"], "XSTR(I13)"*"#I12"(%["#I8"]) \n\t"
-+ "addq.ph %[" #IO0 "], %[" #IO0 "], %[" #I0 "] \n\t" \
-+ "addq.ph %[" #IO1 "], %[" #IO1 "], %[" #I1 "] \n\t" \
-+ "addq.ph %[" #IO2 "], %[" #IO2 "], %[" #I2 "] \n\t" \
-+ "addq.ph %[" #IO3 "], %[" #IO3 "], %[" #I3 "] \n\t" \
-+ "addq.ph %[" #IO4 "], %[" #IO4 "], %[" #I4 "] \n\t" \
-+ "addq.ph %[" #IO5 "], %[" #IO5 "], %[" #I5 "] \n\t" \
-+ "addq.ph %[" #IO6 "], %[" #IO6 "], %[" #I6 "] \n\t" \
-+ "addq.ph %[" #IO7 "], %[" #IO7 "], %[" #I7 "] \n\t" \
-+ "shll_s.ph %[" #IO0 "], %[" #IO0 "], 7 \n\t" \
-+ "shll_s.ph %[" #IO1 "], %[" #IO1 "], 7 \n\t" \
-+ "shll_s.ph %[" #IO2 "], %[" #IO2 "], 7 \n\t" \
-+ "shll_s.ph %[" #IO3 "], %[" #IO3 "], 7 \n\t" \
-+ "shll_s.ph %[" #IO4 "], %[" #IO4 "], 7 \n\t" \
-+ "shll_s.ph %[" #IO5 "], %[" #IO5 "], 7 \n\t" \
-+ "shll_s.ph %[" #IO6 "], %[" #IO6 "], 7 \n\t" \
-+ "shll_s.ph %[" #IO7 "], %[" #IO7 "], 7 \n\t" \
-+ "precrqu_s.qb.ph %[" #IO0 "], %[" #IO1 "], %[" #IO0 "] \n\t" \
-+ "precrqu_s.qb.ph %[" #IO2 "], %[" #IO3 "], %[" #IO2 "] \n\t" \
-+ "precrqu_s.qb.ph %[" #IO4 "], %[" #IO5 "], %[" #IO4 "] \n\t" \
-+ "precrqu_s.qb.ph %[" #IO6 "], %[" #IO7 "], %[" #IO6 "] \n\t" \
-+ "usw %[" #IO0 "], "XSTR(I13)"*" #I9 "(%[" #I8 "]) \n\t" \
-+ "usw %[" #IO2 "], "XSTR(I13)"*" #I10 "(%[" #I8 "]) \n\t" \
-+ "usw %[" #IO4 "], "XSTR(I13)"*" #I11 "(%[" #I8 "]) \n\t" \
-+ "usw %[" #IO6 "], "XSTR(I13)"*" #I12 "(%[" #I8 "]) \n\t"
-
- #define OUTPUT_EARLY_CLOBBER_REGS_10() \
- : [temp1]"=&r"(temp1), [temp2]"=&r"(temp2), [temp3]"=&r"(temp3), \
-diff --git a/Source/LibWebP/src/dsp/dsp.upsampling_mips_dsp_r2.c b/Source/LibWebP/src/dsp/dsp.upsampling_mips_dsp_r2.c
-index 9c9665f..46f207b 100644
---- a/Source/LibWebP/src/dsp/dsp.upsampling_mips_dsp_r2.c
-+++ b/Source/LibWebP/src/dsp/dsp.upsampling_mips_dsp_r2.c
-@@ -34,15 +34,15 @@
- G = G - t2 + kGCst; \
- B = B + kBCst; \
- __asm__ volatile ( \
-- "shll_s.w %["#R"], %["#R"], 9 \n\t" \
-- "shll_s.w %["#G"], %["#G"], 9 \n\t" \
-- "shll_s.w %["#B"], %["#B"], 9 \n\t" \
-- "precrqu_s.qb.ph %["#R"], %["#R"], $zero \n\t" \
-- "precrqu_s.qb.ph %["#G"], %["#G"], $zero \n\t" \
-- "precrqu_s.qb.ph %["#B"], %["#B"], $zero \n\t" \
-- "srl %["#R"], %["#R"], 24 \n\t" \
-- "srl %["#G"], %["#G"], 24 \n\t" \
-- "srl %["#B"], %["#B"], 24 \n\t" \
-+ "shll_s.w %[" #R "], %[" #R "], 9 \n\t" \
-+ "shll_s.w %[" #G "], %[" #G "], 9 \n\t" \
-+ "shll_s.w %[" #B "], %[" #B "], 9 \n\t" \
-+ "precrqu_s.qb.ph %[" #R "], %[" #R "], $zero \n\t" \
-+ "precrqu_s.qb.ph %[" #G "], %[" #G "], $zero \n\t" \
-+ "precrqu_s.qb.ph %[" #B "], %[" #B "], $zero \n\t" \
-+ "srl %[" #R "], %[" #R "], 24 \n\t" \
-+ "srl %[" #G "], %[" #G "], 24 \n\t" \
-+ "srl %[" #B "], %[" #B "], 24 \n\t" \
- : [R]"+r"(R), [G]"+r"(G), [B]"+r"(B) \
- : \
- ); \
-diff --git a/Source/LibWebP/src/dsp/dsp.yuv_mips_dsp_r2.c b/Source/LibWebP/src/dsp/dsp.yuv_mips_dsp_r2.c
-index 43f02cc..45a2200 100644
---- a/Source/LibWebP/src/dsp/dsp.yuv_mips_dsp_r2.c
-+++ b/Source/LibWebP/src/dsp/dsp.yuv_mips_dsp_r2.c
-@@ -39,12 +39,12 @@
- "addu %[temp5], %[temp0], %[temp1] \n\t" \
- "subu %[temp6], %[temp0], %[temp2] \n\t" \
- "addu %[temp7], %[temp0], %[temp4] \n\t" \
--".if "#K" \n\t" \
-+".if " #K " \n\t" \
- "lbu %[temp0], 1(%[y]) \n\t" \
- ".endif \n\t" \
- "shll_s.w %[temp5], %[temp5], 9 \n\t" \
- "shll_s.w %[temp6], %[temp6], 9 \n\t" \
--".if "#K" \n\t" \
-+".if " #K " \n\t" \
- "mul %[temp0], %[t_con_5], %[temp0] \n\t" \
- ".endif \n\t" \
- "shll_s.w %[temp7], %[temp7], 9 \n\t" \
-@@ -54,9 +54,9 @@
- "srl %[temp5], %[temp5], 24 \n\t" \
- "srl %[temp6], %[temp6], 24 \n\t" \
- "srl %[temp7], %[temp7], 24 \n\t" \
-- "sb %[temp5], "#R"(%[dst]) \n\t" \
-- "sb %[temp6], "#G"(%[dst]) \n\t" \
-- "sb %[temp7], "#B"(%[dst]) \n\t" \
-+ "sb %[temp5], " #R "(%[dst]) \n\t" \
-+ "sb %[temp6], " #G "(%[dst]) \n\t" \
-+ "sb %[temp7], " #B "(%[dst]) \n\t" \
-
- #define ASM_CLOBBER_LIST() \
- : [temp0]"=&r"(temp0), [temp1]"=&r"(temp1), [temp2]"=&r"(temp2), \
diff --git a/gnu/packages/patches/freeimage-unbundle.patch b/gnu/packages/patches/freeimage-unbundle.patch
index ca907d3276..4d9b8e25c9 100644
--- a/gnu/packages/patches/freeimage-unbundle.patch
+++ b/gnu/packages/patches/freeimage-unbundle.patch
@@ -1,4 +1,4 @@
-https://src.fedoraproject.org/cgit/rpms/freeimage.git/tree/FreeImage-3.17.0_unbundle.patch
+https://src.fedoraproject.org/cgit/rpms/freeimage.git/tree/FreeImage_unbundle.patch
diff -rupN FreeImage/genfipsrclist.sh FreeImage-new/genfipsrclist.sh
--- FreeImage/genfipsrclist.sh 2015-02-20 10:52:16.000000000 +0100
@@ -25,10 +25,10 @@ diff -rupN FreeImage/gensrclist.sh FreeImage-new/gensrclist.sh
#!/bin/sh
-DIRLIST=". Source Source/Metadata Source/FreeImageToolkit Source/LibJPEG Source/LibPNG Source/LibTIFF4 Source/ZLib Source/LibOpenJPEG Source/OpenEXR Source/OpenEXR/Half Source/OpenEXR/Iex Source/OpenEXR/IlmImf Source/OpenEXR/IlmThread Source/OpenEXR/Imath Source/OpenEXR/IexMath Source/LibRawLite Source/LibRawLite/dcraw Source/LibRawLite/internal Source/LibRawLite/libraw Source/LibRawLite/src Source/LibWebP Source/LibJXR Source/LibJXR/common/include Source/LibJXR/image/sys Source/LibJXR/jxrgluelib"
-+DIRLIST=". Source Source/Metadata Source/FreeImageToolkit Source/LibJXR Source/LibJXR/common/include Source/LibJXR/image/sys Source/LibJXR/jxrgluelib"
++DIRLIST=". Source Source/Metadata Source/FreeImageToolkit"
echo "VER_MAJOR = 3" > Makefile.srcs
- echo "VER_MINOR = 17.0" >> Makefile.srcs
+ echo "VER_MINOR = 18.0" >> Makefile.srcs
diff -rupN FreeImage/Makefile.fip FreeImage-new/Makefile.fip
--- FreeImage/Makefile.fip 2015-03-08 18:03:56.000000000 +0100
+++ FreeImage-new/Makefile.fip 2015-09-05 02:14:09.212684028 +0200
@@ -90,8 +90,8 @@ diff -rupN FreeImage/Makefile.gnu FreeImage-new/Makefile.gnu
-# LibJXR
-CXXFLAGS += -D__ANSI__
-CXXFLAGS += $(INCLUDE)
-+override CFLAGS += $(INCLUDE) -D__ANSI__ $(shell pkg-config --cflags OpenEXR libopenjp2 libraw libpng libtiff-4 libwebp libwebpmux zlib)
-+override LDFLAGS += -ljpeg $(shell pkg-config --libs OpenEXR libopenjp2 libraw libpng libtiff-4 libwebp libwebpmux zlib)
++override CFLAGS += $(INCLUDE) -D__ANSI__ -I/usr/include/jxrlib $(shell pkg-config --cflags OpenEXR libopenjp2 libraw libpng libtiff-4 libwebp libwebpmux zlib)
++override LDFLAGS += -ljpeg -ljpegxr -ljxrglue $(shell pkg-config --libs OpenEXR libopenjp2 libraw libpng libtiff-4 libwebp libwebpmux zlib)
ifeq ($(shell sh -c 'uname -m 2>/dev/null || echo not'),x86_64)
- CFLAGS += -fPIC
@@ -215,6 +215,18 @@ diff -rupN FreeImage/Source/FreeImage/PluginJPEG.cpp FreeImage-new/Source/FreeIm
}
#include "FreeImage.h"
+diff -rupN FreeImage/Source/FreeImage/PluginJXR.cpp FreeImage-new/Source/FreeImage/PluginJXR.cpp
+--- FreeImage/Source/FreeImage/PluginJXR.cpp 2015-03-03 23:07:08.000000000 +0100
++++ FreeImage-new/Source/FreeImage/PluginJXR.cpp 2018-07-31 23:37:58.561953201 +0200
+@@ -23,7 +23,7 @@
+ #include "Utilities.h"
+ #include "../Metadata/FreeImageTag.h"
+
+-#include "../LibJXR/jxrgluelib/JXRGlue.h"
++#include <JXRGlue.h>
+
+ // ==========================================================
+ // Plugin Interface
diff -rupN FreeImage/Source/FreeImage/PluginPNG.cpp FreeImage-new/Source/FreeImage/PluginPNG.cpp
--- FreeImage/Source/FreeImage/PluginPNG.cpp 2015-03-10 20:16:12.000000000 +0100
+++ FreeImage-new/Source/FreeImage/PluginPNG.cpp 2015-09-05 02:13:52.044353363 +0200
@@ -241,38 +253,39 @@ diff -rupN FreeImage/Source/FreeImage/PluginRAW.cpp FreeImage-new/Source/FreeIma
#include "FreeImage.h"
#include "Utilities.h"
+
diff -rupN FreeImage/Source/FreeImage/PluginTIFF.cpp FreeImage-new/Source/FreeImage/PluginTIFF.cpp
--- FreeImage/Source/FreeImage/PluginTIFF.cpp 2015-03-02 02:07:08.000000000 +0100
+++ FreeImage-new/Source/FreeImage/PluginTIFF.cpp 2015-09-05 02:13:52.044353363 +0200
@@ -37,9 +37,9 @@
-
- #include "FreeImage.h"
- #include "Utilities.h"
--#include "../LibTIFF4/tiffiop.h"
-+#include <tiffio.h>
- #include "../Metadata/FreeImageTag.h"
--#include "../OpenEXR/Half/half.h"
-+#include <OpenEXR/half.h>
-
- #include "FreeImageIO.h"
- #include "PSDParser.h"
-@@ -194,16 +194,6 @@ TIFFFdOpen(thandle_t handle, const char
- return tif;
- }
-
--/**
--Open a TIFF file for reading or writing
--@param name
--@param mode
--*/
--TIFF*
--TIFFOpen(const char* name, const char* mode) {
-- return 0;
--}
--
- // ----------------------------------------------------------
- // TIFF library FreeImage-specific routines.
- // ----------------------------------------------------------
+
+ #include "FreeImage.h"
+ #include "Utilities.h"
+-#include "../LibTIFF4/tiffiop.h"
++#include <tiffio.h>
+ #include "../Metadata/FreeImageTag.h"
+-#include "../OpenEXR/Half/half.h"
++#include <OpenEXR/half.h>
+
+ #include "FreeImageIO.h"
+ #include "PSDParser.h"
+@@ -194,16 +194,6 @@ TIFFFdOpen(thandle_t handle, const char *name, const char *mode) {
+ return tif;
+ }
+
+-/**
+-Open a TIFF file for reading or writing
+-@param name
+-@param mode
+-*/
+-TIFF*
+-TIFFOpen(const char* name, const char* mode) {
+- return 0;
+-}
+-
+ // ----------------------------------------------------------
+ // TIFF library FreeImage-specific routines.
+ // ----------------------------------------------------------
diff -rupN FreeImage/Source/FreeImage/PluginWebP.cpp FreeImage-new/Source/FreeImage/PluginWebP.cpp
--- FreeImage/Source/FreeImage/PluginWebP.cpp 2015-03-02 02:07:08.000000000 +0100
+++ FreeImage-new/Source/FreeImage/PluginWebP.cpp 2015-09-05 02:13:52.044353363 +0200
@@ -282,15 +295,81 @@ diff -rupN FreeImage/Source/FreeImage/PluginWebP.cpp FreeImage-new/Source/FreeIm
-#include "../LibWebP/src/webp/decode.h"
-#include "../LibWebP/src/webp/encode.h"
--#include "../LibWebP/src/enc/vp8enci.h"
-#include "../LibWebP/src/webp/mux.h"
+#include <webp/decode.h>
+#include <webp/encode.h>
-+// #include "../LibWebP/src/enc/vp8enci.h"
+#include <webp/mux.h>
// ==========================================================
// Plugin Interface
+ diff -rupN FreeImage/Source/FreeImage/PSDParser.cpp FreeImage-new/Source/FreeImage/PSDParser.cpp
+--- FreeImage/Source/FreeImage/PSDParser.cpp 2016-02-11 03:18:02.000000000 +0100
++++ FreeImage-new/Source/FreeImage/PSDParser.cpp 2018-08-01 00:17:18.323822675 +0200
+@@ -133,8 +133,8 @@ public:
+ template <>
+ class PSDGetValue<8> {
+ public:
+- static inline UINT64 get(const BYTE * iprBuffer) {
+- UINT64 v = ((const UINT64*)iprBuffer)[0];
++ static inline uint64_t get(const BYTE * iprBuffer) {
++ uint64_t v = ((const uint64_t*)iprBuffer)[0];
+ #ifndef FREEIMAGE_BIGENDIAN
+ SwapInt64(&v);
+ #endif
+@@ -147,7 +147,7 @@ public:
+
+ // --------------------------------------------------------------------------
+
+-static UINT64
++static uint64_t
+ psdReadSize(FreeImageIO *io, fi_handle handle, const psdHeaderInfo& header) {
+ if(header._Version == 1) {
+ BYTE Length[4];
+@@ -199,11 +199,11 @@ public:
+ template <>
+ class PSDSetValue<8> {
+ public:
+- static inline void set(const BYTE * iprBuffer, UINT64 v) {
++ static inline void set(const BYTE * iprBuffer, uint64_t v) {
+ #ifndef FREEIMAGE_BIGENDIAN
+ SwapInt64(&v);
+ #endif
+- ((UINT64*)iprBuffer)[0] = v;
++ ((uint64_t*)iprBuffer)[0] = v;
+ }
+ };
+
+@@ -213,7 +213,7 @@ public:
+ // --------------------------------------------------------------------------
+
+ static inline bool
+-psdWriteSize(FreeImageIO *io, fi_handle handle, const psdHeaderInfo& header, UINT64 v) {
++psdWriteSize(FreeImageIO *io, fi_handle handle, const psdHeaderInfo& header, uint64_t v) {
+ if(header._Version == 1) {
+ BYTE Length[4];
+ psdSetLongValue(Length, sizeof(Length), (DWORD)v);
+@@ -1063,10 +1063,10 @@ unsigned psdParser::GetChannelOffset(FIB
+ bool psdParser::ReadLayerAndMaskInfoSection(FreeImageIO *io, fi_handle handle) {
+ bool bSuccess = true;
+
+- UINT64 nTotalBytes = psdReadSize(io, handle, _headerInfo);
++ uint64_t nTotalBytes = psdReadSize(io, handle, _headerInfo);
+
+ // Hack to handle large PSB files without using fseeko().
+- if (sizeof(long) < sizeof(UINT64)) {
++ if (sizeof(long) < sizeof(uint64_t)) {
+ const long offset = 0x10000000;
+ while (nTotalBytes > offset) {
+ if (io->seek_proc(handle, offset, SEEK_CUR) != 0) {
+@@ -1672,7 +1672,7 @@ bool psdParser::WriteLayerAndMaskInfoSec
+ // Short section with no layers.
+ BYTE IntValue[4];
+
+- UINT64 size;
++ uint64_t size;
+ if(_headerInfo._Version == 1) {
+ size = 8;
+ } else {
diff -rupN FreeImage/Source/FreeImage/ZLibInterface.cpp FreeImage-new/Source/FreeImage/ZLibInterface.cpp
--- FreeImage/Source/FreeImage/ZLibInterface.cpp 2015-03-02 02:07:10.000000000 +0100
+++ FreeImage-new/Source/FreeImage/ZLibInterface.cpp 2015-09-05 02:13:52.044353363 +0200
@@ -536,3 +615,21 @@ diff -rupN FreeImage/Source/Metadata/XTIFF.cpp FreeImage-new/Source/Metadata/XTI
if(skip_write_field(tif, tag_id)) {
// skip tags that are already handled by the LibTIFF writing process
+diff -rupN FreeImage/Source/Utilities.h FreeImage-new/Source/Utilities.h
+--- FreeImage/Source/Utilities.h 2016-04-11 15:15:32.000000000 +0200
++++ FreeImage-new/Source/Utilities.h 2018-08-01 00:16:29.826825358 +0200
+@@ -446,12 +446,12 @@ SwapLong(DWORD *lp) {
+ }
+
+ inline void
+-SwapInt64(UINT64 *arg) {
++SwapInt64(uint64_t *arg) {
+ #if defined(_MSC_VER) && _MSC_VER >= 1310
+ *arg = _byteswap_uint64(*arg);
+ #else
+ union Swap {
+- UINT64 sv;
++ uint64_t sv;
+ DWORD ul[2];
+ } tmp, result;
+ tmp.sv = *arg;
diff --git a/gnu/packages/patches/glm-restore-install-target.patch b/gnu/packages/patches/glm-restore-install-target.patch
new file mode 100644
index 0000000000..a628030f6f
--- /dev/null
+++ b/gnu/packages/patches/glm-restore-install-target.patch
@@ -0,0 +1,574 @@
+From: Tobias Geerinckx-Rice <me@tobias.gr>
+Date: Mon, 23 Sep 2019 22:01:17 +0200
+Subject: [PATCH] gnu: glm: Restore ‘install’ target.
+
+It was removed in 0.9.9.6, making installation a tedious manual process
+for no clear reason[0]. Restore it for now.
+
+[0]: https://github.com/g-truc/glm/issues/947
+
+diff -Naur glm/cmake/CMakePackageConfigHelpers.cmake glmn/cmake/CMakePackageConfigHelpers.cmake
+--- glm/cmake/CMakePackageConfigHelpers.cmake 1970-01-01 01:00:00.000000000 +0100
++++ glmn/cmake/CMakePackageConfigHelpers.cmake 2019-09-23 00:11:21.418152249 +0200
+@@ -0,0 +1,227 @@
++# - CONFIGURE_PACKAGE_CONFIG_FILE(), WRITE_BASIC_PACKAGE_VERSION_FILE()
++#
++# CONFIGURE_PACKAGE_CONFIG_FILE(<input> <output> INSTALL_DESTINATION <path>
++# [PATH_VARS <var1> <var2> ... <varN>]
++# [NO_SET_AND_CHECK_MACRO]
++# [NO_CHECK_REQUIRED_COMPONENTS_MACRO])
++#
++# CONFIGURE_PACKAGE_CONFIG_FILE() should be used instead of the plain
++# CONFIGURE_FILE() command when creating the <Name>Config.cmake or <Name>-config.cmake
++# file for installing a project or library. It helps making the resulting package
++# relocatable by avoiding hardcoded paths in the installed Config.cmake file.
++#
++# In a FooConfig.cmake file there may be code like this to make the
++# install destinations know to the using project:
++# set(FOO_INCLUDE_DIR "@CMAKE_INSTALL_FULL_INCLUDEDIR@" )
++# set(FOO_DATA_DIR "@CMAKE_INSTALL_PREFIX@/@RELATIVE_DATA_INSTALL_DIR@" )
++# set(FOO_ICONS_DIR "@CMAKE_INSTALL_PREFIX@/share/icons" )
++# ...logic to determine installedPrefix from the own location...
++# set(FOO_CONFIG_DIR "${installedPrefix}/@CONFIG_INSTALL_DIR@" )
++# All 4 options shown above are not sufficient, since the first 3 hardcode
++# the absolute directory locations, and the 4th case works only if the logic
++# to determine the installedPrefix is correct, and if CONFIG_INSTALL_DIR contains
++# a relative path, which in general cannot be guaranteed.
++# This has the effect that the resulting FooConfig.cmake file would work poorly
++# under Windows and OSX, where users are used to choose the install location
++# of a binary package at install time, independent from how CMAKE_INSTALL_PREFIX
++# was set at build/cmake time.
++#
++# Using CONFIGURE_PACKAGE_CONFIG_FILE() helps. If used correctly, it makes the
++# resulting FooConfig.cmake file relocatable.
++# Usage:
++# 1. write a FooConfig.cmake.in file as you are used to
++# 2. insert a line containing only the string "@PACKAGE_INIT@"
++# 3. instead of SET(FOO_DIR "@SOME_INSTALL_DIR@"), use SET(FOO_DIR "@PACKAGE_SOME_INSTALL_DIR@")
++# (this must be after the @PACKAGE_INIT@ line)
++# 4. instead of using the normal CONFIGURE_FILE(), use CONFIGURE_PACKAGE_CONFIG_FILE()
++#
++# The <input> and <output> arguments are the input and output file, the same way
++# as in CONFIGURE_FILE().
++#
++# The <path> given to INSTALL_DESTINATION must be the destination where the FooConfig.cmake
++# file will be installed to. This can either be a relative or absolute path, both work.
++#
++# The variables <var1> to <varN> given as PATH_VARS are the variables which contain
++# install destinations. For each of them the macro will create a helper variable
++# PACKAGE_<var...>. These helper variables must be used
++# in the FooConfig.cmake.in file for setting the installed location. They are calculated
++# by CONFIGURE_PACKAGE_CONFIG_FILE() so that they are always relative to the
++# installed location of the package. This works both for relative and also for absolute locations.
++# For absolute locations it works only if the absolute location is a subdirectory
++# of CMAKE_INSTALL_PREFIX.
++#
++# By default configure_package_config_file() also generates two helper macros,
++# set_and_check() and check_required_components() into the FooConfig.cmake file.
++#
++# set_and_check() should be used instead of the normal set()
++# command for setting directories and file locations. Additionally to setting the
++# variable it also checks that the referenced file or directory actually exists
++# and fails with a FATAL_ERROR otherwise. This makes sure that the created
++# FooConfig.cmake file does not contain wrong references.
++# When using the NO_SET_AND_CHECK_MACRO, this macro is not generated into the
++# FooConfig.cmake file.
++#
++# check_required_components(<package_name>) should be called at the end of the
++# FooConfig.cmake file if the package supports components.
++# This macro checks whether all requested, non-optional components have been found,
++# and if this is not the case, sets the Foo_FOUND variable to FALSE, so that the package
++# is considered to be not found.
++# It does that by testing the Foo_<Component>_FOUND variables for all requested
++# required components.
++# When using the NO_CHECK_REQUIRED_COMPONENTS option, this macro is not generated
++# into the FooConfig.cmake file.
++#
++# For an example see below the documentation for WRITE_BASIC_PACKAGE_VERSION_FILE().
++#
++#
++# WRITE_BASIC_PACKAGE_VERSION_FILE( filename VERSION major.minor.patch COMPATIBILITY (AnyNewerVersion|SameMajorVersion|ExactVersion) )
++#
++# Writes a file for use as <package>ConfigVersion.cmake file to <filename>.
++# See the documentation of FIND_PACKAGE() for details on this.
++# filename is the output filename, it should be in the build tree.
++# major.minor.patch is the version number of the project to be installed
++# The COMPATIBILITY mode AnyNewerVersion means that the installed package version
++# will be considered compatible if it is newer or exactly the same as the requested version.
++# This mode should be used for packages which are fully backward compatible,
++# also across major versions.
++# If SameMajorVersion is used instead, then the behaviour differs from AnyNewerVersion
++# in that the major version number must be the same as requested, e.g. version 2.0 will
++# not be considered compatible if 1.0 is requested.
++# This mode should be used for packages which guarantee backward compatibility within the
++# same major version.
++# If ExactVersion is used, then the package is only considered compatible if the requested
++# version matches exactly its own version number (not considering the tweak version).
++# For example, version 1.2.3 of a package is only considered compatible to requested version 1.2.3.
++# This mode is for packages without compatibility guarantees.
++# If your project has more elaborated version matching rules, you will need to write your
++# own custom ConfigVersion.cmake file instead of using this macro.
++#
++# Internally, this macro executes configure_file() to create the resulting
++# version file. Depending on the COMPATIBILITY, either the file
++# BasicConfigVersion-SameMajorVersion.cmake.in or BasicConfigVersion-AnyNewerVersion.cmake.in
++# is used. Please note that these two files are internal to CMake and you should
++# not call configure_file() on them yourself, but they can be used as starting
++# point to create more sophisticted custom ConfigVersion.cmake files.
++#
++#
++# Example using both configure_package_config_file() and write_basic_package_version_file():
++# CMakeLists.txt:
++# set(INCLUDE_INSTALL_DIR include/ ... CACHE )
++# set(LIB_INSTALL_DIR lib/ ... CACHE )
++# set(SYSCONFIG_INSTALL_DIR etc/foo/ ... CACHE )
++# ...
++# include(CMakePackageConfigHelpers)
++# configure_package_config_file(FooConfig.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/FooConfig.cmake
++# INSTALL_DESTINATION ${LIB_INSTALL_DIR}/Foo/cmake
++# PATH_VARS INCLUDE_INSTALL_DIR SYSCONFIG_INSTALL_DIR)
++# write_basic_package_version_file(${CMAKE_CURRENT_BINARY_DIR}/FooConfigVersion.cmake
++# VERSION 1.2.3
++# COMPATIBILITY SameMajorVersion )
++# install(FILES ${CMAKE_CURRENT_BINARY_DIR}/FooConfig.cmake ${CMAKE_CURRENT_BINARY_DIR}/FooConfigVersion.cmake
++# DESTINATION ${LIB_INSTALL_DIR}/Foo/cmake )
++#
++# With a FooConfig.cmake.in:
++# set(FOO_VERSION x.y.z)
++# ...
++# @PACKAGE_INIT@
++# ...
++# set_and_check(FOO_INCLUDE_DIR "@PACKAGE_INCLUDE_INSTALL_DIR@")
++# set_and_check(FOO_SYSCONFIG_DIR "@PACKAGE_SYSCONFIG_INSTALL_DIR@")
++#
++# check_required_components(Foo)
++
++
++#=============================================================================
++# Copyright 2012 Alexander Neundorf <neundorf@kde.org>
++#
++# Distributed under the OSI-approved BSD License (the "License");
++# see accompanying file Copyright.txt for details.
++#
++# This software is distributed WITHOUT ANY WARRANTY; without even the
++# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
++# See the License for more information.
++#=============================================================================
++# (To distribute this file outside of CMake, substitute the full
++# License text for the above reference.)
++
++include(CMakeParseArguments)
++
++include(WriteBasicConfigVersionFile)
++
++macro(WRITE_BASIC_PACKAGE_VERSION_FILE)
++ write_basic_config_version_file(${ARGN})
++endmacro()
++
++
++function(CONFIGURE_PACKAGE_CONFIG_FILE _inputFile _outputFile)
++ set(options NO_SET_AND_CHECK_MACRO NO_CHECK_REQUIRED_COMPONENTS_MACRO)
++ set(oneValueArgs INSTALL_DESTINATION )
++ set(multiValueArgs PATH_VARS )
++
++ cmake_parse_arguments(CCF "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
++
++ if(CCF_UNPARSED_ARGUMENTS)
++ message(FATAL_ERROR "Unknown keywords given to CONFIGURE_PACKAGE_CONFIG_FILE(): \"${CCF_UNPARSED_ARGUMENTS}\"")
++ endif()
++
++ if(NOT CCF_INSTALL_DESTINATION)
++ message(FATAL_ERROR "No INSTALL_DESTINATION given to CONFIGURE_PACKAGE_CONFIG_FILE()")
++ endif()
++
++ if(IS_ABSOLUTE "${CCF_INSTALL_DESTINATION}")
++ set(absInstallDir "${CCF_INSTALL_DESTINATION}")
++ else()
++ set(absInstallDir "${CMAKE_INSTALL_PREFIX}/${CCF_INSTALL_DESTINATION}")
++ endif()
++ file(RELATIVE_PATH PACKAGE_RELATIVE_PATH "${absInstallDir}" "${CMAKE_INSTALL_PREFIX}" )
++
++ foreach(var ${CCF_PATH_VARS})
++ if(NOT DEFINED ${var})
++ message(FATAL_ERROR "Variable ${var} does not exist")
++ else()
++ if(IS_ABSOLUTE "${${var}}")
++ string(REPLACE "${CMAKE_INSTALL_PREFIX}" "\${PACKAGE_PREFIX_DIR}"
++ PACKAGE_${var} "${${var}}")
++ else()
++ set(PACKAGE_${var} "\${PACKAGE_PREFIX_DIR}/${${var}}")
++ endif()
++ endif()
++ endforeach()
++
++ set(PACKAGE_INIT "
++####### Expanded from @PACKAGE_INIT@ by configure_package_config_file() #######
++get_filename_component(PACKAGE_PREFIX_DIR \"\${CMAKE_CURRENT_LIST_DIR}/${PACKAGE_RELATIVE_PATH}\" ABSOLUTE)
++")
++
++ if(NOT CCF_NO_SET_AND_CHECK_MACRO)
++ set(PACKAGE_INIT "${PACKAGE_INIT}
++macro(set_and_check _var _file)
++ set(\${_var} \"\${_file}\")
++ if(NOT EXISTS \"\${_file}\")
++ message(FATAL_ERROR \"File or directory \${_file} referenced by variable \${_var} does not exist !\")
++ endif()
++endmacro()
++")
++ endif()
++
++
++ if(NOT CCF_NO_CHECK_REQUIRED_COMPONENTS_MACRO)
++ set(PACKAGE_INIT "${PACKAGE_INIT}
++macro(check_required_components _NAME)
++ foreach(comp \${\${_NAME}_FIND_COMPONENTS})
++ if(NOT \${_NAME}_\${comp}_FOUND)
++ if(\${_NAME}_FIND_REQUIRED_\${comp})
++ set(\${_NAME}_FOUND FALSE)
++ endif()
++ endif()
++ endforeach(comp)
++endmacro()
++")
++ endif()
++
++ set(PACKAGE_INIT "${PACKAGE_INIT}
++####################################################################################")
++
++ configure_file("${_inputFile}" "${_outputFile}" @ONLY)
++
++endfunction()
+diff -Naur glm/cmake/glmBuildConfig.cmake.in glmn/cmake/glmBuildConfig.cmake.in
+--- glm/cmake/glmBuildConfig.cmake.in 1970-01-01 01:00:00.000000000 +0100
++++ glmn/cmake/glmBuildConfig.cmake.in 2019-09-23 00:12:08.090955650 +0200
+@@ -0,0 +1,6 @@
++set(GLM_VERSION "@GLM_VERSION@")
++set(GLM_INCLUDE_DIRS "@CMAKE_CURRENT_SOURCE_DIR@")
++
++if (NOT CMAKE_VERSION VERSION_LESS "3.0")
++ include("${CMAKE_CURRENT_LIST_DIR}/glmTargets.cmake")
++endif()
+diff -Naur glm/cmake/glmConfig.cmake.in glmn/cmake/glmConfig.cmake.in
+--- glm/cmake/glmConfig.cmake.in 1970-01-01 01:00:00.000000000 +0100
++++ glmn/cmake/glmConfig.cmake.in 2019-09-23 00:12:14.566373412 +0200
+@@ -0,0 +1,9 @@
++set(GLM_VERSION "@GLM_VERSION@")
++
++@PACKAGE_INIT@
++
++set_and_check(GLM_INCLUDE_DIRS "@PACKAGE_CMAKE_INSTALL_INCLUDEDIR@")
++
++if (NOT CMAKE_VERSION VERSION_LESS "3.0")
++ include("${CMAKE_CURRENT_LIST_DIR}/glmTargets.cmake")
++endif()
+diff -Naur glm/cmake/glm.pc.in glmn/cmake/glm.pc.in
+--- glm/cmake/glm.pc.in 1970-01-01 01:00:00.000000000 +0100
++++ glmn/cmake/glm.pc.in 2019-09-23 00:11:59.695710511 +0200
+@@ -0,0 +1,7 @@
++prefix=@CMAKE_INSTALL_PREFIX@
++includedir=${prefix}/include
++
++Name: GLM
++Description: OpenGL Mathematics
++Version: @GLM_VERSION@
++Cflags: -I${includedir}
+diff -Naur glm/cmake/GNUInstallDirs.cmake glmn/cmake/GNUInstallDirs.cmake
+--- glm/cmake/GNUInstallDirs.cmake 1970-01-01 01:00:00.000000000 +0100
++++ glmn/cmake/GNUInstallDirs.cmake 2019-09-23 00:11:47.363819337 +0200
+@@ -0,0 +1,188 @@
++# - Define GNU standard installation directories
++# Provides install directory variables as defined for GNU software:
++# http://www.gnu.org/prep/standards/html_node/Directory-Variables.html
++# Inclusion of this module defines the following variables:
++# CMAKE_INSTALL_<dir> - destination for files of a given type
++# CMAKE_INSTALL_FULL_<dir> - corresponding absolute path
++# where <dir> is one of:
++# BINDIR - user executables (bin)
++# SBINDIR - system admin executables (sbin)
++# LIBEXECDIR - program executables (libexec)
++# SYSCONFDIR - read-only single-machine data (etc)
++# SHAREDSTATEDIR - modifiable architecture-independent data (com)
++# LOCALSTATEDIR - modifiable single-machine data (var)
++# LIBDIR - object code libraries (lib or lib64 or lib/<multiarch-tuple> on Debian)
++# INCLUDEDIR - C header files (include)
++# OLDINCLUDEDIR - C header files for non-gcc (/usr/include)
++# DATAROOTDIR - read-only architecture-independent data root (share)
++# DATADIR - read-only architecture-independent data (DATAROOTDIR)
++# INFODIR - info documentation (DATAROOTDIR/info)
++# LOCALEDIR - locale-dependent data (DATAROOTDIR/locale)
++# MANDIR - man documentation (DATAROOTDIR/man)
++# DOCDIR - documentation root (DATAROOTDIR/doc/PROJECT_NAME)
++# Each CMAKE_INSTALL_<dir> value may be passed to the DESTINATION options of
++# install() commands for the corresponding file type. If the includer does
++# not define a value the above-shown default will be used and the value will
++# appear in the cache for editing by the user.
++# Each CMAKE_INSTALL_FULL_<dir> value contains an absolute path constructed
++# from the corresponding destination by prepending (if necessary) the value
++# of CMAKE_INSTALL_PREFIX.
++
++#=============================================================================
++# Copyright 2011 Nikita Krupen'ko <krnekit@gmail.com>
++# Copyright 2011 Kitware, Inc.
++#
++# Distributed under the OSI-approved BSD License (the "License");
++# see accompanying file Copyright.txt for details.
++#
++# This software is distributed WITHOUT ANY WARRANTY; without even the
++# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
++# See the License for more information.
++#=============================================================================
++# (To distribute this file outside of CMake, substitute the full
++# License text for the above reference.)
++
++# Installation directories
++#
++if(NOT DEFINED CMAKE_INSTALL_BINDIR)
++ set(CMAKE_INSTALL_BINDIR "bin" CACHE PATH "user executables (bin)")
++endif()
++
++if(NOT DEFINED CMAKE_INSTALL_SBINDIR)
++ set(CMAKE_INSTALL_SBINDIR "sbin" CACHE PATH "system admin executables (sbin)")
++endif()
++
++if(NOT DEFINED CMAKE_INSTALL_LIBEXECDIR)
++ set(CMAKE_INSTALL_LIBEXECDIR "libexec" CACHE PATH "program executables (libexec)")
++endif()
++
++if(NOT DEFINED CMAKE_INSTALL_SYSCONFDIR)
++ set(CMAKE_INSTALL_SYSCONFDIR "etc" CACHE PATH "read-only single-machine data (etc)")
++endif()
++
++if(NOT DEFINED CMAKE_INSTALL_SHAREDSTATEDIR)
++ set(CMAKE_INSTALL_SHAREDSTATEDIR "com" CACHE PATH "modifiable architecture-independent data (com)")
++endif()
++
++if(NOT DEFINED CMAKE_INSTALL_LOCALSTATEDIR)
++ set(CMAKE_INSTALL_LOCALSTATEDIR "var" CACHE PATH "modifiable single-machine data (var)")
++endif()
++
++if(NOT DEFINED CMAKE_INSTALL_LIBDIR)
++ set(_LIBDIR_DEFAULT "lib")
++ # Override this default 'lib' with 'lib64' iff:
++ # - we are on Linux system but NOT cross-compiling
++ # - we are NOT on debian
++ # - we are on a 64 bits system
++ # reason is: amd64 ABI: http://www.x86-64.org/documentation/abi.pdf
++ # For Debian with multiarch, use 'lib/${CMAKE_LIBRARY_ARCHITECTURE}' if
++ # CMAKE_LIBRARY_ARCHITECTURE is set (which contains e.g. "i386-linux-gnu"
++ # See http://wiki.debian.org/Multiarch
++ if((CMAKE_SYSTEM_NAME MATCHES "Linux|kFreeBSD" OR CMAKE_SYSTEM_NAME STREQUAL "GNU")
++ AND NOT CMAKE_CROSSCOMPILING)
++ if (EXISTS "/etc/debian_version") # is this a debian system ?
++ if(CMAKE_LIBRARY_ARCHITECTURE)
++ set(_LIBDIR_DEFAULT "lib/${CMAKE_LIBRARY_ARCHITECTURE}")
++ endif()
++ else() # not debian, rely on CMAKE_SIZEOF_VOID_P:
++ if(NOT DEFINED CMAKE_SIZEOF_VOID_P)
++ message(AUTHOR_WARNING
++ "Unable to determine default CMAKE_INSTALL_LIBDIR directory because no target architecture is known. "
++ "Please enable at least one language before including GNUInstallDirs.")
++ else()
++ if("${CMAKE_SIZEOF_VOID_P}" EQUAL "8")
++ set(_LIBDIR_DEFAULT "lib64")
++ endif()
++ endif()
++ endif()
++ endif()
++ set(CMAKE_INSTALL_LIBDIR "${_LIBDIR_DEFAULT}" CACHE PATH "object code libraries (${_LIBDIR_DEFAULT})")
++endif()
++
++if(NOT DEFINED CMAKE_INSTALL_INCLUDEDIR)
++ set(CMAKE_INSTALL_INCLUDEDIR "include" CACHE PATH "C header files (include)")
++endif()
++
++if(NOT DEFINED CMAKE_INSTALL_OLDINCLUDEDIR)
++ set(CMAKE_INSTALL_OLDINCLUDEDIR "/usr/include" CACHE PATH "C header files for non-gcc (/usr/include)")
++endif()
++
++if(NOT DEFINED CMAKE_INSTALL_DATAROOTDIR)
++ set(CMAKE_INSTALL_DATAROOTDIR "share" CACHE PATH "read-only architecture-independent data root (share)")
++endif()
++
++#-----------------------------------------------------------------------------
++# Values whose defaults are relative to DATAROOTDIR. Store empty values in
++# the cache and store the defaults in local variables if the cache values are
++# not set explicitly. This auto-updates the defaults as DATAROOTDIR changes.
++
++if(NOT CMAKE_INSTALL_DATADIR)
++ set(CMAKE_INSTALL_DATADIR "" CACHE PATH "read-only architecture-independent data (DATAROOTDIR)")
++ set(CMAKE_INSTALL_DATADIR "${CMAKE_INSTALL_DATAROOTDIR}")
++endif()
++
++if(NOT CMAKE_INSTALL_INFODIR)
++ set(CMAKE_INSTALL_INFODIR "" CACHE PATH "info documentation (DATAROOTDIR/info)")
++ set(CMAKE_INSTALL_INFODIR "${CMAKE_INSTALL_DATAROOTDIR}/info")
++endif()
++
++if(NOT CMAKE_INSTALL_LOCALEDIR)
++ set(CMAKE_INSTALL_LOCALEDIR "" CACHE PATH "locale-dependent data (DATAROOTDIR/locale)")
++ set(CMAKE_INSTALL_LOCALEDIR "${CMAKE_INSTALL_DATAROOTDIR}/locale")
++endif()
++
++if(NOT CMAKE_INSTALL_MANDIR)
++ set(CMAKE_INSTALL_MANDIR "" CACHE PATH "man documentation (DATAROOTDIR/man)")
++ set(CMAKE_INSTALL_MANDIR "${CMAKE_INSTALL_DATAROOTDIR}/man")
++endif()
++
++if(NOT CMAKE_INSTALL_DOCDIR)
++ set(CMAKE_INSTALL_DOCDIR "" CACHE PATH "documentation root (DATAROOTDIR/doc/PROJECT_NAME)")
++ set(CMAKE_INSTALL_DOCDIR "${CMAKE_INSTALL_DATAROOTDIR}/doc/${PROJECT_NAME}")
++endif()
++
++#-----------------------------------------------------------------------------
++
++mark_as_advanced(
++ CMAKE_INSTALL_BINDIR
++ CMAKE_INSTALL_SBINDIR
++ CMAKE_INSTALL_LIBEXECDIR
++ CMAKE_INSTALL_SYSCONFDIR
++ CMAKE_INSTALL_SHAREDSTATEDIR
++ CMAKE_INSTALL_LOCALSTATEDIR
++ CMAKE_INSTALL_LIBDIR
++ CMAKE_INSTALL_INCLUDEDIR
++ CMAKE_INSTALL_OLDINCLUDEDIR
++ CMAKE_INSTALL_DATAROOTDIR
++ CMAKE_INSTALL_DATADIR
++ CMAKE_INSTALL_INFODIR
++ CMAKE_INSTALL_LOCALEDIR
++ CMAKE_INSTALL_MANDIR
++ CMAKE_INSTALL_DOCDIR
++ )
++
++# Result directories
++#
++foreach(dir
++ BINDIR
++ SBINDIR
++ LIBEXECDIR
++ SYSCONFDIR
++ SHAREDSTATEDIR
++ LOCALSTATEDIR
++ LIBDIR
++ INCLUDEDIR
++ OLDINCLUDEDIR
++ DATAROOTDIR
++ DATADIR
++ INFODIR
++ LOCALEDIR
++ MANDIR
++ DOCDIR
++ )
++ if(NOT IS_ABSOLUTE ${CMAKE_INSTALL_${dir}})
++ set(CMAKE_INSTALL_FULL_${dir} "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_${dir}}")
++ else()
++ set(CMAKE_INSTALL_FULL_${dir} "${CMAKE_INSTALL_${dir}}")
++ endif()
++endforeach()
+diff -Naur glm/CMakeLists.txt glmn/CMakeLists.txt
+--- glm/CMakeLists.txt 2019-09-07 14:10:16.000000000 +0200
++++ glmn/CMakeLists.txt 2019-09-23 00:10:29.559815104 +0200
+@@ -4,6 +4,11 @@
+ set(GLM_VERSION "0.9.9")
+ project(glm VERSION ${GLM_VERSION} LANGUAGES CXX)
+
++list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
++
++include(GNUInstallDirs)
++include(CMakePackageConfigHelpers)
++
+ enable_testing()
+
+ option(GLM_QUIET "No CMake Message" OFF)
+@@ -237,3 +242,62 @@
+ add_subdirectory(glm)
+ add_subdirectory(test)
+
++set(GLM_INSTALL_CONFIGDIR "${CMAKE_INSTALL_LIBDIR}/cmake/glm")
++install(DIRECTORY glm DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
++
++
++# CMake automatically adds an architecture compatibility check to make sure
++# 32 and 64 bit code is not accidentally mixed. For a header-only library this
++# is not required. The check can be disabled by temporarily unsetting
++# CMAKE_SIZEOF_VOID_P. In CMake 3.14 and later this can be achieved more cleanly
++# with write_basic_package_version_file(ARCH_INDEPENDENT).
++# TODO: Use this once a newer CMake can be required.
++set(GLM_SIZEOF_VOID_P ${CMAKE_SIZEOF_VOID_P})
++unset(CMAKE_SIZEOF_VOID_P)
++write_basic_package_version_file("${CMAKE_CURRENT_BINARY_DIR}/glmConfigVersion.cmake" VERSION ${GLM_VERSION} COMPATIBILITY AnyNewerVersion)
++set(CMAKE_SIZEOF_VOID_P ${GLM_SIZEOF_VOID_P})
++
++# build tree package config
++configure_file(cmake/glmBuildConfig.cmake.in glmConfig.cmake @ONLY)
++
++# install tree package config
++configure_package_config_file(
++ cmake/glmConfig.cmake.in
++ ${GLM_INSTALL_CONFIGDIR}/glmConfig.cmake
++ INSTALL_DESTINATION ${GLM_INSTALL_CONFIGDIR}
++ PATH_VARS CMAKE_INSTALL_INCLUDEDIR
++ NO_CHECK_REQUIRED_COMPONENTS_MACRO)
++
++install(FILES
++ "${CMAKE_CURRENT_BINARY_DIR}/${GLM_INSTALL_CONFIGDIR}/glmConfig.cmake"
++ "${CMAKE_CURRENT_BINARY_DIR}/glmConfigVersion.cmake"
++ DESTINATION ${GLM_INSTALL_CONFIGDIR})
++
++add_library(glm INTERFACE)
++target_include_directories(glm INTERFACE
++ $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
++ $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>)
++install(TARGETS glm EXPORT glmTargets)
++
++export(EXPORT glmTargets FILE "${CMAKE_CURRENT_BINARY_DIR}/glmTargets.cmake")
++
++install(EXPORT glmTargets FILE glmTargets.cmake DESTINATION ${GLM_INSTALL_CONFIGDIR})
++
++# build pkg-config file
++configure_file("./cmake/glm.pc.in" "glm.pc" @ONLY)
++
++# install pkg-config file
++install(FILES "${CMAKE_CURRENT_BINARY_DIR}/glm.pc" DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig")
++
++export(PACKAGE glm)
++
++if(NOT TARGET uninstall)
++ configure_file(
++ ${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in
++ ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake
++ IMMEDIATE @ONLY)
++
++ add_custom_target(uninstall
++ COMMAND ${CMAKE_COMMAND} -P
++ ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake)
++endif()
+diff -Naur glm/cmake_uninstall.cmake.in glmn/cmake_uninstall.cmake.in
+--- glm/cmake_uninstall.cmake.in 1970-01-01 01:00:00.000000000 +0100
++++ glmn/cmake_uninstall.cmake.in 2019-09-23 00:12:22.495660449 +0200
+@@ -0,0 +1,26 @@
++if(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
++ message(FATAL_ERROR "Cannot find install manifest: @CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
++endif(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
++
++if (NOT DEFINED CMAKE_INSTALL_PREFIX)
++ set (CMAKE_INSTALL_PREFIX "@CMAKE_INSTALL_PREFIX@")
++endif ()
++ message(${CMAKE_INSTALL_PREFIX})
++
++file(READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" files)
++string(REGEX REPLACE "\n" ";" files "${files}")
++foreach(file ${files})
++ message(STATUS "Uninstalling $ENV{DESTDIR}${file}")
++ if(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}")
++ exec_program(
++ "@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\""
++ OUTPUT_VARIABLE rm_out
++ RETURN_VALUE rm_retval
++ )
++ if(NOT "${rm_retval}" STREQUAL 0)
++ message(FATAL_ERROR "Problem when removing $ENV{DESTDIR}${file}")
++ endif(NOT "${rm_retval}" STREQUAL 0)
++ else(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}")
++ message(STATUS "File $ENV{DESTDIR}${file} does not exist.")
++ endif(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}")
++endforeach(file)
diff --git a/gnu/packages/patches/idris-test-no-node.patch b/gnu/packages/patches/idris-test-no-node.patch
deleted file mode 100644
index c04ad41a8e..0000000000
--- a/gnu/packages/patches/idris-test-no-node.patch
+++ /dev/null
@@ -1,61 +0,0 @@
-From 6c52e1b902b869c25e2fe39cff6364143a04da61 Mon Sep 17 00:00:00 2001
-From: Niklas Larsson <niklas@mm.st>
-Date: Tue, 11 Dec 2018 19:56:22 +0100
-Subject: [PATCH] Only check for Node when required
-
----
- test/TestRun.hs | 34 ++++++++++++++++++++--------------
- 1 file changed, 20 insertions(+), 14 deletions(-)
-
-diff --git a/test/TestRun.hs b/test/TestRun.hs
-index c7db9fdcd..4809911f3 100644
---- a/test/TestRun.hs
-+++ b/test/TestRun.hs
-@@ -11,6 +11,7 @@ import Data.Proxy
- import Data.Typeable
- import Options.Applicative
- import System.Directory
-+import System.Environment
- import System.Exit
- import System.FilePath ((</>))
- import System.Info
-@@ -103,20 +104,25 @@ runTest path flags = do
- normalise (x : xs) = x : normalise xs
- normalise [] = []
-
-+checkNode :: IO ()
-+checkNode = do
-+ nodePath <- findExecutable "node"
-+ nodejsPath <- findExecutable "nodejs"
-+ let node = nodePath <|> nodejsPath
-+ case node of
-+ Nothing -> do
-+ putStrLn "For running the test suite against Node, node must be installed."
-+ exitFailure
-+ Just _ -> return ()
-+
- main :: IO ()
- main = do
-- nodePath <- findExecutable "node"
-- nodejsPath <- findExecutable "nodejs"
-- let node = nodePath <|> nodejsPath
-- case node of
-- Nothing -> do
-- putStrLn "For running the test suite against Node, node must be installed."
-- exitFailure
-- Just _ -> do
-- defaultMainWithIngredients ingredients $
-+ args <- getArgs
-+ when ("--node" `elem` args) checkNode
-+ defaultMainWithIngredients ingredients $
- askOption $ \(NodeOpt node) ->
-- let (codegen, flags) = if node then (JS, ["--codegen", "node"])
-- else (C , [])
-- in
-- mkGoldenTests (testFamiliesForCodegen codegen)
-- (flags ++ idrisFlags)
-+ let (codegen, flags) = if node then (JS, ["--codegen", "node"])
-+ else (C , [])
-+ in
-+ mkGoldenTests (testFamiliesForCodegen codegen) (flags ++ idrisFlags)
-+
diff --git a/gnu/packages/patches/ilmbase-fix-tests.patch b/gnu/packages/patches/ilmbase-fix-tests.patch
index fcaa37d201..34d3a180c4 100644
--- a/gnu/packages/patches/ilmbase-fix-tests.patch
+++ b/gnu/packages/patches/ilmbase-fix-tests.patch
@@ -22,10 +22,8 @@ Date: Wed, 24 Feb 2016 01:04:11 +0000
Also fix a pre-existing typo.
-Index: ilmbase/ImathTest/testBoxAlgo.cpp
-===================================================================
---- ilmbase.orig/ImathTest/testBoxAlgo.cpp
-+++ ilmbase/ImathTest/testBoxAlgo.cpp
+--- a/IlmBase/ImathTest/testBoxAlgo.cpp
++++ b/IlmBase/ImathTest/testBoxAlgo.cpp
@@ -886,10 +886,11 @@ boxMatrixTransform ()
assert (approximatelyEqual (b2.min, b4.min, e));
@@ -54,10 +52,8 @@ On 32-bit x86, allow even greater discrepency at double
precision, due to possible double-rounding. See
https://lists.nongnu.org/archive/html/openexr-devel/2015-12/msg00001.html
-Index: ilmbase/ImathTest/testBox.cpp
-===================================================================
---- ilmbase.orig/ImathTest/testBox.cpp
-+++ ilmbase/ImathTest/testBox.cpp
+--- a/IlmBase/ImathTest/testBox.cpp
++++ b/IlmBase/ImathTest/testBox.cpp
@@ -47,6 +47,58 @@ using namespace IMATH_INTERNAL_NAMESPACE
namespace {
diff --git a/gnu/packages/patches/ilmbase-openexr-pkg-config.patch b/gnu/packages/patches/ilmbase-openexr-pkg-config.patch
new file mode 100644
index 0000000000..99613080d8
--- /dev/null
+++ b/gnu/packages/patches/ilmbase-openexr-pkg-config.patch
@@ -0,0 +1,40 @@
+Fix pkg-config files when using the CMake build system.
+
+Upstream bug report:
+https://github.com/openexr/openexr/issues/567
+
+diff --git a/IlmBase/config/CMakeLists.txt b/IlmBase/config/CMakeLists.txt
+index 508176a..9e6ab91 100644
+--- a/IlmBase/config/CMakeLists.txt
++++ b/IlmBase/config/CMakeLists.txt
+@@ -71,9 +71,9 @@ if(ILMBASE_INSTALL_PKG_CONFIG)
+ # use a helper function to avoid variable pollution, but pretty simple
+ function(ilmbase_pkg_config_help pcinfile)
+ set(prefix ${CMAKE_INSTALL_PREFIX})
+- set(exec_prefix ${CMAKE_INSTALL_BINDIR})
+- set(libdir ${CMAKE_INSTALL_LIBDIR})
+- set(includedir ${CMAKE_INSTALL_INCLUDEDIR})
++ set(exec_prefix ${CMAKE_INSTALL_FULL_BINDIR})
++ set(libdir ${CMAKE_INSTALL_FULL_LIBDIR})
++ set(includedir ${CMAKE_INSTALL_FULL_INCLUDEDIR})
+ set(LIB_SUFFIX_DASH ${ILMBASE_LIB_SUFFIX})
+ if(TARGET Threads::Threads)
+ # hrm, can't use properties as they end up as generator expressions
+diff --git a/OpenEXR/config/CMakeLists.txt b/OpenEXR/config/CMakeLists.txt
+index 1ef829a..b8dc141 100644
+--- a/OpenEXR/config/CMakeLists.txt
++++ b/OpenEXR/config/CMakeLists.txt
+@@ -72,9 +72,9 @@ if(OPENEXR_INSTALL_PKG_CONFIG)
+ # use a helper function to avoid variable pollution, but pretty simple
+ function(openexr_pkg_config_help pcinfile)
+ set(prefix ${CMAKE_INSTALL_PREFIX})
+- set(exec_prefix ${CMAKE_INSTALL_BINDIR})
+- set(libdir ${CMAKE_INSTALL_LIBDIR})
+- set(includedir ${CMAKE_INSTALL_INCLUDEDIR})
++ set(exec_prefix ${CMAKE_INSTALL_FULL_BINDIR})
++ set(libdir ${CMAKE_INSTALL_FULL_LIBDIR})
++ set(includedir ${CMAKE_INSTALL_FULL_INCLUDEDIR})
+ set(LIB_SUFFIX_DASH ${OPENEXR_LIB_SUFFIX})
+ if(TARGET Threads::Threads)
+ # hrm, can't use properties as they end up as generator expressions
+
diff --git a/gnu/packages/patches/p11-kit-jks-timestamps.patch b/gnu/packages/patches/p11-kit-jks-timestamps.patch
deleted file mode 100644
index 8cb8ed8684..0000000000
--- a/gnu/packages/patches/p11-kit-jks-timestamps.patch
+++ /dev/null
@@ -1,42 +0,0 @@
-Fix test failures induced by setting the SOURCE_DATE_EPOCH variable.
-
-Taken from upstream: <https://github.com/p11-glue/p11-kit/pull/213>.
-
-From 2a474e1fe8f4bd8b4ed7622e5cf3b2718a202562 Mon Sep 17 00:00:00 2001
-From: Daiki Ueno <dueno@redhat.com>
-Date: Mon, 28 Jan 2019 13:03:15 +0100
-Subject: [PATCH] extract-jks: Prefer _p11_extract_jks_timestamp to
- SOURCE_DATE_EPOCH
-
-Give _p11_extract_jks_timestamp precedence over SOURCE_DATE_EPOCH so
-that the test results are not affected by the envvar settings.
----
- trust/extract-jks.c | 8 ++++----
- 1 file changed, 4 insertions(+), 4 deletions(-)
-
-diff --git a/trust/extract-jks.c b/trust/extract-jks.c
-index ad8dc35..a6f855f 100644
---- a/trust/extract-jks.c
-+++ b/trust/extract-jks.c
-@@ -250,7 +250,9 @@ prepare_jks_buffer (p11_enumerate *ex,
- * when this was this certificate was added to the keystore, however
- * we don't have that information. Java uses time in milliseconds
- */
-- {
-+ if (_p11_extract_jks_timestamp)
-+ now = _p11_extract_jks_timestamp;
-+ else {
- char *source_date_epoch;
- source_date_epoch = secure_getenv ("SOURCE_DATE_EPOCH");
- if (source_date_epoch) {
-@@ -276,9 +278,7 @@ prepare_jks_buffer (p11_enumerate *ex,
- return false;
- }
- now = epoch;
-- } else if (_p11_extract_jks_timestamp)
-- now = _p11_extract_jks_timestamp;
-- else
-+ } else
- now = time (NULL);
- }
-