]> de.git.xonotic.org Git - xonotic/netradiant.git/blobdiff - easy-builder
revert 0574802, the glwidget has to not be hidden for the macos hack to work
[xonotic/netradiant.git] / easy-builder
index d2ff3da6e826d0bba53e7ba32514a895642ee3e5..d9f7336a64630b19c90d7037cc055f31af991de2 100755 (executable)
@@ -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
 
@@ -92,28 +109,52 @@ 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}" \
+               -D'CMAKE_BUILD_TYPE'="${build_type}" \
+               "${cmake_user_opts[@]}" \
+               "${project_source_dir}"
+}
+
+task_build_builtins () {
+       sync
+       make -j"${job_count}" builtins
+}
+
+task_build () {
+       sync
+       make -j"${job_count}"
+}
+
+task_install () {
+       sync
+       make "${install_target}"
+}
+
 set -x
 
-"${fetch_submodules_cmd[@]}"
-
-mkdir -pv "${build_dir}"
-cd "${build_dir}"
-
-cmake \
-       -G'Unix Makefiles' \
-       -D'CMAKE_INSTALL_PREFIX'="${install_dir}" \
-       -D'CMAKE_BUILD_TYPE'="${build_type}" \
-       "${cmake_user_opts[@]}" \
-       "${project_source_dir}"
-
-cmake \
-       --build "${build_dir}" \
-       -- \
-       -j"${job_count}" \
-       'builtins'
-
-cmake \
-       --build "${build_dir}" \
-       -- \
-       -j"${job_count}" \
-       "${install_target}"
+task_enter_build_dir
+
+task_fetch_submodules
+
+task_configure
+
+task_build_builtins
+
+task_build
+
+task_install