nixpkgs/pkgs/applications/blockchains/pivx.nix
Profpatsch 4a7f99d55d treewide: with stdenv.lib; in meta -> with lib;
Part of: https://github.com/NixOS/nixpkgs/issues/108938

meta = with stdenv.lib;

is a widely used pattern. We want to slowly remove
the `stdenv.lib` indirection and encourage people
to use `lib` directly. Thus let’s start with the meta
field.

This used a rewriting script to mostly automatically
replace all occurances of this pattern, and add the
`lib` argument to the package header if it doesn’t
exist yet.

The script in its current form is available at
https://cs.tvl.fyi/depot@2f807d7f141068d2d60676a89213eaa5353ca6e0/-/blob/users/Profpatsch/nixpkgs-rewriter/default.nix
2021-01-11 10:38:22 +01:00

60 lines
2.1 KiB
Nix

{ fetchFromGitHub, lib, stdenv, pkgconfig, autoreconfHook, wrapQtAppsHook ? null
, openssl, db48, boost, zlib, miniupnpc, gmp
, qrencode, glib, protobuf, yasm, libevent
, util-linux, qtbase ? null, qttools ? null
, enableUpnp ? false
, disableWallet ? false
, disableDaemon ? false
, withGui ? false }:
with stdenv.lib;
stdenv.mkDerivation rec {
name = "pivx-${version}";
version = "4.1.1";
src = fetchFromGitHub {
owner = "PIVX-Project";
repo= "PIVX";
rev = "v${version}";
sha256 = "03ndk46h6093v8s18d5iffz48zhlshq7jrk6vgpjfs6z2iqgd2sy";
};
nativeBuildInputs = [ pkgconfig autoreconfHook ] ++ optionals withGui [ wrapQtAppsHook ];
buildInputs = [ glib gmp openssl db48 yasm boost zlib libevent miniupnpc protobuf util-linux ]
++ optionals withGui [ qtbase qttools qrencode ];
configureFlags = [ "--with-boost-libdir=${boost.out}/lib" ]
++ optional enableUpnp "--enable-upnp-default"
++ optional disableWallet "--disable-wallet"
++ optional disableDaemon "--disable-daemon"
++ optionals withGui [ "--with-gui=yes"
"--with-qt-bindir=${qtbase.dev}/bin:${qttools.dev}/bin"
];
enableParallelBuilding = true;
doChecks = true;
postBuild = ''
mkdir -p $out/share/applications $out/share/icons
cp contrib/debian/pivx-qt.desktop $out/share/applications/
cp share/pixmaps/*128.png $out/share/icons/
'';
doInstallCheck = true;
installCheckPhase = ''
$out/bin/test_pivx
'';
meta = with lib; {
description = "An open source crypto-currency focused on fast private transactions";
longDescription = ''
PIVX is an MIT licensed, open source, blockchain-based cryptocurrency with
ultra fast transactions, low fees, high network decentralization, and
Zero Knowledge cryptography proofs for industry-leading transaction anonymity.
'';
license = licenses.mit;
homepage = "https://pivx.org";
maintainers = with maintainers; [ wucke13 ];
platforms = platforms.unix;
};
}