From 58d1a1b07385c99a62361577ea9d16c4e3c96972 Mon Sep 17 00:00:00 2001 From: "William A. Kennington III" Date: Sat, 1 Aug 2015 18:45:23 -0700 Subject: ceph: Make python fixes more reliable --- pkgs/tools/filesystems/ceph/generic.nix | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'pkgs') diff --git a/pkgs/tools/filesystems/ceph/generic.nix b/pkgs/tools/filesystems/ceph/generic.nix index 1130772ccd85..dca6d9300206 100644 --- a/pkgs/tools/filesystems/ceph/generic.nix +++ b/pkgs/tools/filesystems/ceph/generic.nix @@ -235,15 +235,24 @@ stdenv.mkDerivation { for PY in $(find $lib/lib -name \*.py); do LIBS="$(sed -n "s/.*find_library('\([^)]*\)').*/\1/p" "$PY")" + # Delete any calls to find_library + sed -i '/find_library/d' "$PY" + # Fix each find_library call for LIB in $LIBS; do REALLIB="$lib/lib/lib$LIB.so" - sed -i "s,find_library('$LIB'),'$REALLIB',g" "$PY" + sed -i "s,\(lib$LIB = CDLL(\).*,\1'$REALLIB'),g" "$PY" done # Reapply compilation optimizations NAME=$(basename -s .py "$PY") - (cd "$(dirname $PY)"; python -c "import $NAME"; python -O -c "import $NAME") + rm -f "$PY"{c,o} + pushd "$(dirname $PY)" + python -c "import $NAME" + python -O -c "import $NAME" + popd + test -f "$PY"c + test -f "$PY"o done ''; -- cgit 1.4.1