Skip to content

Commit

Permalink
Merge commit '3c2d228ddc74b75122b07a87bbd06263092a9661' into next
Browse files Browse the repository at this point in the history
  • Loading branch information
enderw88 committed Aug 7, 2015
2 parents 254d82e + 3c2d228 commit 0e82bd0
Show file tree
Hide file tree
Showing 58 changed files with 2,355 additions and 179 deletions.
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +0,0 @@
[submodule "lib/utfcpp"]
path = lib/utfcpp
url = http://github.com/ledger/utfcpp.git
104 changes: 88 additions & 16 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,34 +2,106 @@
# provides GNU GCC 4.6, which does not support -std=c++11 GNU GCC 4.8 is installed

# NOTE: Please validate this file after editing it using
# Travis WebLint http://lint.travis-ci.org/
# or travis-yaml https://github.com/travis-ci/travis-yaml
# Travis WebLint https://lint.travis-ci.org/
# or travis-lint https://github.com/travis-ci/travis-lint

language: cpp
compiler:
- clang
- gcc
- clang
os:
- linux
- osx
sudo: false
cache:
apt: true

env:
global:
# Boost version to use:
# _MIN is used when building the master branch
# _MAX is used when building any other branch
- BOOST_VERSION_MIN="1.49.0"
- BOOST_VERSION_MAX="1.58.0"
# List of required boost libraries to build
- BOOST_LIBS="date_time,filesystem,iostreams,python,regex,system,test"
# List of required Homebrew formulae to install
- BREWS="gmp,mpfr"
# Encrypted COVERITY_SCAN_TOKEN
- secure: "mYNxD1B8WNSvUeKzInehZ7syi2g1jH2ymeSQxoeKKD2duq3pvNWPdZdc4o9MlWQcAqcz58rhFZRIpuEWCnP0LbbJaG+MyuemMn9uAmg9Y4gFpMsBPHuTdf8pO3rDex+tkrr9puEJFgL+QV/TehxO6NDDpx7UdYvJb+4aZD/auYI="

matrix:
exclude:
- os: linux
compiler: clang
# Compiling ledger on Linux with clang
# either crashes clang or results in a ledger binary that crashes with SIGSEGV.
- os: osx
compiler: gcc
# On Mac OS X building ledger with GNU GCC 4.8 fails due to
# undefined symbols, maybe because boost was not being built with g++-4.8.
# Undefined symbols for architecture x86_64:
# "boost::re_detail::perl_matcher<char const*, std::allocator<boost::sub_match<char const*> >, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::construct_init(boost::basic_regex<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > > const&, boost::regex_constants::_match_flags)", referenced from:
# boost::re_detail::perl_matcher<char const*, std::allocator<boost::sub_match<char const*> >, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::perl_matcher(char const*, char const*, boost::match_results<char const*, std::allocator<boost::sub_match<char const*> > >&, boost::basic_regex<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > > const&, boost::regex_constants::_match_flags, char const*) in main.cc.o
# boost::re_detail::perl_matcher<char const*, std::allocator<boost::sub_match<char const*> >, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::perl_matcher(char const*, char const*, boost::match_results<char const*, std::allocator<boost::sub_match<char const*> > >&, boost::basic_regex<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > > const&, boost::regex_constants::_match_flags, char const*) in global.cc.o
# "boost::re_detail::perl_matcher<char const*, std::allocator<boost::sub_match<char const*> >, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::find()", referenced from:
# bool boost::regex_search<char const*, char, boost::regex_traits<char, boost::cpp_regex_traits<char> > >(char const*, char const*, boost::basic_regex<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > > const&, boost::regex_constants::_match_flags) in main.cc.o
# bool boost::regex_search<char const*, char, boost::regex_traits<char, boost::cpp_regex_traits<char> > >(char const*, char const*, boost::basic_regex<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > > const&, boost::regex_constants::_match_flags) in global.cc.o

addons:
coverity_scan:
project:
name: "ledger/ledger"
description: "Build submitted via Travis CI"
build_command_prepend: "cmake . -DUSE_PYTHON=ON -DBUILD_DEBUG=ON -DCLANG_GCOV=ON"
build_command: "make"
branch_pattern: coverity
apt:
sources:
- ubuntu-toolchain-r-test
#- boost-latest
packages:
- gcc-4.8
- g++-4.8
- libgmp-dev
- libmpfr-dev
- libedit-dev
#- libboost1.55-dev
#- libboost-test1.55-dev
#- libboost-regex1.55-dev
#- libboost-python1.55-dev
#- libboost-system1.55-dev
#- libboost-date-time1.55-dev
#- libboost-iostreams1.55-dev
#- libboost-filesystem1.55-dev
#- libboost-serialization1.55-dev

before_install:
# Add software package repositories with recent versions of gcc and boost
- sudo add-apt-repository ppa:ubuntu-toolchain-r/test --yes
- sudo add-apt-repository ppa:boost-latest/ppa --yes
- sudo apt-get update -qq

install:
# Install GNU GCC 4.8 required by use of C++11
- if [ "$CXX" = "g++" ]; then sudo apt-get install -qq g++-4.8 gcc-4.8; fi
- if [ "$CXX" = "g++" ]; then export CXX="g++-4.8" CC="gcc-4.8"; fi
# Install Ledger dependencies
- sudo apt-get install -qq libboost1.55 libgmp-dev libmpfr-dev libeditline-dev
- if [ "${TRAVIS_BRANCH}" = "master" ]; then export BOOST_VERSION="${BOOST_VERSION_MIN}"; else export BOOST_VERSION="${BOOST_VERSION_MAX}"; fi
- if [ -n "${BOOST_VERSION}" ]; then export BOOST_ROOT="${TRAVIS_BUILD_DIR}/../boost-trunk"; export CMAKE_MODULE_PATH="${BOOST_ROOT}"; fi
- if [ "${CXX}" = "g++" ]; then export CXX="$(which g++-4.8)"; export CC="$(which gcc-4.8)"; fi
- if [ "${TRAVIS_OS_NAME}" = "osx" ]; then export DYLD_LIBRARY_PATH="${BOOST_ROOT}/lib"; fi
# c++ is a symlink to clang++, but the compiler behaves differently when invoked as c++
- if [ "${TRAVIS_OS_NAME}" = "osx" -a "${CXX}" = "clang++" ]; then export CXX="$(which c++)"; export CC="$(which cc)"; fi
- tools/travis-before_install.sh

install:
- tools/travis-install.sh

before_script:
- ./acprep debug make --python
- cmake . -DUSE_PYTHON=ON -DBUILD_DEBUG=ON
- make

script:
- ./acprep check --jobs $(nproc) -- --output-on-failure
- ctest --output-on-failure
- PYTHONPATH=. python python/demo.py

after_script:
# These scripts are run for informational purposes and
# should be reintegrated into CTest once they reliably verify the documentation.
- python test/CheckTexinfo.py -l ledger -s .
- python test/CheckManpage.py -l ledger -s .

notifications:
email:
on_success: change
Expand Down
18 changes: 14 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ set(Ledger_VERSION_PATCH 1)
set(Ledger_VERSION_PRERELEASE "-alpha.1")
set(Ledger_VERSION_DATE 20141005)

# Point CMake at any custom modules we may ship
list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake")

enable_testing()

add_definitions(-std=c++11)
Expand Down Expand Up @@ -225,7 +228,7 @@ macro(add_ledger_library_dependencies _target)
target_link_libraries(${_target} ${INTL_LIB})
endif()
if (HAVE_BOOST_PYTHON)
if(APPLE)
if(CMAKE_SYSTEM_NAME STREQUAL Darwin)
# Don't link directly to a Python framework on OS X, to avoid segfaults
# when the module is imported from a different interpreter
target_link_libraries(${_target} ${Boost_LIBRARIES})
Expand All @@ -244,13 +247,20 @@ endmacro(add_ledger_library_dependencies _target)

########################################################################

include(FindUtfcpp)
if (UTFCPP_FOUND)
include_directories("${UTFCPP_INCLUDE_DIR}")
else()
message(FATAL_ERROR "Missing required header file: utf8.h\n"
"Define UTFCPP_PATH or install utfcpp locally into the source tree below lib/utfcpp/."
)
endif()

set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR})
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR})

# add the binary tree to the search path for include files so that we will
# find TutorialConfig.h
include_directories("${PROJECT_SOURCE_DIR}/lib")
include_directories("${PROJECT_SOURCE_DIR}/lib/utfcpp/source")
# find system.hh
include_directories("${PROJECT_BINARY_DIR}")

configure_file(
Expand Down
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
[![Build Status](https://img.shields.io/travis/ledger/ledger/master.svg?&style=flat)](https://travis-ci.org/ledger/ledger)
[![Build Status master](https://img.shields.io/travis/ledger/ledger/master.svg?label=master&style=flat)](https://travis-ci.org/ledger/ledger)
[![Build Status next](https://img.shields.io/travis/ledger/ledger/next.svg?label=next&style=flat)](https://travis-ci.org/ledger/ledger)
[![Status](https://img.shields.io/badge/status-active-brightgreen.svg?style=flat)](https://github.com/ledger/ledger/pulse/monthly)
[![License](https://img.shields.io/badge/license-BSD-blue.svg?style=flat)](http://opensource.org/licenses/BSD-3-Clause)
[![GitHub tag](https://img.shields.io/github/tag/ledger/ledger.svg?style=flat)](https://github.com/ledger/ledger/releases)
[![GitHub release](https://img.shields.io/github/release/ledger/ledger.svg?style=flat)](https://github.com/ledger/ledger/releases)


# Ledger: Command-Line Accounting
Expand Down Expand Up @@ -147,9 +148,9 @@ Or, for Ubuntu 12.04:
Debian squeeze (6.0): the version of boost in squeeze is too old
for ledger and unfortunately no backport is available at the moment.

Debian 7 (wheezy) and Debian 8 (jessie) contain all components needed to
build ledger. You can install all required build dependencies using the
following command:
Debian 7 (wheezy), Debian 8 (jessie), Debian testing (stretch) and Debian
unstable (sid) contain all components needed to build ledger. You can
install all required build dependencies using the following command:

$ sudo apt-get install build-essential cmake autopoint texinfo python-dev \
zlib1g-dev libbz2-dev libgmp3-dev gettext libmpfr-dev \
Expand Down
10 changes: 2 additions & 8 deletions acprep
Original file line number Diff line number Diff line change
Expand Up @@ -490,17 +490,10 @@ class PrepareBuild(CommandLineApp):
# Update local files with the latest information #
#########################################################################

def phase_submodule(self, *args):
self.log.info('Executing phase: submodule')
if self.git_working_tree():
self.execute('git', 'submodule', 'init')
self.execute('git', 'submodule', 'update')

def phase_pull(self, *args):
self.log.info('Executing phase: pull')
if self.git_working_tree():
self.execute('git', 'pull')
self.phase_submodule()

#########################################################################
# Automatic installation of build dependencies #
Expand Down Expand Up @@ -569,6 +562,7 @@ class PrepareBuild(CommandLineApp):
'libedit-dev',
'texinfo',
'lcov',
'libutfcpp-dev',
'sloccount'
] + BoostInfo().dependencies('ubuntu-trusty')
elif re.search('saucy', info):
Expand Down Expand Up @@ -606,6 +600,7 @@ class PrepareBuild(CommandLineApp):
'libedit-dev',
'texinfo',
'lcov',
'libutfcpp-dev',
'sloccount'
] + BoostInfo().dependencies('ubuntu-precise')
else:
Expand Down Expand Up @@ -885,7 +880,6 @@ class PrepareBuild(CommandLineApp):

def phase_config(self, *args):
self.log.info('Executing phase: config')
self.phase_submodule()
self.phase_configure(*args)
if self.should_clean:
self.phase_clean()
Expand Down
30 changes: 30 additions & 0 deletions cmake/FindUtfcpp.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# - Try to find utfcpp
# Once done, this will define
#
# UTFCPP_FOUND - system has utfcpp's utf8.h
# UTFCPP_PATH - the utfcpp include directories

include(CheckCXXSourceCompiles)

set(UTFCPP_FOUND FALSE)

find_path(UTFCPP_INCLUDE_DIR
NAMES utf8.h
HINTS "${UTFCPP_PATH}" "${PROJECT_SOURCE_DIR}/lib/utfcpp/v2_0/source"
)

if (UTFCPP_INCLUDE_DIR)
set(CMAKE_REQUIRED_INCLUDES "${UTFCPP_INCLUDE_DIR}")
set(UTFCPP_FOUND TRUE)
endif()

check_cxx_source_compiles("
#include <string>
#include \"utf8.h\"
int main(int argc, char** argv) {
std::string input = std::string(\"utfcpp\");
const char * p = input.c_str();
std::size_t len = input.length();
utf8::is_valid(p, p + len);
}" HAVE_WORKING_UTFCPP)
24 changes: 24 additions & 0 deletions doc/NEWS
Original file line number Diff line number Diff line change
@@ -1,5 +1,29 @@
Ledger NEWS

* 3.x.x

- Added a --no-revalued option

- Improved Embedded Python Support

- Fixed parsing of transactions with single-character payees and comments

- Fixed crash when using -M with empty result

- Fixed sorting for option --auto-match

- Fixed treatment of "year 2015" and "Y2014" directives

- Fixed crash when using --trace 10 or above

- Build fix for boost 1.56

- Build fix for Cygwin

- Fixed Util and Math tests on Mac OS X

- Various documentation improvements

* 3.1

- Changed the definition of cost basis to preserve the original cost basis
Expand Down
15 changes: 13 additions & 2 deletions doc/ledger.1
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,12 @@ posting occurring in that period.
Display values in terms of the given
.Ar COMMODITY .
The latest available price is used.
.\".It Fl \-explicit
.It Fl \-explicit
Direct
.Nm
to require pre-declarations for entities (such as accounts,
commodities and tags) rather than taking entities from cleared
transactions as defined.
.It Fl \-file Ar FILE
Read journal data from
.Ar FILE .
Expand Down Expand Up @@ -716,9 +721,15 @@ Aliases are completely ignored.
Suppress any color TTY output.
.It Fl \-no-pager
Disables the pager on TTY output.
.It Fl \-no-revalued
Stop
.Nm
from showing
<Revalued>
postings.
.It Fl \-no-rounding
Don't output
.Qq Li <Rounding>
.Qq Li <Adjustment>
postings. Note that this will cause the
running total to often not add up! Its main use is for
.Fl \-amount-data Pq Fl j
Expand Down
Loading

0 comments on commit 0e82bd0

Please sign in to comment.