Root/octave/Makefile

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

Archive Download this file



interactive