Root/emacs/Makefile

1#
2# Copyright (C) David Kuehling <dvdkhlng TA gmx TOD de>
3#
4# License GPLv2 or later.
5#
6include $(TOPDIR)/rules.mk
7
8PKG_NAME:=emacs
9PKG_VERSION:=23.2
10PKG_RELEASE:=1
11PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
12PKG_SOURCE_URL:=ftp://ftp.fu-berlin.de/pub/gnu/emacs/ \
13    @GNU/emacs/
14
15PKG_MD5SUM:=b6691852dae0bc142b3c12749f6b7ade
16PKG_INSTALL:=1
17PKG_FIXUP:=libtool
18
19PKG_BUILD_DEPENDS:= emacs/host libtool/host
20
21include $(INCLUDE_DIR)/host-build.mk
22include $(INCLUDE_DIR)/package.mk
23
24define Package/emacs/Default
25  SUBMENU:=Emacs
26  SECTION:=utils
27  CATEGORY:=Utilities
28  TITLE:=The GNU Emacs Self-Documenting, Extensible Editor
29  URL:=http://www.gnu.org/software/emacs/
30# SUBMENU:=Editors
31endef
32
33define Package/emacs/Default/description
34GNU Emacs is an extensible, customizable text editor — and more.
35At its core is an interpreter for Emacs Lisp, a dialect of the
36Lisp programming language with extensions to support text editing.
37endef
38
39define Package/emacs-bin
40$(call Package/emacs/Default)
41  DEPENDS:=+libncurses +emacs-data
42  TITLE+= (executable)
43endef
44
45define Package/emacs-bin/description
46$(call Package/emacs/Default/description)
47 This package contains the Emacs executable files
48endef
49
50define Package/emacs-data
51$(call Package/emacs/Default)
52  TITLE+= (compiled lisp)
53endef
54
55define Package/emacs-data/description
56$(call Package/emacs/Default/description)
57 This package contains the compiled Lisp files needed to run Emacs.
58endef
59
60define Package/emacs-ja-dic
61$(call Package/emacs/Default)
62  TITLE+= (japanese input dictionary)
63endef
64
65define Package/emacs-ja-dic/description
66$(call Package/emacs/Default/description)
67 This package contains the japanese dictionary used to input japanese Kanji
68 via Hiragana->Kanji conversion (\'set-input-method japanese\'). This
69 dictionary is huge, so huge that emacs won\'t be able to load it on systems
70 with 32MB or fewer RAM.
71endef
72
73define Package/emacs-el
74$(call Package/emacs/Default)
75  TITLE+= (lisp source)
76endef
77
78define Package/emacs-el/description
79$(call Package/emacs/Default/description)
80 This package contains the Lisp source files of Emacs that can queried via
81 C-h f in case provided documentation of an Emacs function is insufficient.
82endef
83
84HOST_CONFIGURE_ARGS += --without-x
85CONFIGURE_ARGS += --without-x
86MAKE_FLAGS += "LD=$(TARGET_CROSS)gcc -nostdlib"
87
88define Build/Prepare
89    $(call Build/Prepare/Default)
90endef
91
92define Host/Configure
93    $(call Host/Configure/Default)
94endef
95
96## On the host, we only compile and install minimum Emacs components used for
97## bootstrapping
98define Host/Compile
99    export LD_LIBRARY_PATH=$(STAGING_DIR_HOST)/lib; \
100    $(call Host/Compile/Default, lib-src)
101    $(call Host/Compile/Default, -C src temacs emacs)
102endef
103
104define Host/Install
105    export LD_LIBRARY_PATH=$(STAGING_DIR_HOST)/lib; \
106    $(INSTALL_DIR) $(STAGING_DIR_HOST)/bin
107    $(INSTALL_DIR) $(STAGING_DIR_HOST)/lib
108    $(INSTALL_BIN) $(HOST_BUILD_DIR)/src/temacs $(STAGING_DIR_HOST)/bin/
109    $(INSTALL_BIN) $(HOST_BUILD_DIR)/src/emacs $(STAGING_DIR_HOST)/bin/
110    $(INSTALL_BIN) $(HOST_BUILD_DIR)/lib-src/make-docfile $(STAGING_DIR_HOST)/bin/emacs-make-docfile
111    $(INSTALL_BIN) $(HOST_BUILD_DIR)/src/prefix-args $(STAGING_DIR_HOST)/bin/emacs-prefix-args
112# $(INSTALL_DATA) $(HOST_BUILD_DIR)/bla $(STAGING_DIR_HOST)/lib/
113endef
114
115define Build/Configure
116    $(call Build/Configure/Default)
117endef
118
119define Build/Compile
120    $(call Build/Compile/Default, -C lib-src -o test-distrib)
121# ln -sf $(STAGING_DIR_HOST)/bin/temacs $(PKG_BUILD_DIR)/src/
122    ln -sf $(STAGING_DIR_HOST)/bin/emacs-make-docfile $(PKG_BUILD_DIR)/lib-src/make-docfile
123    ln -sf $(STAGING_DIR_HOST)/bin/emacs-prefix-args $(PKG_BUILD_DIR)/src/prefix-args
124    sed -ie 's; /usr/lib/crt; $(TOOLCHAIN_DIR)/usr/lib/crt;g' $(PKG_BUILD_DIR)/src/Makefile
125    sed -ie 's;\(#.*PATH_DUMPLOADSEARCH\).*$$$$;\1 PATH_LOADSEARCH;' $(PKG_BUILD_DIR)/src/epaths.h
126    $(call Build/Compile/Default, -C src -o lib-src -o prefix-args -o ../lib-src/make-docfile temacs ../etc/DOC)
127    cp -v $(PKG_BUILD_DIR)/src/temacs $(PKG_BUILD_DIR)/src/emacs
128    $(call Build/Compile/Default, -C lisp EMACS=$(STAGING_DIR_HOST)/bin/emacs)
129    $(call Build/Compile/Default, -C leim BUILT-EMACS=$(STAGING_DIR_HOST)/bin/emacs)
130endef
131
132define Build/Install
133    $(call Build/Install/Default,install-arch-indep install-arch-dep install-leim "MFLAGS=-o test-distrib")
134    $(INSTALL_DATA) ./files/site-start.el $(PKG_INSTALL_DIR)/usr/share/emacs/$(PKG_VERSION)/site-lisp
135endef
136
137define Package/emacs-bin/install
138    $(INSTALL_DIR) $(1)/usr
139    cp -r $(PKG_INSTALL_DIR)/usr/{bin,lib} $(1)/usr
140endef
141
142define Package/emacs-data/install
143    $(INSTALL_DIR) $(1)/usr
144    (cd $(PKG_INSTALL_DIR)/usr && \
145      tar -cf - --exclude "*.el.gz" \
146        --exclude "images" \
147        --exclude "refcards" \
148        --exclude "schema" \
149        --exclude "NEWS*" \
150        --exclude "ja-dic" \
151        share) \
152        | (cd $(1)/usr && tar -xvf -)
153endef
154
155define Package/emacs-ja-dic/install
156    $(INSTALL_DIR) $(1)/usr
157    (cd $(PKG_INSTALL_DIR)/usr && tar -cf - \
158        --exclude "*.el.gz" share/emacs/$(PKG_VERSION)/leim/ja-dic) \
159        | (cd $(1)/usr && tar -xvf -)
160endef
161
162define Package/emacs-el/install
163    $(INSTALL_DIR) $(1)/usr
164    (cd $(PKG_INSTALL_DIR)/usr && find share -name "*.el.gz" | tar -cf - -T -) \
165        | (cd $(1)/usr && tar -xvf -)
166endef
167
168
169$(eval $(call HostBuild))
170$(eval $(call BuildPackage,emacs-bin))
171$(eval $(call BuildPackage,emacs-data))
172$(eval $(call BuildPackage,emacs-ja-dic))
173$(eval $(call BuildPackage,emacs-el))
174
175
176# The following comments configure the Emacs editor. Just ignore them.
177# Local Variables:
178# compile-command: "make -C ~/h/src/qi/openwrt-xburst package/emacs/compile -j2 V=99"
179# End:
180

Archive Download this file



interactive