2022-06-16 17:23:12 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, nixosTests }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "3proxy";
|
2021-07-04 02:40:35 +00:00
|
|
|
version = "0.9.4";
|
2021-01-15 22:18:51 +00:00
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
src = fetchFromGitHub {
|
2022-06-16 17:23:12 +00:00
|
|
|
owner = "3proxy";
|
2020-04-24 23:36:52 +00:00
|
|
|
repo = pname;
|
|
|
|
rev = version;
|
2021-07-04 02:40:35 +00:00
|
|
|
sha256 = "sha256-4bLlQ/ULvpjs6fr19yBBln5mRRc+yj+zVLiTs1e/Ypc=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
2021-01-15 22:18:51 +00:00
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
# They use 'install -s', that calls the native strip instead of the cross.
|
|
|
|
# Don't strip binary on install, we strip it on fixup phase anyway.
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace Makefile.Linux \
|
|
|
|
--replace "(INSTALL_BIN) -s" "(INSTALL_BIN)" \
|
|
|
|
--replace "/usr" ""
|
|
|
|
'';
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
makeFlags = [
|
2021-01-15 22:18:51 +00:00
|
|
|
"-f Makefile.Linux"
|
2022-06-16 17:23:12 +00:00
|
|
|
"INSTALL=install"
|
2021-01-15 22:18:51 +00:00
|
|
|
"DESTDIR=${placeholder "out"}"
|
2022-06-16 17:23:12 +00:00
|
|
|
"CC:=$(CC)"
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
2021-01-15 22:18:51 +00:00
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
postInstall = ''
|
|
|
|
rm -fr $out/var
|
|
|
|
'';
|
|
|
|
|
2021-05-20 23:08:51 +00:00
|
|
|
passthru.tests = {
|
|
|
|
smoke-test = nixosTests._3proxy;
|
|
|
|
};
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Tiny free proxy server";
|
2022-06-16 17:23:12 +00:00
|
|
|
homepage = "https://github.com/3proxy/3proxy";
|
2021-01-15 22:18:51 +00:00
|
|
|
license = licenses.bsd2;
|
2020-04-24 23:36:52 +00:00
|
|
|
platforms = platforms.linux;
|
2021-01-15 22:18:51 +00:00
|
|
|
maintainers = with maintainers; [ misuzu ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|