]> de.git.xonotic.org Git - xonotic/netradiant.git/blobdiff - easy-builder
linux: do not strip binaries (does not work well with the non-PIE hack)
[xonotic/netradiant.git] / easy-builder
index 0f266902b90715ee0a8ad3c03cbabe1c57bd0b6b..9fe738b677ba4120551d6d2ba949cc45dbbef59d 100755 (executable)
@@ -14,10 +14,22 @@ 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
+       '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 +105,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,19 +126,18 @@ task_configure () {
 }
 
 task_build_builtins () {
-       cmake \
-               --build "${build_dir}" \
-               -- \
-               -j"${job_count}" \
-               'builtins'
+       sync
+       make -j"${job_count}" builtins
 }
 
 task_build () {
-       cmake \
-               --build "${build_dir}" \
-               -- \
-               -j"${job_count}" \
-               "${install_target}"
+       sync
+       make -j"${job_count}"
+}
+
+task_install () {
+       sync
+       make "${install_target}"
 }
 
 set -x
@@ -136,7 +150,6 @@ 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_build
+
+task_install