mirror of
https://github.com/hyprwm/Hyprland
synced 2024-12-22 15:09:50 +01:00
build: Unbreak Meson build on FreeBSD (#3549)
* generateVersion.sh: move cp(1) flags before arguments POSIX and BSD cp(1) don't support flags after arguments e.g., cp: -fr is not a directory * generateVersion.sh: switch to sed(1) -i for better compatibility On BSDs awk is usually The One True Awk thus doesn't support `-i inplace`. awk: unknown option -i ignored awk: can't open file {sub(/@HASH@/,"1234567890abcdef")}1 source line number 1
This commit is contained in:
parent
34455844e9
commit
0cf3d5b39a
1 changed files with 7 additions and 7 deletions
|
@ -1,14 +1,14 @@
|
|||
#!/bin/sh
|
||||
cp ./src/version.h.in ./src/version.h -fr
|
||||
cp -fr ./src/version.h.in ./src/version.h
|
||||
|
||||
HASH=$(git rev-parse HEAD)
|
||||
BRANCH=$(git rev-parse --abbrev-ref HEAD)
|
||||
MESSAGE=$(git show ${GIT_COMMIT_HASH} | head -n 5 | tail -n 1 | sed -e 's/#//g' -e 's/\"//g')
|
||||
DIRTY=$(git diff-index --quiet HEAD -- || echo \"dirty\")
|
||||
DIRTY=$(git diff-index --quiet HEAD -- || echo dirty)
|
||||
TAG=$(git describe --tags)
|
||||
|
||||
awk -i inplace "{sub(/@HASH@/,\"${HASH}\")}1" ./src/version.h
|
||||
awk -i inplace "{sub(/@BRANCH@/,\"${BRANCH}\")}1" ./src/version.h
|
||||
awk -i inplace "{sub(/@MESSAGE@/,\"${MESSAGE}\")}1" ./src/version.h
|
||||
awk -i inplace "{sub(/@DIRTY@/,\"${DIRTY}\")}1" ./src/version.h
|
||||
awk -i inplace "{sub(/@TAG@/,\"${TAG}\")}1" ./src/version.h
|
||||
sed -i -e "s#@HASH@#${HASH}#" ./src/version.h
|
||||
sed -i -e "s#@BRANCH@#${BRANCH}#" ./src/version.h
|
||||
sed -i -e "s#@MESSAGE@#${MESSAGE}#" ./src/version.h
|
||||
sed -i -e "s#@DIRTY@#${DIRTY}#" ./src/version.h
|
||||
sed -i -e "s#@TAG@#${TAG}#" ./src/version.h
|
Loading…
Reference in a new issue