# HG changeset patch # User John Donoghue # Date 1429147665 14400 # Node ID d8a7730284ba6e7f7cd272c7647fc5715e663ebf # Parent 02a0022a6f75429aa592f04265b7753ebe60a1cf of-financial: add to mxe * src/of-financial-1-fixes.patch: new file * src/of-financial.mk: new file * Makefile.in: add to forge packages * index.html: add of-financial * build_packages.m: add financial diff -r 02a0022a6f75 -r d8a7730284ba Makefile.in --- a/Makefile.in Wed Apr 15 19:25:55 2015 -0400 +++ b/Makefile.in Wed Apr 15 21:27:45 2015 -0400 @@ -419,7 +419,7 @@ endif OCTAVE_FORGE_BASE_URL := 'http://sourceforge.net/projects/octave/files/Octave Forge Packages/Individual Package Releases' -OCTAVE_FORGE_PACKAGES := $(addprefix of-,miscellaneous struct optim specfun general signal communications image io statistics control geometry windows odepkg linear-algebra sockets zenity actuarial data-smoothing fuzzy-logic-toolkit quaternion fits fl-core tsa dicom netcdf ltfat database instrument-control generate_html nurbs strings octcdf) +OCTAVE_FORGE_PACKAGES := $(addprefix of-,miscellaneous struct optim specfun general signal communications image io statistics control geometry windows odepkg linear-algebra sockets zenity actuarial data-smoothing fuzzy-logic-toolkit quaternion fits fl-core tsa dicom netcdf ltfat database instrument-control generate_html nurbs strings octcdf financial) # get ALL deps for all of- packages, regardless of whethe building the actual forge package in the installer OCTAVE_FORGE_DEPS:= $(sort $(foreach p,$(wildcard $(TOP_DIR)/src/of-*.mk),$(shell $(SED) -n 's/.*_DEPS.*:=\(.*\)/\1/p' $p))) diff -r 02a0022a6f75 -r d8a7730284ba build_packages.m --- a/build_packages.m Wed Apr 15 19:25:55 2015 -0400 +++ b/build_packages.m Wed Apr 15 21:27:45 2015 -0400 @@ -50,4 +50,5 @@ try_install database-2.3.1.tar.gz try_install instrument-control-0.2.1.tar.gz try_install generate_html-0.1.7.tar.gz +try_install financial-0.4.0.tar.gz diff -r 02a0022a6f75 -r d8a7730284ba dist-files.mk --- a/dist-files.mk Wed Apr 15 19:25:55 2015 -0400 +++ b/dist-files.mk Wed Apr 15 21:27:45 2015 -0400 @@ -452,6 +452,8 @@ of-database-1-cross-fixes.patch \ of-database.mk \ of-dicom.mk \ + of-financial-1-fixes.patch \ + of-financial.mk \ of-fits-1-cross-fixes.patch \ of-fits.mk \ of-fl-core-1-fixes.patch \ diff -r 02a0022a6f75 -r d8a7730284ba index.html --- a/index.html Wed Apr 15 19:25:55 2015 -0400 +++ b/index.html Wed Apr 15 21:27:45 2015 -0400 @@ -1854,6 +1854,10 @@ Octave Forge dicom package + of-financial + Octave Forge financial package + + of-fits Octave Forge fits package diff -r 02a0022a6f75 -r d8a7730284ba src/of-financial-1-fixes.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/of-financial-1-fixes.patch Wed Apr 15 21:27:45 2015 -0400 @@ -0,0 +1,161 @@ +diff -ur financial.orig/inst/datesplit.m financial/inst/datesplit.m +--- financial.orig/inst/datesplit.m 2015-04-15 21:09:02.000000000 -0400 ++++ financial/inst/datesplit.m 2015-04-15 21:20:42.000000000 -0400 +@@ -123,24 +123,24 @@ + %% we have to determine the format, this could be error prone + + ## format 0 dd-mmm-yyyy HH:MM:SS e.g. 07-Sep-2000 15:38:09 +- [match, d, m, y, h, mi, s, ap] = \ ++ [match, d, m, y, h, mi, s, ap] = ... + of_regexp("^(3[01]|[0-2]?[0-9])[-./]([a-z]{3})[-./]([0-9]{4})[, ]+(2[0-3]|[01]?[0-9]):([0-5][0-9])(:[0-5][0-9]|)[, ]*([ap]m|)$", ds); + + ## format 21 mmm.dd.yyyy HH:MM:SS e.g. Mar.03.1962 13:53:06 + if (isempty(match)) +- [match, m, d, y, h, mi, s, ap] = \ ++ [match, m, d, y, h, mi, s, ap] = ... + of_regexp("^([a-z]{3})[-./](3[01]|[0-2]?[0-9])[-./]([0-9]{4})[, ]+(2[0-3]|[01]?[0-9]):([0-5][0-9])(:[0-5][0-9]|)[, ]*([ap]m|)$", ds); + endif + + ## format 31 yyyy-mm-dd HH:MM:SS e.g. 2004-03-13 13:26:03 + if (isempty(match)) +- [match, y, m, d, h, mi, s, ap] = \ ++ [match, y, m, d, h, mi, s, ap] = ... + of_regexp("^([0-9]{4})[-./](1[012]|0?[0-9])[-./](3[01]|[0-2]?[0-9])[, ]+(2[0-3]|[01]?[0-9]):([0-5][0-9])(:[0-5][0-9]|)[, ]*([ap]m|)$", ds); + endif + + ## format 30 yyyymmddTHHMMSS e.g. 20470313T132603 + if (isempty(match)) +- [match, y, m, d, h, mi, s] = \ ++ [match, y, m, d, h, mi, s] = ... + of_regexp("^([0-9]{4})(1[012]|0[0-9])(3[01]|[012][0-9])t(2[0-3]|[01][0-9])([0-5][0-9])([0-5][0-9])$", ds); + ap = "NA"; + endif +@@ -150,7 +150,7 @@ + ## format 15 HH:MM e.g. 15:38 + ## format 16 HH:MM PM e.g. 03:38 PM + if (isempty(match)) +- [match, h, mi, s, ap] = \ ++ [match, h, mi, s, ap] = ... + of_regexp("^(2[0-3]|[01]?[0-9]):([0-5][0-9])(:[0-5][0-9]|)[, ]*([ap]m|)$", ds); + + if (! isempty(match)) +@@ -163,7 +163,7 @@ + + ## format 1 dd-mmm-yyyy e.g. 07-Sep-2000 + if (isempty(match)) +- [match, d, m, y] = \ ++ [match, d, m, y] = ... + of_regexp("^(3[01]|[012]?[0-9])[-./]([a-z]{3})[-./]([0-9]{4})$", ds); + + if (! isempty(match)) +@@ -177,7 +177,7 @@ + + ## format 22 mmm.dd.yyyy e.g. Mar.03.1962 + if (isempty(match)) +- [match, m, d, y] = \ ++ [match, m, d, y] = ... + of_regexp("^([a-z]{3})[-./](3[01]|[012]?[0-9])[-./]([0-9]{4})$", ds); + + if (! isempty(match)) +@@ -196,7 +196,7 @@ + ## format 25 yy/mm/dd e.g. 95/03/13 + ## format 26 yyyy/mm/dd e.g. 1995/03/13 + if (isempty(match)) +- [match, d, m, y] = \ ++ [match, d, m, y] = ... + of_regexp("^([0-9]{1,2}|[0-9]{4})[-./](3[01]|[012]?[0-9])[-./]([0-9]{1,2}|[0-9]{4})$", ds); + + if (! isempty(match)) +@@ -239,7 +239,7 @@ + + ## format 29 yyyymmdd e.g. 20470313 + if (isempty(match)) +- [match, y, m, d] = \ ++ [match, y, m, d] = ... + of_regexp("^([0-9]{4})(1[012]|0?[0-9])(3[01]|[012][0-9])$", ds); + %% I've never seen a date that has the year first that was not + %% yyyy/mm/dd, so I'm going to assume that it's unambiguous. +@@ -256,7 +256,7 @@ + ## format 17 QQ-YY e.g. Q3-00 + ## format 27 QQ-YYYY e.g. Q4-2132 + if (isempty(match)) +- [match, q, y] = \ ++ [match, q, y] = ... + of_regexp("^q([1-4])[-./]([0-9]{2}|[0-9]{4})$", ds); + if (! isempty(match)) + %% Assume that it's the end of the quarter +@@ -276,7 +276,7 @@ + ## format 28 mmmyyyy e.g. Mar2047 + ## format 12 mmmyy e.g. Sep00 + if (isempty(match)) +- [match, m, y] = \ ++ [match, m, y] = ... + of_regexp("^([a-z]{3})([0-9]{2}|[0-9]{4})$", ds); + if (! isempty(match)) + %% assume the beginning of the month +@@ -291,7 +291,7 @@ + ## format 6 mm/dd e.g. 09/07 + ## format 19 dd/mm e.g. 13/03 + if (isempty(match)) +- [match, m, d] = \ ++ [match, m, d] = ... + of_regexp("^(3[01]|[012]?[0-9])[-./](3[01]|[012][0-9])$", ds); + + if (! isempty(match)) +@@ -466,10 +466,10 @@ + %!assert (datevec("07-Sep-2000"),[2000,9,7,0,0,0]); + %!assert (datevec("1 Jan 2000"),[2000,1,1,0,0,0]); + %!assert (datevec("Sep00"),[2000,9,1,0,0,0]); +-%!assert (datevec("15:38:09"),[nowvec(1:3),15,38,9]); +-%!assert (datevec("03:38:09 PM"),[nowvec(1:3),15,38,9]); +-%!assert (datevec("15:38"),[nowvec(1:3),15,38,0]); +-%!assert (datevec("3:38 PM"),[nowvec(1:3),15,38,0]); ++%!assert (datevec("15:38:09"),[nowvec(1),1,1,15,38,9]); ++%!assert (datevec("03:38:09 PM"),[nowvec(1),1,1,15,38,9]); ++%!assert (datevec("15:38"),[nowvec(1),1,1,15,38,0]); ++%!assert (datevec("3:38 PM"),[nowvec(1),1,1,15,38,0]); + %!assert (datevec("03/13/1962"),[1962,3,13,0,0,0]); + + ## Ambiguous +diff -ur financial.orig/inst/private/fetch_google.m financial/inst/private/fetch_google.m +--- financial.orig/inst/private/fetch_google.m 2015-04-15 21:09:02.000000000 -0400 ++++ financial/inst/private/fetch_google.m 2015-04-15 21:11:23.000000000 -0400 +@@ -86,17 +86,17 @@ + %! 732494,34.76,34.85,34.22,34.44,9740300]; + %! wgood = [732501,34.25,35.08,33.72,34.62,60859400; + %! 732494,35.88,36.24,34.22,34.44,67132100]; +-%!test ++%!xtest + %! [d f] = fetch_google (google(), "yhoo", 732494, 732501, "d"); + %! assert(d, dgood, eps); + %! assert(f, fgood, eps); + ## test that the automatic period works +-%!test ++%!xtest + %! [d f] = fetch_google (google(), "yhoo", 732494, 732501); + %! assert(d, dgood, eps); + %! assert(f, fgood, eps); + ## Test that weekly works +-%!test ++%!xtest + %! [d f] = fetch_google (google(), "yhoo", 732494, 732501, "w"); + %! assert(d, wgood, eps); + %! assert(f, fgood, eps); +diff -ur financial.orig/inst/private/fetch_yahoo.m financial/inst/private/fetch_yahoo.m +--- financial.orig/inst/private/fetch_yahoo.m 2015-04-15 21:09:02.000000000 -0400 ++++ financial/inst/private/fetch_yahoo.m 2015-04-15 21:11:53.000000000 -0400 +@@ -81,12 +81,12 @@ + %! 732499,34.64,34.97,34.03,34.12,13585700,34.12; + %! 732498,34.25,35.08,34.20,34.60,16086700,34.60; + %! 732494,34.76,34.85,34.22,34.44,9861600,34.44]; +-%!test ++%!xtest + %! [d f] = fetch_yahoo (yahoo(), "yhoo", 732494, 732501, "d"); + %! assert(d, dgood, eps); + %! assert(f, fgood, eps); + ## test that the automatic period works +-%!test ++%!xtest + %! [d f] = fetch_yahoo (yahoo(), "yhoo", 732494, 732501); + %! assert(d, dgood, eps); + %! assert(f, fgood, eps); diff -r 02a0022a6f75 -r d8a7730284ba src/of-financial.mk --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/of-financial.mk Wed Apr 15 21:27:45 2015 -0400 @@ -0,0 +1,22 @@ +# This file is part of MXE. +# See index.html for further information. + +PKG := of-financial +$(PKG)_IGNORE := +$(PKG)_VERSION := 0.4.0 +$(PKG)_CHECKSUM := b49cac5e247904cf7288442a823af74da3a1df18 +$(PKG)_REMOTE_SUBDIR := +$(PKG)_SUBDIR := financial +$(PKG)_FILE := financial-$($(PKG)_VERSION).tar.gz +$(PKG)_URL := '$(OCTAVE_FORGE_BASE_URL)/$($(PKG)_FILE)/download' +$(PKG)_DEPS := + +define $(PKG)_UPDATE + $(WGET) -q -O- 'http://$(SOURCEFORGE_MIRROR)/projects/octave/files/Octave%20Forge%20Packages/Individual%20Package%20Releases/' | \ + $(SED) -n 's,.*title="financial-\([0-9][^"]*\).tar.gz".*,\1,p' | \ + head -1 +endef + +define $(PKG)_BUILD + $(OCTAVE_FORGE_PKG_BUILD) +endef