Cross-compilation fixes
This commit is contained in:
parent
0758f0996b
commit
b6e36b7e1c
|
@ -96,21 +96,14 @@ let
|
||||||
install -Dt $out/bin ${output}
|
install -Dt $out/bin ${output}
|
||||||
''
|
''
|
||||||
);
|
);
|
||||||
in
|
|
||||||
|
|
||||||
callerArg: sbomArg:
|
|
||||||
|
|
||||||
let
|
|
||||||
applySbom =
|
applySbom =
|
||||||
|
sbom:
|
||||||
{
|
{
|
||||||
passthru ? { },
|
passthru ? { },
|
||||||
...
|
...
|
||||||
}@prevAttrs:
|
}@prevAttrs:
|
||||||
let
|
let
|
||||||
sbom = lib.attrsets.recursiveUpdate (
|
|
||||||
if builtins.isAttrs sbomArg then sbomArg else builtins.fromJSON (builtins.readFile sbomArg)
|
|
||||||
) passthru.sbom or { };
|
|
||||||
|
|
||||||
properties = # SBOM metadata.component.properties as an attrset.
|
properties = # SBOM metadata.component.properties as an attrset.
|
||||||
lib.attrsets.recursiveUpdate (builtins.listToAttrs sbom.metadata.component.properties)
|
lib.attrsets.recursiveUpdate (builtins.listToAttrs sbom.metadata.component.properties)
|
||||||
passthru.properties or { };
|
passthru.properties or { };
|
||||||
|
@ -182,15 +175,18 @@ let
|
||||||
prevAttrs
|
prevAttrs
|
||||||
) prevAttrs prevAttrs.passthru.sbom.components;
|
) prevAttrs prevAttrs.passthru.sbom.components;
|
||||||
|
|
||||||
composition =
|
compose =
|
||||||
finalAttrs:
|
callerArg: sbom: finalAttrs:
|
||||||
let
|
let
|
||||||
callerAttrs = if builtins.isAttrs callerArg then callerArg else callerArg finalAttrs;
|
callerAttrs = if builtins.isAttrs callerArg then callerArg else callerArg finalAttrs;
|
||||||
sbomAttrs = callerAttrs // (applySbom callerAttrs);
|
sbomAttrs = callerAttrs // (applySbom sbom callerAttrs);
|
||||||
overrideAttrs = sbomAttrs // (applyOverrides sbomAttrs);
|
overrideAttrs = sbomAttrs // (applyOverrides sbomAttrs);
|
||||||
in
|
in
|
||||||
overrideAttrs;
|
overrideAttrs;
|
||||||
in
|
in
|
||||||
stdenv.mkDerivation composition
|
callerArg: sbomArg:
|
||||||
|
let
|
||||||
# TODO: Add an overrideSbom function into the result..
|
sbom = if builtins.isAttrs sbomArg then sbomArg else builtins.fromJSON (builtins.readFile sbomArg);
|
||||||
|
overrideSbom = f: stdenv.mkDerivation (compose callerArg (sbom // (f sbom)));
|
||||||
|
in
|
||||||
|
(stdenv.mkDerivation (compose callerArg sbom)) // { inherit overrideSbom; }
|
||||||
|
|
16
sbom.json
16
sbom.json
|
@ -7,7 +7,7 @@
|
||||||
"bom-ref": "pkg:nim/syndicate_utils",
|
"bom-ref": "pkg:nim/syndicate_utils",
|
||||||
"name": "syndicate_utils",
|
"name": "syndicate_utils",
|
||||||
"description": "Utilites for Syndicated Actors and Synit",
|
"description": "Utilites for Syndicated Actors and Synit",
|
||||||
"version": "20240622",
|
"version": "20240624",
|
||||||
"authors": [
|
"authors": [
|
||||||
{
|
{
|
||||||
"name": "Emery Hemingway"
|
"name": "Emery Hemingway"
|
||||||
|
@ -491,10 +491,10 @@
|
||||||
"type": "library",
|
"type": "library",
|
||||||
"bom-ref": "pkg:nim/getdns",
|
"bom-ref": "pkg:nim/getdns",
|
||||||
"name": "getdns",
|
"name": "getdns",
|
||||||
"version": "20230806",
|
"version": "trunk",
|
||||||
"externalReferences": [
|
"externalReferences": [
|
||||||
{
|
{
|
||||||
"url": "https://git.sr.ht/~ehmry/getdns-nim/archive/e4ae0992ed7c5540e6d498f3074d06c8f454a0b6.tar.gz",
|
"url": "https://git.sr.ht/~ehmry/getdns-nim/archive/e925d2f6d2bf31384969568e97917af8ef77b7a2.tar.gz",
|
||||||
"type": "source-distribution"
|
"type": "source-distribution"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -509,23 +509,23 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "nix:fod:path",
|
"name": "nix:fod:path",
|
||||||
"value": "/nix/store/j8i20k9aarzppg4p234449140nnnaycq-source"
|
"value": "/nix/store/hq145zgfjldsj7fh026ikfwkhs2cz9nv-source"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "nix:fod:rev",
|
"name": "nix:fod:rev",
|
||||||
"value": "e4ae0992ed7c5540e6d498f3074d06c8f454a0b6"
|
"value": "e925d2f6d2bf31384969568e97917af8ef77b7a2"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "nix:fod:sha256",
|
"name": "nix:fod:sha256",
|
||||||
"value": "1dp53gndr6d9s9601dd5ipkiq94j53hlx46mxv8gpr8nd98bqysg"
|
"value": "0gflawpkwk8nghwvs69yb5mj3s6fzrmybys5466m2650xr26hs4p"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "nix:fod:url",
|
"name": "nix:fod:url",
|
||||||
"value": "https://git.sr.ht/~ehmry/getdns-nim/archive/e4ae0992ed7c5540e6d498f3074d06c8f454a0b6.tar.gz"
|
"value": "https://git.sr.ht/~ehmry/getdns-nim/archive/e925d2f6d2bf31384969568e97917af8ef77b7a2.tar.gz"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "nix:fod:ref",
|
"name": "nix:fod:ref",
|
||||||
"value": "20230806"
|
"value": "trunk"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "nix:fod:srcDir",
|
"name": "nix:fod:srcDir",
|
||||||
|
|
|
@ -76,7 +76,7 @@ proc spawnHttpClient*(turn: Turn; relay: Cap): Actor {.discardable.} =
|
||||||
)
|
)
|
||||||
var resp = HttpResponse(orKind: HttpResponseKind.status)
|
var resp = HttpResponse(orKind: HttpResponseKind.status)
|
||||||
resp.status.code = stdRes.status[0 .. 2].parseInt
|
resp.status.code = stdRes.status[0 .. 2].parseInt
|
||||||
resp.status.message = stdRes.status[3 .. ^1]
|
resp.status.message = stdRes.status[4 .. ^1]
|
||||||
message(turn, peer, resp)
|
message(turn, peer, resp)
|
||||||
resp = HttpResponse(orKind: HttpResponseKind.header)
|
resp = HttpResponse(orKind: HttpResponseKind.header)
|
||||||
for key, vals in stdRes.headers.table:
|
for key, vals in stdRes.headers.table:
|
||||||
|
|
|
@ -9,8 +9,8 @@ import
|
||||||
# Avoid Sqlite3 from the standard library because it is
|
# Avoid Sqlite3 from the standard library because it is
|
||||||
# only held together by wishful thinking and dlload.
|
# only held together by wishful thinking and dlload.
|
||||||
|
|
||||||
{.passC: staticExec("pkg-config --cflags sqlite3").}
|
{.passC: staticExec"$PKG_CONFIG --cflags sqlite3".}
|
||||||
{.passL: staticExec("pkg-config --libs sqlite3").}
|
{.passL: staticExec"$PKG_CONFIG --libs sqlite3".}
|
||||||
|
|
||||||
{.pragma: sqlite3h, header: "sqlite3.h".}
|
{.pragma: sqlite3h, header: "sqlite3.h".}
|
||||||
|
|
||||||
|
|
|
@ -5,8 +5,8 @@ import std/[os, strutils]
|
||||||
import preserves, preserves/sugar, syndicate
|
import preserves, preserves/sugar, syndicate
|
||||||
import ./schema/[assertions, config]
|
import ./schema/[assertions, config]
|
||||||
|
|
||||||
{.passC: staticExec("pkg-config --cflags libxslt").}
|
{.passC: staticExec"$PKG_CONFIG --cflags libxslt".}
|
||||||
{.passL: staticExec("pkg-config --libs libxslt").}
|
{.passL: staticExec"$PKG_CONFIG --libs libxslt".}
|
||||||
|
|
||||||
{.pragma: libxslt, header: "libxslt/xslt.h", importc.}
|
{.pragma: libxslt, header: "libxslt/xslt.h", importc.}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue