nixpkgs/pkgs/applications/misc/xmrig/proxy.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

62 lines
1.2 KiB
Nix
Raw Normal View History

2023-02-05 05:25:30 +00:00
{ stdenv
, lib
, fetchFromGitHub
, cmake
, libuv
, libmicrohttpd
, openssl
, darwin
2018-04-09 12:00:42 +00:00
}:
2023-02-05 05:25:30 +00:00
let
inherit (darwin.apple_sdk_11_0.frameworks) CoreServices IOKit;
in
2018-04-09 12:00:42 +00:00
stdenv.mkDerivation rec {
pname = "xmrig-proxy";
2024-03-26 16:19:11 +00:00
version = "6.21.1";
2018-04-09 12:00:42 +00:00
src = fetchFromGitHub {
owner = "xmrig";
repo = "xmrig-proxy";
rev = "v${version}";
2024-03-26 16:19:11 +00:00
hash = "sha256-70SYdO3uyPINanAoARd2lDwyiuc2f/gg4QuoDgoXjjs=";
2018-04-09 12:00:42 +00:00
};
postPatch = ''
2023-02-05 05:25:30 +00:00
# Link dynamically against libraries instead of statically
substituteInPlace CMakeLists.txt \
--replace uuid.a uuid
substituteInPlace cmake/OpenSSL.cmake \
--replace "set(OPENSSL_USE_STATIC_LIBS TRUE)" "set(OPENSSL_USE_STATIC_LIBS FALSE)"
2018-04-09 12:00:42 +00:00
'';
2023-02-05 05:25:30 +00:00
nativeBuildInputs = [
cmake
];
buildInputs = [
libuv
libmicrohttpd
openssl
] ++ lib.optionals stdenv.isDarwin [
CoreServices
IOKit
];
2018-04-09 12:00:42 +00:00
installPhase = ''
2023-02-05 05:25:30 +00:00
runHook preInstall
2018-04-09 12:00:42 +00:00
install -vD xmrig-proxy $out/bin/xmrig-proxy
2023-02-05 05:25:30 +00:00
runHook postInstall
2018-04-09 12:00:42 +00:00
'';
meta = with lib; {
description = "Monero (XMR) Stratum protocol proxy";
mainProgram = "xmrig-proxy";
2018-04-09 12:00:42 +00:00
homepage = "https://github.com/xmrig/xmrig-proxy";
license = licenses.gpl3Plus;
maintainers = with maintainers; [ aij ];
};
}