Advertisement
Guest User

Untitled

a guest
Nov 30th, 2023
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.02 KB | None | 0 0
  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. rp_module_id="dosbox-staging"
  13. rp_module_desc="modern DOS/x86 emulator focusing on ease of use"
  14. rp_module_help="ROM Extensions: .bat .com .exe .sh .conf\n\nCopy your DOS games to $romdir/pc"
  15. rp_module_licence="GPL2 https://raw.githubusercontent.com/dosbox-staging/dosbox-staging/master/COPYING"
  16. rp_module_repo="git https://github.com/dosbox-staging/dosbox-staging.git :_get_branch_dosbox-staging"
  17. rp_module_section="opt"
  18. rp_module_flags="sdl2"
  19.  
  20. function _get_branch_dosbox-staging() {
  21. download https://api.github.com/repos/dosbox-staging/dosbox-staging/releases/latest - | grep -m 1 tag_name | cut -d\" -f4
  22. }
  23.  
  24. function depends_dosbox-staging() {
  25. getDepends cmake libasound2-dev libglib2.0-dev libopusfile-dev libpng-dev libsdl2-dev libsdl2-net-dev libsdl2-image-dev libspeexdsp-dev meson ninja-build
  26. }
  27.  
  28. function sources_dosbox-staging() {
  29. gitPullOrClone
  30. # Check if we have at least meson>=0.57, otherwise install it locally for the build
  31. local meson_version="$(meson --version)"
  32. if compareVersions "$meson_version" lt 0.57; then
  33. downloadAndExtract "https://github.com/mesonbuild/meson/releases/download/0.61.5/meson-0.61.5.tar.gz" meson --strip-components 1
  34. fi
  35. }
  36.  
  37. function build_dosbox-staging() {
  38. local params=(-Duse_mt32emu="false" -Duse_slirp="true" -Dprefix="$md_inst" -Ddatadir="resources")
  39. # use the build local Meson installation if found
  40. local meson_cmd="meson"
  41. [[ -f "$md_build/meson/meson.py" ]] && meson_cmd="python3 $md_build/meson/meson.py"
  42.  
  43. # disable speexdsp simd support on armv6 devices
  44. isPlatform "armv6" && params+=(-Dspeexdsp:simd=false)
  45.  
  46. $meson_cmd setup "${params[@]}" build
  47. $meson_cmd compile -j${__jobs} -C build
  48.  
  49. md_ret_require=(
  50. "$md_build/build/dosbox"
  51. )
  52. }
  53.  
  54. function install_dosbox-staging() {
  55. ninja -C build install
  56. }
  57.  
  58. function configure_dosbox-staging() {
  59. configure_dosbox
  60.  
  61. [[ "$md_id" == "remove" ]] && return
  62.  
  63. local config_dir="$md_conf_root/pc"
  64. chown -R $user: "$config_dir"
  65.  
  66. local staging_output="texturenb"
  67. if isPlatform "kms"; then
  68. staging_output="openglnb"
  69. fi
  70.  
  71. local config_path=$(su "$user" -c "\"$md_inst/bin/dosbox\" -printconf")
  72. if [[ -f "$config_path" ]]; then
  73. iniConfig " = " "" "$config_path"
  74. if isPlatform "rpi"; then
  75. iniSet "fullscreen" "true"
  76. iniSet "fullresolution" "original"
  77. iniSet "vsync" "true"
  78. iniSet "output" "$staging_output"
  79. iniSet "core" "dynamic"
  80. iniSet "blocksize" "2048"
  81. iniSet "prebuffer" "50"
  82. fi
  83. fi
  84. }
  85.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement