diff options
-rw-r--r-- | CMakeLists.txt | 33 | ||||
-rw-r--r-- | default.nix | 23 | ||||
-rw-r--r-- | src/journal.cc | 5 | ||||
-rw-r--r-- | src/system.hh.in | 2 | ||||
-rw-r--r-- | src/utils.h | 4 |
5 files changed, 20 insertions, 47 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 9d709338..e4eb091b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,6 +9,8 @@ set(Ledger_VERSION_DATE 20140417) enable_testing() +add_definitions(-std=c++11) + ######################################################################## option(USE_PYTHON "Build support for the Python scripting bridge" OFF) @@ -148,37 +150,6 @@ endif() cmake_pop_check_state() -#cmake_push_check_state() -# -#set(CMAKE_REQUIRED_FLAGS -std=c++11) -#set(CMAKE_REQUIRED_INCLUDES ${CMAKE_INCLUDE_PATH}) -# -#check_cxx_source_runs(" -##include <regex> -##include <vector> -##include <iostream> -# -#int main() { -# std::vector<int> x {0, 1, 2, 3, 4}; -# for (auto i : x) -# std::cout << i << std::endl; -# -# std::regex r(\"foo\"); -# std::cout << std::regex_match(\"foobar\", r) << std::endl; -# return 0; -#}" CXX11_RUNS) -# -#cmake_pop_check_state() -# -#if(CXX11_RUNS) -# set(HAVE_CXX11 1) -# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") -#else() - set(HAVE_CXX11 0) -#endif() -# -#cmake_pop_check_state() - ######################################################################## include_directories(${CMAKE_INCLUDE_PATH}) diff --git a/default.nix b/default.nix index 7a822bbe..f1745ce4 100644 --- a/default.nix +++ b/default.nix @@ -1,17 +1,26 @@ -{ stdenv, fetchgit, cmake, ninja, boost, gmp, mpfr, libedit, python, texinfo }: +{ stdenv, fetchgit, cmake, boost, gmp, mpfr, libedit, python +, texinfo, gnused }: + +let + rev = "20140417"; +in stdenv.mkDerivation { - name = "ledger-3.0.2"; - version = "3.0.2"; + name = "ledger-3.0.2.${rev}"; src = ./.; - buildInputs = [ cmake ninja boost gmp mpfr libedit python texinfo ]; + buildInputs = [ cmake boost gmp mpfr libedit python texinfo gnused ]; - # Tests on Darwin are failing - doCheck = !stdenv.isDarwin; enableParallelBuilding = true; + # Skip byte-compiling of emacs-lisp files because this is currently + # broken in ledger... + postInstall = '' + mkdir -p $out/share/emacs/site-lisp/ + cp -v $src/lisp/*.el $out/share/emacs/site-lisp/ + ''; + meta = { homepage = "http://ledger-cli.org/"; description = "A double-entry accounting system with a command-line reporting interface"; @@ -25,6 +34,6 @@ stdenv.mkDerivation { ''; platforms = stdenv.lib.platforms.all; - maintainers = with stdenv.lib.maintainers; [ simons the-kenny ]; + maintainers = with stdenv.lib.maintainers; [ simons the-kenny jwiegley ]; }; } diff --git a/src/journal.cc b/src/journal.cc index 2512664f..804c9ee2 100644 --- a/src/journal.cc +++ b/src/journal.cc @@ -409,10 +409,9 @@ bool journal_t::add_xact(xact_t * xact) foreach (post_t * post, xact->posts) { account_t * acct = post->account; if (acct->deferred_posts) { - deferred_posts_map_t::iterator - i = acct->deferred_posts->find(uuid); + auto i = acct->deferred_posts->find(uuid); if (i != acct->deferred_posts->end()) { - foreach (post_t * rpost, (*i).second) + for (post_t * rpost : (*i).second) if (acct == rpost->account) acct->add_post(rpost); acct->deferred_posts->erase(i); diff --git a/src/system.hh.in b/src/system.hh.in index 952411f9..8f501587 100644 --- a/src/system.hh.in +++ b/src/system.hh.in @@ -56,8 +56,6 @@ #define Ledger_VERSION_PATCH @Ledger_VERSION_PATCH@ #define Ledger_VERSION_DATE @Ledger_VERSION_DATE@ -#define HAVE_CXX11 @HAVE_CXX11@ - #define HAVE_EDIT @HAVE_EDIT@ #define HAVE_GETTEXT @HAVE_GETTEXT@ diff --git a/src/utils.h b/src/utils.h index 95cc64fd..c3dcf562 100644 --- a/src/utils.h +++ b/src/utils.h @@ -485,11 +485,7 @@ inline void check_for_signal() { /*@{*/ #define foreach BOOST_FOREACH -#if HAVE_CXX11 using std::unique_ptr; -#else -#define unique_ptr std::auto_ptr -#endif namespace ledger { |