mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-07-16 13:48:56 +00:00
buildGoModule: supported structuredAttrs with subPackages (#519903)
This commit is contained in:
@@ -320,10 +320,15 @@ lib.extendMkDerivation {
|
||||
}
|
||||
|
||||
getGoDirs() {
|
||||
local type;
|
||||
type="$1"
|
||||
if [ -n "$subPackages" ]; then
|
||||
echo "$subPackages" | sed "s,\(^\| \),\1./,g"
|
||||
local -r type="$1"
|
||||
|
||||
# Support strucuredAttrs, they are not space seperated
|
||||
local -a subPackagesArray
|
||||
concatTo subPackagesArray subPackages
|
||||
|
||||
# Outputs each element prefixed with './' if the array is not empty
|
||||
if [[ ''${#subPackagesArray[@]} -gt 0 ]]; then
|
||||
echo "''${subPackagesArray[*]/#/./}"
|
||||
else
|
||||
find . -type f -name \*$type.go -exec dirname {} \; | grep -v "/vendor/" | sort --unique | grep -v "$exclude"
|
||||
fi
|
||||
|
||||
@@ -15,6 +15,7 @@ buildGoModule (finalAttrs: {
|
||||
hash = "sha256-DmIjqBTIzwkQ8aJ6xCgIwjDtczlTH5AKbPKFUGx3qQ8=";
|
||||
};
|
||||
|
||||
__structuredAttrs = true;
|
||||
vendorHash = "sha256-gBURmodXkod4fukw6LWEY+MBxPcf4vn/f6K78UR77n0=";
|
||||
|
||||
modRoot = "./cmd";
|
||||
|
||||
Reference in New Issue
Block a user