From c7b2eba2e2b5c2592aa9bb8d0be94fbd00203cc779e863c4a424bcd51fe9661e Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Mon, 29 Jan 2024 17:55:30 +0000 Subject: [PATCH 1/3] - Force-replace all /usr/bin/env python by python3. OBS-URL: https://build.opensuse.org/package/show/devel:tools/grpc?expand=0&rev=177 --- grpc.changes | 5 +++++ grpc.spec | 2 ++ 2 files changed, 7 insertions(+) diff --git a/grpc.changes b/grpc.changes index e251eff..8298f81 100644 --- a/grpc.changes +++ b/grpc.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Mon Jan 29 17:25:06 UTC 2024 - Jan Engelhardt + +- Force-replace all /usr/bin/env python by python3. + ------------------------------------------------------------------- Thu Jan 18 07:58:43 UTC 2024 - John Paul Adrian Glaubitz diff --git a/grpc.spec b/grpc.spec index 62c4161..66cf4a5 100644 --- a/grpc.spec +++ b/grpc.spec @@ -131,6 +131,8 @@ pushd third_party/xxhash %patch2 -p1 popd rm -Rf third_party/abseil-cpp/ +find . -type f -exec grep -l '#!/usr/bin/env py' | \ + xargs perl -i -lpe 's{#!/usr/bin/env py\w+}{#!/usr/bin/python3}g' # protoc is invoked strangely; make it happy with this dir or it will assert() mkdir -p third_party/protobuf/src From 2ff2108b106f30e5a7be9b806cdd4c67e9e4940eb7c9ece45ef4ab38e3039529 Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Tue, 30 Jan 2024 00:22:07 +0000 Subject: [PATCH 2/3] stronger /env replacement OBS-URL: https://build.opensuse.org/package/show/devel:tools/grpc?expand=0&rev=178 --- grpc.spec | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/grpc.spec b/grpc.spec index 66cf4a5..b78efc3 100644 --- a/grpc.spec +++ b/grpc.spec @@ -126,14 +126,17 @@ This subpackage contains source code of the gRPC reference implementation. %prep %autosetup -N +find "." -type f -exec grep -l '/usr/bin/env' {} + | \ + xargs -r perl -i -lpe 's{#! ?/usr/bin/env python\S+}{#!/usr/bin/python3}g' +find "." -type f -exec grep -l '/usr/bin/env ' {} + | \ + xargs -r perl -i -lpe 's{#! ?/usr/bin/env }{#!/usr/bin/}g' pushd third_party/xxhash %patch1 -p1 %patch2 -p1 popd rm -Rf third_party/abseil-cpp/ -find . -type f -exec grep -l '#!/usr/bin/env py' | \ - xargs perl -i -lpe 's{#!/usr/bin/env py\w+}{#!/usr/bin/python3}g' +%build # protoc is invoked strangely; make it happy with this dir or it will assert() mkdir -p third_party/protobuf/src From e4d3402ff121fa9eaef30efac4f08ff2b79535422c67934593703a2999d2ffe8 Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Tue, 30 Jan 2024 11:33:52 +0000 Subject: [PATCH 3/3] /usr/bin/env can go die OBS-URL: https://build.opensuse.org/package/show/devel:tools/grpc?expand=0&rev=179 --- grpc.spec | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/grpc.spec b/grpc.spec index b78efc3..2f31317 100644 --- a/grpc.spec +++ b/grpc.spec @@ -126,10 +126,12 @@ This subpackage contains source code of the gRPC reference implementation. %prep %autosetup -N -find "." -type f -exec grep -l '/usr/bin/env' {} + | \ - xargs -r perl -i -lpe 's{#! ?/usr/bin/env python\S+}{#!/usr/bin/python3}g' -find "." -type f -exec grep -l '/usr/bin/env ' {} + | \ - xargs -r perl -i -lpe 's{#! ?/usr/bin/env }{#!/usr/bin/}g' +find "." -type f -exec grep -l '/usr/bin/env ' {} + | + xargs -r perl -i -lpe \ + 's{#! ?/usr/bin/env python\S*}{#!/usr/bin/python3}g; + s{#! ?/usr/bin/env sh}{#!/bin/sh}g; + s{#! ?/usr/bin/env bash}{#!/bin/bash}g; + s{#! ?/usr/bin/env }{#!/usr/bin/}g;' pushd third_party/xxhash %patch1 -p1 %patch2 -p1 @@ -143,6 +145,8 @@ mkdir -p third_party/protobuf/src cp -a /usr/src/opencensus-proto third_party/ export CFLAGS="%optflags -Wno-error" export CXXFLAGS="$CFLAGS" +find "." -type f -exec grep '/usr/bin/env ' {} + || : +pushd . %cmake -DgRPC_INSTALL=ON \ -DgRPC_INSTALL_LIBDIR:PATH="%_lib" \ -DgRPC_INSTALL_CMAKEDIR:PATH="%_libdir/cmake/grpc" \ @@ -155,6 +159,8 @@ export CXXFLAGS="$CFLAGS" -DgRPC_ZLIB_PROVIDER=package \ -DCMAKE_CXX_STANDARD=17 %cmake_build +popd +find "." -type f -exec grep '/usr/bin/env ' {} + || : %install b="%buildroot"