X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=easy-builder;h=220649fd9cf2b8d6d0a4cc2a2c074e87913377d1;hb=2b10f26bd44273e10c33e6d245e11661c08101f9;hp=2c71c35225395119f311b8e8b89478a121290938;hpb=a694298820d2ff4d25ac468b18032696124bee5b;p=xonotic%2Fnetradiant.git diff --git a/easy-builder b/easy-builder index 2c71c352..220649fd 100755 --- a/easy-builder +++ b/easy-builder @@ -14,10 +14,27 @@ install_dir="${project_source_dir}/install${SUBDIR:+/${SUBDIR}}" install_target='install/strip' build_type='Release' -if [ "$(uname -s)" = 'FreeBSD' ] -then - install_target='install' -fi +case "$(uname -s)" in + # Stripping is known to make non-PIE Linux netradiant binary unusable. + # Maybe that's related to the way we patch rpath? + # + # Building NetRadiant as non-PIE is required because of + # a mistake in the mimetype-library that prevents users + # to run the application from file managers on Linux. + # + # See: https://gitlab.freedesktop.org/xdg/shared-mime-info/-/issues/11 + # + # After installation it's possible to strip manually all binaries except + # the netradiant one. + 'Linux') + install_target='install' + ;; + # Stripping is known to make FreeBSD binaries unusable. + # Maybe that's related to the way we patch rpath? + 'FreeBSD') + install_target='install' + ;; +esac _job_count=4 @@ -93,15 +110,18 @@ case "$(uname -s)" in esac task_enter_build_dir () { + sync mkdir -pv "${build_dir}" cd "${build_dir}" } task_fetch_submodules () { + sync "${fetch_submodules_cmd[@]}" } task_configure () { + sync cmake \ -G'Unix Makefiles' \ -D'CMAKE_INSTALL_PREFIX'="${install_dir}" \ @@ -111,14 +131,22 @@ task_configure () { } task_build_builtins () { + sync make -j"${job_count}" builtins } +task_discover_builtins () { + sync + cmake "${project_source_dir}" +} + task_build () { + sync make -j"${job_count}" } task_install () { + sync make "${install_target}" } @@ -132,9 +160,8 @@ task_configure task_build_builtins -# Sometime linking fails on macOS with this message: -# ld: symbol(s) not found for architecture x86_64 -# and restarting the build process just work. -task_build || task_build +task_discover_builtins + +task_build task_install