Fix broken fish.pc build on non-GNU platforms

`-v` is a non-standard GNU-only extension to `awk`, its usage in the
generation of the fish.pc script breaks on non-GNU platforms (such as
FreeBSD and presumably macOS).

Using `sed` with only standard posix commands instead.
This commit is contained in:
Mahmoud Al-Qudsi 2018-01-23 22:07:04 -06:00
parent 2ba76a7115
commit 462b9c2209

View file

@ -113,7 +113,9 @@ FISH_CREATE_DIRS(${rel_datadir}/pkgconfig ${extra_completionsdir}
# $v $(INSTALL) -m 644 fish.pc $(DESTDIR)$(datadir)/pkgconfig
CONFIGURE_FILE(fish.pc.in fish.pc.noversion)
ADD_CUSTOM_COMMAND(OUTPUT fish.pc
COMMAND awk -v `cat ${FBVF} | tr -d '\"'` '/^Version:/ {$$0=$$0 FISH_BUILD_VERSION} 1' fish.pc.noversion > fish.pc
COMMAND sed '/Version/d' fish.pc.noversion > fish.pc
COMMAND echo -n "Version: " >> fish.pc
COMMAND sed 's/FISH_BUILD_VERSION=//\;s/\"//g' ${FBVF} >> fish.pc
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
DEPENDS ${FBVF} ${CMAKE_CURRENT_BINARY_DIR}/fish.pc.noversion)