fork
Configure Feed
Select the types of activity you want to include in your feed.
lol
fork
Configure Feed
Select the types of activity you want to include in your feed.
1{ stdenv
2, lib
3, fetchFromGitHub
4, fetchpatch
5, autoconf
6, automake
7, bison
8, cmake
9, libtool
10, civetweb
11, coreutils
12, curl
13, flex
14, gnutls
15, jemalloc
16, libconfig
17, libdaemon
18, libev
19, libgcrypt
20, libinjection
21, libmicrohttpd_0_9_70
22, lz4
23, nlohmann_json
24, openssl
25, pcre
26, perl
27, prometheus-cpp
28, python
29, re2
30, zlib
31}:
32
33stdenv.mkDerivation rec {
34 pname = "proxysql";
35 version = "2.3.2";
36
37 src = fetchFromGitHub {
38 owner = "sysown";
39 repo = pname;
40 rev = version;
41 sha256 = "13l4bf7zhfjy701qx9hfr40vlsm4d0pbfmwr5d6lf514xznvsnzl";
42 };
43
44 patches = [
45 ./makefiles.patch
46 ./dont-phone-home.patch
47 (fetchpatch {
48 url = "https://github.com/sysown/proxysql/pull/3402.patch";
49 sha256 = "079jjhvx32qxjczmsplkhzjn9gl7c2a3famssczmjv2ffs65vibi";
50 })
51 ];
52
53 nativeBuildInputs = [
54 autoconf
55 automake
56 cmake
57 libtool
58 perl
59 python
60 ];
61
62 buildInputs = [
63 bison
64 curl
65 flex
66 gnutls
67 libgcrypt
68 openssl
69 zlib
70 ];
71
72 GIT_VERSION = version;
73
74 dontConfigure = true;
75
76 # replace and fix some vendored dependencies
77 preBuild = /* sh */ ''
78 pushd deps
79
80 function replace_dep() {
81 local folder="$1"
82 local src="$2"
83 local symlink="$3"
84 local name="$4"
85
86 pushd "$folder"
87
88 rm -rf "$symlink"
89 if [ -d "$src" ]; then
90 cp -R "$src"/. "$symlink"
91 chmod -R u+w "$symlink"
92 else
93 tar xf "$src"
94 ln -s "$name" "$symlink"
95 fi
96
97 popd
98 }
99
100 ${lib.concatMapStringsSep "\n"
101 (x: ''replace_dep "${x.f}" "${x.p.src}" "${x.p.pname or (builtins.parseDrvName x.p.name).name}" "${x.p.name}"'') [
102 { f = "curl"; p = curl; }
103 { f = "jemalloc"; p = jemalloc; }
104 { f = "libconfig"; p = libconfig; }
105 { f = "libdaemon"; p = libdaemon; }
106 { f = "libev"; p = libev; }
107 { f = "libinjection"; p = libinjection; }
108 { f = "libmicrohttpd"; p = libmicrohttpd_0_9_70; }
109 { f = "libssl"; p = openssl; }
110 { f = "lz4"; p = lz4; }
111 { f = "pcre"; p = pcre; }
112 { f = "prometheus-cpp"; p = prometheus-cpp; }
113 { f = "re2"; p = re2; }
114 ]}
115
116 pushd libhttpserver
117 tar xf libhttpserver-0.18.1.tar.gz
118 sed -i s_/bin/pwd_${coreutils}/bin/pwd_g libhttpserver/configure.ac
119 popd
120
121 pushd json
122 rm json.hpp
123 ln -s ${nlohmann_json.src}/single_include/nlohmann/json.hpp .
124 popd
125
126 pushd prometheus-cpp/prometheus-cpp/3rdparty
127 replace_dep . "${civetweb.src}" civetweb
128 popd
129
130 sed -i s_/usr/bin/env_${coreutils}/bin/env_g libssl/openssl/config
131
132 popd
133 patchShebangs .
134 '';
135
136 preInstall = ''
137 mkdir -p $out/{etc,bin,lib/systemd/system}
138 '';
139
140 postInstall = ''
141 sed -i s_/usr/bin/proxysql_$out/bin/proxysql_ $out/lib/systemd/system/*.service
142 '';
143
144 meta = with lib; {
145 homepage = "https://proxysql.com/";
146 broken = stdenv.isDarwin;
147 description = "High-performance MySQL proxy";
148 license = with licenses; [ gpl3Only ];
149 maintainers = with maintainers; [ ajs124 ];
150 };
151}