mirror of
https://github.com/rizinorg/cutter
synced 2026-08-11 16:23:06 -04:00
Remove qmake (#2546)
* Remove qmake project and move some variables directly to CMake project * Remove meson and update docs. * Add instructions for basic macOS build.
This commit is contained in:
parent
4f3a5c1c2e
commit
562979bcff
21 changed files with 422 additions and 1279 deletions
|
|
@ -18,7 +18,7 @@ git pull origin master
|
|||
|
||||
# Generate Crowdin single translation file from cutter_fr.ts
|
||||
log "Generating single translation file"
|
||||
lupdate ../Cutter.pro
|
||||
find . -iname "*.ts" | xargs lupdate .. -ts
|
||||
cp ./fr/cutter_fr_FR.ts ./Translations.ts
|
||||
|
||||
# Push it so Crowdin can find new strings, and later push updated translations
|
||||
|
|
|
|||
|
|
@ -3,13 +3,13 @@ import os
|
|||
import re
|
||||
|
||||
scripts_path = os.path.dirname(os.path.realpath(__file__))
|
||||
pro_file_path = os.path.join(scripts_path, "..", "src", "Cutter.pro")
|
||||
pro_file_path = os.path.join(scripts_path, "..", "CMakeLists.txt")
|
||||
|
||||
with open(pro_file_path, "r") as f:
|
||||
pro_content = f.read()
|
||||
|
||||
def version_var_re(name):
|
||||
return "^[ \t]*{}[ \t]*=[ \t]*(\d+)[ \t]*$".format(name)
|
||||
return "^set\({}[ \t]*(\d+)\)$".format(name)
|
||||
|
||||
m = re.search(version_var_re("CUTTER_VERSION_MAJOR"), pro_content, flags=re.MULTILINE)
|
||||
version_major = int(m.group(1)) if m is not None else 0
|
||||
|
|
|
|||
|
|
@ -1,26 +0,0 @@
|
|||
|
||||
import sys
|
||||
import re
|
||||
import json
|
||||
|
||||
in_filename = sys.argv[1]
|
||||
out_filename = sys.argv[2]
|
||||
vars = json.loads(sys.argv[3])
|
||||
|
||||
with open(in_filename, "r") as f:
|
||||
content = f.read()
|
||||
|
||||
content = content.replace("\\\"", "\"")
|
||||
|
||||
varname_pattern = re.compile("[A-Za-z0-9_]+")
|
||||
for name, value in vars.items():
|
||||
if varname_pattern.fullmatch(name) is None:
|
||||
print("Name \"{}\" is not a valid variable name.".format(name))
|
||||
continue
|
||||
|
||||
pattern = "\\$\\$({}|\\{{{}\\}})".format(name, name)
|
||||
print(pattern)
|
||||
content = re.sub(pattern, str(value), content)
|
||||
|
||||
with open(out_filename, "w") as f:
|
||||
f.write(content)
|
||||
|
|
@ -1,30 +0,0 @@
|
|||
import os
|
||||
import sys
|
||||
|
||||
name = sys.argv[1]
|
||||
value = []
|
||||
root = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
|
||||
with open(os.path.join(root, 'src', 'Cutter.pro')) as f:
|
||||
text = f.read()
|
||||
text = text.replace('\\\n', '')
|
||||
nbraces = 0
|
||||
for line in text.split('\n'):
|
||||
line = line.strip()
|
||||
if not line or all(char in line for char in ('{', '}')):
|
||||
continue
|
||||
if line.startswith('}'):
|
||||
nbraces -= 1
|
||||
continue
|
||||
if line.endswith('{'):
|
||||
nbraces += 1
|
||||
continue
|
||||
if nbraces > 0 or '=' not in line:
|
||||
continue
|
||||
words = line.split()
|
||||
if words[0] == name and '=' in words[1]:
|
||||
value.extend(words[2:])
|
||||
if name == 'QT':
|
||||
value = [str.title(s) for s in value]
|
||||
if not value:
|
||||
sys.exit(1)
|
||||
print(';'.join(value), end='')
|
||||
Loading…
Add table
Add a link
Reference in a new issue