Skip to content

Commit d845cdd

Browse files
Clo91eafunlsycn
authored andcommitted
[formal] add jasper env
1 parent f46c668 commit d845cdd

File tree

2 files changed

+97
-0
lines changed

2 files changed

+97
-0
lines changed

templates/chisel/nix/overlay.nix

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,14 @@ final: prev: {
2121
assert final.lib.assertMsg (final.snpslmdLicenseFile != "")
2222
"You forget to set SNPSLMD_LICENSE_FILE or the '--impure' flag";
2323
final.callPackage ./pkgs/vcs-fhs-env.nix { };
24+
jasperHome = builtins.getEnv "JASPER_HOME";
25+
cdsLicenseFile = builtins.getEnv "CDS_LIC_FILE";
26+
cds-fhs-env = assert final.lib.assertMsg (final.jasperHome != "")
27+
"You forget to set JASPER_HOME or the '--impure' flag";
28+
assert final.lib.assertMsg (final.cdsLicenseFile != "")
29+
"You forget to set CDS_LIC_FILE or the '--impure' flag";
30+
final.callPackage ./pkgs/cds-fhs-env.nix { };
31+
2432

2533
projectDependencies = final.callPackage ./pkgs/project-dependencies.nix { };
2634

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
# SPDX-License-Identifier: Apache-2.0
2+
# SPDX-FileCopyrightText: 2024 Jiuyang Liu <[email protected]>
3+
{ jasperHome
4+
, cdsLicenseFile
5+
, fetchFromGitHub
6+
}:
7+
let
8+
nixpkgsSrcs = fetchFromGitHub {
9+
owner = "NixOS";
10+
repo = "nixpkgs";
11+
"rev" = "c374d94f1536013ca8e92341b540eba4c22f9c62";
12+
"hash" = "sha256-Z/ELQhrSd7bMzTO8r7NZgi9g5emh+aRKoCdaAv5fiO0=";
13+
};
14+
15+
# The cds we have only support x86-64_linux
16+
lockedPkgs = import nixpkgsSrcs { system = "x86_64-linux"; };
17+
in
18+
lockedPkgs.buildFHSEnv {
19+
name = "cds-fhs-env";
20+
21+
profile = ''
22+
[ ! -e "${jasperHome}" ] && echo "env JASPER_HOME not set" && exit 1
23+
[ ! -d "${jasperHome}" ] && echo "JASPER_HOME not accessible" && exit 1
24+
[ -z "${cdsLicenseFile}" ] && echo "env CDS LICENSE not set" && exit 1
25+
export JASPER_HOME=${jasperHome}
26+
export PATH=$JASPER_HOME/bin:$PATH
27+
export _oldCdsEnvPath="$PATH"
28+
preHook() {
29+
PATH="$PATH:$_oldCdsEnvPath"
30+
}
31+
export -f preHook
32+
'';
33+
targetPkgs = (ps: with ps; [
34+
dejavu_fonts
35+
libGL
36+
util-linux
37+
libxcrypt-legacy
38+
coreutils-full
39+
ncurses5
40+
gmp5
41+
bzip2
42+
glib
43+
bc
44+
time
45+
elfutils
46+
ncurses5
47+
e2fsprogs
48+
cyrus_sasl
49+
expat
50+
sqlite
51+
nssmdns
52+
(libkrb5.overrideAttrs rec {
53+
version = "1.18.2";
54+
src = fetchurl {
55+
url = "https://kerberos.org/dist/krb5/${lib.versions.majorMinor version}/krb5-${version}.tar.gz";
56+
hash = "sha256-xuTJ7BqYFBw/XWbd8aE1VJBQyfq06aRiDumyIIWHOuA=";
57+
};
58+
sourceRoot = "krb5-${version}/src";
59+
})
60+
(gnugrep.overrideAttrs rec {
61+
version = "3.1";
62+
doCheck = false;
63+
src = fetchurl {
64+
url = "mirror://gnu/grep/grep-${version}.tar.xz";
65+
hash = "sha256-22JcerO7PudXs5JqXPqNnhw5ka0kcHqD3eil7yv3oH4=";
66+
};
67+
})
68+
keyutils
69+
graphite2
70+
libpulseaudio
71+
libxml2
72+
gcc
73+
gnumake
74+
xorg.libX11
75+
xorg.libXft
76+
xorg.libXScrnSaver
77+
xorg.libXext
78+
xorg.libxcb
79+
xorg.libXau
80+
xorg.libXrender
81+
xorg.libXcomposite
82+
xorg.libXi
83+
xorg.libSM
84+
xorg.libICE
85+
fontconfig
86+
freetype
87+
zlib
88+
]);
89+
}

0 commit comments

Comments
 (0)