-
-
Notifications
You must be signed in to change notification settings - Fork 12
/
default.nix
90 lines (77 loc) · 2.01 KB
/
default.nix
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
84
85
86
87
88
89
90
{ lib
, stdenv
, cmake
, qtbase
, wrapQtAppsHook
, texlive
, lato
, withDoc ? true
, withGui ? true
}:
assert lib.asserts.assertMsg (withGui -> withDoc)
"withGui implies withDoc";
assert lib.asserts.assertMsg (! (stdenv.hostPlatform.isWindows && withGui == false))
"Minimal mode is not compatible with Windows build";
stdenv.mkDerivation {
pname = "qucsrflayout" + lib.strings.optionalString (!withGui) "-minimal";
version =
let
firstLine = builtins.elemAt (lib.strings.split "\n" (builtins.readFile ./CHANGELOG)) 0;
in builtins.elemAt (builtins.match "^qucsrflayout \\((.*)\\)$" firstLine) 0;
src = lib.nix-filter {
root = ./.;
include = [
"cmake"
"src"
"doc"
"lib"
"pack"
"test"
"CMakeLists.txt"
"CHANGELOG"
];
};
cmakeFlags = lib.optionals (!withGui) [
"-DQRFL_MINIMAL=ON"
];
nativeBuildInputs = [
cmake
] ++ lib.optionals withGui [
wrapQtAppsHook
] ++ lib.optionals withDoc [
lato
(texlive.combine {
inherit (texlive) scheme-small standalone pgfplots;
})
];
buildInputs = lib.optionals withGui [
qtbase
];
# Default target depends on doc when QRFL_MINIMAL=OFF
preBuild = lib.optionals (withDoc && withGui) ''
export XDG_CACHE_HOME=$TMPDIR
'';
postBuild = lib.optionals (withDoc && !withGui) ''
export XDG_CACHE_HOME=$TMPDIR
make doc
'';
postInstall = lib.optionals stdenv.hostPlatform.isWindows ''
mkdir -p $out/bin/platforms
ln -t $out/bin/platforms -s ${qtbase}/lib/qt-6/plugins/platforms/qwindows.dll
'';
dontWrapQtApps = stdenv.hostPlatform.isWindows;
QT_XCB_GL_INTEGRATION = "none";
meta = {
homepage = "https://github.com/thomaslepoix/Qucs-RFlayout";
description = "Export Qucs RF schematics to KiCad layouts & OpenEMS scripts";
license = lib.licenses.gpl3;
maintainers = [
{
email = "[email protected]";
github = "thomaslepoix";
githubId = 26417323;
name = "Thomas Lepoix";
}
];
};
}