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. |
| 5 | # |
| 6 | include $(TOPDIR)/rules.mk |
| 7 | |
| 8 | PKG_NAME:=emacs |
| 9 | PKG_VERSION:=23.2 |
| 10 | PKG_RELEASE:=1 |
| 11 | PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz |
| 12 | PKG_SOURCE_URL:=ftp://ftp.fu-berlin.de/pub/gnu/emacs/ \ |
| 13 | @GNU/emacs/ |
| 14 | |
| 15 | PKG_MD5SUM:=b6691852dae0bc142b3c12749f6b7ade |
| 16 | PKG_INSTALL:=1 |
| 17 | PKG_FIXUP:=libtool |
| 18 | |
| 19 | PKG_BUILD_DEPENDS:= emacs/host libtool/host |
| 20 | |
| 21 | include $(INCLUDE_DIR)/host-build.mk |
| 22 | include $(INCLUDE_DIR)/package.mk |
| 23 | |
| 24 | define 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 |
| 31 | endef |
| 32 | |
| 33 | define Package/emacs/Default/description |
| 34 | GNU Emacs is an extensible, customizable text editor — and more. |
| 35 | At its core is an interpreter for Emacs Lisp, a dialect of the |
| 36 | Lisp programming language with extensions to support text editing. |
| 37 | endef |
| 38 | |
| 39 | define Package/emacs-bin |
| 40 | $(call Package/emacs/Default) |
| 41 | DEPENDS:=+libncurses +emacs-data |
| 42 | TITLE+= (executable) |
| 43 | endef |
| 44 | |
| 45 | define Package/emacs-bin/description |
| 46 | $(call Package/emacs/Default/description) |
| 47 | This package contains the Emacs executable files |
| 48 | endef |
| 49 | |
| 50 | define Package/emacs-data |
| 51 | $(call Package/emacs/Default) |
| 52 | TITLE+= (compiled lisp) |
| 53 | endef |
| 54 | |
| 55 | define Package/emacs-data/description |
| 56 | $(call Package/emacs/Default/description) |
| 57 | This package contains the compiled Lisp files needed to run Emacs. |
| 58 | endef |
| 59 | |
| 60 | define Package/emacs-ja-dic |
| 61 | $(call Package/emacs/Default) |
| 62 | TITLE+= (japanese input dictionary) |
| 63 | endef |
| 64 | |
| 65 | define 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. |
| 71 | endef |
| 72 | |
| 73 | define Package/emacs-el |
| 74 | $(call Package/emacs/Default) |
| 75 | TITLE+= (lisp source) |
| 76 | endef |
| 77 | |
| 78 | define 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. |
| 82 | endef |
| 83 | |
| 84 | HOST_CONFIGURE_ARGS += --without-x |
| 85 | CONFIGURE_ARGS += --without-x |
| 86 | MAKE_FLAGS += "LD=$(TARGET_CROSS)gcc -nostdlib" |
| 87 | |
| 88 | define Build/Prepare |
| 89 | $(call Build/Prepare/Default) |
| 90 | endef |
| 91 | |
| 92 | define Host/Configure |
| 93 | $(call Host/Configure/Default) |
| 94 | endef |
| 95 | |
| 96 | ## On the host, we only compile and install minimum Emacs components used for |
| 97 | ## bootstrapping |
| 98 | define 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) |
| 102 | endef |
| 103 | |
| 104 | define 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/ |
| 113 | endef |
| 114 | |
| 115 | define Build/Configure |
| 116 | $(call Build/Configure/Default) |
| 117 | endef |
| 118 | |
| 119 | define 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) |
| 130 | endef |
| 131 | |
| 132 | define 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 |
| 135 | endef |
| 136 | |
| 137 | define Package/emacs-bin/install |
| 138 | $(INSTALL_DIR) $(1)/usr |
| 139 | cp -r $(PKG_INSTALL_DIR)/usr/{bin,lib} $(1)/usr |
| 140 | endef |
| 141 | |
| 142 | define 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 -) |
| 153 | endef |
| 154 | |
| 155 | define 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 -) |
| 160 | endef |
| 161 | |
| 162 | define 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 -) |
| 166 | endef |
| 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 |
