Files
MX_Pmodule/scripts/emacs.build

67 lines
1.1 KiB
Bash
Executable File

#!/bin/bash
source "$(dirname $0)/../lib/libem.bash"
module use 'Libraries'
build_dependencies="${COMPILER} libungif tiff"
case ${OS} in
Darwin )
configure_args='--with-ns'
build_dependencies="libungif tiff"
CC=''
CXX=''
COMPILER=''
COMPILER_VERSION=''
function em.post_install() {
mkdir -p "${PREFIX}"
cp -rv "${MODULE_BUILDDIR}"/nextstep/Emacs.app "${PREFIX}"
}
;;
*)
;;
esac
function em.configure() {
"${MODULE_SRCDIR}"/configure \
--prefix="${PREFIX}" \
${configure_args} \
|| exit 1
}
function em.post_install() {
mkdir "${PREFIX}/bin"
cat > "${PREFIX}/bin/Emacs" <<\EOF
#!/bin/bash
declare -r OS=$(uname -s)
if [[ "${OS}" == "Darwin" ]]; then
open "${EMACS_DIR}/Emacs.app" --args "$@"
else
"${EMACS_DIR}/bin/emacs" "$@"
fi
EOF
cat > "${PREFIX}/bin/Emacsclient" <<\EOF
#!/bin/bash
declare -r OS=$(uname -s)
if [[ "${OS}" == "Darwin" ]]; then
"${EMACS_DIR}/Emacs.app/Contents/MacOS/bin/emacsclient" -c "$@"
else
"${EMACS_DIR}/bin/emacsclient" -c "$@" &
fi
EOF
chmod 0755 "${PREFIX}/bin/Emacs"
chmod 0755 "${PREFIX}/bin/Emacsclient"
}
em.add_to_family 'Tools'
em.set_build_dependencies ${build_dependencies}
em.make_all