|
| 1 | +#!/usr/bin/env bash |
| 2 | + |
| 3 | +# This file is part of The RetroPie Project |
| 4 | +# |
| 5 | +# The RetroPie Project is the legal property of its developers, whose names are |
| 6 | +# too numerous to list here. Please refer to the COPYRIGHT.md file distributed with this source. |
| 7 | +# |
| 8 | +# See the LICENSE.md file at the top-level directory of this distribution and |
| 9 | +# at https://raw.githubusercontent.com/RetroPie/RetroPie-Setup/master/LICENSE.md |
| 10 | +# |
| 11 | + |
| 12 | +# NOTE v1.4.0 may be the last version available to build on a rpi. Newer versions have added a |
| 13 | +# Microsoft DirectX dependency https://github.com/microsoft/DirectXShaderCompiler which only supports |
| 14 | +# nvidia, amd, and intel GPUs (Not available for rpi) |
| 15 | + |
| 16 | +# NOTE vulkan support is available, currently disabled. |
| 17 | + |
| 18 | +rp_module_id="rbdoom3_bfg" |
| 19 | +rp_module_desc="rbdoom3_bfg - Doom 3: BFG Edition" |
| 20 | +rp_module_licence="GPL3 https://raw.githubusercontent.com/RobertBeckebans/RBDOOM-3-BFG/master/LICENSE.md" |
| 21 | +rp_module_help="For the game data, from your windows install (Gog or Steam) locate the 'base' directory. Copy ALL contents to $romdir/ports/doom3_bfg" |
| 22 | +rp_module_section="exp" |
| 23 | +rp_module_repo="git https://github.com/RobertBeckebans/RBDOOM-3-BFG.git v1.4.0" |
| 24 | +rp_module_flags="" |
| 25 | + |
| 26 | +function _arch_rbdoom3_bfg() { |
| 27 | + echo "$(uname -m | sed -e 's/i.86/x86/' | sed -e 's/^arm.*/arm/')" |
| 28 | +} |
| 29 | + |
| 30 | +function depends_rbdoom3_bfg() { |
| 31 | + local depends=(cmake libavcodec-dev libavformat-dev libavutil-dev libopenal-dev libsdl2-dev |
| 32 | + libswscale-dev) |
| 33 | + isPlatform "rpi" && depends+=(libglew-dev libimgui-dev libjpeg-dev libpng-dev rapidjson-dev |
| 34 | + zlib1g-dev) |
| 35 | + |
| 36 | + getDepends "${depends[@]}" |
| 37 | +} |
| 38 | + |
| 39 | +function sources_rbdoom3_bfg() { |
| 40 | + gitPullOrClone |
| 41 | +} |
| 42 | + |
| 43 | +function build_rbdoom3_bfg() { |
| 44 | + if [[ -d $md_build/build ]]; then |
| 45 | + cd $md_build |
| 46 | + rm -rf build |
| 47 | + fi |
| 48 | + |
| 49 | + mkdir $md_build/build |
| 50 | + cd $md_build/build |
| 51 | + |
| 52 | + if isPlatform "rpi"; then |
| 53 | + # NOTE: I am guessing on DCPU_TYPE for 32bit and 64bit. |
| 54 | + if isPlatform "64bit"; then |
| 55 | + # This is a 64-bit rpi build |
| 56 | + cmake -G "Unix Makefiles" \ |
| 57 | + -DSDL2=ON \ |
| 58 | + # NOTE: This is from the rasbian rules file. I have no idea what DEB_HOST_MULTIARCH |
| 59 | + # returns. Since this isn't being cross-compiled, I hope it doesn't matter. |
| 60 | + #-DCMAKE_LIBRARY_PATH=$(DEB_HOST_MULTIARCH) \ |
| 61 | + -DUSE_SYSTEM_ZLIB=ON \ |
| 62 | + -DUSE_SYSTEM_LIBPNG=ON \ |
| 63 | + -DUSE_SYSTEM_LIBJPEG=ON \ |
| 64 | + -DUSE_SYSTEM_LIBGLEW=ON \ |
| 65 | + -DUSE_SYSTEM_IMGUI=ON \ |
| 66 | + -DUSE_SYSTEM_RAPIDJSON=ON \ |
| 67 | + -DCPU_TYPE=aarch64 \ |
| 68 | + -DUSE_PRECOMPILED_HEADERS=OFF \ |
| 69 | + -DCPU_OPTIMIZATION="" \ |
| 70 | + -DUSE_INTRINSICS_SSE=OFF \ |
| 71 | + ../neo |
| 72 | + else |
| 73 | + # This is a 32-bit rpi build |
| 74 | + cmake -G "Unix Makefiles" \ |
| 75 | + -DSDL2=ON \ |
| 76 | + # NOTE: This is from the rasbian rules file. I have no idea what DEB_HOST_MULTIARCH |
| 77 | + # returns. Since this isn't being cross-compiled, I hope it doesn't matter. |
| 78 | + #-DCMAKE_LIBRARY_PATH=$(DEB_HOST_MULTIARCH) \ |
| 79 | + -DUSE_SYSTEM_ZLIB=ON \ |
| 80 | + -DUSE_SYSTEM_LIBPNG=ON \ |
| 81 | + -DUSE_SYSTEM_LIBJPEG=ON \ |
| 82 | + -DUSE_SYSTEM_LIBGLEW=ON \ |
| 83 | + -DUSE_SYSTEM_IMGUI=ON \ |
| 84 | + -DUSE_SYSTEM_RAPIDJSON=ON \ |
| 85 | + -DCPU_TYPE=armhf \ |
| 86 | + -DUSE_PRECOMPILED_HEADERS=OFF \ |
| 87 | + -DCPU_OPTIMIZATION="" \ |
| 88 | + -DUSE_INTRINSICS_SSE=OFF \ |
| 89 | + ../neo |
| 90 | + fi |
| 91 | + else |
| 92 | + cmake -G "Eclipse CDT4 - Unix Makefiles" \ |
| 93 | + -DCMAKE_BUILD_TYPE=RelWithDebInfo \ |
| 94 | + -DSDL2=ON \ |
| 95 | + ../neo |
| 96 | + fi |
| 97 | + |
| 98 | + # Make clean is probably not necessary. It can't hurt, might help. |
| 99 | + make clean |
| 100 | + make |
| 101 | + |
| 102 | + md_ret_require="$md_build/build/RBDoom3BFG" |
| 103 | +} |
| 104 | + |
| 105 | +function install_rbdoom3_bfg() { |
| 106 | + md_ret_files=( |
| 107 | + "build/RBDoom3BFG" |
| 108 | + "base/default.cfg" |
| 109 | + "base/extract_resources.cfg" |
| 110 | + "base/renderprogs" |
| 111 | + ) |
| 112 | +} |
| 113 | + |
| 114 | +function configure_rbdoom3_bfg() { |
| 115 | + addPort "$md_id" "doom3_bfg" "Doom 3 (BFG Edition)" "$md_inst/RBDoom3BFG" |
| 116 | + |
| 117 | + mkRomDir "ports/doom3_bfg" |
| 118 | + |
| 119 | + moveConfigDir "$md_inst/base" "$romdir/ports/doom3_bfg" |
| 120 | + |
| 121 | + if [[ "$md_mode" == "install" ]]; then |
| 122 | + mkdir /opt/retropie/ports/rbdoom3_bfg/base/ |
| 123 | + mkdir "$home/.doom3/base" |
| 124 | + fi |
| 125 | +} |
0 commit comments