2010-12-12 01:28:11 +02:00
|
|
|
#
|
|
|
|
# Copyright (C) David Kuehling <dvdkhlng TA gmx TOD de>
|
|
|
|
#
|
2010-12-18 21:35:36 +02:00
|
|
|
# License GPLv2 or later. NO WARRANTY.
|
2010-12-12 01:28:11 +02:00
|
|
|
#
|
2010-12-18 21:35:36 +02:00
|
|
|
# OpenWRT package for the complete GNU Emacs editor
|
2010-12-14 23:29:12 +02:00
|
|
|
|
2010-12-12 01:28:11 +02:00
|
|
|
include $(TOPDIR)/rules.mk
|
|
|
|
|
|
|
|
PKG_NAME:=emacs
|
|
|
|
PKG_VERSION:=23.2
|
2011-02-26 14:08:21 +02:00
|
|
|
PKG_RELEASE:=4
|
2010-12-12 01:28:11 +02:00
|
|
|
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
|
|
|
PKG_SOURCE_URL:=ftp://ftp.fu-berlin.de/pub/gnu/emacs/ \
|
|
|
|
@GNU/emacs/
|
|
|
|
|
|
|
|
PKG_MD5SUM:=b6691852dae0bc142b3c12749f6b7ade
|
|
|
|
PKG_INSTALL:=1
|
2011-02-28 23:11:54 +02:00
|
|
|
|
2010-12-12 01:28:11 +02:00
|
|
|
PKG_FIXUP:=libtool
|
2011-02-28 23:11:54 +02:00
|
|
|
PKG_REMOVE_FILES:=
|
2010-12-12 01:28:11 +02:00
|
|
|
|
2011-02-28 23:11:54 +02:00
|
|
|
PKG_BUILD_DEPENDS:= emacs/host
|
2010-12-12 01:28:11 +02:00
|
|
|
|
|
|
|
include $(INCLUDE_DIR)/host-build.mk
|
|
|
|
include $(INCLUDE_DIR)/package.mk
|
|
|
|
|
2010-12-12 13:46:54 +02:00
|
|
|
define Package/emacs/Default
|
|
|
|
SUBMENU:=Emacs
|
2010-12-12 01:28:11 +02:00
|
|
|
SECTION:=utils
|
|
|
|
CATEGORY:=Utilities
|
2010-12-18 21:35:36 +02:00
|
|
|
TITLE:=The GNU Emacs Editor a.k.a. \"Emacs OS\"
|
2010-12-12 01:28:11 +02:00
|
|
|
URL:=http://www.gnu.org/software/emacs/
|
2010-12-12 13:46:54 +02:00
|
|
|
# SUBMENU:=Editors
|
2010-12-12 01:28:11 +02:00
|
|
|
endef
|
|
|
|
|
2010-12-12 13:46:54 +02:00
|
|
|
define Package/emacs/Default/description
|
2010-12-12 01:28:11 +02:00
|
|
|
GNU Emacs is an extensible, customizable text editor — and more.
|
|
|
|
At its core is an interpreter for Emacs Lisp, a dialect of the
|
|
|
|
Lisp programming language with extensions to support text editing.
|
|
|
|
endef
|
|
|
|
|
2010-12-18 21:35:36 +02:00
|
|
|
define Package/emacs
|
2010-12-14 09:57:03 +02:00
|
|
|
$(call Package/emacs/Default)
|
2010-12-12 13:46:54 +02:00
|
|
|
DEPENDS:=+libncurses +emacs-data
|
|
|
|
TITLE+= (executable)
|
|
|
|
endef
|
|
|
|
|
2010-12-18 21:35:36 +02:00
|
|
|
define Package/emacs/description
|
2010-12-12 13:46:54 +02:00
|
|
|
$(call Package/emacs/Default/description)
|
|
|
|
This package contains the Emacs executable files
|
|
|
|
endef
|
2010-12-12 01:28:11 +02:00
|
|
|
|
2010-12-12 13:46:54 +02:00
|
|
|
define Package/emacs-data
|
2010-12-14 09:57:03 +02:00
|
|
|
$(call Package/emacs/Default)
|
2010-12-12 13:46:54 +02:00
|
|
|
TITLE+= (compiled lisp)
|
|
|
|
endef
|
2010-12-12 01:28:11 +02:00
|
|
|
|
2010-12-12 13:46:54 +02:00
|
|
|
define Package/emacs-data/description
|
|
|
|
$(call Package/emacs/Default/description)
|
|
|
|
This package contains the compiled Lisp files needed to run Emacs.
|
|
|
|
endef
|
|
|
|
|
2010-12-14 09:57:03 +02:00
|
|
|
define Package/emacs-ja-dic
|
|
|
|
$(call Package/emacs/Default)
|
|
|
|
TITLE+= (japanese input dictionary)
|
2010-12-18 21:35:36 +02:00
|
|
|
DEPENDS:=+emacs
|
2010-12-14 09:57:03 +02:00
|
|
|
endef
|
|
|
|
|
|
|
|
define Package/emacs-ja-dic/description
|
|
|
|
$(call Package/emacs/Default/description)
|
|
|
|
This package contains the japanese dictionary used to input japanese Kanji
|
|
|
|
via Hiragana->Kanji conversion (\'set-input-method japanese\'). This
|
2010-12-14 10:08:53 +02:00
|
|
|
dictionary is huge, so huge that emacs won\'t be able to load it on systems
|
2010-12-14 09:57:03 +02:00
|
|
|
with 32MB or fewer RAM.
|
|
|
|
endef
|
|
|
|
|
2010-12-12 13:46:54 +02:00
|
|
|
define Package/emacs-el
|
2010-12-14 09:57:03 +02:00
|
|
|
$(call Package/emacs/Default)
|
2010-12-12 13:46:54 +02:00
|
|
|
TITLE+= (lisp source)
|
|
|
|
endef
|
2010-12-12 01:28:11 +02:00
|
|
|
|
2010-12-12 13:46:54 +02:00
|
|
|
define Package/emacs-el/description
|
|
|
|
$(call Package/emacs/Default/description)
|
|
|
|
This package contains the Lisp source files of Emacs that can queried via
|
|
|
|
C-h f in case provided documentation of an Emacs function is insufficient.
|
|
|
|
endef
|
2010-12-12 01:28:11 +02:00
|
|
|
|
2010-12-16 01:36:49 +02:00
|
|
|
EMACS_STRIPTEASE_ARGS = \
|
|
|
|
--without-x \
|
|
|
|
--without-xpm \
|
|
|
|
--without-jpeg \
|
|
|
|
--without-gif \
|
|
|
|
--without-png \
|
|
|
|
--without-rsvg \
|
|
|
|
--without-xft \
|
|
|
|
--without-libotf \
|
|
|
|
--without-dbus \
|
2011-02-26 14:08:21 +02:00
|
|
|
--without-gconf \
|
|
|
|
--without-gpm \
|
|
|
|
--without-sound
|
2010-12-16 01:36:49 +02:00
|
|
|
|
|
|
|
HOST_CONFIGURE_ARGS += $(EMACS_STRIPTEASE_ARGS)
|
|
|
|
CONFIGURE_ARGS += $(EMACS_STRIPTEASE_ARGS)
|
2010-12-18 21:35:36 +02:00
|
|
|
MAKE_FLAGS += "LD=$(TARGET_CROSS)gcc"
|
2010-12-16 01:36:49 +02:00
|
|
|
|
|
|
|
## Don't try that: lowering PURESIZE makes Emacs' RAM usage explode! Maybe
|
|
|
|
## something about Elisp garbage collection!?
|
|
|
|
#TARGET_CPPFLAGS += -DPURESIZE=16
|
2010-12-12 01:28:11 +02:00
|
|
|
|
2010-12-18 21:35:36 +02:00
|
|
|
## Keep emacs build system from doing all kinds nasty tricks that won't work
|
|
|
|
## (well) with openwrt and uclibc. Especially keep it from attempting to
|
|
|
|
## manually configure crt* startup file linking. We won't be able to 'dump'
|
|
|
|
## during cross-compile anyway. Dumping inside the target system seems not
|
|
|
|
## possible due to lack of RAM. Note that we also need to sanitize the
|
|
|
|
## Makefile using 'sed' below.
|
|
|
|
TARGET_CPPFLAGS += -DCANNOT_DUMP -DNO_REMAP -DORDINARY_LINK
|
|
|
|
|
2010-12-12 01:28:11 +02:00
|
|
|
define Build/Prepare
|
|
|
|
$(call Build/Prepare/Default)
|
|
|
|
endef
|
|
|
|
|
|
|
|
define Host/Configure
|
|
|
|
$(call Host/Configure/Default)
|
|
|
|
endef
|
|
|
|
|
|
|
|
## On the host, we only compile and install minimum Emacs components used for
|
|
|
|
## bootstrapping
|
|
|
|
define Host/Compile
|
|
|
|
export LD_LIBRARY_PATH=$(STAGING_DIR_HOST)/lib; \
|
2010-12-14 23:06:38 +02:00
|
|
|
$(call Host/Compile/Default)
|
2010-12-12 01:28:11 +02:00
|
|
|
endef
|
|
|
|
|
|
|
|
define Host/Install
|
2010-12-14 23:06:38 +02:00
|
|
|
$(call Host/Install/Default)
|
2010-12-12 01:28:11 +02:00
|
|
|
$(INSTALL_BIN) $(HOST_BUILD_DIR)/lib-src/make-docfile $(STAGING_DIR_HOST)/bin/emacs-make-docfile
|
|
|
|
$(INSTALL_BIN) $(HOST_BUILD_DIR)/src/prefix-args $(STAGING_DIR_HOST)/bin/emacs-prefix-args
|
|
|
|
endef
|
|
|
|
|
|
|
|
define Build/Configure
|
|
|
|
$(call Build/Configure/Default)
|
|
|
|
endef
|
|
|
|
|
|
|
|
define Build/Compile
|
|
|
|
$(call Build/Compile/Default, -C lib-src -o test-distrib)
|
|
|
|
ln -sf $(STAGING_DIR_HOST)/bin/emacs-make-docfile $(PKG_BUILD_DIR)/lib-src/make-docfile
|
|
|
|
ln -sf $(STAGING_DIR_HOST)/bin/emacs-prefix-args $(PKG_BUILD_DIR)/src/prefix-args
|
2010-12-18 21:35:36 +02:00
|
|
|
sed -ie 's;\(TEMACS_LDFLAGS\|STARTFILES\) =.*;\1 =;' $(PKG_BUILD_DIR)/src/Makefile
|
|
|
|
# sed -ie 's; /usr/lib/crt[^ ]\+; $(TOOLCHAIN_DIR)/usr/lib/crt;g' $(PKG_BUILD_DIR)/src/Makefile
|
|
|
|
sed -ie 's; /usr/lib/crt[^ ]\+; ;g' $(PKG_BUILD_DIR)/src/Makefile
|
2010-12-12 13:46:54 +02:00
|
|
|
sed -ie 's;\(#.*PATH_DUMPLOADSEARCH\).*$$$$;\1 PATH_LOADSEARCH;' $(PKG_BUILD_DIR)/src/epaths.h
|
2010-12-12 01:28:11 +02:00
|
|
|
$(call Build/Compile/Default, -C src -o lib-src -o prefix-args -o ../lib-src/make-docfile temacs ../etc/DOC)
|
|
|
|
cp -v $(PKG_BUILD_DIR)/src/temacs $(PKG_BUILD_DIR)/src/emacs
|
|
|
|
$(call Build/Compile/Default, -C lisp EMACS=$(STAGING_DIR_HOST)/bin/emacs)
|
|
|
|
$(call Build/Compile/Default, -C leim BUILT-EMACS=$(STAGING_DIR_HOST)/bin/emacs)
|
|
|
|
endef
|
|
|
|
|
|
|
|
define Build/Install
|
2010-12-18 21:35:36 +02:00
|
|
|
sed -ie 's;./src/emacs\( --version\);$(STAGING_DIR_HOST)/bin/emacs \1;g' \
|
|
|
|
$(PKG_BUILD_DIR)/Makefile
|
2011-01-25 07:39:17 +02:00
|
|
|
$(call Build/Install/Default,install-arch-indep install-arch-dep install-leim INSTALL_STRIP="" "MFLAGS=-o test-distrib")
|
2010-12-14 09:57:03 +02:00
|
|
|
$(INSTALL_DATA) ./files/site-start.el $(PKG_INSTALL_DIR)/usr/share/emacs/$(PKG_VERSION)/site-lisp
|
2010-12-12 01:28:11 +02:00
|
|
|
endef
|
|
|
|
|
2010-12-18 21:35:36 +02:00
|
|
|
define Package/emacs/install
|
2010-12-12 13:46:54 +02:00
|
|
|
$(INSTALL_DIR) $(1)/usr
|
|
|
|
cp -r $(PKG_INSTALL_DIR)/usr/{bin,lib} $(1)/usr
|
|
|
|
endef
|
|
|
|
|
|
|
|
define Package/emacs-data/install
|
2010-12-18 21:35:36 +02:00
|
|
|
$(INSTALL_DIR) $(1)/
|
|
|
|
(cd $(PKG_INSTALL_DIR)/ && \
|
2010-12-12 13:46:54 +02:00
|
|
|
tar -cf - --exclude "*.el.gz" \
|
|
|
|
--exclude "images" \
|
|
|
|
--exclude "refcards" \
|
|
|
|
--exclude "schema" \
|
|
|
|
--exclude "NEWS*" \
|
2010-12-14 09:57:03 +02:00
|
|
|
--exclude "ja-dic" \
|
2010-12-18 22:01:50 +02:00
|
|
|
usr/share) \
|
2010-12-18 21:35:36 +02:00
|
|
|
| (cd $(1)/ && tar -xvf -)
|
2010-12-12 13:46:54 +02:00
|
|
|
endef
|
|
|
|
|
2010-12-14 09:57:03 +02:00
|
|
|
define Package/emacs-ja-dic/install
|
|
|
|
$(INSTALL_DIR) $(1)/usr
|
|
|
|
(cd $(PKG_INSTALL_DIR)/usr && tar -cf - \
|
|
|
|
--exclude "*.el.gz" share/emacs/$(PKG_VERSION)/leim/ja-dic) \
|
|
|
|
| (cd $(1)/usr && tar -xvf -)
|
|
|
|
endef
|
|
|
|
|
2010-12-12 13:46:54 +02:00
|
|
|
define Package/emacs-el/install
|
2010-12-12 01:28:11 +02:00
|
|
|
$(INSTALL_DIR) $(1)/usr
|
2010-12-14 23:06:38 +02:00
|
|
|
(cd $(PKG_INSTALL_DIR)/usr && find share -name "*.el.gz" \
|
|
|
|
| tar -cf - -T - --exclude "ja-dic" ) \
|
|
|
|
| (cd $(1)/usr && tar -xvf -)
|
2010-12-12 01:28:11 +02:00
|
|
|
endef
|
|
|
|
|
2010-12-14 09:57:03 +02:00
|
|
|
|
2010-12-12 01:28:11 +02:00
|
|
|
$(eval $(call HostBuild))
|
2010-12-18 21:35:36 +02:00
|
|
|
$(eval $(call BuildPackage,emacs))
|
2010-12-12 13:46:54 +02:00
|
|
|
$(eval $(call BuildPackage,emacs-data))
|
2010-12-14 09:57:03 +02:00
|
|
|
$(eval $(call BuildPackage,emacs-ja-dic))
|
2010-12-12 13:46:54 +02:00
|
|
|
$(eval $(call BuildPackage,emacs-el))
|
2010-12-12 01:28:11 +02:00
|
|
|
|
2010-12-14 09:57:03 +02:00
|
|
|
|
2010-12-12 01:28:11 +02:00
|
|
|
# The following comments configure the Emacs editor. Just ignore them.
|
|
|
|
# Local Variables:
|
2010-12-16 01:36:49 +02:00
|
|
|
# compile-command: "make -C ~/h/src/qi/openwrt-xburst package/emacs/compile -j2 V=99"
|
2010-12-12 01:28:11 +02:00
|
|
|
# End:
|