1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5 nixosTests,
6}:
7
8stdenv.mkDerivation rec {
9 pname = "3proxy";
10 version = "0.9.5";
11
12 src = fetchFromGitHub {
13 owner = "3proxy";
14 repo = "3proxy";
15 rev = version;
16 sha256 = "sha256-uy6flZ1a7o02pr5O0pgl9zCjh8mE9W5JxotJeBMB16A=";
17 };
18
19 # They use 'install -s', that calls the native strip instead of the cross.
20 # Don't strip binary on install, we strip it on fixup phase anyway.
21 postPatch = ''
22 substituteInPlace Makefile.Linux \
23 --replace "(INSTALL_BIN) -s" "(INSTALL_BIN)" \
24 --replace "/usr" ""
25 '';
26
27 makeFlags = [
28 "-f Makefile.Linux"
29 "INSTALL=install"
30 "DESTDIR=${placeholder "out"}"
31 "CC:=$(CC)"
32 ];
33
34 postInstall = ''
35 rm -fr $out/var
36 '';
37
38 # common.c:208:9: error: initialization of 'int (*)(struct pollfd *, unsigned int, int)' from incompatible pointer type 'int (*)(struct pollfd *, nfds_t, int)' {aka 'int (*)(struct pollfd *, long unsigned int, int)'}
39 env.NIX_CFLAGS_COMPILE = "-Wno-error=incompatible-pointer-types";
40
41 passthru.tests = {
42 smoke-test = nixosTests._3proxy;
43 };
44
45 meta = {
46 description = "Tiny free proxy server";
47 homepage = "https://github.com/3proxy/3proxy";
48 license = lib.licenses.bsd2;
49 platforms = lib.platforms.linux;
50 maintainers = with lib.maintainers; [ misuzu ];
51 };
52}