diff options
author | Emanuele Ballarin | 2018-08-05 15:57:05 +0200 |
---|---|---|
committer | GitHub | 2018-08-05 15:57:05 +0200 |
commit | 0d6eef6a6a73d9e2dbd7649287ec79e4108b6793 (patch) | |
tree | 4d4ec3bb6901594f9aa7e96d495aca233cfb6887 /PKGBUILD | |
parent | 62cde7f798a3028dcfc2eac8152d55887bdef9f2 (diff) | |
download | aur-0d6eef6a6a73d9e2dbd7649287ec79e4108b6793.tar.gz |
Add preliminary check for xattr library compliance
This addition makes the build script more robust in the case of a legacy-compliant xattr library, allowing a successful build.
Diffstat (limited to 'PKGBUILD')
-rw-r--r-- | PKGBUILD | 12 |
1 files changed, 9 insertions, 3 deletions
@@ -46,9 +46,15 @@ build() { export CGO_CFLAGS="-I${srcdir}/go/deps/sqlite/ -I${srcdir}/go/deps/dqlite/include/" export CGO_LDFLAGS="-L${srcdir}/go/deps/sqlite/.libs/ -L${srcdir}/go/deps/dqlite/.libs/" export LD_LIBRARY_PATH="${srcdir}/go/deps/sqlite/.libs/:${srcdir}/go/deps/dqlite/.libs/" - # Fix for error "attr/xattr.h: No such file or directory" - cd "${GOPATH}/src/${go_base}/../" - sed -i '/#include <attr\/xattr.h>/c\#include <sys\/xattr.h>' ./lxd/shared/idmap/shift_linux.go + # Fix error "attr/xattr.h: No such file or directory", but only if it's needed + if [ -e "/usr/include/attr/xattr.h" ] || [ -L "/usr/include/attr/xattr.h" ] ; then + : + elif [ -e "/usr/include/sys/xattr.h" ] || [ -L "/usr/include/sys/xattr.h" ] ; then + cd "${GOPATH}/src/${go_base}/../" + sed -i '/#include <attr\/xattr.h>/c\#include <sys\/xattr.h>' ./lxd/shared/idmap/shift_linux.go + else + echo "Error: you are using a non-compliant attrs library!" + fi # Normal execution cd "${GOPATH}/src/${go_base}" # Fix for error "Missing custom libsqlite3[...]" (pt.2/2) |