diff options
-rw-r--r-- | flake.nix | 18 |
1 files changed, 15 insertions, 3 deletions
@@ -2,6 +2,7 @@ description = "A double-entry accounting system with a command-line reporting interface"; outputs = { self, nixpkgs }: let + usePython = false; useGpgme = true; forAllSystems = f: nixpkgs.lib.genAttrs systems (system: f system); nixpkgsFor = forAllSystems (system: import nixpkgs { inherit system; }); @@ -19,16 +20,27 @@ nativeBuildInputs = with pkgs; [ cmake ]; buildInputs = with pkgs; [ - boost gmp mpfr libedit python3 texinfo gnused - ] ++ pkgs.lib.optional useGpgme gpgme; + (boost.override { enablePython = usePython; python = python3; }) + gmp mpfr libedit texinfo gnused + ] + ++ pkgs.lib.optional usePython python3 + ++ pkgs.lib.optional useGpgme gpgme; enableParallelBuilding = true; cmakeFlags = [ "-DCMAKE_INSTALL_LIBDIR=lib" - (pkgs.lib.optionalString useGpgme "-DUSE_GPGME=1") + (pkgs.lib.optionalString usePython "-DUSE_PYTHON:BOOL=ON") + (pkgs.lib.optionalString useGpgme "-DUSE_GPGME:BOOL=ON") ]; + # by default, it will query the python interpreter for it's sitepackages location + # however, that would write to a different nixstore path, pass our own sitePackages location + prePatch = pkgs.lib.optionalString usePython '' + substituteInPlace src/CMakeLists.txt \ + --replace 'DESTINATION ''${Python_SITEARCH}' 'DESTINATION "lib/${pkgs.python3.sitePackages}"' + ''; + checkPhase = '' export LD_LIBRARY_PATH=$PWD export DYLD_LIBRARY_PATH=$PWD |