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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
|
{
lib,
python3Packages,
fetchFromGitHub,
gsettings-desktop-schemas,
adwaita-icon-theme,
wrapGAppsHook3,
gdk-pixbuf,
makeDesktopItem,
copyDesktopItems,
}:
let
version = "2.62.3";
in
python3Packages.buildPythonApplication rec {
inherit version;
pname = "pyfa";
format = "other";
src = fetchFromGitHub {
owner = "pyfa-org";
repo = "Pyfa";
tag = "v${version}";
hash = "sha256-PqiwZwok7Mv1M4txU3D5MZYu8WxDCetLmvTqZ30rypY=";
};
desktopItems = [
(makeDesktopItem {
name = pname;
exec = "${pname} %U";
icon = "pyfa";
desktopName = pname;
genericName = "Python fitting assistant for Eve Online";
categories = [ "Game" ];
})
];
build-system = [ python3Packages.setuptools ];
dependencies = with python3Packages; [
wxpython
logbook
matplotlib
python-dateutil
requests
sqlalchemy_1_4
cryptography
markdown2
beautifulsoup4
pyaml
roman
numpy
python-jose
requests-cache
];
buildInputs = [
gsettings-desktop-schemas
adwaita-icon-theme
gdk-pixbuf
];
dontWrapGApps = true;
nativeBuildInputs = [
python3Packages.pyinstaller
wrapGAppsHook3
copyDesktopItems
];
#
# upstream does not include setup.py
#
patchPhase = ''
cat > setup.py <<EOF
from setuptools import setup
setup(
name = "${pname}",
version = "${version}",
scripts = ["pyfa.py"],
packages = setuptools.find_packages(),
)
EOF
'';
configurePhase = ''
runHook preConfigure
python3 db_update.py
runHook postConfigure
'';
buildPhase = ''
runHook preBuild
pyinstaller --clean --noconfirm pyfa.spec
runHook postBuild
'';
#
# pyinstaller builds up dist/pyfa/pyfa binary and
# dist/pyfa/apps directory with libraries and everything else.
# creating a symbolic link out in $out/bin to $out/share/pyfa to avoid
# exposing the innards of pyfa to the rest of the env.
#
installPhase = ''
runHook preInstall
mkdir -p $out/bin
mkdir -p $out/share/pixmaps
mkdir -p $out/share/icons/hicolor/64x64/apps/
cp -r dist/pyfa $out/share/
cp imgs/gui/pyfa64.png $out/share/pixmaps/pyfa.png
cp imgs/gui/pyfa64.png $out/share/icons/hicolor/64x64/apps/${pname}.png
ln -sf $out/share/pyfa/pyfa $out/bin/pyfa
runHook postInstall
'';
fixupPhase = ''
runHook preFixup
wrapProgramShell $out/share/pyfa/pyfa \
''${gappsWrapperArgs[@]} \
runHook postFixup
'';
doCheck = true;
meta = {
description = "Python fitting assistant, cross-platform fitting tool for EVE Online";
homepage = "https://github.com/pyfa-org/Pyfa";
license = lib.licenses.gpl3Plus;
maintainers = with lib.maintainers; [
toasteruwu
cholli
paschoal
];
mainProgram = "pyfa";
platforms = lib.platforms.linux;
};
}
|