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#
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
18include $(TOPDIR)/rules.mk
19
20PKG_NAME:=octave
21PKG_VERSION:=3.2.4
22PKG_RELEASE:=4
23PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
24PKG_SOURCE_URL:=ftp://ftp.octave.org/pub/octave/
25PKG_MD5SUM:=90c39fa9e241ad2e978bcee4682a2ba9
26PKG_INSTALL:=1
27PKG_BUILD_PARALLEL:=1
28
29PKG_FIXUP:=libtool
30PKG_REMOVE_FILES:=
31
32PKG_BUILD_DEPENDS:= @INSTALL_GFORTRAN
33
34#include $(INCLUDE_DIR)/host-build.mk
35include $(INCLUDE_DIR)/package.mk
36
37define 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
44endef
45
46define Package/octave/Default/description
47GNU Octave is a high-level language, primarily intended for numerical
48computations. It provides a convenient command line interface for solving
49linear and nonlinear problems numerically, and for performing other numerical
50experiments using a language that is mostly compatible with Matlab. It may
51also be used as a batch-oriented language.
52endef
53
54# todo: graphicsmagick package from multimedia feed is not complete. We need
55# the Magick++ library and the Magick++-config script installed.
56define 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)
63endef
64
65define Package/octave/description
66$(call Package/octave/Default/description)
67 This package contains the Octave executable files
68endef
69
70define Package/octave-data
71$(call Package/octave/Default)
72  TITLE+= (function files)
73endef
74
75define Package/octave-data/description
76$(call Package/octave/Default/description)
77 This package contains the platform-independant .m-files.
78endef
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
85OCTAVE_LIB_DIR := /usr/lib
86
87# ugly workaround for octave 3.2.4 to compile with latest openwrt toolchain
88TARGET_CXXFLAGS += -include stddef.h -fpermissive
89
90CONFIGURE_ARGS += --without-x --without-fftw --disable-docs --without-curl
91CONFIGURE_VARS += octlibdir=$(OCTAVE_LIB_DIR) FFLAGS="$(TARGET_CFLAGS)"
92#MAKE_FLAGS += "LD=$(TARGET_CROSS)gcc -nostdlib"
93
94define Build/Configure
95    $(call Build/Configure/Default)
96endef
97
98define Build/Compile
99    $(call Build/Compile/Default)
100endef
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.
105OCTAVE_SANITIZE_TIMESTAMPS := touch --date="Jan 01 01:00:00 AM CET 1970"
106
107define 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/
112endef
113
114define 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
135endef
136
137define 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)
142endef
143
144define 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)
150endef
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

Archive Download this file



interactive