Skip to content

Commit 5abeba2

Browse files
committed
Fix bundled wxWidgets build on OpenSUSE
OpenSUSE has defined its libdir to be 'lib64', which is mismatched with wxWidgets' in-place wx-config, which expects 'lib.' Work around this by unsetting the CONFIG_SITE envvar (which enables the OpenSUSE customizations) when configuring wxWidgets. Fixes: #558 Fixes: #1067 Fixes: #2422 Fixes: #2532
1 parent e93b558 commit 5abeba2

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

buildtools/build_wxwidgets.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -370,13 +370,19 @@ def main(wxDir, args):
370370
if os.path.exists(frameworkRootDir):
371371
shutil.rmtree(frameworkRootDir)
372372

373+
# Workaround OpenSUSE libdir issue by unsetting CONFIG_SITE envvar
374+
env = None
375+
if "CONFIG_SITE" in os.environ:
376+
env = dict(os.environ)
377+
del env["CONFIG_SITE"]
378+
373379
print("Configure options: " + repr(configure_opts))
374380
wxBuilder = builder.AutoconfBuilder()
375381
if not options.no_config and not options.clean:
376382
olddir = os.getcwd()
377383
if buildDir:
378384
os.chdir(buildDir)
379-
exitIfError(wxBuilder.configure(dir=wxRootDir, options=configure_opts),
385+
exitIfError(wxBuilder.configure(dir=wxRootDir, options=configure_opts, env=env),
380386
"Error running configure")
381387
os.chdir(olddir)
382388

buildtools/builder.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ class AutoconfBuilder(GNUMakeBuilder):
165165
def __init__(self, formatName="autoconf"):
166166
GNUMakeBuilder.__init__(self, formatName=formatName)
167167

168-
def configure(self, dir=None, options=None):
168+
def configure(self, dir=None, options=None, env=None):
169169
#olddir = os.getcwd()
170170
#os.chdir(dir)
171171

@@ -193,9 +193,9 @@ def configure(self, dir=None, options=None):
193193
optionsStr = " ".join(options) if options else ""
194194
command = "%s %s" % (configure_cmd, optionsStr)
195195
print(command)
196-
result = os.system(command)
196+
result = subprocess.run(command, shell=True, env=env)
197197
#os.chdir(olddir)
198-
return result
198+
return result.returncode
199199

200200

201201
class MSVCBuilder(Builder):

0 commit comments

Comments
 (0)