[skip test]
This commit is contained in:
alexey.lysiuk 2023-03-25 12:54:50 +02:00
parent 81479edc4d
commit 07575f016c
3 changed files with 48 additions and 41 deletions

View file

@ -14,18 +14,18 @@ jobs:
fail-fast: false
matrix:
target:
- glib
- radare2
steps:
- uses: actions/checkout@v3
# - name: Build target
# run: |
# ./build.py --target ${{ matrix.target }}
- name: Generate Xcode project
- name: Build target
run: |
./build.py --target ${{ matrix.target }} --xcode
./build.py --target ${{ matrix.target }}
# - name: Generate Xcode project
# run: |
# ./build.py --target ${{ matrix.target }} --xcode
- name: List Build Directory
if: always()

View file

@ -535,6 +535,7 @@ class MesonTarget(BuildTarget):
self._write_cross_file(cross_file_path, state)
args.append(f'--cross-file={cross_file_path}')
args += state.options.to_list(CommandLineOptions.CMAKE_RULES)
args.append(state.build_path)
args.append(state.source)
@ -543,7 +544,7 @@ class MesonTarget(BuildTarget):
def build(self, state: BuildState):
if state.xcode:
args = ('open', f'{self.name}.xcodeproj')
args = ['open', f'{self.name}.xcodeproj']
subprocess.run(args, check=True, cwd=state.build_path, env=state.environment)
else:
# args = ['ninja']

View file

@ -89,6 +89,7 @@ class QPakManTarget(base.CMakeTarget):
class Radare2Target(base.MesonTarget):
def __init__(self, name='radare2'):
super().__init__(name)
self.configure_prefix = False
def prepare_source(self, state: BuildState):
state.download_source(
@ -99,33 +100,38 @@ class Radare2Target(base.MesonTarget):
return state.has_source_file('man/radare2.1')
def configure(self, state: BuildState):
option = state.options
option['blob'] = 'true'
option['r2_gittip'] = 'ab809417aa6b676922f95cf77861924eb90e7ef2'
option['r2_version_commit'] = '1'
super().configure(state)
# Fix absolute paths in r_userconf.h
search_subpath = str(state.install_path)
replace_subpath = '/usr/local'
def fix_paths(line: str):
return line.replace(search_subpath, replace_subpath) if search_subpath in line else line
self.update_text_file(state.build_path / 'r_userconf.h', fix_paths)
# Fix commit in r_version.h
names_values = (
('R2_GITTIP', '"ab809417aa6b676922f95cf77861924eb90e7ef2"'),
('R2_VERSION_COMMIT', '1'),
)
def fix_commit(line: str):
for name, value in names_values:
beginning = f'#define {name} '
if line.startswith(beginning):
return f'{beginning}{value}\n'
return line
self.update_text_file(state.build_path / 'r_version.h', fix_commit)
# # Fix absolute paths in r_userconf.h
# search_subpath = str(state.install_path)
# replace_subpath = '/usr/local'
#
# def fix_paths(line: str):
# return line.replace(search_subpath, replace_subpath) if search_subpath in line else line
#
# self.update_text_file(state.build_path / 'r_userconf.h', fix_paths)
#
# # Fix commit in r_version.h
# names_values = (
# ('R2_GITTIP', '"ab809417aa6b676922f95cf77861924eb90e7ef2"'),
# ('R2_VERSION_COMMIT', '1'),
# )
#
# def fix_commit(line: str):
# for name, value in names_values:
# beginning = f'#define {name} '
#
# if line.startswith(beginning):
# return f'{beginning}{value}\n'
#
# return line
#
# self.update_text_file(state.build_path / 'r_version.h', fix_commit)
class RizinTarget(base.MesonTarget):
@ -143,14 +149,14 @@ class RizinTarget(base.MesonTarget):
def configure(self, state: BuildState):
super().configure(state)
# Fix absolute paths in r_userconf.h
search_subpath = str(state.install_path)
replace_subpath = '/usr/local'
def fix_paths(line: str):
return line.replace(search_subpath, replace_subpath) if search_subpath in line else line
self.update_text_file(state.build_path / 'rz_userconf.h', fix_paths)
# # Fix absolute paths in r_userconf.h
# search_subpath = str(state.install_path)
# replace_subpath = '/usr/local'
#
# def fix_paths(line: str):
# return line.replace(search_subpath, replace_subpath) if search_subpath in line else line
#
# self.update_text_file(state.build_path / 'rz_userconf.h', fix_paths)
class SeverZipTarget(base.MakeTarget):