nixpkgs/pkgs/by-name/p2/p2pool/package.nix
aleksana 571c71e6f7 treewide: migrate packages to pkgs/by-name, take 1
We are migrating packages that meet below requirements:

1. using `callPackage`
2. called path is a directory
3. overriding set is empty (`{ }`)
4. not containing path expressions other than relative path (to
makenixpkgs-vet happy)
5. not referenced by nix files outside of the directory, other
than`pkgs/top-level/all-packages.nix`
6. not referencing nix files outside of the directory
7. not referencing `default.nix` (since it's changed to `package.nix`)
8. `outPath` doesn't change after migration

The tool is here: https://github.com/Aleksanaa/by-name-migrate.
2024-11-09 20:04:51 +08:00

63 lines
1.3 KiB
Nix

{ stdenv
, cmake
, curl
, fetchFromGitHub
, gss
, hwloc
, lib
, libsodium
, libuv
, nix-update-script
, openssl
, pkg-config
, zeromq
, darwin
}:
let
inherit (darwin.apple_sdk.frameworks) Foundation;
in
stdenv.mkDerivation rec {
pname = "p2pool";
version = "4.1.1";
src = fetchFromGitHub {
owner = "SChernykh";
repo = "p2pool";
rev = "v${version}";
hash = "sha256-rxsKbrgDdVtGEv63SHi3FbFpqU2j6ESksq0SDm78j+0=";
fetchSubmodules = true;
};
nativeBuildInputs = [ cmake pkg-config ];
buildInputs = [ libuv zeromq libsodium gss hwloc openssl curl ]
++ lib.optionals stdenv.hostPlatform.isDarwin [ Foundation ];
cmakeFlags = ["-DWITH_LTO=OFF"];
env.NIX_CFLAGS_COMPILE = toString (lib.optionals (stdenv.hostPlatform.isDarwin && lib.versionOlder stdenv.hostPlatform.darwinMinVersion "10.13") [
"-faligned-allocation"
]);
installPhase = ''
runHook preInstall
install -vD p2pool $out/bin/p2pool
runHook postInstall
'';
passthru = {
updateScript = nix-update-script { };
};
meta = with lib; {
description = "Decentralized pool for Monero mining";
homepage = "https://github.com/SChernykh/p2pool";
license = licenses.gpl3Only;
maintainers = with maintainers; [ ratsclub ];
mainProgram = "p2pool";
platforms = platforms.all;
};
}