libinjection: patch for python3 builds

This commit is contained in:
Armeen Mahdian 2022-04-21 10:47:50 -05:00
parent 09a02d7e65
commit ea5cfaf8e1

View file

@ -1,5 +1,5 @@
{ lib, stdenv, fetchFromGitHub { lib, stdenv, fetchFromGitHub, fetchpatch
, python2 , python3
}: }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
@ -13,11 +13,19 @@ stdenv.mkDerivation rec {
sha256 = "0chsgam5dqr9vjfhdcp8cgk7la6nf3lq44zs6z6si98cq743550g"; sha256 = "0chsgam5dqr9vjfhdcp8cgk7la6nf3lq44zs6z6si98cq743550g";
}; };
nativeBuildInputs = [ python2 ]; nativeBuildInputs = [ python3 ];
strictDeps = true; strictDeps = true;
patchPhase = '' patches = [
(fetchpatch {
name = "support-python3-for-building";
url = "https://raw.githubusercontent.com/sysown/proxysql/bed58f92917eb651b80fd8ffa627a485eb320805/deps/libinjection/update-build-py3.diff";
hash = "sha256-SPdf57FIDDNpatWe5pjhAiZl5yPMDEv50k0Wj+eWTEM=";
})
];
postPatch = ''
patchShebangs src patchShebangs src
substituteInPlace src/Makefile \ substituteInPlace src/Makefile \
--replace /usr/local $out --replace /usr/local $out