From 3c8e44856cda9686541d0120d32459b3517f3b00 Mon Sep 17 00:00:00 2001 From: fanta Date: Mon, 26 Sep 2022 09:18:29 +0200 Subject: [PATCH] first version ubuntu 22 --- compileMednafen.sh | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100755 compileMednafen.sh diff --git a/compileMednafen.sh b/compileMednafen.sh new file mode 100755 index 0000000..1878f88 --- /dev/null +++ b/compileMednafen.sh @@ -0,0 +1,24 @@ +#!/bin/bash +# Fanta +d="/tmp/mednafen" +rm -rf $d ; mkdir -p $d + +if [ "$(whoami)" != "root" ]; then + echo "[+] Checking root user" + echo -e "\e[31m\e[1m[NOT OK]\e[0m Run it with root please" && exit +fi + +# Ubuntu 22.04.1 LTS +cat /etc/issue | grep "Ubuntu 22.04.1 LTS" 1>/dev/null ; if [ "$?" -ne 1 ]; then + apt install -y libasound2-dev libflac-dev libsdl2-dev gcc make zlib1g-dev build-essential pkg-config + lastVersion=$(wget -q "https://mednafen.github.io/releases" -O - | tr "<" "\n" | grep -i "tar.xz" | grep -v "server" | grep -iv "unstable" | head -1 | cut -d "\"" -f 2) + lastVersionNameFile=$(echo "$lastVersion" | cut -d "/" -f 4) + lastVersionUrl="https://mednafen.github.io$lastVersion" + wget -q "$lastVersionUrl" -O $d/$lastVersionNameFile + cd $d + tar xfvJ $lastVersionNameFile + cd mednafen + ./configure --enable-debugger + make -j$(nproc) + make install +fi