2023-02-09 11:40:11 +00:00
|
|
|
{ stdenv
|
|
|
|
, lib
|
|
|
|
, fetchFromGitHub
|
|
|
|
, cmake
|
|
|
|
, libuv
|
|
|
|
, libmicrohttpd
|
|
|
|
, openssl
|
|
|
|
, darwin
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
2023-02-09 11:40:11 +00:00
|
|
|
let
|
|
|
|
inherit (darwin.apple_sdk_11_0.frameworks) CoreServices IOKit;
|
|
|
|
in
|
2020-04-24 23:36:52 +00:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "xmrig-proxy";
|
2024-09-19 14:19:46 +00:00
|
|
|
version = "6.22.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "xmrig";
|
|
|
|
repo = "xmrig-proxy";
|
|
|
|
rev = "v${version}";
|
2024-09-19 14:19:46 +00:00
|
|
|
hash = "sha256-qRn/FiYvogGFUIUj3CojtfO6fXRZghH+bgRP+ysI6mc=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
postPatch = ''
|
2023-02-09 11:40:11 +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)"
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2023-02-09 11:40:11 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
cmake
|
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
libuv
|
|
|
|
libmicrohttpd
|
|
|
|
openssl
|
2024-09-26 11:04:55 +00:00
|
|
|
] ++ lib.optionals stdenv.hostPlatform.isDarwin [
|
2023-02-09 11:40:11 +00:00
|
|
|
CoreServices
|
|
|
|
IOKit
|
|
|
|
];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
installPhase = ''
|
2023-02-09 11:40:11 +00:00
|
|
|
runHook preInstall
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
install -vD xmrig-proxy $out/bin/xmrig-proxy
|
2023-02-09 11:40:11 +00:00
|
|
|
|
|
|
|
runHook postInstall
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Monero (XMR) Stratum protocol proxy";
|
2024-04-21 15:54:59 +00:00
|
|
|
mainProgram = "xmrig-proxy";
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://github.com/xmrig/xmrig-proxy";
|
|
|
|
license = licenses.gpl3Plus;
|
|
|
|
maintainers = with maintainers; [ aij ];
|
|
|
|
};
|
|
|
|
}
|