OpenWrt packages
Sign in or create your account | Project List | Help
OpenWrt packages Git Source Tree
Root/
| 1 | # |
| 2 | # Copyright (C) David Kuehling <dvdkhlng TA gmx TOD de> |
| 3 | # |
| 4 | # License GPLv2 or later. NO WARRANTY. |
| 5 | # |
| 6 | # OpenWRT package for the complete GNU Emacs editor |
| 7 | |
| 8 | include $(TOPDIR)/rules.mk |
| 9 | |
| 10 | PKG_NAME:=emacs |
| 11 | PKG_VERSION:=23.2 |
| 12 | PKG_RELEASE:=4 |
| 13 | PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz |
| 14 | PKG_SOURCE_URL:=ftp://ftp.fu-berlin.de/pub/gnu/emacs/ \ |
| 15 | @GNU/emacs/ |
| 16 | |
| 17 | PKG_MD5SUM:=b6691852dae0bc142b3c12749f6b7ade |
| 18 | PKG_INSTALL:=1 |
| 19 | |
| 20 | PKG_FIXUP:=libtool |
| 21 | PKG_REMOVE_FILES:= |
| 22 | |
| 23 | PKG_BUILD_DEPENDS:= emacs/host |
| 24 | |
| 25 | include $(INCLUDE_DIR)/host-build.mk |
| 26 | include $(INCLUDE_DIR)/package.mk |
| 27 | |
| 28 | define Package/emacs/Default |
| 29 | SUBMENU:=Emacs |
| 30 | SECTION:=utils |
| 31 | CATEGORY:=Utilities |
| 32 | TITLE:=The GNU Emacs Editor a.k.a. \"Emacs OS\" |
| 33 | URL:=http://www.gnu.org/software/emacs/ |
| 34 | # SUBMENU:=Editors |
| 35 | endef |
| 36 | |
| 37 | define Package/emacs/Default/description |
| 38 | GNU Emacs is an extensible, customizable text editor — and more. |
| 39 | At its core is an interpreter for Emacs Lisp, a dialect of the |
| 40 | Lisp programming language with extensions to support text editing. |
| 41 | endef |
| 42 | |
| 43 | define Package/emacs |
| 44 | $(call Package/emacs/Default) |
| 45 | DEPENDS:=+libncurses +emacs-data |
| 46 | TITLE+= (executable) |
| 47 | endef |
| 48 | |
| 49 | define Package/emacs/description |
| 50 | $(call Package/emacs/Default/description) |
| 51 | This package contains the Emacs executable files |
| 52 | endef |
| 53 | |
| 54 | define Package/emacs-data |
| 55 | $(call Package/emacs/Default) |
| 56 | TITLE+= (compiled lisp) |
| 57 | endef |
| 58 | |
| 59 | define Package/emacs-data/description |
| 60 | $(call Package/emacs/Default/description) |
| 61 | This package contains the compiled Lisp files needed to run Emacs. |
| 62 | endef |
| 63 | |
| 64 | define Package/emacs-ja-dic |
| 65 | $(call Package/emacs/Default) |
| 66 | TITLE+= (japanese input dictionary) |
| 67 | DEPENDS:=+emacs |
| 68 | endef |
| 69 | |
| 70 | define Package/emacs-ja-dic/description |
| 71 | $(call Package/emacs/Default/description) |
| 72 | This package contains the japanese dictionary used to input japanese Kanji |
| 73 | via Hiragana->Kanji conversion (\'set-input-method japanese\'). This |
| 74 | dictionary is huge, so huge that emacs won\'t be able to load it on systems |
| 75 | with 32MB or fewer RAM. |
| 76 | endef |
| 77 | |
| 78 | define Package/emacs-el |
| 79 | $(call Package/emacs/Default) |
| 80 | TITLE+= (lisp source) |
| 81 | endef |
| 82 | |
| 83 | define Package/emacs-el/description |
| 84 | $(call Package/emacs/Default/description) |
| 85 | This package contains the Lisp source files of Emacs that can queried via |
| 86 | C-h f in case provided documentation of an Emacs function is insufficient. |
| 87 | endef |
| 88 | |
| 89 | EMACS_STRIPTEASE_ARGS = \ |
| 90 | --without-x \ |
| 91 | --without-xpm \ |
| 92 | --without-jpeg \ |
| 93 | --without-gif \ |
| 94 | --without-png \ |
| 95 | --without-rsvg \ |
| 96 | --without-xft \ |
| 97 | --without-libotf \ |
| 98 | --without-dbus \ |
| 99 | --without-gconf \ |
| 100 | --without-gpm \ |
| 101 | --without-sound |
| 102 | |
| 103 | HOST_CONFIGURE_ARGS += $(EMACS_STRIPTEASE_ARGS) |
| 104 | CONFIGURE_ARGS += $(EMACS_STRIPTEASE_ARGS) |
| 105 | MAKE_FLAGS += "LD=$(TARGET_CROSS)gcc" |
| 106 | |
| 107 | ## Don't try that: lowering PURESIZE makes Emacs' RAM usage explode! Maybe |
| 108 | ## something about Elisp garbage collection!? |
| 109 | #TARGET_CPPFLAGS += -DPURESIZE=16 |
| 110 | |
| 111 | ## Keep emacs build system from doing all kinds nasty tricks that won't work |
| 112 | ## (well) with openwrt and uclibc. Especially keep it from attempting to |
| 113 | ## manually configure crt* startup file linking. We won't be able to 'dump' |
| 114 | ## during cross-compile anyway. Dumping inside the target system seems not |
| 115 | ## possible due to lack of RAM. Note that we also need to sanitize the |
| 116 | ## Makefile using 'sed' below. |
| 117 | TARGET_CPPFLAGS += -DCANNOT_DUMP -DNO_REMAP -DORDINARY_LINK |
| 118 | |
| 119 | define Build/Prepare |
| 120 | $(call Build/Prepare/Default) |
| 121 | endef |
| 122 | |
| 123 | define Host/Configure |
| 124 | $(call Host/Configure/Default) |
| 125 | endef |
| 126 | |
| 127 | ## On the host, we only compile and install minimum Emacs components used for |
| 128 | ## bootstrapping |
| 129 | define Host/Compile |
| 130 | export LD_LIBRARY_PATH=$(STAGING_DIR_HOST)/lib; \ |
| 131 | $(call Host/Compile/Default) |
| 132 | endef |
| 133 | |
| 134 | define Host/Install |
| 135 | $(call Host/Install/Default) |
| 136 | $(INSTALL_BIN) $(HOST_BUILD_DIR)/lib-src/make-docfile $(STAGING_DIR_HOST)/bin/emacs-make-docfile |
| 137 | $(INSTALL_BIN) $(HOST_BUILD_DIR)/src/prefix-args $(STAGING_DIR_HOST)/bin/emacs-prefix-args |
| 138 | endef |
| 139 | |
| 140 | define Build/Configure |
| 141 | $(call Build/Configure/Default) |
| 142 | endef |
| 143 | |
| 144 | define Build/Compile |
| 145 | $(call Build/Compile/Default, -C lib-src -o test-distrib) |
| 146 | ln -sf $(STAGING_DIR_HOST)/bin/emacs-make-docfile $(PKG_BUILD_DIR)/lib-src/make-docfile |
| 147 | ln -sf $(STAGING_DIR_HOST)/bin/emacs-prefix-args $(PKG_BUILD_DIR)/src/prefix-args |
| 148 | sed -ie 's;\(TEMACS_LDFLAGS\|STARTFILES\) =.*;\1 =;' $(PKG_BUILD_DIR)/src/Makefile |
| 149 | # sed -ie 's; /usr/lib/crt[^ ]\+; $(TOOLCHAIN_DIR)/usr/lib/crt;g' $(PKG_BUILD_DIR)/src/Makefile |
| 150 | sed -ie 's; /usr/lib/crt[^ ]\+; ;g' $(PKG_BUILD_DIR)/src/Makefile |
| 151 | sed -ie 's;\(#.*PATH_DUMPLOADSEARCH\).*$$$$;\1 PATH_LOADSEARCH;' $(PKG_BUILD_DIR)/src/epaths.h |
| 152 | $(call Build/Compile/Default, -C src -o lib-src -o prefix-args -o ../lib-src/make-docfile temacs ../etc/DOC) |
| 153 | cp -v $(PKG_BUILD_DIR)/src/temacs $(PKG_BUILD_DIR)/src/emacs |
| 154 | $(call Build/Compile/Default, -C lisp EMACS=$(STAGING_DIR_HOST)/bin/emacs) |
| 155 | $(call Build/Compile/Default, -C leim BUILT-EMACS=$(STAGING_DIR_HOST)/bin/emacs) |
| 156 | endef |
| 157 | |
| 158 | define Build/Install |
| 159 | sed -ie 's;./src/emacs\( --version\);$(STAGING_DIR_HOST)/bin/emacs \1;g' \ |
| 160 | $(PKG_BUILD_DIR)/Makefile |
| 161 | $(call Build/Install/Default,install-arch-indep install-arch-dep install-leim INSTALL_STRIP="" "MFLAGS=-o test-distrib") |
| 162 | $(INSTALL_DATA) ./files/site-start.el $(PKG_INSTALL_DIR)/usr/share/emacs/$(PKG_VERSION)/site-lisp |
| 163 | endef |
| 164 | |
| 165 | define Package/emacs/install |
| 166 | $(INSTALL_DIR) $(1)/usr |
| 167 | cp -r $(PKG_INSTALL_DIR)/usr/{bin,lib} $(1)/usr |
| 168 | endef |
| 169 | |
| 170 | define Package/emacs-data/install |
| 171 | $(INSTALL_DIR) $(1)/ |
| 172 | (cd $(PKG_INSTALL_DIR)/ && \ |
| 173 | tar -cf - --exclude "*.el.gz" \ |
| 174 | --exclude "images" \ |
| 175 | --exclude "refcards" \ |
| 176 | --exclude "schema" \ |
| 177 | --exclude "NEWS*" \ |
| 178 | --exclude "ja-dic" \ |
| 179 | usr/share) \ |
| 180 | | (cd $(1)/ && tar -xvf -) |
| 181 | endef |
| 182 | |
| 183 | define Package/emacs-ja-dic/install |
| 184 | $(INSTALL_DIR) $(1)/usr |
| 185 | (cd $(PKG_INSTALL_DIR)/usr && tar -cf - \ |
| 186 | --exclude "*.el.gz" share/emacs/$(PKG_VERSION)/leim/ja-dic) \ |
| 187 | | (cd $(1)/usr && tar -xvf -) |
| 188 | endef |
| 189 | |
| 190 | define Package/emacs-el/install |
| 191 | $(INSTALL_DIR) $(1)/usr |
| 192 | (cd $(PKG_INSTALL_DIR)/usr && find share -name "*.el.gz" \ |
| 193 | | tar -cf - -T - --exclude "ja-dic" ) \ |
| 194 | | (cd $(1)/usr && tar -xvf -) |
| 195 | endef |
| 196 | |
| 197 | |
| 198 | $(eval $(call HostBuild)) |
| 199 | $(eval $(call BuildPackage,emacs)) |
| 200 | $(eval $(call BuildPackage,emacs-data)) |
| 201 | $(eval $(call BuildPackage,emacs-ja-dic)) |
| 202 | $(eval $(call BuildPackage,emacs-el)) |
| 203 | |
| 204 | |
| 205 | # The following comments configure the Emacs editor. Just ignore them. |
| 206 | # Local Variables: |
| 207 | # compile-command: "make -C ~/h/src/qi/openwrt-xburst package/emacs/compile -j2 V=99" |
| 208 | # End: |
| 209 |
