OpenWrt packages
Sign in or create your account | Project List | Help
OpenWrt packages Git Source Tree
Root/
| 1 | # |
| 2 | # Copyright (C) 2011 David Kuehling <dvdkhlng TA gmx TOD de> |
| 3 | # |
| 4 | # License GPLv2 or later. NO WARRANTY. |
| 5 | # |
| 6 | # OpenWRT package for the GNU Octave |
| 7 | |
| 8 | include $(TOPDIR)/rules.mk |
| 9 | |
| 10 | PKG_NAME:=octave |
| 11 | PKG_VERSION:=3.2.4 |
| 12 | PKG_RELEASE:=3 |
| 13 | PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz |
| 14 | PKG_SOURCE_URL:=ftp://ftp.octave.org/pub/octave/ |
| 15 | PKG_MD5SUM:=90c39fa9e241ad2e978bcee4682a2ba9 |
| 16 | PKG_INSTALL:=1 |
| 17 | |
| 18 | PKG_FIXUP:=libtool |
| 19 | PKG_REMOVE_FILES:= |
| 20 | |
| 21 | PKG_BUILD_DEPENDS:= @INSTALL_GFORTRAN |
| 22 | |
| 23 | #include $(INCLUDE_DIR)/host-build.mk |
| 24 | include $(INCLUDE_DIR)/package.mk |
| 25 | |
| 26 | define Package/octave/Default |
| 27 | SUBMENU:=Octave |
| 28 | SECTION:=lang |
| 29 | CATEGORY:=Languages |
| 30 | TITLE:=GNU Octave |
| 31 | URL:=http://www.gnu.org/software/octave/ |
| 32 | SUBMENU:=Octave |
| 33 | endef |
| 34 | |
| 35 | define Package/octave/Default/description |
| 36 | GNU Octave is a high-level language, primarily intended for numerical |
| 37 | computations. It provides a convenient command line interface for solving |
| 38 | linear and nonlinear problems numerically, and for performing other numerical |
| 39 | experiments using a language that is mostly compatible with Matlab. It may |
| 40 | also be used as a batch-oriented language. |
| 41 | endef |
| 42 | |
| 43 | # todo: graphicsmagick package from multimedia feed is not complete. We need |
| 44 | # the Magick++ library and the Magick++-config script installed. |
| 45 | define Package/octave |
| 46 | $(call Package/octave/Default) |
| 47 | DEPENDS:= +libltdl +zlib +libpcre +libncurses +libreadline +libgfortran \ |
| 48 | +octave-data |
| 49 | #+fftw3 |
| 50 | #+GraphicsMagick |
| 51 | TITLE+= (executable) |
| 52 | endef |
| 53 | |
| 54 | define Package/octave/description |
| 55 | $(call Package/octave/Default/description) |
| 56 | This package contains the Octave executable files |
| 57 | endef |
| 58 | |
| 59 | define Package/octave-data |
| 60 | $(call Package/octave/Default) |
| 61 | TITLE+= (function files) |
| 62 | endef |
| 63 | |
| 64 | define Package/octave-data/description |
| 65 | $(call Package/octave/Default/description) |
| 66 | This package contains the platform-independant .m-files. |
| 67 | endef |
| 68 | |
| 69 | # fftw contains a lots of code. not much use for soft-float anyways. try to |
| 70 | # keep memory low and go without fftw (using smaller fftpack instead). |
| 71 | # todo: verify how much RAM that actually safes |
| 72 | # todo : need -enable-rpath? |
| 73 | |
| 74 | OCTAVE_LIB_DIR := /usr/lib |
| 75 | CONFIGURE_ARGS += --without-x --without-fftw |
| 76 | CONFIGURE_VARS += octlibdir=$(OCTAVE_LIB_DIR) |
| 77 | #MAKE_FLAGS += "LD=$(TARGET_CROSS)gcc -nostdlib" |
| 78 | |
| 79 | define Build/Configure |
| 80 | $(call Build/Configure/Default) |
| 81 | endef |
| 82 | |
| 83 | define Build/Compile |
| 84 | $(call Build/Compile/Default) |
| 85 | endef |
| 86 | |
| 87 | # octave emits warnings "timestamp in the future" that cannot be suppressed |
| 88 | # early in the startup-process. Give early as possible timestamps so we don't |
| 89 | # see that warning. |
| 90 | OCTAVE_SANITIZE_TIMESTAMPS := touch --date="Jan 01 01:00:00 AM CET 1970" |
| 91 | |
| 92 | define Build/Install |
| 93 | $(call Build/Install/Default) |
| 94 | $(INSTALL_DIR) $(PKG_INSTALL_DIR)/usr/share/octave/site/m/startup |
| 95 | $(INSTALL_DATA) ./files/octaverc \ |
| 96 | $(PKG_INSTALL_DIR)/usr/share/octave/site/m/startup/ |
| 97 | endef |
| 98 | |
| 99 | define Build/InstallDev |
| 100 | $(INSTALL_DIR) $(1)/usr/include/octave-$(PKG_VERSION)/octave |
| 101 | $(CP) $(PKG_INSTALL_DIR)/usr/include/octave-$(PKG_VERSION)/octave/*.h \ |
| 102 | $(1)/usr/include/octave-$(PKG_VERSION)/octave/ |
| 103 | |
| 104 | $(INSTALL_DIR) $(1)/usr/lib/octave |
| 105 | $(INSTALL_DIR) $(1)$(OCTAVE_LIB_DIR) |
| 106 | $(CP) -r $(PKG_INSTALL_DIR)/usr/lib/octave/* \ |
| 107 | $(1)/usr/lib/octave/ |
| 108 | $(CP) $(PKG_INSTALL_DIR)$(OCTAVE_LIB_DIR)/* \ |
| 109 | $(1)$(OCTAVE_LIB_DIR)/ |
| 110 | |
| 111 | $(INSTALL_DIR) $(1)/usr/bin/ |
| 112 | $(CP) $(PKG_INSTALL_DIR)/usr/bin/octave-config-$(PKG_VERSION) \ |
| 113 | $(1)/usr/bin/ |
| 114 | $(CP) $(PKG_INSTALL_DIR)/usr/bin/mkoctfile-$(PKG_VERSION) \ |
| 115 | $(1)/usr/bin/ |
| 116 | $(SED) 's;\(DEFAULT_[A-Z]*DIR="\)/usr;\1$(STAGING_DIR)/usr;g' \ |
| 117 | $(1)/usr/bin/mkoctfile-$(PKG_VERSION) |
| 118 | $(LN) mkoctfile-$(PKG_VERSION) $(1)/usr/bin/mkoctfile |
| 119 | $(LN) octave-config-$(PKG_VERSION) $(1)/usr/bin/octave-config |
| 120 | endef |
| 121 | |
| 122 | define Package/octave/install |
| 123 | $(INSTALL_DIR) $(1)/usr |
| 124 | cp -r $(PKG_INSTALL_DIR)/usr/{bin,lib} $(1)/usr |
| 125 | find $(1)/usr/lib -name "*.oct" -type f | \ |
| 126 | xargs $(OCTAVE_SANITIZE_TIMESTAMPS) |
| 127 | endef |
| 128 | |
| 129 | define Package/octave-data/install |
| 130 | $(INSTALL_DIR) $(1)/ |
| 131 | (cd $(PKG_INSTALL_DIR)/ && tar -cf - usr/share) \ |
| 132 | | (cd $(1)/ && tar -xvf -) |
| 133 | find $(1)/usr/share -name "*.m" -type f | \ |
| 134 | xargs $(OCTAVE_SANITIZE_TIMESTAMPS) |
| 135 | endef |
| 136 | |
| 137 | #$(eval $(call HostBuild)) |
| 138 | $(eval $(call BuildPackage,octave)) |
| 139 | $(eval $(call BuildPackage,octave-data)) |
| 140 | |
| 141 | |
| 142 | # The following comments configure the Emacs editor. Just ignore them. |
| 143 | # Local Variables: |
| 144 | # compile-command: "make -C ~/h/src/qi/openwrt-xburst package/octave/compile -j2 V=99" |
| 145 | # End: |
| 146 |
