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
17
18PKG_FIXUP:=libtool
19PKG_REMOVE_FILES:=
20
21PKG_BUILD_DEPENDS:= @INSTALL_GFORTRAN
22
23#include $(INCLUDE_DIR)/host-build.mk
24include $(INCLUDE_DIR)/package.mk
25
26define 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
33endef
34
35define Package/octave/Default/description
36GNU Octave is a high-level language, primarily intended for numerical
37computations. It provides a convenient command line interface for solving
38linear and nonlinear problems numerically, and for performing other numerical
39experiments using a language that is mostly compatible with Matlab. It may
40also be used as a batch-oriented language.
41endef
42
43# todo: graphicsmagick package from multimedia feed is not complete. We need
44# the Magick++ library and the Magick++-config script installed.
45define 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)
52endef
53
54define Package/octave/description
55$(call Package/octave/Default/description)
56 This package contains the Octave executable files
57endef
58
59define Package/octave-data
60$(call Package/octave/Default)
61  TITLE+= (function files)
62endef
63
64define Package/octave-data/description
65$(call Package/octave/Default/description)
66 This package contains the platform-independant .m-files.
67endef
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
74OCTAVE_LIB_DIR := /usr/lib
75CONFIGURE_ARGS += --without-x --without-fftw
76CONFIGURE_VARS += octlibdir=$(OCTAVE_LIB_DIR)
77#MAKE_FLAGS += "LD=$(TARGET_CROSS)gcc -nostdlib"
78
79define Build/Configure
80    $(call Build/Configure/Default)
81endef
82
83define Build/Compile
84    $(call Build/Compile/Default)
85endef
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.
90OCTAVE_SANITIZE_TIMESTAMPS := touch --date="Jan 01 01:00:00 AM CET 1970"
91
92define 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/
97endef
98
99define 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
120endef
121
122define 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)
127endef
128
129define 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)
135endef
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

Archive Download this file



interactive