Reading the Haskel School of Music I was trying to install the needed packages: Euterpea, HSoM
and UISF
.
I’ve installed all the Haskell toolchain from fresh through ghcup
. Installing Euterpea with cabal v2-install --allow-newer --lib
was successful. But when trying to compile HSoM same way it gives an error:
Cloning into 'HSoM'...
Wrote tarball sdist to /app/HSoM/dist-newstyle/sdist/HSoM-1.0.0.tar.gz
Resolving dependencies...
Error: cabal: Could not resolve dependencies:
[__0] next goal: Euterpea (user goal)
[__0] rejecting: Euterpea-2.0.7, Euterpea-2.0.6, Euterpea-2.0.5,
Euterpea-2.0.4, Euterpea-2.0.3, Euterpea-2.0.2, Euterpea-2.0.1,
Euterpea-2.0.0, Euterpea-1.1.1, Euterpea-1.1.0, Euterpea-1.0.0 (constraint
from user target requires ==2.0.8)
[__0] fail (backjumping, conflict set: Euterpea)
After searching the rest of the dependency tree exhaustively, these were the
goals I've had most trouble fulfilling: Euterpea
My guess is that Euterpea is installed and loaded for ghc
, but not for cabal
$ cabal list --installed | awk '/^\* Euterpea$/,/^$/'
* Euterpea
Synopsis: Library for computer music research and education
Default available version: 2.0.7
Installed versions: 2.0.8
Homepage: http://www.euterpea.com
License: BSD3
$ cabal list Euterpea # I don't get why it says "Not Installed"
* Euterpea
Synopsis: Library for computer music research and education
Default available version: 2.0.7
Installed versions: [ Not installed ]
Homepage: http://www.euterpea.com
License: BSD3
$ ghc-pkg list Euterpea
/opt/ghc/9.4.5/lib/ghc-9.4.5/lib/package.conf.d
(no packages)
/root/.ghc/x86_64-linux-9.4.5/package.conf.d
Euterpea-2.0.8
I’ve double-checked that the versions of ghc
, ghci
and ghc-pkg
matched. As a note, I can import FRP.UISF
which I installed running cabal install --lib UISF
. For reproducibility, I wrote this Dockerfile
. Copy the contents locally and you can test the Dockerfile
by:
docker build -t euterpea .
docker run -it euterpea
# Base image with GHC and required dependencies
FROM haskell:latest
# Install system-level dependencies
RUN apt-get update && apt-get install -y \
libgmp-dev \
fluidsynth \
ffmpeg \
alsa-utils \
libasound2-dev
# Set the working directory
WORKDIR /app
RUN cabal update
# HSoM depends on Euterpea and UISF
RUN apt-get install -y \
libghc-openglraw-dev \
libghc-gluraw-dev \
&& cabal install --lib UISF
# Clone and install Euterpea2
RUN git clone https://github.com/Euterpea/Euterpea2.git \
&& cd Euterpea2 \
&& cabal v2-install --allow-newer --lib
# Clone and install HSoM
RUN git clone https://github.com/Euterpea/HSoM.git \
&& cd HSoM; mv readme.txt ReadMe.txt \
&& cabal v1-install --allow-newer
# Set the command to start the server or run other application
CMD ["/bin/bash"]