feat(external): Include *.s (ASM) files in external builds

This commit is contained in:
Vincent Ambo 2019-12-13 15:15:53 +00:00
parent cfae527cc1
commit 859c429b2f
2 changed files with 9 additions and 0 deletions

View file

@ -67,6 +67,7 @@ let
libArgs = args // {
name = pathToName entry.name;
path = lib.concatStringsSep "/" ([ path ] ++ entry.locator);
sfiles = map (f: src + ("/" + f)) entry.sfiles;
};
binArgs = args // {

8
external/main.go vendored
View file

@ -32,6 +32,7 @@ type pkg struct {
Name string `json:"name"`
Locator []string `json:"locator"`
Files []string `json:"files"`
SFiles []string `json:"sfiles"`
LocalDeps [][]string `json:"localDeps"`
ForeignDeps []string `json:"foreignDeps"`
IsCommand bool `json:"isCommand"`
@ -75,6 +76,7 @@ func findGoDirs(at string) ([]string, error) {
// generate a derivation for this package.
func analysePackage(root, source, importpath string, stdlib map[string]bool) (pkg, error) {
ctx := build.Default
ctx.CgoEnabled = false
p, err := ctx.ImportDir(source, build.IgnoreVendor)
if err != nil {
@ -114,10 +116,16 @@ func analysePackage(root, source, importpath string, stdlib map[string]bool) (pk
files = append(files, path.Join(prefix, f))
}
sfiles := []string{}
for _, f := range p.SFiles {
sfiles = append(sfiles, path.Join(prefix, f))
}
return pkg{
Name: path.Join(importpath, prefix),
Locator: locator,
Files: files,
SFiles: sfiles,
LocalDeps: local,
ForeignDeps: foreign,
IsCommand: p.IsCommand(),