[gdk-pixbuf] build: Fix running gen-thumbnailer.py on Windows



commit 82f40a6f0502c31c1086840df61e1f67c7d523f9
Author: Chun-wei Fan <fanchunwei src gnome org>
Date:   Thu Aug 3 16:23:13 2017 +0800

    build: Fix running gen-thumbnailer.py on Windows
    
    We need to prepend the PATH envvar so that the main GDK-Pixbuf DLL that
    we just built can be loaded on Windows when running this script, as
    Windows do not support rpath.
    
    Since gdk-pixbuf-pixdata resides in the same path as the main GDK-Pixbuf
    DLL, we can just use its path so that we can acquire the needed path to it.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=785767

 build-aux/gen-thumbnailer.py |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/build-aux/gen-thumbnailer.py b/build-aux/gen-thumbnailer.py
index 9994043..05ac821 100644
--- a/build-aux/gen-thumbnailer.py
+++ b/build-aux/gen-thumbnailer.py
@@ -22,6 +22,10 @@ args = argparser.parse_args()
 newenv = os.environ.copy()
 newenv['GDK_PIXBUF_PIXDATA'] = args.pixdata
 newenv['GDK_PIXBUF_MODULE_FILE'] = args.loaders
+# 'nt': NT-based Windows, see https://docs.python.org/3/library/os.html
+if os.name == 'nt':
+    gdk_pixbuf_dll_buildpath = os.path.dirname(args.pixdata)
+    newenv['PATH'] = gdk_pixbuf_dll_buildpath + os.pathsep + newenv['PATH']
 
 cmd = args.printer
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]