-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
See chipsalliance/t1#817. Signed-off-by: Avimitin <[email protected]>
- Loading branch information
Showing
3 changed files
with
36 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,33 @@ | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# SPDX-FileCopyrightText: 2024 Jiuyang Liu <[email protected]> | ||
|
||
let | ||
getEnv' = key: | ||
let | ||
val = builtins.getEnv key; | ||
in | ||
if val == "" then | ||
builtins.throw "${key} not set or '--impure' not applied" | ||
else val; | ||
in | ||
final: prev: { | ||
espresso = final.callPackage ./pkgs/espresso.nix { }; | ||
|
||
mill = | ||
let jre = final.jdk21; | ||
in (prev.mill.override { inherit jre; }).overrideAttrs | ||
(_: { passthru = { inherit jre; }; }); | ||
|
||
fetchMillDeps = final.callPackage ./pkgs/mill-builder.nix { }; | ||
|
||
circt-full = final.callPackage ./pkgs/circt-full.nix { }; | ||
add-determinism = | ||
final.callPackage ./pkgs/add-determinism { }; # faster strip-undetereminism | ||
|
||
# Using VCS need to set VC_STATIC_HOME and SNPSLMD_LICENSE_FILE to impure env, and add sandbox dir to VC_STATIC_HOME | ||
# Remember to add "--impure" flag for nix to read this value from environment | ||
vcStaticHome = builtins.getEnv "VC_STATIC_HOME"; | ||
snpslmdLicenseFile = builtins.getEnv "SNPSLMD_LICENSE_FILE"; | ||
vcs-fhs-env = assert final.lib.assertMsg (final.vcStaticHome != "") | ||
"You forget to set VC_STATIC_HOME or the '--impure' flag"; | ||
assert final.lib.assertMsg (final.snpslmdLicenseFile != "") | ||
"You forget to set SNPSLMD_LICENSE_FILE or the '--impure' flag"; | ||
final.callPackage ./pkgs/vcs-fhs-env.nix { }; | ||
jasperHome = builtins.getEnv "JASPER_HOME"; | ||
cdsLicenseFile = builtins.getEnv "CDS_LIC_FILE"; | ||
cds-fhs-env = assert final.lib.assertMsg (final.jasperHome != "") | ||
"You forget to set JASPER_HOME or the '--impure' flag"; | ||
assert final.lib.assertMsg (final.cdsLicenseFile != "") | ||
"You forget to set CDS_LIC_FILE or the '--impure' flag"; | ||
final.callPackage ./pkgs/cds-fhs-env.nix { }; | ||
|
||
# faster strip-undetereminism | ||
add-determinism = final.callPackage ./pkgs/add-determinism { }; | ||
|
||
vcs-fhs-env = final.callPackage ./pkgs/vcs-fhs-env.nix { inherit getEnv'; }; | ||
|
||
cds-fhs-env = final.callPackage ./pkgs/cds-fhs-env.nix { inherit getEnv'; }; | ||
|
||
projectDependencies = final.callPackage ./pkgs/project-dependencies.nix { }; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,29 @@ | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# SPDX-FileCopyrightText: 2024 Jiuyang Liu <[email protected]> | ||
{ jasperHome | ||
, cdsLicenseFile | ||
{ getEnv' | ||
, fetchFromGitHub | ||
}: | ||
let | ||
nixpkgsSrcs = fetchFromGitHub { | ||
owner = "NixOS"; | ||
repo = "nixpkgs"; | ||
"rev" = "c374d94f1536013ca8e92341b540eba4c22f9c62"; | ||
"hash" = "sha256-Z/ELQhrSd7bMzTO8r7NZgi9g5emh+aRKoCdaAv5fiO0="; | ||
rev = "c374d94f1536013ca8e92341b540eba4c22f9c62"; | ||
hash = "sha256-Z/ELQhrSd7bMzTO8r7NZgi9g5emh+aRKoCdaAv5fiO0="; | ||
}; | ||
|
||
# The cds we have only support x86-64_linux | ||
lockedPkgs = import nixpkgsSrcs { system = "x86_64-linux"; }; | ||
|
||
jasperHome = getEnv' "JASPER_HOME"; | ||
cdsLicenseFile = getEnv' "CDS_LIC_FILE"; | ||
in | ||
lockedPkgs.buildFHSEnv { | ||
name = "cds-fhs-env"; | ||
|
||
profile = '' | ||
[ ! -e "${jasperHome}" ] && echo "env JASPER_HOME not set" && exit 1 | ||
[ ! -d "${jasperHome}" ] && echo "JASPER_HOME not accessible" && exit 1 | ||
[ -z "${cdsLicenseFile}" ] && echo "env CDS_LIC_FILE not set" && exit 1 | ||
[ ! -e "${jasperHome}" ] && echo "env JASPER_HOME='${jasperHome}' points to unknown location" && exit 1 | ||
[ ! -d "${jasperHome}" ] && echo "env JASPER_HOME='${jasperHome}' not accessible" && exit 1 | ||
export JASPER_HOME=${jasperHome} | ||
export CDS_LIC_FILE=${cdsLicenseFile} | ||
export PATH=$JASPER_HOME/bin:$PATH | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters