github.com/jstaf/onedriver@v0.14.2-0.20240420231225-f07678f9e6ef/cgo-helper.sh (about) 1 #!/usr/bin/env bash 2 # cgo cannot conditionally use different packages based on which system packages 3 # are installed so this script is here to autodetect which webkit2gtk c headers 4 # we have access to 5 6 if [ -n "$CGO_ENABLED" ] && [ "$CGO_ENABLED" -eq 0 ]; then 7 exit 0 8 fi 9 10 if pkg-config webkit2gtk-4.0; then 11 sed -i 's/webkit2gtk-4.1/webkit2gtk-4.0/g' fs/graph/oauth2_gtk.go 12 elif ! pkg-config webkit2gtk-4.1; then 13 echo "webkit2gtk development headers must be installed" 14 exit 1 15 fi