
Hi, Does anyone know how to generate a text file in a Cabal package? E.g. I want cabal to install a text file into $share_dir/applications/ app.desktop, and fill in certain fragments of this file with paths depending of the $share_dir variable. Say: ==============Yi.desktop template================== [Desktop Entry] Name=Yi Text Editor Comment=Edit text files, and add configuration in Haskell Comment[en_CA]=Edit text files, and configure editor in Haskell Comment[en_GB]=Edit text files, and configure editor in Haskell Comment[pl]=Edytor plików tekstowych z konfiguracją w Haskellu TryExec=$yi_bindir/bin/ yi Exec=$yi_bindir/bin/yi -f %F Terminal=true Type=Application Icon=$yi_sharedir/share/art/yi +lambda.svg Categories=Utility;TextEditor; StartupNotify=false MimeType=text/plain; =============================================== Sorry I couldn't find it in Cabal documentation. -- Best regards Michal

Hello Michał You should be able to run arbitrary code during build/installation by changing main in Setup.hs to use defaultMainWithHooks then supplying your own UserHooks main = defaultMainWithHooks my_hooks my_hooks :: UserHooks my_hooks = ... Best wishes Stephen
participants (2)
-
Michał J Gajda
-
Stephen Tetley