Rockbox open source high quality audio player as a Music Player Daemon
mpris rockbox mpd libadwaita audio rust zig deno
2
fork

Configure Feed

Select the types of activity you want to include in your feed.

add install script

+262
+16
README.md
··· 48 48 make zig 49 49 ``` 50 50 51 + ## ๐Ÿšš Installation 52 + 53 + with `curl` (Ubuntu/Debian): 54 + 55 + ```sh 56 + curl -fsSL https://raw.githubusercontent.com/tsirysndr/rockbox-zig/HEAD/install.sh | bash 57 + ``` 58 + 59 + MacOS, currently not supported, but you can run in a docker container. 60 + 61 + 62 + ## ๐Ÿ“ฆ Downloads 63 + 64 + - `Linux`: intel: [rockbox_2024.10.30_x86_64-linux.tar.gz](https://github.com/tsirysndr/rockbox-zig/releases/download/2024.10.30/rockbox_2024.10.30_x86_64-linux.tar.gz) arm64: [rockbox_2024.10.30_aarch64-linux.tar.gz](https://github.com/tsirysndr/rockbox-zig/releases/download/2024.10.30/rockbox_2024.10.30_aarch64-linux.tar.gz) 65 + 66 + 51 67 ## โœจ Features 52 68 53 69 - [x] Zig Build System
+246
install.sh
··· 1 + #!/bin/bash 2 + 3 + set -e -o pipefail 4 + 5 + readonly MAGENTA="$(tput setaf 5 2>/dev/null || echo '')" 6 + readonly GREEN="$(tput setaf 2 2>/dev/null || echo '')" 7 + readonly CYAN="$(tput setaf 6 2>/dev/null || echo '')" 8 + readonly ORANGE="$(tput setaf 3 2>/dev/null || echo '')" 9 + readonly NO_COLOR="$(tput sgr0 2>/dev/null || echo '')" 10 + 11 + if ! command -v curl >/dev/null 2>&1; then 12 + echo "Error: curl is required to install Rockbox." 13 + exit 1 14 + fi 15 + 16 + if ! command -v tar >/dev/null 2>&1; then 17 + echo "Error: tar is required to install Rockbox." 18 + exit 1 19 + fi 20 + 21 + export PATH="$HOME/.local/bin:$PATH" 22 + 23 + # Define the release information 24 + RELEASE_URL="https://api.github.com/repos/tsirysndr/rockbox-zig/releases/latest" 25 + 26 + ASSET_NAME="" 27 + 28 + function detect_os() { 29 + # Determine the operating system 30 + OS=$(uname -s) 31 + if [ "$OS" = "Linux" ]; then 32 + # Determine the CPU architecture 33 + ARCH=$(uname -m) 34 + if [ "$ARCH" = "aarch64" ]; then 35 + ASSET_NAME="_aarch64-linux.tar.gz" 36 + elif [ "$ARCH" = "x86_64" ]; then 37 + ASSET_NAME="_x86_64-linux.tar.gz" 38 + else 39 + echo "Unsupported architecture: $ARCH" 40 + exit 1 41 + fi 42 + else 43 + echo "Unsupported operating system: $OS" 44 + exit 1 45 + fi; 46 + } 47 + 48 + # Install Rockbox CLI 49 + 50 + detect_os 51 + 52 + # Retrieve the download URL for the desired asset 53 + DOWNLOAD_URL=$(curl -sSL "$RELEASE_URL" | grep -o "browser_download_url.*rockbox_.*$ASSET_NAME\"" | cut -d ' ' -f 2) 54 + 55 + ASSET_NAME=$(basename $DOWNLOAD_URL) 56 + 57 + INSTALL_DIR="$HOME/.local/bin" 58 + 59 + DOWNLOAD_URL=`echo $DOWNLOAD_URL | tr -d '\"'` 60 + 61 + # Download the asset 62 + curl -SL $DOWNLOAD_URL -o /tmp/$ASSET_NAME 63 + 64 + # Extract the asset 65 + tar -xzf /tmp/$ASSET_NAME -C /tmp 66 + 67 + # Set the correct permissions for the binary 68 + chmod +x /tmp/rockbox 69 + 70 + mv /tmp/rockbox $INSTALL_DIR 71 + 72 + if command -v apt-get >/dev/null 2>&1; then 73 + if command -v sudo >/dev/null 2>&1; then 74 + sudo apt-get install -y libusb-dev \ 75 + libsdl1.2-dev \ 76 + libfreetype6 \ 77 + libunwind-dev \ 78 + alsa-utils \ 79 + libasound2 80 + else 81 + apt-get install -y libusb-dev \ 82 + libsdl1.2-dev \ 83 + libfreetype6 \ 84 + libunwind-dev \ 85 + alsa-utils \ 86 + libasound2 87 + fi 88 + elif command -v pacman >/dev/null 2>&1; then 89 + if command -v sudo >/dev/null 2>&1; then 90 + sudo pacman -S --noconfirm libusb \ 91 + sdl \ 92 + freetype2 \ 93 + libunwind \ 94 + alsa-lib 95 + else 96 + pacman -S --noconfirm libusb \ 97 + sdl \ 98 + freetype2 \ 99 + libunwind \ 100 + alsa-lib 101 + fi 102 + elif command -v dnf >/dev/null 2>&1; then 103 + if command -v sudo >/dev/null 2>&1; then 104 + sudo dnf install -y libusb \ 105 + SDL \ 106 + freetype \ 107 + libunwind \ 108 + alsa-lib 109 + else 110 + dnf install -y libusb \ 111 + SDL \ 112 + freetype \ 113 + libunwind \ 114 + alsa-lib 115 + fi 116 + elif command -v zypper >/dev/null 2>&1; then 117 + if command -v sudo >/dev/null 2>&1; then 118 + sudo zypper install -y libusb-1_0-0 \ 119 + libSDL-1_2-0 \ 120 + freetype2 \ 121 + libunwind \ 122 + alsa 123 + else 124 + zypper install -y libusb-1_0-0 \ 125 + libSDL-1_2-0 \ 126 + freetype2 \ 127 + libunwind \ 128 + alsa 129 + fi 130 + elif command -v apk >/dev/null 2>&1; then 131 + if command -v sudo >/dev/null 2>&1; then 132 + sudo apk add libusb \ 133 + sdl \ 134 + freetype \ 135 + libunwind \ 136 + alsa-lib 137 + else 138 + apk add libusb \ 139 + sdl \ 140 + freetype \ 141 + libunwind \ 142 + alsa-lib 143 + fi 144 + fi 145 + 146 + # Install Rockbox daemon 147 + 148 + detect_os 149 + 150 + DOWNLOAD_URL=$(curl -sSL $RELEASE_URL | grep -o "browser_download_url.*rockboxd_.*$ASSET_NAME\"" | cut -d ' ' -f 2) 151 + 152 + ASSET_NAME=$(basename $DOWNLOAD_URL) 153 + 154 + DOWNLOAD_URL=`echo $DOWNLOAD_URL | tr -d '\"'` 155 + 156 + # Download the asset 157 + curl -SL $DOWNLOAD_URL -o /tmp/$ASSET_NAME 158 + 159 + # Extract the asset 160 + tar -xzf /tmp/$ASSET_NAME -C /tmp 161 + 162 + # Set the correct permissions for the binary 163 + chmod +x /tmp/rockboxd 164 + 165 + mv /tmp/rockboxd $INSTALL_DIR 166 + 167 + # Install Rockbox assets 168 + 169 + detect_os 170 + 171 + ASSET_NAME=$(echo $ASSET_NAME | sed 's/_x86_64/-x86_64/') 172 + ASSET_NAME=$(echo $ASSET_NAME | sed 's/_aarch64/-aarch64/') 173 + 174 + DOWNLOAD_URL=$(curl -sSL $RELEASE_URL | grep -o "browser_download_url.*rockbox-assets.*$ASSET_NAME\"" | cut -d ' ' -f 2) 175 + 176 + ASSET_NAME=$(basename $DOWNLOAD_URL) 177 + 178 + DOWNLOAD_URL=`echo $DOWNLOAD_URL | tr -d '\"'` 179 + 180 + # Download the asset 181 + curl -SL $DOWNLOAD_URL -o /tmp/$ASSET_NAME 182 + 183 + 184 + # Extract the asset 185 + mkdir -p /tmp/rockbox-assets 186 + tar -xzf /tmp/$ASSET_NAME -C /tmp/rockbox-assets 187 + 188 + mkdir -p $INSTALL_DIR/../share/rockbox 189 + cp -r /tmp/rockbox-assets/* $INSTALL_DIR/../share/rockbox 190 + 191 + # Install Rockbox Codecs 192 + 193 + detect_os 194 + 195 + ASSET_NAME=$(echo $ASSET_NAME | sed 's/_x86_64/-x86_64/') 196 + ASSET_NAME=$(echo $ASSET_NAME | sed 's/_aarch64/-aarch64/') 197 + 198 + DOWNLOAD_URL=$(curl -sSL $RELEASE_URL | grep -o "browser_download_url.*rockbox-codecs.*$ASSET_NAME\"" | cut -d ' ' -f 2) 199 + 200 + ASSET_NAME=$(basename $DOWNLOAD_URL) 201 + 202 + DOWNLOAD_URL=`echo $DOWNLOAD_URL | tr -d '\"'` 203 + 204 + # Download the asset 205 + curl -SL $DOWNLOAD_URL -o /tmp/$ASSET_NAME 206 + 207 + # Extract the asset 208 + tar -xzf /tmp/$ASSET_NAME -C /tmp 209 + 210 + mkdir -p $INSTALL_DIR/../lib/rockbox 211 + cp -r /tmp/codecs $INSTALL_DIR/../lib/rockbox 212 + cp -r /tmp/rocks $INSTALL_DIR/../lib/rockbox 213 + 214 + # detect if user can run rockboxd, if not add $HOME/.local/bin to PATH 215 + if ! command -v rockboxd >/dev/null 2>&1; then 216 + echo "export PATH=\"\$HOME/.local/bin:\$PATH\"" >> $HOME/.bashrc 217 + export PATH="$HOME/.local/bin:$PATH" 218 + fi 219 + 220 + cat <<EOF 221 + ${ORANGE} 222 + __________ __ ___. 223 + Open \______ \ ____ ____ | | _\_ |__ _______ ___ 224 + Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / 225 + Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < 226 + Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \\ 227 + \/ \/ \/ \/ \/ 228 + ${NO_COLOR} 229 + Welcome to Rockbox Zig! ๐Ÿš€ 230 + A fork of the original Rockbox project, with a focus on modernization and more features. 231 + 232 + ${GREEN}https://github.com/tsirysndr/rockbox-zig${NO_COLOR} 233 + 234 + Please file an issue if you encounter any problems! 235 + 236 + =============================================================================== 237 + 238 + Installation completed! ๐ŸŽ‰ 239 + 240 + To get started, run: 241 + 242 + ${CYAN}rockbox start${NO_COLOR} 243 + 244 + Stuck? Join our Discord ${MAGENTA}https://discord.gg/tXPrgcPKSt${NO_COLOR} 245 + 246 + EOF