summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Pipping <sebastian@pipping.org>2024-05-05 15:21:03 +0200
committerGitHub <noreply@github.com>2024-05-05 15:21:03 +0200
commitda88e9a4443dba37daea123f5e51b18a2611e03b (patch)
tree677764951865d6801fde4671b26e5816db950042
parentb58b38719507f6700dd5a7898d88c36c8b95154a (diff)
parent1253273fe4cfb322efd1834debda84118edff950 (diff)
downloadexpat-upstream-master.tar.gz
Merge pull request #869 from dag-erling/des/non-gnu-sedupstream-master
Drop dependency on GNU sed
-rw-r--r--.github/workflows/autotools-cmake.yml11
-rw-r--r--expat/Makefile.am2
-rw-r--r--expat/README.md2
-rwxr-xr-xexpat/apply-clang-format.sh2
4 files changed, 11 insertions, 6 deletions
diff --git a/.github/workflows/autotools-cmake.yml b/.github/workflows/autotools-cmake.yml
index bf48db9b..9b05914a 100644
--- a/.github/workflows/autotools-cmake.yml
+++ b/.github/workflows/autotools-cmake.yml
@@ -81,7 +81,6 @@ jobs:
automake \
cmake \
docbook2x \
- gnu-sed \
libtool \
lzip
@@ -128,8 +127,14 @@ jobs:
# Autotools' LT_LIB_M has a hardcoded exclude for "*-*-darwin*" hosts,
# while macOS does have libm and is successfully found by CMake.
# We patch the CMake side in line here to get the differ below to empty.
- export PATH="$(brew --prefix)/opt/gnu-sed/libexec/gnubin:${PATH}"
- sed 's,-lm,,' -i build_cmake/ROOT/usr/local/lib*/pkgconfig/expat.pc
+ #
+ # Both GNU and BSD sed can edit in-place without creating a backup,
+ # but not with the same syntax. The syntax for editing in-place
+ # _with_ a backup however is the same, so do that, then remove the
+ # backup so it doesn't show up in the diff later.
+ sed -e 's,-lm,,' -i.bak \
+ build_cmake/ROOT/usr/local/lib*/pkgconfig/expat.pc
+ rm -f build_cmake/ROOT/usr/local/lib*/pkgconfig/expat.pc.bak
fi
diff \
diff --git a/expat/Makefile.am b/expat/Makefile.am
index 18d3221c..47cdd1b9 100644
--- a/expat/Makefile.am
+++ b/expat/Makefile.am
@@ -117,7 +117,7 @@ buildlib:
@echo 'ERROR: # find . -name Makefile.am -exec sed \' >&2
@echo 'ERROR: -e "s,libexpat\.la,libexpatw.la," \' >&2
@echo 'ERROR: -e "s,libexpat_la,libexpatw_la," \' >&2
- @echo 'ERROR: -i {} +' >&2
+ @echo 'ERROR: -i.bak {} +' >&2
@echo 'ERROR:' >&2
@echo 'ERROR: * Run automake to re-generate Makefile.in files' >&2
@echo 'ERROR:' >&2
diff --git a/expat/README.md b/expat/README.md
index 3e949063..709afd2e 100644
--- a/expat/README.md
+++ b/expat/README.md
@@ -161,7 +161,7 @@ support this mode of compilation (yet):
`find . -name Makefile.am -exec sed
-e 's,libexpat\.la,libexpatw.la,'
-e 's,libexpat_la,libexpatw_la,'
- -i {} +`
+ -i.bak {} +`
1. Run `automake` to re-write `Makefile.in` files:<br/>
`automake`
diff --git a/expat/apply-clang-format.sh b/expat/apply-clang-format.sh
index 8d2cf938..ddff1255 100755
--- a/expat/apply-clang-format.sh
+++ b/expat/apply-clang-format.sh
@@ -56,5 +56,5 @@ clang-format "${args[@]}" -- "${files[@]}"
sed \
-e 's, @$,@,' \
-e 's,#\( \+\)cmakedefine,#cmakedefine,' \
- -i \
+ -i.bak \
expat_config.h.cmake