Description of problem: GYP is broken now in Fedora 31+. An error occured when trying to generate cmake project for Telegram Desktop: module 'string' has no attribute 'maketrans' Version-Release number of selected component (if applicable): 0.1-0.31.fcd686f1git.fc32 How reproducible: Always. Steps to Reproduce: 1. gyp --depth=. --generator-output=../.. -Goutput_dir=out -Dapi_id=X -Dapi_hash=Y -Dbuild_defines=TDESKTOP_DISABLE_AUTOUPDATE,TDESKTOP_DISABLE_REGISTER_CUSTOM_SCHEME,TDESKTOP_DISABLE_DESKTOP_FILE_GENERATION,TDESKTOP_DISABLE_CRASH_REPORTS,TDESKTOP_LAUNCHER_FILENAME=telegram-desktop.desktop, Telegram.gyp --format=cmake 2. 3. Actual results: BUILDSTDERR: Traceback (most recent call last): BUILDSTDERR: File "/usr/bin/gyp", line 11, in <module> BUILDSTDERR: load_entry_point('gyp==0.1', 'console_scripts', 'gyp')() BUILDSTDERR: File "/usr/lib/python3.7/site-packages/gyp/__init__.py", line 551, in script_main BUILDSTDERR: return main(sys.argv[1:]) BUILDSTDERR: File "/usr/lib/python3.7/site-packages/gyp/__init__.py", line 544, in main BUILDSTDERR: return gyp_main(args) BUILDSTDERR: File "/usr/lib/python3.7/site-packages/gyp/__init__.py", line 520, in gyp_main BUILDSTDERR: options.duplicate_basename_check) BUILDSTDERR: File "/usr/lib/python3.7/site-packages/gyp/__init__.py", line 97, in Load BUILDSTDERR: generator = __import__(generator_name, globals(), locals(), generator_name) BUILDSTDERR: File "/usr/lib/python3.7/site-packages/gyp/generator/cmake.py", line 43, in <module> BUILDSTDERR: _maketrans = string.maketrans BUILDSTDERR: AttributeError: module 'string' has no attribute 'maketrans' BUILDSTDERR: error: Bad exit status from /var/tmp/rpm-tmp.J4hoqc (%build) ~/build/BUILD/tdesktop-1.8.2/Telegram/gyp ~/build/BUILD/tdesktop-1.8.2 Expected results: Successful cmake manifest generation. Additional info: Full build log and additional task information: http://koji.rpmfusion.org/koji/taskinfo?taskID=350153 (F31) http://koji.rpmfusion.org/koji/taskinfo?taskID=350152 (Rawhide)
Proposed fix: in file pylib/gyp/generator/cmake.py change string.maketrans to str.maketrans.
Created attachment 1607029 [details] patch This should fix the build issue
Fixed in gyp-0.1-0.33.fcd686f1git.fc31