RetroPie forum home
    • Recent
    • Tags
    • Popular
    • Home
    • Docs
    • Register
    • Login
    Please do not post a support request without first reading and following the advice in https://retropie.org.uk/forum/topic/3/read-this-first

    Need help with writing install script

    Scheduled Pinned Locked Moved Help and Support
    new emulatorinstalliationlr-melonds
    16 Posts 2 Posters 1.6k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • UnknownU
      Unknown
      last edited by

      I'm trying to write an install script for lr-melonDS because it supports DSI emulation. This is my first time doing this . Here is the script:

      #!/usr/bin/env bash
      
      # This file is part of The RetroPie Project
      #
      # The RetroPie Project is the legal property of its developers, whose names are
      # too numerous to list here. Please refer to the COPYRIGHT.md file distributed with this source.
      #
      # See the LICENSE.md file at the top-level directory of this distribution and
      # at https://raw.githubusercontent.com/RetroPie/RetroPie-Setup/master/LICENSE.md
      #
      
      rp_module_id="lr-melonDS"
      rp_module_desc="NDS/DSI emu requries bios and firmware from DS/DSI port for libretro"
      rp_module_help="ROM Extensions: .nds .zip\n\nCopy your Nintendo DS/DSI roms to $romdir/nds"
      rp_module_licence="GPL2 https://github.com/libretro/melonDS/blob/master/LICENSE"
      rp_module_section="exp"
      #rp_module_flags="!all 64bit"
      
      function _params_lr-melonDS() {
          local params=()
          isPlatform "arm" && params+=("platform=armvhardfloat")
          isPlatform "aarch64" && params+=("melonDS_JIT=0")
          echo "${params[@]}"
      }
      
      function depends_lr-melonDS() {
          getDepends cmake libcurl4-gnutls-dev libpcap0.8-dev libsdl2-dev qtbase5-dev qtdeclarative5-dev libslirp-dev
      }
      
      function sources_lr-melonDS() {
          gitPullOrClone "$md_build" https://github.com/Arisotura/melonDS.git
      }
      
      function build_lr-melonDS() {
          cd melon-ds/src/frontend/libretro
          make clean
          make $(_params_lr-melonDS)
          md_ret_require="$md_build/melonDS/src/frontend/libretro/melonDS_libretro.so"
      }
      
      function install_lr-melonDS() {
          md_ret_files=(
              'melonDS/src/frontend/libretro/melonDS_libretro.so'
          )
      }
      
      function configure_lr-melonDS() {
          mkRomDir "nds"
          ensureSystemretroconfig "nds"
      
          addEmulator 0 "$md_id" "nds" "$md_inst/melonDS_libretro.so"
          addSystem "nds"
      }
      

      So far it can't install needed dependencies, can anyone tell me what is wrong with this script?

      1 Reply Last reply Reply Quote 0
      • mituM
        mitu Global Moderator
        last edited by mitu

        What error do you get and where ? The depends functions looks ok, but the build part doesn't look correct - there's no melon-ds folder present in the source repository.

        UnknownU 1 Reply Last reply Reply Quote 1
        • UnknownU
          Unknown @mitu
          last edited by

          @mitu
          Here is the log file:

          Log started at: Wed Dec 23 13:31:26 EST 2020
          
          RetroPie-Setup version: 4.7.2 (ac8d8775)
          System: rpi4 (aarch64) - Raspbian GNU/Linux 10 (buster) - Linux retropie 5.4.79-v8+ #1373 SMP PREEMPT Mon Nov 23 13:32:41 GMT 2020 aarch64 GNU/Linux
          
          = = = = = = = = = = = = = = = = = = = = =
          Installing dependencies for 'lr-melonDS' : NDS/DSI emu requries bios and firmware from DS/DSI port for libretro
          = = = = = = = = = = = = = = = = = = = = =
          
          Did not find needed dependencies: libcurl4-gnutls-dev qtdeclarative5-dev libslirp-dev. Trying to install them now.
          Hit:1 http://archive.raspberrypi.org/debian buster InRelease
          Get:2 http://raspbian.raspberrypi.org/raspbian buster InRelease [15.0 kB]
          Fetched 15.0 kB in 1s (14.3 kB/s)
          Reading package lists...
          Reading package lists...
          Building dependency tree...
          Reading state information...
          E: Unable to locate package libslirp-dev
          Could not install package(s): libcurl4-gnutls-dev qtdeclarative5-dev libslirp-dev.
          
          Log ended at: Wed Dec 23 13:31:31 EST 2020
          Total running time: 0 hours, 0 mins, 5 secs
          
          mituM 1 Reply Last reply Reply Quote 0
          • mituM
            mitu Global Moderator @Unknown
            last edited by mitu

            @unknown said in Need help with writing install script:

            E: Unable to locate package libslirp-dev

            It looks like the package doesn't exist in the current Raspberry Pi OS release.

            UnknownU 1 Reply Last reply Reply Quote 1
            • UnknownU
              Unknown @mitu
              last edited by

              @mitu
              Well, that's not good. Is there another way to get it?

              mituM 1 Reply Last reply Reply Quote 0
              • mituM
                mitu Global Moderator @Unknown
                last edited by mitu

                You could install it manually from source, and remove the dependency in the scriptmodule. During compilation, if needed, MelonDS will find it and use it.

                UnknownU 1 Reply Last reply Reply Quote 1
                • UnknownU
                  Unknown
                  last edited by

                  This post is deleted!
                  1 Reply Last reply Reply Quote 0
                  • UnknownU
                    Unknown @mitu
                    last edited by

                    @mitu I t appeears that "libslirp-dev" is avaliable for ubuntu.

                    @mitu said in Need help with writing install script:

                    What error do you get and where ? The depends functions looks ok, but the build part doesn't look correct - there's no melon-ds folder present in the source repository.

                    Forgive me for asking, but what would you sugguest I replace:

                    md_ret_require="$md_build/melonDS/src/frontend/libretro/melonDS_libretro.so"
                    

                    with?

                    mituM 1 Reply Last reply Reply Quote 0
                    • mituM
                      mitu Global Moderator @Unknown
                      last edited by mitu

                      @unknown said in Need help with writing install script:

                      @mitu I t appeears that "libslirp-dev" is avaliable for ubuntu.

                      Yes, but only starting with Ubuntu 20.04 and it's not available for the platform you're trying to install it (Debian Buster).

                      Forgive me for asking, but what would you sugguest I replace:

                      md_ret_require="$md_build/melonDS/src/frontend/libretro/melonDS_libretro.so"
                      

                      with?

                      Not sure what you're trying to do here - does MelonDS have a Libretro core that should appear at that location ? Because in the src/frontend folder, as present in the project's repository, there's no libretro folder.

                      My advice would be to try to compile and use the emulator without resorting to RetroPie's scriptmodules, just following the project's installation instructions. This way you can test it's working, before resolving any issues that may appear in the scriptmodule.

                      UnknownU 1 Reply Last reply Reply Quote 1
                      • UnknownU
                        Unknown @mitu
                        last edited by

                        @mitu I just relized that I wasn't cloning from the libretro core on github. Here is the current install script.

                        #!/usr/bin/env bash
                        
                        # This file is part of The RetroPie Project
                        #
                        # The RetroPie Project is the legal property of its developers, whose names are
                        # too numerous to list here. Please refer to the COPYRIGHT.md file distributed with this source.
                        #
                        # See the LICENSE.md file at the top-level directory of this distribution and
                        # at https://raw.githubusercontent.com/RetroPie/RetroPie-Setup/master/LICENSE.md
                        #
                        
                        rp_module_id="lr-melonDS"
                        rp_module_desc="NDS/DSI emu requries bios and firmware from DS/DSI port for libretro"
                        rp_module_help="ROM Extensions: .nds .zip\n\nCopy your Nintendo DS/DSI roms to $romdir/nds"
                        rp_module_licence="GPL2 https://github.com/libretro/melonDS/blob/master/LICENSE"
                        rp_module_section="exp"
                        #rp_module_flags="!all 64bit"
                        
                        function _params_lr-melonDS() {
                            local params=()
                            isPlatform "arm" && params+=("platform=armvhardfloat")
                            isPlatform "aarch64" && params+=("melonDS_JIT=0")
                            echo "${params[@]}"
                        }
                        
                        function depends_lr-melonDS() {
                            getDepends cmake libcurl4-gnutls-dev libpcap0.8-dev libsdl2-dev qtbase5-dev qtdeclarative5-dev 
                        }
                        
                        function sources_lr-melonDS() {
                            gitPullOrClone "$md_build" https://github.com/libretro/melonDS.git
                        }
                        
                        function build_lr-melonDS() {
                            cd melon-ds/src/frontend/libretro
                            make clean
                            make $(_params_lr-melonDS)
                            #md_ret_require="$md_build/melonDS/src/frontend/libretro/melonDS_libretro.so"
                        }
                        
                        function install_lr-melonDS() {
                            md_ret_files=(
                                'melonDS/src/frontend/libretro/melonDS_libretro.so'
                            )
                        }
                        
                        function configure_lr-melonDS() {
                            mkRomDir "nds"
                            ensureSystemretroconfig "nds"
                        
                            addEmulator 0 "$md_id" "nds" "$md_inst/melonDS_libretro.so"
                            addSystem "nds"
                        }
                        

                        I still have to find the melonDS_libretro.so file, but this is progress!

                        UnknownU 1 Reply Last reply Reply Quote 0
                        • UnknownU
                          Unknown @Unknown
                          last edited by

                          Here is a link to my logfile:
                          https://github.com/Python-retropie-raspberry-pi-hobby/3/blob/main/README.md

                          mituM 1 Reply Last reply Reply Quote 0
                          • mituM
                            mitu Global Moderator @Unknown
                            last edited by

                            @unknown As I said, try to install the emulator first without the RetroPie script, including compilation, and see which steps are needed to compile and configure it.

                            UnknownU 2 Replies Last reply Reply Quote 1
                            • UnknownU
                              Unknown @mitu
                              last edited by

                              @mitu I will look into that, in the meantime here is the latest version of the install script.

                              #!/usr/bin/env bash
                              
                              # This file is part of The RetroPie Project
                              #
                              # The RetroPie Project is the legal property of its developers, whose names are
                              # too numerous to list here. Please refer to the COPYRIGHT.md file distributed with this source.
                              #
                              # See the LICENSE.md file at the top-level directory of this distribution and
                              # at https://raw.githubusercontent.com/RetroPie/RetroPie-Setup/master/LICENSE.md
                              #
                              
                              rp_module_id="lr-melonDS"
                              rp_module_desc="NDS/DSI emu requries bios and firmware from DS/DSI melonDS port for libretro"
                              rp_module_help="ROM Extensions: .nds .zip\n\nCopy your Nintendo DS/DSI roms to $romdir/nds"
                              rp_module_licence="GPL2 https://github.com/libretro/melonDS/blob/master/LICENSE"
                              rp_module_section="exp"
                              rp_module_flags="!all 64bit"
                              
                              function _params_lr-melonDS() {
                                  local params=()
                                  isPlatform "arm" && params+=("platform=armvhardfloat")
                                  isPlatform "aarch64" && params+=("melonDS_JIT=0")
                                  echo "${params[@]}"
                              }
                              
                              function depends_lr-melonDS() {
                                  getDepends cmake libcurl4-gnutls-dev libpcap0.8-dev libsdl2-dev qtbase5-dev qtdeclarative5-dev 
                                  git clone https://github.com/virtualsquare/libvdeslirp.git 
                                  cd bin
                                  make -j8
                                  sudo make install
                              }
                              
                              function sources_lr-melonDS() {
                                  gitPullOrClone "$md_build" https://github.com/libretro/melonDS.git
                              }
                              
                              function build_lr-melonDS() {
                                  cd melon-ds/src/frontend/libretro
                                  make clean
                                  make $(_params_lr-melonDS)
                                  #md_ret_require="$md_build/lr-melonDS/src/frontend/libretro/melonDS_libretro.so"
                              }
                              
                              function install_lr-melonDS() {
                                  md_ret_files=(
                                      'lr-melonDS/src/frontend/libretro/melonDS_libretro.so'
                                  )
                              }
                              
                              function configure_lr-melonDS() {
                                  mkRomDir "nds"
                                  ensureSystemretroconfig "nds"
                              
                                  addEmulator 0 "$md_id" "nds" "$md_inst/melonDS_libretro.so"
                                  addSystem "nds"
                              }
                              

                              I'm getting the feeling that this emulator will not work for 32bit.

                              1 Reply Last reply Reply Quote 0
                              • UnknownU
                                Unknown @mitu
                                last edited by

                                @mitu I've located a arm64bit version, but I haven't run it yet because apparently DSI bios isn't accepted. Also here are the compiling steps.

                                #Linux:
                                
                                    Install dependencies: sudo apt install cmake libcurl4-gnutls-dev libpcap0.8-dev libsdl2-dev qt5-default libslirp-dev libarchive-dev libepoxy-dev
                                    Download the melonDS repository and prepare:
                                
                                git clone https://github.com/Arisotura/melonDS
                                cd melonDS
                                mkdir build && cd build
                                
                                   # Compile:
                                
                                mkdir -p build
                                cd build
                                cmake ..
                                make -j$(nproc --all)
                                

                                Any suggestions?

                                UnknownU 1 Reply Last reply Reply Quote 0
                                • UnknownU
                                  Unknown @Unknown
                                  last edited by

                                  ok melonDS now offers a arm64 linux build which means it should work when retropie has a 64bit version. unfortunately we will have to wait until then for DSi

                                  1 Reply Last reply Reply Quote 0
                                  • UnknownU
                                    Unknown
                                    last edited by

                                    @mitu Could you move this to “ideas and development “ please?

                                    1 Reply Last reply Reply Quote 0
                                    • First post
                                      Last post

                                    Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.

                                    Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.