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