Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: correct search for Lua interpreter for qmake builds #6616

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 9 additions & 3 deletions translations/translated/CMakeLists.txt
@@ -1,6 +1,6 @@
############################################################################
# Copyright (C) 2018 by Vadim Peretokin - vperetokin@gmail.com #
# Copyright (C) 2020 by Stephen Lyons - slysven@virginmedia.com #
# Copyright (C) 2020, 2023 by Stephen Lyons - slysven@virginmedia.com #
# #
# This program is free software; you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
Expand Down Expand Up @@ -51,9 +51,15 @@ if(NOT WIN32)
# message(STATUS "The environmental variable LANG should now be reset to: ${OLDLANG} and it is now: $ENV{LANG}")
endif()

find_program(LUA_LOCATION lua5.1)
find_program(LUA_LOCATION lua-5.1)
if(NOT LUA_LOCATION)
find_program(LUA_LOCATION lua)
find_program(LUA_LOCATION lua5.1)
if(NOT LUA_LOCATION)
find_program(LUA_LOCATION lua51)
if(NOT LUA_LOCATION)
find_program(LUA_LOCATION lua)
endif()
endif()
endif()

execute_process(
Expand Down
49 changes: 37 additions & 12 deletions translations/translated/updateqm.pri
Expand Up @@ -46,34 +46,59 @@ STATS_GENERATOR = $$system_path("$${PWD}/generate-translation-stats.lua")

win32 {
CMD = "where"
message("You can safely ignore one or two \"INFO: Could not find files for the given pattern(s).\" messages that may appear!")
message("You can safely ignore one to three \"INFO: Could not find files for the given pattern(s).\" messages that may appear!")
} else {
# OpenBSD reports the failure to find lua5.1 loudly enough to be seen;
# so explictly bin the stderr output:
CMD = "which 2>/dev/null"
}

LUA_SEARCH_OUT = $$system("$$CMD lua5.1")
win32 {
# The '.1' in the file name confuses the QMake system() utility or the
# shell used in the Windows case as it is considered to be an extension
# unless we put in the actual 'exe' extension as well:
LUA_SEARCH_OUT = $$system("$$CMD lua-5.1.exe")
} else {
LUA_SEARCH_OUT = $$system("$$CMD lua-5.1")
}
isEmpty(LUA_SEARCH_OUT) {
LUA_SEARCH_OUT = $$system("$$CMD lua51")
win32 {
LUA_SEARCH_OUT = $$system("$$CMD lua5.1.exe")
} else {
LUA_SEARCH_OUT = $$system("$$CMD lua5.1")
}
isEmpty(LUA_SEARCH_OUT) {
LUA_SEARCH_OUT = $$system("$$CMD lua")
# This can be used for all OS since there is no '.'
LUA_SEARCH_OUT = $$system("$$CMD lua51")
isEmpty(LUA_SEARCH_OUT) {
error("no lua found in PATH")
LUA_SEARCH_OUT = $$system("$$CMD lua")
isEmpty(LUA_SEARCH_OUT) {
error("no lua found in PATH")
} else {
# "lua" worked
LUA_COMMAND = "lua"
}

} else {
LUA_COMMAND = "lua"
# "lua51" worked
LUA_COMMAND = "lua51"
}

} else {
LUA_COMMAND = "lua51"
# "lua5.1" worked
win32 {
LUA_COMMAND = "lua5.1.exe"
} else {
LUA_COMMAND = "lua5.1"
}
}

} else {
# "lua-5.1" worked
win32 {
# The '.1' in the file name confuses the QMake system() utility or the
# shell used in the Windows case as it is considered to be an extension
# unless we put in the actual 'exe' extension as well:
LUA_COMMAND = "lua5.1.exe"
LUA_COMMAND = "lua-5.1.exe"
} else {
LUA_COMMAND = "lua5.1"
LUA_COMMAND = "lua-5.1"
}
}

Expand Down