From 1d5727292e5c0ac073f36d991759a6b7782e9f5f Mon Sep 17 00:00:00 2001 From: Sourcery AI <> Date: Wed, 16 Feb 2022 10:11:38 +0000 Subject: [PATCH] 'Refactored by Sourcery' --- dependencies/np3-windows/bullet/build.py | 20 ++++++--- dependencies/np3-windows/freetype/build.py | 27 +++++++----- dependencies/np3-windows/harfbuzz/build.py | 49 +++++++++++++++------- 3 files changed, 64 insertions(+), 32 deletions(-) diff --git a/dependencies/np3-windows/bullet/build.py b/dependencies/np3-windows/bullet/build.py index e75bd44..aad0a34 100644 --- a/dependencies/np3-windows/bullet/build.py +++ b/dependencies/np3-windows/bullet/build.py @@ -21,12 +21,20 @@ def run(temp_dir: str): os.mkdir(install_dir) os.environ["PATH"] = os.path.dirname(__np__.find_build_tool_exe("ninja", "ninja.exe")) + os.pathsep + os.environ["PATH"] - __np__.run_build_tool_exe("cmake", "cmake.exe", "-G", "Ninja", - "-DCMAKE_BUILD_TYPE=Release", "-DBUILD_CPU_DEMOS=OFF", - "-DBUILD_OPENGL3_DEMOS=OFF", "-DBUILD_UNIT_TESTS=OFF", - "-DINSTALL_LIBS=ON", - "-DCMAKE_INSTALL_PREFIX=" + install_dir, - src_dir) + __np__.run_build_tool_exe( + "cmake", + "cmake.exe", + "-G", + "Ninja", + "-DCMAKE_BUILD_TYPE=Release", + "-DBUILD_CPU_DEMOS=OFF", + "-DBUILD_OPENGL3_DEMOS=OFF", + "-DBUILD_UNIT_TESTS=OFF", + "-DINSTALL_LIBS=ON", + f'-DCMAKE_INSTALL_PREFIX={install_dir}', + src_dir, + ) + __np__.run_build_tool_exe("ninja", "ninja.exe") __np__.run_build_tool_exe("ninja", "ninja.exe", "install") diff --git a/dependencies/np3-windows/freetype/build.py b/dependencies/np3-windows/freetype/build.py index caac890..a7d9c9b 100644 --- a/dependencies/np3-windows/freetype/build.py +++ b/dependencies/np3-windows/freetype/build.py @@ -23,16 +23,23 @@ def run(temp_dir: str): os.mkdir(install_dir) os.environ["PATH"] = os.path.dirname(__np__.find_build_tool_exe("ninja", "ninja.exe")) + os.pathsep + os.environ["PATH"] - __np__.run_build_tool_exe("cmake", "cmake.exe", "-G", "Ninja", - "-DCMAKE_INSTALL_PREFIX=" + install_dir, - "-DCMAKE_BUILD_TYPE=Release", - "-DZLIB_ROOT=" + __np__.find_dep_root("zlib"), - "-DWITH_HarfBuzz=ON", "-DWITH_BZip2=OFF", - "-DWITH_PNG=OFF", - "-DHARFBUZZ_INCLUDE_DIRS=" + __np__.find_dep_include("harfbuzz"), - "-DPC_HARFBUZZ_INCLUDEDIR=" + __np__.find_dep_include("harfbuzz"), - "-DPC_HARFBUZZ_LIBDIR=" + __np__.find_dep_libs("harfbuzz"), - src_dir) + __np__.run_build_tool_exe( + "cmake", + "cmake.exe", + "-G", + "Ninja", + f'-DCMAKE_INSTALL_PREFIX={install_dir}', + "-DCMAKE_BUILD_TYPE=Release", + "-DZLIB_ROOT=" + __np__.find_dep_root("zlib"), + "-DWITH_HarfBuzz=ON", + "-DWITH_BZip2=OFF", + "-DWITH_PNG=OFF", + "-DHARFBUZZ_INCLUDE_DIRS=" + __np__.find_dep_include("harfbuzz"), + "-DPC_HARFBUZZ_INCLUDEDIR=" + __np__.find_dep_include("harfbuzz"), + "-DPC_HARFBUZZ_LIBDIR=" + __np__.find_dep_libs("harfbuzz"), + src_dir, + ) + __np__.run_build_tool_exe("ninja", "ninja.exe") __np__.run_build_tool_exe("ninja", "ninja.exe", "install") diff --git a/dependencies/np3-windows/harfbuzz/build.py b/dependencies/np3-windows/harfbuzz/build.py index f01955a..f4d09ea 100644 --- a/dependencies/np3-windows/harfbuzz/build.py +++ b/dependencies/np3-windows/harfbuzz/build.py @@ -28,12 +28,20 @@ def run(temp_dir: str): os.environ["PATH"] = os.path.dirname(__np__.find_build_tool_exe("ninja", "ninja.exe")) + os.pathsep + os.environ[ "PATH"] - __np__.run_build_tool_exe("cmake", "cmake.exe", "-G", "Ninja", - "-DCMAKE_BUILD_TYPE=Release", - "-DCMAKE_INSTALL_PREFIX=" + ft_install_dir, - "-DZLIB_ROOT=" + __np__.find_dep_root("zlib"), - "-DWITH_HarfBuzz=OFF", "-DWITH_BZip2=OFF", - "-DWITH_PNG=OFF", ft_src_dir) + __np__.run_build_tool_exe( + "cmake", + "cmake.exe", + "-G", + "Ninja", + "-DCMAKE_BUILD_TYPE=Release", + f'-DCMAKE_INSTALL_PREFIX={ft_install_dir}', + "-DZLIB_ROOT=" + __np__.find_dep_root("zlib"), + "-DWITH_HarfBuzz=OFF", + "-DWITH_BZip2=OFF", + "-DWITH_PNG=OFF", + ft_src_dir, + ) + __np__.run_build_tool_exe("ninja", "ninja.exe") __np__.run_build_tool_exe("ninja", "ninja.exe", "install") @@ -52,16 +60,25 @@ def run(temp_dir: str): install_dir = os.path.join(temp_dir, "install") os.mkdir(install_dir) - __np__.run_build_tool_exe("cmake", "cmake.exe", "-G", "Ninja", - "-DCMAKE_BUILD_TYPE=Release", - "-DCMAKE_INSTALL_PREFIX=" + install_dir, - "-DCMAKE_PREFIX_PATH=" + ft_install_dir, - "-DHB_HAVE_FREETYPE=ON", "-DHB_BUILD_TESTS=OFF", - "-DHB_BUILD_UTILS=OFF", "-DHB_BUILD_SUBSET=OFF", - "-DHB_HAVE_INTROSPECTION=OFF", "-DHB_HAVE_CORETEXT=OFF", - f"-DFREETYPE_INCLUDE_DIR_freetype2={ft_install_dir}/include/freetype2", - f"-DFREETYPE_INCLUDE_DIR_ft2build={ft_install_dir}/include/freetype2", - src_dir) + __np__.run_build_tool_exe( + "cmake", + "cmake.exe", + "-G", + "Ninja", + "-DCMAKE_BUILD_TYPE=Release", + f'-DCMAKE_INSTALL_PREFIX={install_dir}', + f'-DCMAKE_PREFIX_PATH={ft_install_dir}', + "-DHB_HAVE_FREETYPE=ON", + "-DHB_BUILD_TESTS=OFF", + "-DHB_BUILD_UTILS=OFF", + "-DHB_BUILD_SUBSET=OFF", + "-DHB_HAVE_INTROSPECTION=OFF", + "-DHB_HAVE_CORETEXT=OFF", + f"-DFREETYPE_INCLUDE_DIR_freetype2={ft_install_dir}/include/freetype2", + f"-DFREETYPE_INCLUDE_DIR_ft2build={ft_install_dir}/include/freetype2", + src_dir, + ) + __np__.run_build_tool_exe("ninja", "ninja.exe") __np__.run_build_tool_exe("ninja", "ninja.exe", "install")