diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index ff58994db..c72587489 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -56,10 +56,11 @@ ], // Use 'postCreateCommand' to run commands after the container is created. // "postCreateCommand": "make setup-dev", + "postCreateCommand": "bash .devcontainer/install-taglib.sh", // Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root. "remoteUser": "vscode", "remoteEnv": { "ND_MUSICFOLDER": "./music", "ND_DATAFOLDER": "./data" } -} +} \ No newline at end of file diff --git a/.devcontainer/install-taglib.sh b/.devcontainer/install-taglib.sh new file mode 100644 index 000000000..e71c46158 --- /dev/null +++ b/.devcontainer/install-taglib.sh @@ -0,0 +1,30 @@ +#!/bin/bash +set -e + +# 1. Detect Architecture +ARCH=$(dpkg --print-architecture) +TAGLIB_VERSION="v2.1.1-1" + +case $ARCH in + "amd64") + DOWNLOAD_ARCH="linux-amd64" + ;; + "arm64") + DOWNLOAD_ARCH="linux-arm64" + ;; + *) + echo "Unsupported architecture: $ARCH" + exit 1 + ;; +esac + +URL="https://github.com/navidrome/cross-taglib/releases/download/${TAGLIB_VERSION}/taglib-${DOWNLOAD_ARCH}.tar.gz" + +echo "Downloading TagLib for ${ARCH} from ${URL}" + +wget "$URL" -O /tmp/cross-taglib.tar.gz +sudo tar -xzf /tmp/cross-taglib.tar.gz -C /usr --strip-components=1 +sudo mv /usr/include/taglib/* /usr/include +sudo rm /tmp/cross-taglib.tar.gz /usr/provenance.json + +echo "TagLib installation complete" \ No newline at end of file