From 8d2aa38ccb9660652990024d521d45edf7cb5570 Mon Sep 17 00:00:00 2001 From: Alexander Sieg Date: Mon, 29 Apr 2024 17:58:08 +0200 Subject: [PATCH] python3Packages.rq: fix build on darwin --- pkgs/development/python-modules/rq/default.nix | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/pkgs/development/python-modules/rq/default.nix b/pkgs/development/python-modules/rq/default.nix index 36ddd4d95b349..292cd36d83061 100644 --- a/pkgs/development/python-modules/rq/default.nix +++ b/pkgs/development/python-modules/rq/default.nix @@ -1,5 +1,4 @@ { lib -, stdenv , fetchFromGitHub , buildPythonPackage , pythonOlder @@ -16,8 +15,14 @@ , pytestCheckHook , redis-server , sentry-sdk +, writeText }: +let + redisConf = writeText "redis.conf" '' + bind 127.0.0.1 ::1 + ''; +in buildPythonPackage rec { pname = "rq"; version = "1.16.1"; @@ -47,13 +52,14 @@ buildPythonPackage rec { sentry-sdk ]; - preCheck = lib.optionalString stdenv.isLinux '' + __darwinAllowLocalNetworking = true; + preCheck = '' PATH=$out/bin:$PATH - ${redis-server}/bin/redis-server & + ${redis-server}/bin/redis-server ${redisConf} & REDIS_PID=$! ''; - postCheck = lib.optionalString stdenv.isLinux '' + postCheck = '' kill $REDIS_PID '';