termux-packages/scripts/build/haskell-build/termux_create_haskell_debscripts.sh
Aditya Alok dc2474b2c2 feat(ghc): enable cross-compiling haskell packages on CI
- `termux_setup_ghc_cross_compiler` should not be called by build.sh, as it installs cross-compiler
in $TERMUX_PREFIX (otherwise ghc adds wrong `rpaths` to built libs and executables)

Signed-off-by: Aditya Alok <dev.aditya.alok@gmail.com>
2022-03-09 10:01:57 +09:00

18 lines
480 B
Bash

termux_create_haskell_debscripts() {
if [ "${TERMUX_PKG_IS_HASKELL_LIB}" = true ]; then
cat <<-EOF >./postinst
#!${TERMUX_PREFIX}/bin/sh
sh ${TERMUX_PREFIX}/share/haskell/register/${TERMUX_PKG_NAME}.sh
EOF
cat <<-EOF >./prerm
#!${TERMUX_PREFIX}/bin/sh
if [ "${TERMUX_PACKAGE_FORMAT}" = "pacman" ] || [ "\$1" = "remove" ] || [ "\$1" = "update" ]; then
sh ${TERMUX_PREFIX}/share/haskell/unregister/${TERMUX_PKG_NAME}.sh
fi
EOF
else
return 0
fi
}