@@ -60,22 +60,20 @@ def initialize(self, version, build_data):
6060 lua_version = "5.4.8"
6161 lua_src = f"lua-{ lua_version } .tar.gz"
6262 lua_checksum = f"lua-{ lua_version } .sha256"
63- root_dir = os . path . dirname ( __file__ )
64- package_dir = os . path . join ( root_dir , "python_lua_helper" )
63+ package_dir = "python_lua_helper"
64+ build_dir = "build"
6565 if current_os == "linux" :
6666 print ("Linux detected - building Lua from source..." )
67- # Change to root directory
68- os .chdir (root_dir )
67+ print (f"PWD={ os .curdir } " )
6968 # Clean/create build directory
70- build_dir = os .path .join (root_dir , "build" )
7169 if os .path .exists (build_dir ):
7270 shutil .rmtree (build_dir )
7371 os .makedirs (build_dir , exist_ok = False )
7472 # Download Lua source if it doesn't exist
7573 if not os .path .exists (lua_src ):
7674 print (f"Downloading { lua_src } " )
7775 self .run (
78- root_dir ,
76+ os . curdir ,
7977 "curl" ,
8078 "-s" ,
8179 "-L" ,
@@ -85,15 +83,13 @@ def initialize(self, version, build_data):
8583 )
8684 # Check checksum
8785 print (f"Checking { lua_src } " )
88- self .check_sha256 (lua_src , os . path . join ( root_dir , lua_checksum ) )
86+ self .check_sha256 (lua_src , lua_checksum )
8987 # Extract archive
9088 shutil .unpack_archive (lua_src , build_dir )
91- # Change to extracted Lua source directory
9289 lua_build_dir = os .path .join (build_dir , f"lua-{ lua_version } " )
93- os .chdir (lua_build_dir )
9490 # Apply patch
9591 print ("Applying build patch..." )
96- patch_file = os .path .join (root_dir , "build.patch" )
92+ patch_file = os .path .join (".." , ".." , "build.patch" )
9793 self .run (lua_build_dir , "patch" , "-p1" , "-i" , patch_file )
9894 # Build Lua with optimization flags
9995 print ("Building Lua..." )
@@ -118,9 +114,9 @@ def initialize(self, version, build_data):
118114 )
119115 target_binary = os .path .join (package_dir , "lua.exe" )
120116 if arch in ["x86_64" , "amd64" ]:
121- source_binary = os . path . join ( root_dir , "lua-windows-x86_64" )
117+ source_binary = "lua-windows-x86_64"
122118 elif arch in ["i386" , "i586" , "i686" , "x86" ]:
123- source_binary = os . path . join ( root_dir , "lua-windows-i686" )
119+ source_binary = "lua-windows-i686"
124120 else :
125121 print (
126122 f"Warning: Unsupported Windows architecture '{ arch } ' - no Lua binary available"
0 commit comments