diff options
author | John Wiegley <johnw@newartisans.com> | 2020-03-27 18:28:35 -0700 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2020-03-27 18:28:35 -0700 |
commit | 0b0728e2a7e08194552624608770a770f653f767 (patch) | |
tree | 4357dc6134ba508dc63648fb1f31c37da9eac13f /default.nix | |
parent | 94922c22b6b337c83b9ce174f6cc9dcc6436feb1 (diff) | |
download | fork-ledger-0b0728e2a7e08194552624608770a770f653f767.tar.gz fork-ledger-0b0728e2a7e08194552624608770a770f653f767.tar.bz2 fork-ledger-0b0728e2a7e08194552624608770a770f653f767.zip |
Update default.nix to match more closely what nixpkgs is using
Diffstat (limited to 'default.nix')
-rw-r--r-- | default.nix | 57 |
1 files changed, 33 insertions, 24 deletions
diff --git a/default.nix b/default.nix index 8fb96e4c..5916afea 100644 --- a/default.nix +++ b/default.nix @@ -1,35 +1,44 @@ -{ stdenv, fetchFromGitHub, cmake, boost, gmp, mpfr, libedit, python -, texinfo, gnused, usePython ? true }: - -stdenv.mkDerivation rec { - name = "ledger-${version}"; +{ packages ? "llvmPackages_9" + +, rev ? "1fe82110febdf005d97b2927610ee854a38a8f26" +, sha256 ? "08x6saa7iljyq2m0j6p9phy0v17r3p8l7vklv7y7gvhdc7a85ppi" + +, pkgs ? import (builtins.fetchTarball { + url = "https://github.com/NixOS/nixpkgs/archive/${rev}.tar.gz"; + inherit sha256; }) { + config.allowUnfree = true; + config.allowBroken = false; + overlays = [ + (self: super: {}) + ]; + } +}: + +let version = "3.1.3"; + rev = "20190331"; +in - src = ./.; +pkgs.stdenv.mkDerivation { + name = "ledger-${version}-${rev}"; - buildInputs = [ - (boost.override { enablePython = usePython; }) - gmp mpfr libedit python texinfo gnused - ]; + src = ./.; - nativeBuildInputs = [ cmake ]; + buildInputs = with pkgs; [ cmake boost gmp mpfr libedit python texinfo gnused ]; enableParallelBuilding = true; - cmakeFlags = [ - "-DCMAKE_INSTALL_LIBDIR=lib" - # "-DBUILD_DOCS:BOOL=ON" - (stdenv.lib.optionalString usePython "-DUSE_PYTHON=true") - ]; + cmakeFlags = [ "-DCMAKE_INSTALL_LIBDIR=lib" ]; + + buildPhase = "make -j$NIX_BUILD_CORES"; + checkPhase = "ctest -j$NIX_BUILD_CORES"; - postBuild = '' - make doc - ''; + doCheck = true; - meta = with stdenv.lib; { - homepage = https://ledger-cli.org/; + meta = { + homepage = "http://ledger-cli.org/"; description = "A double-entry accounting system with a command-line reporting interface"; - license = licenses.bsd3; + license = pkgs.stdenv.lib.licenses.bsd3; longDescription = '' Ledger is a powerful, double-entry accounting system that is accessed @@ -38,7 +47,7 @@ stdenv.mkDerivation rec { their data, there really is no alternative. ''; - platforms = platforms.all; - maintainers = with maintainers; [ the-kenny jwiegley ]; + platforms = pkgs.stdenv.lib.platforms.all; + maintainers = with pkgs.stdenv.lib.maintainers; [ the-kenny jwiegley ]; }; } |