[gimp/wip/Jehan/incremental-win-installer-improvements: 3/5] build: move lua import files into bin/.




commit abc5b81c2edf5e7cbeea60d656accdb7d888abde
Author: Jehan <jehan girinstud io>
Date:   Thu May 20 19:17:45 2021 +0200

    build: move lua import files into bin/.
    
    It looks like the DLL ends up searched into bin/lgi/ and other lua files
    from bin/lua/. There might be better solutions for the issue, but for
    the time being, it seems to work ok.
    
    Note that ender used instead to rebuild lua with the following changes
    (cf. IRC):
    
    > src/luaconf.h:
    > #define LUA_PATH_DEFAULT \
    >   "!\\..\\share\\lua\\5.1\\?.lua;" "!\\..\\share\\lua\\5.1\\?\\init.lua;" LUA_LDIR"?.lua;" 
LUA_LDIR"?\\init.lua;"
    > #define LUA_CPATH_DEFAULT \
    >   LUA_CDIR"..\\lib\\lua\\5.1\\?.dll;" LUA_CDIR"?.dll;" LUA_CDIR"loadall.dll"
    
    But moving files around in the installed tree is much simpler than
    rebuilding the whole lua just for this.

 build/windows/gitlab-ci/package-gimp-msys2.sh | 8 ++++++++
 build/windows/installer/files.isi             | 1 +
 2 files changed, 9 insertions(+)
---
diff --git a/build/windows/gitlab-ci/package-gimp-msys2.sh b/build/windows/gitlab-ci/package-gimp-msys2.sh
index 6e7a6e4e6c..c65199d1e0 100644
--- a/build/windows/gitlab-ci/package-gimp-msys2.sh
+++ b/build/windows/gitlab-ci/package-gimp-msys2.sh
@@ -115,6 +115,14 @@ cp -fr ${MSYS_PREFIX}/share/luajit-2.1.0-beta3 ${GIMP_DISTRIB}/share/
 cp -fr ${MSYS_PREFIX}/share/mypaint-data ${GIMP_DISTRIB}/share/
 cp -fr ${MSYS_PREFIX}/share/poppler ${GIMP_DISTRIB}/share/
 
+# Move these 2 folders into bin/ so that Lua plug-ins find the lua
+# dependencies. The alternative was to modify LUA_PATH_DEFAULT and
+# LUA_CPATH_DEFAULT macros in lua (which ender used to do, hence
+# rebuilding lua). But it's much simpler to just move these 2 folders as
+# bin/lua/ and bin/lgi/
+cp -fr ${MSYS_PREFIX}/share/lua/5.1/ ${GIMP_DISTRIB}/bin/lua
+cp -fr ${MSYS_PREFIX}/lib/lua/5.1/lgi/ ${GIMP_DISTRIB}/bin/
+
 # XXX Are these themes really needed?
 cp -fr ${MSYS_PREFIX}/share/themes ${GIMP_DISTRIB}/share/
 
diff --git a/build/windows/installer/files.isi b/build/windows/installer/files.isi
index 07fa01f2f0..d225262394 100644
--- a/build/windows/installer/files.isi
+++ b/build/windows/installer/files.isi
@@ -56,4 +56,5 @@ Source: "{#DEPS_DIR}\{#DDIR}\lib\python3.8\*"; DestDir: "{app}\lib\python3.8"; C
 Source: "{#DEPS_DIR}\{#DDIR}\bin\luajit.exe"; DestDir: "{app}\bin"; Components: lua and gimp{#PLATFORM}; 
Flags: restartreplace uninsrestartdelete ignoreversion
 Source: "{#DEPS_DIR}\{#DDIR}\bin\lua51.dll"; DestDir: "{app}\bin"; Components: lua and gimp{#PLATFORM}; 
Flags: restartreplace uninsrestartdelete ignoreversion
 Source: "{#DEPS_DIR}\{#DDIR}\lib\lua\5.1\*.*"; DestDir: "{app}\lib\lua\5.1"; Components: lua and 
gimp{#PLATFORM}; Flags: recursesubdirs restartreplace uninsrestartdelete ignoreversion
+Source: "{#DEPS_DIR}\{#DDIR}\bin\lua\*"; DestDir: "{app}\bin\lua"; Components: lua and gimp{#PLATFORM}; 
Flags: recursesubdirs restartreplace ignoreversion uninsrestartdelete
 #endif


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