diff --git a/oewm/build_mesa3d.py b/oewm/build_mesa3d.py index 595118ec2fb09a206675c0a7dd5f0c0b512f63cd..05040e052386014087393fab325f932ce53841b6 100644 --- a/oewm/build_mesa3d.py +++ b/oewm/build_mesa3d.py @@ -28,6 +28,7 @@ from meson_cross_process import prepare_environment nproc = multiprocessing.cpu_count() # Setup vars oewm_out_dir = sys.argv[1] # /path/to/openeuler/out/x86_64/Debug +build_type = os.path.basename(oewm_out_dir) target_out_dir = os.path.join(oewm_out_dir, 'mesa3d') # mesa3d final output dir target = os.path.basename(oewm_out_dir) platform = os.path.basename(os.path.dirname(oewm_out_dir)) # get platform name from /path/to/openeuler/out/x86_64/Debug/../ @@ -58,7 +59,7 @@ os.chdir(mesa3d_dir) # print(F"\033[96m[-] mesa building: out_dir:\033[0m {oewm_out_dir}") # Prepare env -prepare_environment(project_dir, platform) +prepare_environment(project_dir, platform, build_type) # Build mesa by meson meson_cmd = [ @@ -69,7 +70,7 @@ meson_cmd = [ '-Dplatforms=ohos', # '-Degl-native-platform=ohos', # '-Ddri-drivers=', - '-Dgallium-drivers=panfrost,swrast,zink,svga', + '-Dgallium-drivers=panfrost,swrast,zink,svga,r600', # '-Dvulkan-drivers=', # '-Dgbm=enabled', # '-Degl=enabled', diff --git a/oewm/meson_cross_process.py b/oewm/meson_cross_process.py index 462c6990c4d2055070815798c73f4f67d4c35d7c..ae0ea9abd6a8cf6555aba21bffac64bbbccb84a5 100644 --- a/oewm/meson_cross_process.py +++ b/oewm/meson_cross_process.py @@ -97,7 +97,7 @@ def generate_cross_file(project_stub_in, sysroot_stub_in): result = result.replace("sysroot_stub", sysroot_stub_in) file.write(result) -def generate_pc_file(pc_template_file, project_dir, product_name): +def generate_pc_file(pc_template_file, project_dir, platform, build_type): # print("\033[96m[-] mesa: Generate pc file:\033[0m", pc_template_file) if not os.path.exists('pkgconfig'): os.makedirs('pkgconfig') @@ -106,18 +106,19 @@ def generate_pc_file(pc_template_file, project_dir, product_name): with open(filename, "w+") as pc_file: raw_content = file_raw.read() raw_content = raw_content.replace("oewm_project_directory_stub", project_dir) - raw_content = raw_content.replace("oewm-arm-release", product_name) + raw_content = raw_content.replace("platform_stub", platform) + raw_content = raw_content.replace("build_type_stub", build_type) pc_file.write(raw_content) -def process_pkgconfig(project_dir, product_name): +def process_pkgconfig(project_dir, platform, build_type): # print("\033[96m[-] mesa: Process pkgconfig...\033[0m") template_dir = os.path.split(os.path.abspath( __file__))[0] + r"/pkgconfig_template" templates = os.listdir(template_dir) for template in templates: if not os.path.isdir(template): - generate_pc_file(template_dir + '/' + template, project_dir, product_name) + generate_pc_file(template_dir + '/' + template, project_dir, platform, build_type) -def prepare_environment(project_path, product): +def prepare_environment(project_path, product, build_type): # print("\033[96m[-] mesa: Prepare environment...\033[0m") global project_stub global sysroot_stub @@ -125,10 +126,10 @@ def prepare_environment(project_path, product): project_stub = project_path sysroot_stub = os.path.join(project_stub, "out", product, "obj", "third_party", "musl") generate_cross_file(project_path, sysroot_stub) - process_pkgconfig(project_path, product) + process_pkgconfig(project_path, product, build_type) if __name__ == '__main__': - if len(sys.argv) < 3: + if len(sys.argv) < 4: print("\033[91m[!] mesa: must input the OpenHarmony directory and the product name.\033[0m") exit(-1) - prepare_environment(sys.argv[1], sys.argv[2]) + prepare_environment(sys.argv[1], sys.argv[2], sys.argv[3]) diff --git a/oewm/pkgconfig_template/gbm.pc b/oewm/pkgconfig_template/gbm.pc deleted file mode 100644 index b41570d6de3b13b9d0575e739cfd3ff0ccefb587..0000000000000000000000000000000000000000 --- a/oewm/pkgconfig_template/gbm.pc +++ /dev/null @@ -1,9 +0,0 @@ -oewm_project_dir=oewm_project_directory_stub -libdir=${oewm_project_dir}/device/rockchip/hardware/gpu -includedir=${oewm_project_dir}/device/rockchip/hardware/gpu/include - -Name: gbm -Description: Userspace interface to kernel DRM services -Version: 2.5.109 -Libs: -L${libdir} -llibgbm -Cflags: -I${oewm_project_dir}/device/rockchip/hardware/gpu/include \ No newline at end of file diff --git a/oewm/pkgconfig_template/libsurface.pc b/oewm/pkgconfig_template/libsurface.pc index d02e7bf3ac6be310a1522a8a5bf73971def2f7b4..1f4826e9fb33aeafc1c27804ad39a7b7f860971d 100644 --- a/oewm/pkgconfig_template/libsurface.pc +++ b/oewm/pkgconfig_template/libsurface.pc @@ -1,5 +1,7 @@ oewm_project_dir=oewm_project_directory_stub -libdir=${oewm_project_dir}/out/x86_64/Debug/ +platform=platform_stub +build_type=build_type_stub +libdir=${oewm_project_dir}/out/${platform}/${build_type}/ includedir=${oewm_project_dir}/oewm/core/surface/include/ Name: libsurface