pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Update Ledger to the latest release 3.1



Module Name:	pkgsrc-wip
Committed By:	atomicules <base%atomicules.co.uk@localhost>
Pushed By:	atomicules
Date:		Fri Oct 30 21:29:23 2015 +0000
Changeset:	3fab151ff1115ba81304edbdf8c481400e971a4a

Modified Files:
	ledger/DESCR
	ledger/Makefile
	ledger/PLIST
	ledger/distinfo
Added Files:
	ledger/TODO
	ledger/patches/patch-src_account.h
	ledger/patches/patch-src_filters.cc
	ledger/patches/patch-src_item.h
	ledger/patches/patch-src_iterators.cc
	ledger/patches/patch-src_parser.h
	ledger/patches/patch-src_post.h
	ledger/patches/patch-src_times.h

Log Message:
Update Ledger to the latest release 3.1

Note that 3.1 is still a year old and 3.1.1 must be just around the
corner from being released, but this package had become so out of date
that the urls were no longer correct. I thought targeting a released
version was a better idea than a git branch, etc.

I have built and tested this on NetBSD 7 AMD64 and it works, but I have
had to use a bit of a hacky approach in the Makefile. Any tips on a
cleaner approach would be appreciated. See the Makefile and the TODO
file for more information on what I've tried.

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=3fab151ff1115ba81304edbdf8c481400e971a4a

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 ledger/DESCR                          | 33 ++++++---------
 ledger/Makefile                       | 50 +++++++++++++++-------
 ledger/PLIST                          | 78 ++++++++++++++++++++++++-----------
 ledger/TODO                           | 43 +++++++++++++++++++
 ledger/distinfo                       | 14 +++++--
 ledger/patches/patch-src_account.h    | 18 ++++++++
 ledger/patches/patch-src_filters.cc   | 14 +++++++
 ledger/patches/patch-src_item.h       | 18 ++++++++
 ledger/patches/patch-src_iterators.cc | 14 +++++++
 ledger/patches/patch-src_parser.h     | 14 +++++++
 ledger/patches/patch-src_post.h       | 18 ++++++++
 ledger/patches/patch-src_times.h      | 18 ++++++++
 12 files changed, 270 insertions(+), 62 deletions(-)

diffs:
diff --git a/ledger/DESCR b/ledger/DESCR
index 75538e9..542b4fe 100644
--- a/ledger/DESCR
+++ b/ledger/DESCR
@@ -1,23 +1,16 @@
-Ledger is a powerful, double-entry accounting system that is accessed
-from the UNIX command-line. This may put off some users - as there
-is no flashy UI - but for those who want unparalleled reporting
-access to their data, there really is no alternative.
+Double-entry accounting system with a command-line reporting interface
+http://www.ledger-cli.org
 
-Ledger never creates or modifies your data. Your entries are kept
-in a text file that you maintain, and you can rest assured, no
-automated tool will ever change that data.
+Ledger is a powerful, double-entry accounting system that is accessed from the
+UNIX command-line. This may put off some users, since there is no flashy UI, but
+for those who want unparalleled reporting access to their data there are few
+alternatives.
 
-Ledger is 100% currency-agnostic. You can store multiple currencies
-in any account, convert between them, or even pay in one currency
-and receive change in another.
+Ledger uses text files for input. It reads the files and generates reports;
+there is no other database or stored state. To use Ledger, you create a file of
+your account names and transactions, run from the command line with some options
+to specify input and requested reports, and get output. The output is generally
+plain text, though you could generate a graph or html instead. Ledger is simple
+in concept, surprisingly rich in ability, and easy to use.
 
-Ledger is international. Although UTF8 support is not quite there
-yet, Ledger uses ISO format dates, attaches no meaning to the naming
-of accounts, and can accept data in either US or European decimal
-formats. It will report currencies back to you following the manner
-of your own entries.
-
-Ledger uses a simple set of base commands which can be extended in
-countless ways. You can create monthly reports, average reports,
-check account balances, reconcile accounts, keep track of capital
-gains on stocks, etc.
+#Above text taken from the Ledger README
diff --git a/ledger/Makefile b/ledger/Makefile
index d0d19b4..3681d0d 100644
--- a/ledger/Makefile
+++ b/ledger/Makefile
@@ -1,23 +1,45 @@
-# $NetBSD: Makefile,v 1.3 2013/10/05 14:32:12 slitvinov Exp $
-#
+# $NetBSD$
 
-DISTNAME=	ledger-2.6.3
+GITHUB_PROJECT=	ledger
+VERSION= 3.1
+DISTNAME=	v${VERSION}
+PKGNAME= ${GITHUB_PROJECT}-${VERSION}
 CATEGORIES=	finance
-MASTER_SITES=	${MASTER_SITE_SOURCEFORGE:=ledger/}
+MASTER_SITES=	${MASTER_SITE_GITHUB:=ledger/}
+DIST_SUBDIR=	${GITHUB_PROJECT}
 
-MAINTAINER=	jkj%kapsi.fi@localhost
-HOMEPAGE=	http://wiki.github.com/jwiegley/ledger
+MAINTAINER=	base%atomicules.co.uk@localhost
+HOMEPAGE=	http://ledger-cli.org/
 COMMENT=	Double-entry accounting system for command-line
+LICENSE=	ledger-license
 
-GNU_CONFIGURE=	yes
-USE_LIBTOOL=	yes
-INFO_FILES=	yes
+# url2pkg-marker (please do not remove this line.)
 
-PKG_DESTDIR_SUPPORT=	destdir
+WRKSRC=	${WRKDIR}/${GITHUB_PROJECT}-${VERSION}
+USE_LANGUAGES= c++ c
+USE_TOOLS+= curl unzip
 
-# configure script seems to require c
-USE_LANGUAGES=	c++ c
+# A list of other things you need in order to configure and build using the Ledger acprep script, that I'm not sure where to put:
+# - python
+# - cmake
+
+#Version 3.1 requires a separate download of UTFCPP, automate this
+#With version 3.1.1 this should get bundled with the Ledger release and this target can be removed.
+post-extract:
+	cd ${WRKSRC} && curl -L -O https://github.com/ledger/ledger/releases/download/v3.1/ledger-utfcpp.zip && unzip ledger-utfcpp.zip
+
+#This is a hack!
+#The supplied acprep tool works really well for configuration and building, but in order to use it I had to disable the PKGSRC configure and build stages and then call acprep for configuration and build after the patch phase.
+#See the TODO file for more details and everything less hacky I tried that didn't work.
+NO_CONFIGURE= yes
+NO_BUILD= yes
+post-patch:
+	cd ${WRKSRC} && ./acprep configure --prefix ${PREFIX} -- -DCMAKE_INSTALL_RPATH_USE_LINK_PATH:BOOL=ON -DCMAKE_INSTALL_MANDIR:PATH=${PKGMANDIR} && ./acprep make
 
-.include "../../devel/gmp/buildlink3.mk"
-.include "../../devel/pcre/buildlink3.mk"
 .include "../../mk/bsd.pkg.mk"
+.include "../../mk/fetch/sites.mk"
+
+#These are the minimum libraries required for Ledger
+.include "../../devel/boost-libs/buildlink3.mk"
+.include "../../devel/gmp/buildlink3.mk"
+.include "../../math/mpfr/buildlink3.mk"
diff --git a/ledger/PLIST b/ledger/PLIST
index 57fa085..2d944f2 100644
--- a/ledger/PLIST
+++ b/ledger/PLIST
@@ -1,39 +1,67 @@
-@comment $NetBSD: PLIST,v 1.2 2009/10/11 10:44:51 thomasklausner Exp $
+@comment $NetBSD$
+@comment Obtained from install_manifest.txt
 bin/ledger
-include/ledger/acconf.h
+include/ledger/account.h
 include/ledger/amount.h
+include/ledger/annotate.h
+include/ledger/archive.h
 include/ledger/balance.h
-include/ledger/binary.h
-include/ledger/config.h
+include/ledger/chain.h
+include/ledger/commodity.h
+include/ledger/compare.h
+include/ledger/context.h
+include/ledger/convert.h
 include/ledger/csv.h
-include/ledger/datetime.h
-include/ledger/debug.h
-include/ledger/derive.h
+include/ledger/draft.h
 include/ledger/emacs.h
 include/ledger/error.h
+include/ledger/expr.h
+include/ledger/exprbase.h
+include/ledger/filters.h
+include/ledger/flags.h
 include/ledger/format.h
-include/ledger/gnucash.h
+include/ledger/generate.h
+include/ledger/global.h
+include/ledger/history.h
+include/ledger/item.h
+include/ledger/iterators.h
 include/ledger/journal.h
-include/ledger/ledger.h
+include/ledger/lookup.h
 include/ledger/mask.h
-include/ledger/ofx.h
+include/ledger/op.h
 include/ledger/option.h
+include/ledger/org.h
+include/ledger/output.h
 include/ledger/parser.h
-include/ledger/qif.h
+include/ledger/pool.h
+include/ledger/post.h
+include/ledger/precmd.h
+include/ledger/predicate.h
+include/ledger/print.h
+include/ledger/pstream.h
+include/ledger/ptree.h
+include/ledger/pyfstream.h
+include/ledger/pyinterp.h
+include/ledger/pyutils.h
+include/ledger/query.h
 include/ledger/quotes.h
-include/ledger/reconcile.h
 include/ledger/report.h
-include/ledger/textual.h
-include/ledger/timing.h
-include/ledger/util.h
-include/ledger/valexpr.h
+include/ledger/scope.h
+include/ledger/select.h
+include/ledger/session.h
+include/ledger/stats.h
+include/ledger/stream.h
+include/ledger/strptime.h
+include/ledger/system.hh
+include/ledger/temps.h
+include/ledger/timelog.h
+include/ledger/times.h
+include/ledger/token.h
+include/ledger/unistring.h
+include/ledger/utils.h
 include/ledger/value.h
-include/ledger/walk.h
-include/ledger/xml.h
-info/ledger.info
-lib/libamounts.la
-lib/libledger.la
-share/emacs/site-lisp/ledger.el
-share/emacs/site-lisp/ledger.elc
-share/emacs/site-lisp/timeclock.el
-share/emacs/site-lisp/timeclock.elc
+include/ledger/views.h
+include/ledger/xact.h
+lib/libledger.so
+lib/libledger.so.3
+man/man1/ledger.1
diff --git a/ledger/TODO b/ledger/TODO
new file mode 100644
index 0000000..0318954
--- /dev/null
+++ b/ledger/TODO
@@ -0,0 +1,43 @@
+#Notes on the Makefile for pkgsrc/wip/ledger
+
+##Making the Makefile less hacky
+
+Currently the makefile uses quite a hacky approach to get something that works. Ledger comes with its own python based acprep tool for configuration and building which is mostly a wrapper around cmake, but it is actually really good and works, where as using plain cmake and make should work, but doesn't (for me). So in order to use acprep I had to disable the build and configure stages in the Pkgsrc Makefile and instead do them in a post-patch target.
+
+I did try some less hacky approaches, but I couldn't get them to work.
+
+###1 Using CONFIGURE_SCRIPT
+
+This seems like it should be the none-hacky way of doing what I want to do (run the acprep script). This is what I tried:
+
+	HAS_CONFIGURE= yes
+	CONFIGURE_ENV= python 
+	CONFIGURE_SCRIPT= ./acprep configure
+	CONFIGURE_ARGS=  --prefix ${PREFIX} -- -DCMAKE_INSTALL_RPATH_USE_LINK_PATH:BOOL=ON"
+	MAKE_PROGRAM= ./acprep
+	BUILD_MAKE_FLAGS= make
+	BUILD_MAKE_FILE=
+
+along with various permutations of splitting the overall commands between [CONFIGURE_ENV, CONFIGURE_SCRIPT, etc][1].
+
+###2 Using CMAKE
+
+In theory Ledger supports direct configuration and building with CMake, but something Pkgsrc does with CMake makes it not work. It will appear to configure fine and will build, but won't link. I have tried so many different variations of CMake settings, but for whatever reason I cannot get it to link unless I use acprep. None of this works:
+	
+	USE_CMAKE= yes
+	CMAKE_ARGS+= -DCMAKE_INSTALL_PREFIX:PATH=${PREFIX} -DCMAKE_INSTALL_RPATH_USE_LINK_PATH:BOOL=ON -DCMAKE_SHARED_LINKER_FLAGS="-R${PREFIX}/lib -L${PREFIX}/lib" -DCMAKE_MODULE_LINKER_FLAGS="-R${PREFIX}/lib -L${PREFIX}/lib" -DCMAKE_EXE_LINKER_FLAGS="-R${PREFIX}/lib -L${PREFIX}/lib" -DCMAKE_CXX_COMPILER=g++ 
+
+or
+
+	USE_CMAKE= yes
+	CMAKE_ARGS+= -DCMAKE_INSTALL_PREFIX:PATH=${PREFIX} -DCMAKE_PREFIX_PATH:PATH=${PREFIX} -DCMAKE_LIBRARY_PATH:PATH=${PREFIX}/lib -DCMAKE_INSTALL_RPATH_USE_LINK_PATH:BOOL=ON
+	LDFLAGS+= -L${PREFIX}/lib
+
+...etc
+
+##Other things that need doing
+
+- Adding options (as in show-options) for all the optional dependencies
+- Figuring out how to specify all the dependencies for building (such as python and cmake), but that aren't linked in
+
+[1]: https://www.netbsd.org/docs/pkgsrc/build.html#build.configure
diff --git a/ledger/distinfo b/ledger/distinfo
index 678d3a2..560258b 100644
--- a/ledger/distinfo
+++ b/ledger/distinfo
@@ -1,5 +1,13 @@
 $NetBSD: distinfo,v 1.2 2013/10/05 14:32:12 slitvinov Exp $
 
-SHA1 (ledger-2.6.3.tar.gz) = 5b8e7d8199acb116f13720a5a469fff1f14b4041
-RMD160 (ledger-2.6.3.tar.gz) = 62e96f958d8af3e0d90567d84f68b162b1dbfaef
-Size (ledger-2.6.3.tar.gz) = 660752 bytes
+SHA1 (ledger/v3.1.tar.gz) = 549aa375d4802e9dd4fd153c45ab64d8ede94afc
+RMD160 (ledger/v3.1.tar.gz) = 6e9b1afaeb29e75ad8fe251ac19ad4618c4ec5c1
+SHA512 (ledger/v3.1.tar.gz) = caa84330eee05d3e88820e8afd4a906d22f6aaa9de4abc2f6813636754e052e6ec4d1b3d2fce68215aededc72651405c62aaf16a2c1b69d34e1b10ffece48519
+Size (ledger/v3.1.tar.gz) = 817624 bytes
+SHA1 (patch-src_account.h) = eb560d3c3390eab0c4bb2a312d5ed4b9436de453
+SHA1 (patch-src_filters.cc) = e5f8a20519f689eb9a98ed8bfa89f74a3beb8237
+SHA1 (patch-src_item.h) = 738538ac35603879d40d5094ebcc21efca865172
+SHA1 (patch-src_iterators.cc) = 23617982df804a5817d9a66bff8f46d08aa777d4
+SHA1 (patch-src_parser.h) = 00df805cdffb313fe25d65bc55cfb4e4c271c471
+SHA1 (patch-src_post.h) = 1f625c90e8673c87081cf23aaa0260ec1a1dc166
+SHA1 (patch-src_times.h) = 9f9aeaaf6e45ee83420f7efac9763886eee960de
diff --git a/ledger/patches/patch-src_account.h b/ledger/patches/patch-src_account.h
new file mode 100644
index 0000000..03e23e0
--- /dev/null
+++ b/ledger/patches/patch-src_account.h
@@ -0,0 +1,18 @@
+$NetBSD$
+
+Patch pulled from upstream (Commit: bcaca24de4264f89a94069701361988007e22e58) to allow compilation with recent Boost versions
+--- src/account.h.orig	2014-10-05 23:02:43.000000000 +0000
++++ src/account.h
+@@ -261,11 +261,7 @@ public:
+   mutable optional<xdata_t> xdata_;
+ 
+   bool has_xdata() const {
+-#if BOOST_VERSION >= 105600
+-    return xdata_ != NULL;
+-#else
+-    return xdata_;
+-#endif
++    return static_cast<bool>(xdata_);
+   }
+   void clear_xdata();
+   xdata_t& xdata() {
diff --git a/ledger/patches/patch-src_filters.cc b/ledger/patches/patch-src_filters.cc
new file mode 100644
index 0000000..e70af7a
--- /dev/null
+++ b/ledger/patches/patch-src_filters.cc
@@ -0,0 +1,14 @@
+$NetBSD$
+
+Patch pulled from upstream (Commit: a1cb25ad2d9a98ea9ec0bb3ee27fe3cde6046434) to allow compilation with recent Boost versions
+--- src/filters.cc.orig	2015-10-26 20:11:54.000000000 +0000
++++ src/filters.cc
+@@ -707,7 +707,7 @@ namespace {
+     insert_prices_in_map(price_map_t& _all_prices)
+       : all_prices(_all_prices) {}
+ 
+-    void operator()(datetime_t& date, const amount_t& price) {
++    void operator()(const datetime_t& date, const amount_t& price) {
+       all_prices.insert(price_map_t::value_type(date, price));
+     }
+   };
diff --git a/ledger/patches/patch-src_item.h b/ledger/patches/patch-src_item.h
new file mode 100644
index 0000000..1a8b2d7
--- /dev/null
+++ b/ledger/patches/patch-src_item.h
@@ -0,0 +1,18 @@
+$NetBSD$
+
+Patch pulled from upstream (Commit: bcaca24de4264f89a94069701361988007e22e58) to allow compilation with recent Boost versions
+--- src/item.h.orig	2014-10-05 23:02:43.000000000 +0000
++++ src/item.h
+@@ -191,11 +191,7 @@ public:
+   static bool use_aux_date;
+ 
+   virtual bool has_date() const {
+-#if BOOST_VERSION >= 105600
+-    return _date != NULL;
+-#else
+-    return _date;
+-#endif
++    return static_cast<bool>(_date);
+   }
+ 
+   virtual date_t date() const {
diff --git a/ledger/patches/patch-src_iterators.cc b/ledger/patches/patch-src_iterators.cc
new file mode 100644
index 0000000..67388db
--- /dev/null
+++ b/ledger/patches/patch-src_iterators.cc
@@ -0,0 +1,14 @@
+$NetBSD$
+
+Patch pulled from upstream (Commit: a1cb25ad2d9a98ea9ec0bb3ee27fe3cde6046434) to allow compilation with recent Boost versions
+--- src/iterators.cc.orig	2015-10-26 20:11:32.000000000 +0000
++++ src/iterators.cc
+@@ -96,7 +96,7 @@ namespace {
+       TRACE_DTOR(create_price_xact);
+     }
+ 
+-    void operator()(datetime_t& date, const amount_t& price) {
++    void operator()(const datetime_t& date, const amount_t& price) {
+       xact_t * xact;
+       string   symbol = price.commodity().symbol();
+ 
diff --git a/ledger/patches/patch-src_parser.h b/ledger/patches/patch-src_parser.h
new file mode 100644
index 0000000..61e7b8e
--- /dev/null
+++ b/ledger/patches/patch-src_parser.h
@@ -0,0 +1,14 @@
+$NetBSD$
+
+Patch pulled from upstream (Commit: bcaca24de4264f89a94069701361988007e22e58) to allow compilation with recent Boost versions
+--- src/parser.h.orig	2014-10-05 23:02:43.000000000 +0000
++++ src/parser.h
+@@ -118,7 +118,7 @@ public:
+ 
+   ptr_op_t parse(std::istream&           in,
+                  const parse_flags_t&    flags           = PARSE_DEFAULT,
+-                 const optional<string>& original_string = NULL);
++                 const optional<string>& original_string = boost::none);
+ };
+ 
+ } // namespace ledger
diff --git a/ledger/patches/patch-src_post.h b/ledger/patches/patch-src_post.h
new file mode 100644
index 0000000..80152e2
--- /dev/null
+++ b/ledger/patches/patch-src_post.h
@@ -0,0 +1,18 @@
+$NetBSD$
+
+Patch pulled from upstream (Commit: bcaca24de4264f89a94069701361988007e22e58) to allow compilation with recent Boost versions
+--- src/post.h.orig	2014-10-05 23:02:43.000000000 +0000
++++ src/post.h
+@@ -205,11 +205,7 @@ public:
+   mutable optional<xdata_t> xdata_;
+ 
+   bool has_xdata() const {
+-#if BOOST_VERSION >= 105600
+-    return xdata_ != NULL;
+-#else
+-    return xdata_;
+-#endif
++    return static_cast<bool>(xdata_);
+   }
+   void clear_xdata() {
+     xdata_ = none;
diff --git a/ledger/patches/patch-src_times.h b/ledger/patches/patch-src_times.h
new file mode 100644
index 0000000..9518eec
--- /dev/null
+++ b/ledger/patches/patch-src_times.h
@@ -0,0 +1,18 @@
+$NetBSD$
+
+Patch pulled from upstream (Commit: bcaca24de4264f89a94069701361988007e22e58) to allow compilation with recent Boost versions
+--- src/times.h.orig	2014-10-05 23:02:43.000000000 +0000
++++ src/times.h
+@@ -568,11 +568,7 @@ public:
+   void   stabilize(const optional<date_t>& date = none);
+ 
+   bool   is_valid() const {
+-#if BOOST_VERSION >= 105600
+-    return start != NULL;
+-#else
+-    return start;
+-#endif
++    return static_cast<bool>(start);
+   }
+ 
+   /** Find the current or next period containing date.  Returns false if


Home | Main Index | Thread Index | Old Index