Root/yacas/Makefile

1# Copyright (C) 2008 OpenWrt.org
2#
3# This is free software, licensed under the GNU General Public License v2.
4#
5
6include $(TOPDIR)/rules.mk
7## Package name
8PKG_NAME:=yacas
9## Package version we need (to match our download source)
10PKG_VERSION:=1.2.2
11## Release version (don't really needed, just for completeness)
12PKG_RELEASE:=3
13## Name of the file we will download, with the previous package name definitions
14PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
15## Url with the PKG_SOURCE file
16PKG_SOURCE_URL:=http://yacas.sourceforge.net/backups/
17## Program to uncompress the sources
18PKG_CAT:=zcat
19
20include $(INCLUDE_DIR)/package.mk
21# Definition of the package, for adding to menuconfig and creating the ipkg.
22define Package/yacas
23    TITLE:=yacas
24    SECTION:=Maths
25    CATEGORY:=Maths
26    DEPENDS:=@BROKEN
27    URL:=http://yacas.sourceforge.net
28endef
29
30# Directory where the sources will be uncompiled and built BUILD_DIR
31# is an env variable from the OpenWrt toolchain, you don't need to set
32# it.
33
34PKG_BUILD_DIR:=$(BUILD_DIR)/yacas-$(PKG_VERSION)
35
36# Long description of the package
37
38define Package/yacas/description
39    YACAS is an easy to use, general purpose Computer Algebra System, a program for symbolic manipulation of mathematical expressions. It uses its own programming language designed for symbolic as well as arbitrary-precision numerical computations. The system has a library of scripts that implement many of the symbolic algebra operations; new algorithms can be easily added to the library. YACAS comes with extensive documentation (hundreds of pages) covering the scripting language, the functionality that is already implemented in the system, and the algorithms we used.
40endef
41
42define Build/Prepare
43# The following is a dirty hack. To compile yacas you need to get
44# mkfastprimes to run in your host computer. To do so, in Prepare I
45# download the tar.gz in pkg_build_dir/temporaryyacas to configure and
46# make it to get this mkfastprimes compiled. configure has a problem:
47# it generates the Makefile in the current working directory... and cd
48# doesn't seem to change it. Thus, it would overwrite the Makefile in
49# ports/misc/yacas, a thing which we don't like. To solve it, copy
50# Makefile to Makefile2, configure-make and copy it back. The only
51# drawback of this approach is that ports/misc/yacas/ gets a little
52# full of miscellaneous, unneeded files, generated by configure. Once
53# we have mkfastprimes, we copy it to tmp, and then the applied patch
54# uses that file. It looks like pwd, export and several other
55# constructs don't work under openwrt's build-make environment, that
56# is why I just use $(CP) which looks like works correctly.
57    wget $(PKG_SOURCE_URL)$(PKG_NAME)-$(PKG_VERSION).tar.gz
58    mkdir /tmp/temporaryyacas
59    mv $(PKG_NAME)-$(PKG_VERSION).tar.gz /tmp/temporaryyacas/
60    cp Makefile Makefile2
61    tar -C /tmp/temporaryyacas/ -xvf /tmp/temporaryyacas/$(PKG_NAME)-$(PKG_VERSION).tar.gz
62    patch /tmp/temporaryyacas/$(PKG_NAME)-$(PKG_VERSION)/configure.in patches1/manmake.pat
63    patch /tmp/temporaryyacas/$(PKG_NAME)-$(PKG_VERSION)/Makefile.in patches1/manmake2.pat
64    /tmp/temporaryyacas/$(PKG_NAME)-$(PKG_VERSION)/configure
65    make
66    $(CP) src/mkfastprimes /tmp/mkfastprimes
67    cp Makefile2 Makefile
68    rm /tmp/temporaryyacas/ -rf
69    $(call Build/Prepare/Default)
70endef
71
72# Configure, in principle does not need any parameter
73
74define Package/yacas/Build/Configure
75    $(call Build/Configure/Default)
76endef
77
78# To end, copy the yacas binary to sbin, and all yacas scripts to
79# sin/yacas-scripts. When you have installed the ipkg you have to add
80# sin/yacas-scripts/ to the path, if you don't yacas won't do
81# anything. You can also cd to sbin/yacas-scripts and run yacas from
82# there. I'll have to check if configure or make has a configuration
83# parameter to set the scripts folder.
84
85define Package/yacas/install
86    $(INSTALL_DIR) $(1)/usr/sbin
87    $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/yacas $(1)/usr/sbin/
88    mkdir $(1)/usr/sbin/yacas-scripts/
89    cp -r $(PKG_BUILD_DIR)/scripts/* $(1)/usr/sbin/yacas-scripts/
90endef
91
92# Final step for bulding the package
93
94$(eval $(call BuildPackage,yacas))
95
96
97

Archive Download this file



interactive