mirror of
https://github.com/hyprwm/Hyprland.git
synced 2024-09-11 05:15:39 +03: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,14 +1,14 @@
|
|||||||
#!/bin/sh
|
#!/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)
|
HASH=$(git rev-parse HEAD)
|
||||||
BRANCH=$(git rev-parse --abbrev-ref 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')
|
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)
|
TAG=$(git describe --tags)
|
||||||
|
|
||||||
awk -i inplace "{sub(/@HASH@/,\"${HASH}\")}1" ./src/version.h
|
sed -i -e "s#@HASH@#${HASH}#" ./src/version.h
|
||||||
awk -i inplace "{sub(/@BRANCH@/,\"${BRANCH}\")}1" ./src/version.h
|
sed -i -e "s#@BRANCH@#${BRANCH}#" ./src/version.h
|
||||||
awk -i inplace "{sub(/@MESSAGE@/,\"${MESSAGE}\")}1" ./src/version.h
|
sed -i -e "s#@MESSAGE@#${MESSAGE}#" ./src/version.h
|
||||||
awk -i inplace "{sub(/@DIRTY@/,\"${DIRTY}\")}1" ./src/version.h
|
sed -i -e "s#@DIRTY@#${DIRTY}#" ./src/version.h
|
||||||
awk -i inplace "{sub(/@TAG@/,\"${TAG}\")}1" ./src/version.h
|
sed -i -e "s#@TAG@#${TAG}#" ./src/version.h
|
Loading…
Reference in New Issue
Block a user