Files
nixpkgs/pkgs/by-name/py/pyfa/package.nix
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

145 lines
2.9 KiB
Nix

{
lib,
python3Packages,
fetchFromGitHub,
gsettings-desktop-schemas,
adwaita-icon-theme,
wrapGAppsHook3,
gdk-pixbuf,
makeDesktopItem,
copyDesktopItems,
}:
let
version = "2.64.1";
in
python3Packages.buildPythonApplication rec {
inherit version;
pname = "pyfa";
format = "other";
src = fetchFromGitHub {
owner = "pyfa-org";
repo = "Pyfa";
tag = "v${version}";
hash = "sha256-qqfJ8nYI1y74sGJDbwrq0mT03em62BmU+y6GPmUUIIo=";
};
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;
};
}