76 lines
1.4 KiB
Bash
Executable File
76 lines
1.4 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
source "$(dirname $0)/../../../lib/libpmodules.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=''
|
|
pmodules.post_install() {
|
|
mkdir -p "${PREFIX}"
|
|
cp -rv "${MODULE_BUILDDIR}"/nextstep/Emacs.app "${PREFIX}"
|
|
}
|
|
;;
|
|
Linux )
|
|
# with 24.5 configure complains about missing libjpeg even it
|
|
# is installed!
|
|
configure_args='--with-jpeg=no'
|
|
;;
|
|
*)
|
|
;;
|
|
esac
|
|
|
|
pmodules.configure() {
|
|
"${MODULE_SRCDIR}"/configure \
|
|
--prefix="${PREFIX}" \
|
|
${configure_args} \
|
|
|| exit 1
|
|
install -m 0755 -d "${PREFIX}"
|
|
}
|
|
|
|
pmodules.post_install() {
|
|
if [[ -d "${MODULE_BUILDDIR}/nextstep/Emacs.app" ]]; then
|
|
cp -a "${MODULE_BUILDDIR}/nextstep/Emacs.app" "${PREFIX}"
|
|
fi
|
|
mkdir -p "${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"
|
|
}
|
|
|
|
pmodules.add_to_group 'Tools'
|
|
pmodules.set_build_dependencies ${build_dependencies}
|
|
pmodules.make_all
|
|
|