forked from vlaci/openconnect-sso
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathshell.nix
More file actions
83 lines (72 loc) · 1.48 KB
/
shell.nix
File metadata and controls
83 lines (72 loc) · 1.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
{
callPackage,
mkShell,
stdenv,
qt6,
poetry,
pre-commit,
gawk,
git,
gnumake,
which,
}:
let
inherit (callPackage ./. { }) openconnect-sso;
# qtLibsFor =
# let
# inherit (lib)
# concatStrings
# filter
# head
# getName
# splitVersion
# take
# ;
# in
# dep:
# let
# qtbase = head (filter (d: getName d.name == "qtbase") dep.nativeBuildInputs);
# version = splitVersion qtbase.version;
# majorMinor = concatStrings (take 2 version);
# in
# pkgs."libsForQt${majorMinor}";
#
# qtLibs = qtLibsFor python3Packages.pyqt5;
qtwrapper = stdenv.mkDerivation {
name = "qtwrapper";
dontWrapQtApps = true;
makeWrapperArgs = [ "\${qtWrapperArgs[@]}" ];
unpackPhase = ":";
nativeBuildInputs = [
qt6.qtbase
qt6.wrapQtAppsHook
];
installPhase = ''
mkdir -p $out/bin
cat > $out/bin/wrap-qt <<'EOF'
#!/bin/sh
"$@"
EOF
chmod +x $out/bin/wrap-qt
wrapQtApp $out/bin/wrap-qt
'';
};
in
mkShell {
buildInputs = [
poetry
pre-commit
gawk
git
gnumake
which
]
++ openconnect-sso.propagatedBuildInputs;
shellHook = ''
# Python wheels are ZIP files which cannot contain timestamps prior to 1980
export SOURCE_DATE_EPOCH=315532800
# Helper for tests to find Qt libraries
export NIX_QTWRAPPER=${qtwrapper}/bin/wrap-qt
echo "Run 'make help' for available commands"
'';
}