Root/octave/Makefile

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

Archive Download this file



interactive