2011-01-02 16:19:00 +02:00
|
|
|
#
|
|
|
|
# Copyright (C) 2011 David Kuehling <dvdkhlng TA gmx TOD de>
|
|
|
|
#
|
|
|
|
# License GPLv2 or later. NO WARRANTY.
|
|
|
|
#
|
|
|
|
# OpenWRT package for the GNU Octave
|
2011-06-09 17:16:10 +03:00
|
|
|
#
|
|
|
|
# todo: how do we enable octave's internal help system?
|
2012-03-23 04:24:44 +02:00
|
|
|
#
|
|
|
|
# todo: we may have a (slight) linking problem: it prefers liboctinterp.so &
|
|
|
|
# friends from staging_dir/target-mipsel_uClibc-0.9.32/usr/lib/ over the one
|
|
|
|
# freshly compiled. As a workaround, try 'rm
|
|
|
|
# openwrt-xburst/staging_dir/target-mipsel_uClibc-0.9.32/usr/lib/*oct*' if
|
|
|
|
# compilation fails for you. Mostly that doesn't matter on clean rebuilds
|
|
|
|
# anyways.
|
|
|
|
#
|
2011-01-02 16:19:00 +02:00
|
|
|
|
|
|
|
include $(TOPDIR)/rules.mk
|
|
|
|
|
|
|
|
PKG_NAME:=octave
|
|
|
|
PKG_VERSION:=3.2.4
|
2012-03-23 04:24:44 +02:00
|
|
|
PKG_RELEASE:=4
|
2011-01-02 16:19:00 +02:00
|
|
|
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
2012-10-12 16:50:28 +03:00
|
|
|
PKG_SOURCE_URL:=ftp://ftp.octave.org/pub/gnu/octave/
|
2011-01-02 16:19:00 +02:00
|
|
|
PKG_MD5SUM:=90c39fa9e241ad2e978bcee4682a2ba9
|
|
|
|
PKG_INSTALL:=1
|
2011-06-09 17:16:10 +03:00
|
|
|
PKG_BUILD_PARALLEL:=1
|
2011-02-28 23:13:05 +02:00
|
|
|
|
2011-01-02 16:19:00 +02:00
|
|
|
PKG_FIXUP:=libtool
|
2011-02-28 23:13:05 +02:00
|
|
|
PKG_REMOVE_FILES:=
|
2011-01-02 16:19:00 +02:00
|
|
|
|
2011-02-28 23:13:05 +02:00
|
|
|
PKG_BUILD_DEPENDS:= @INSTALL_GFORTRAN
|
2011-01-02 16:19:00 +02:00
|
|
|
|
|
|
|
#include $(INCLUDE_DIR)/host-build.mk
|
|
|
|
include $(INCLUDE_DIR)/package.mk
|
|
|
|
|
|
|
|
define Package/octave/Default
|
|
|
|
SUBMENU:=Octave
|
|
|
|
SECTION:=lang
|
|
|
|
CATEGORY:=Languages
|
|
|
|
TITLE:=GNU Octave
|
|
|
|
URL:=http://www.gnu.org/software/octave/
|
|
|
|
SUBMENU:=Octave
|
|
|
|
endef
|
|
|
|
|
|
|
|
define Package/octave/Default/description
|
|
|
|
GNU Octave is a high-level language, primarily intended for numerical
|
|
|
|
computations. It provides a convenient command line interface for solving
|
|
|
|
linear and nonlinear problems numerically, and for performing other numerical
|
|
|
|
experiments using a language that is mostly compatible with Matlab. It may
|
|
|
|
also be used as a batch-oriented language.
|
|
|
|
endef
|
|
|
|
|
2011-01-03 23:07:55 +02:00
|
|
|
# todo: graphicsmagick package from multimedia feed is not complete. We need
|
|
|
|
# the Magick++ library and the Magick++-config script installed.
|
2011-01-02 16:19:00 +02:00
|
|
|
define Package/octave
|
|
|
|
$(call Package/octave/Default)
|
2011-01-03 23:07:55 +02:00
|
|
|
DEPENDS:= +libltdl +zlib +libpcre +libncurses +libreadline +libgfortran \
|
2012-10-12 20:03:01 +03:00
|
|
|
+octave-data +libpthread +libstdcpp
|
2011-01-03 23:07:55 +02:00
|
|
|
#+fftw3
|
|
|
|
#+GraphicsMagick
|
2011-01-02 16:19:00 +02:00
|
|
|
TITLE+= (executable)
|
|
|
|
endef
|
|
|
|
|
|
|
|
define Package/octave/description
|
|
|
|
$(call Package/octave/Default/description)
|
|
|
|
This package contains the Octave executable files
|
|
|
|
endef
|
|
|
|
|
|
|
|
define Package/octave-data
|
|
|
|
$(call Package/octave/Default)
|
|
|
|
TITLE+= (function files)
|
|
|
|
endef
|
|
|
|
|
|
|
|
define Package/octave-data/description
|
|
|
|
$(call Package/octave/Default/description)
|
|
|
|
This package contains the platform-independant .m-files.
|
|
|
|
endef
|
|
|
|
|
|
|
|
# fftw contains a lots of code. not much use for soft-float anyways. try to
|
|
|
|
# keep memory low and go without fftw (using smaller fftpack instead).
|
|
|
|
# todo: verify how much RAM that actually safes
|
2011-01-02 17:52:41 +02:00
|
|
|
# todo : need -enable-rpath?
|
2011-01-08 15:22:43 +02:00
|
|
|
|
|
|
|
OCTAVE_LIB_DIR := /usr/lib
|
2012-03-23 04:24:44 +02:00
|
|
|
|
|
|
|
# ugly workaround for octave 3.2.4 to compile with latest openwrt toolchain
|
|
|
|
TARGET_CXXFLAGS += -include stddef.h -fpermissive
|
|
|
|
|
2012-03-28 14:59:24 +03:00
|
|
|
CONFIGURE_ARGS += --without-x --without-fftw --disable-docs --without-curl
|
|
|
|
CONFIGURE_VARS += octlibdir=$(OCTAVE_LIB_DIR) FFLAGS="$(TARGET_CFLAGS)"
|
2011-01-02 16:19:00 +02:00
|
|
|
#MAKE_FLAGS += "LD=$(TARGET_CROSS)gcc -nostdlib"
|
|
|
|
|
|
|
|
define Build/Configure
|
|
|
|
$(call Build/Configure/Default)
|
|
|
|
endef
|
|
|
|
|
|
|
|
define Build/Compile
|
2011-01-08 17:48:25 +02:00
|
|
|
$(call Build/Compile/Default)
|
2011-01-02 16:19:00 +02:00
|
|
|
endef
|
|
|
|
|
2011-01-08 15:22:43 +02:00
|
|
|
# octave emits warnings "timestamp in the future" that cannot be suppressed
|
|
|
|
# early in the startup-process. Give early as possible timestamps so we don't
|
|
|
|
# see that warning.
|
|
|
|
OCTAVE_SANITIZE_TIMESTAMPS := touch --date="Jan 01 01:00:00 AM CET 1970"
|
|
|
|
|
2011-01-02 16:19:00 +02:00
|
|
|
define Build/Install
|
|
|
|
$(call Build/Install/Default)
|
2011-01-08 15:22:43 +02:00
|
|
|
$(INSTALL_DIR) $(PKG_INSTALL_DIR)/usr/share/octave/site/m/startup
|
|
|
|
$(INSTALL_DATA) ./files/octaverc \
|
|
|
|
$(PKG_INSTALL_DIR)/usr/share/octave/site/m/startup/
|
2011-01-02 16:19:00 +02:00
|
|
|
endef
|
|
|
|
|
2011-01-03 23:07:55 +02:00
|
|
|
define Build/InstallDev
|
|
|
|
$(INSTALL_DIR) $(1)/usr/include/octave-$(PKG_VERSION)/octave
|
|
|
|
$(CP) $(PKG_INSTALL_DIR)/usr/include/octave-$(PKG_VERSION)/octave/*.h \
|
|
|
|
$(1)/usr/include/octave-$(PKG_VERSION)/octave/
|
|
|
|
|
|
|
|
$(INSTALL_DIR) $(1)/usr/lib/octave
|
2011-01-08 15:22:43 +02:00
|
|
|
$(INSTALL_DIR) $(1)$(OCTAVE_LIB_DIR)
|
2011-01-03 23:07:55 +02:00
|
|
|
$(CP) -r $(PKG_INSTALL_DIR)/usr/lib/octave/* \
|
|
|
|
$(1)/usr/lib/octave/
|
2011-01-08 15:22:43 +02:00
|
|
|
$(CP) $(PKG_INSTALL_DIR)$(OCTAVE_LIB_DIR)/* \
|
|
|
|
$(1)$(OCTAVE_LIB_DIR)/
|
2011-01-03 23:07:55 +02:00
|
|
|
|
|
|
|
$(INSTALL_DIR) $(1)/usr/bin/
|
|
|
|
$(CP) $(PKG_INSTALL_DIR)/usr/bin/octave-config-$(PKG_VERSION) \
|
|
|
|
$(1)/usr/bin/
|
|
|
|
$(CP) $(PKG_INSTALL_DIR)/usr/bin/mkoctfile-$(PKG_VERSION) \
|
|
|
|
$(1)/usr/bin/
|
|
|
|
$(SED) 's;\(DEFAULT_[A-Z]*DIR="\)/usr;\1$(STAGING_DIR)/usr;g' \
|
|
|
|
$(1)/usr/bin/mkoctfile-$(PKG_VERSION)
|
|
|
|
$(LN) mkoctfile-$(PKG_VERSION) $(1)/usr/bin/mkoctfile
|
|
|
|
$(LN) octave-config-$(PKG_VERSION) $(1)/usr/bin/octave-config
|
|
|
|
endef
|
|
|
|
|
2011-01-02 16:19:00 +02:00
|
|
|
define Package/octave/install
|
|
|
|
$(INSTALL_DIR) $(1)/usr
|
|
|
|
cp -r $(PKG_INSTALL_DIR)/usr/{bin,lib} $(1)/usr
|
2011-01-08 15:22:43 +02:00
|
|
|
find $(1)/usr/lib -name "*.oct" -type f | \
|
|
|
|
xargs $(OCTAVE_SANITIZE_TIMESTAMPS)
|
2011-01-02 16:19:00 +02:00
|
|
|
endef
|
|
|
|
|
|
|
|
define Package/octave-data/install
|
|
|
|
$(INSTALL_DIR) $(1)/
|
|
|
|
(cd $(PKG_INSTALL_DIR)/ && tar -cf - usr/share) \
|
|
|
|
| (cd $(1)/ && tar -xvf -)
|
2011-01-08 15:22:43 +02:00
|
|
|
find $(1)/usr/share -name "*.m" -type f | \
|
|
|
|
xargs $(OCTAVE_SANITIZE_TIMESTAMPS)
|
2011-01-02 16:19:00 +02:00
|
|
|
endef
|
|
|
|
|
|
|
|
#$(eval $(call HostBuild))
|
|
|
|
$(eval $(call BuildPackage,octave))
|
|
|
|
$(eval $(call BuildPackage,octave-data))
|
|
|
|
|
|
|
|
|
|
|
|
# The following comments configure the Emacs editor. Just ignore them.
|
|
|
|
# Local Variables:
|
|
|
|
# compile-command: "make -C ~/h/src/qi/openwrt-xburst package/octave/compile -j2 V=99"
|
|
|
|
# End:
|