<div dir="ltr"><div>You know, you could use "gzip | xxd"........<br><br></div>But I think 10 lines of python code is probably fine. :)<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Mar 11, 2017 at 11:22 AM, Lionel Landwerlin <span dir="ltr"><<a href="mailto:lionel.g.landwerlin@intel.com" target="_blank">lionel.g.landwerlin@intel.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">v2 (from Dylan):<br>
   Add main function<br>
   Add missing Copyright<br>
   Use print_function<br>
<br>
</span>v3: Add actual license (Dylan)<br>
<br>
Signed-off-by: Lionel Landwerlin <<a href="mailto:lionel.g.landwerlin@intel.com">lionel.g.landwerlin@intel.com</a><wbr>><br>
Reviewed-by: Dylan Baker <<a href="mailto:dylan@pnwbakers.com">dylan@pnwbakers.com</a>><br>
---<br>
 src/intel/<a href="http://Makefile.genxml.am" rel="noreferrer" target="_blank">Makefile.genxml.am</a>        |  1 +<br>
 src/intel/genxml/gen_zipped_<wbr>file.py | 47 ++++++++++++++++++++++++++++++<wbr>+++++++<br>
 2 files changed, 48 insertions(+)<br>
 create mode 100644 src/intel/genxml/gen_zipped_<wbr>file.py<br>
<span class=""><br>
diff --git a/src/intel/<a href="http://Makefile.genxml.am" rel="noreferrer" target="_blank">Makefile.genxml.am</a> b/src/intel/<a href="http://Makefile.genxml.am" rel="noreferrer" target="_blank">Makefile.genxml.am</a><br>
index 20e4b15786..1866d7e2df 100644<br>
--- a/src/intel/<a href="http://Makefile.genxml.am" rel="noreferrer" target="_blank">Makefile.genxml.am</a><br>
+++ b/src/intel/<a href="http://Makefile.genxml.am" rel="noreferrer" target="_blank">Makefile.genxml.am</a><br>
@@ -60,4 +60,5 @@ EXTRA_DIST += \<br>
        genxml/genX_pack.h \<br>
        genxml/gen_macros.h \<br>
        genxml/gen_pack_header.py \<br>
+       genxml/gen_zipped_file.py \<br>
        genxml/README<br>
diff --git a/src/intel/genxml/gen_zipped_<wbr>file.py b/src/intel/genxml/gen_zipped_<wbr>file.py<br>
</span>new file mode 100644<br>
index 0000000000..66222cabe7<br>
--- /dev/null<br>
+++ b/src/intel/genxml/gen_zipped_<wbr>file.py<br>
@@ -0,0 +1,47 @@<br>
<span class="">+#encoding=utf-8<br>
+#<br>
+# Copyright © 2017 Intel Corporation<br>
+#<br>
</span>+# Permission is hereby granted, free of charge, to any person obtaining a<br>
+# copy of this software and associated documentation files (the "Software"),<br>
+# to deal in the Software without restriction, including without limitation<br>
+# the rights to use, copy, modify, merge, publish, distribute, sublicense,<br>
+# and/or sell copies of the Software, and to permit persons to whom the<br>
+# Software is furnished to do so, subject to the following conditions:<br>
+#<br>
+# The above copyright notice and this permission notice (including the next<br>
+# paragraph) shall be included in all copies or substantial portions of the<br>
+# Software.<br>
+#<br>
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR<br>
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,<br>
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL<br>
+# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER<br>
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING<br>
+# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS<br>
+# IN THE SOFTWARE.<br>
+#<br>
<span class="">+<br>
+from __future__ import print_function<br>
+import os<br>
+import sys<br>
+import zlib<br>
+<br>
+def main():<br>
+    if len(sys.argv) < 2:<br>
+        print("No input xml file specified")<br>
+        sys.exit(1)<br>
+<br>
+    with open(sys.argv[1]) as f:<br>
+        compressed_data = zlib.compress(f.read())<br>
+<br>
+    gen_name = os.path.splitext(os.path.<wbr>basename(sys.argv[1]))[0]<br>
+    print("static const uint8_t %s_xml[] = {" % gen_name)<br>
</span>+    print("   ", end='')<br>
<span class="im HOEnZb">+<br>
+    for i, c in enumerate(compressed_data, start=1):<br>
+        print("0x%.2x, " % ord(c), end='\n   ' if not i % 12 else '')<br>
+    print('\n};')<br>
+<br>
+if __name__ == '__main__':<br>
+    main()<br>
--<br>
2.11.0<br>
</span><div class="HOEnZb"><div class="h5">______________________________<wbr>_________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev" rel="noreferrer" target="_blank">https://lists.freedesktop.org/<wbr>mailman/listinfo/mesa-dev</a><br>
</div></div></blockquote></div><br></div>