Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ 2 lib, 3 python3Packages, 4 fetchFromGitHub, 5 gsettings-desktop-schemas, 6 adwaita-icon-theme, 7 wrapGAppsHook3, 8 gdk-pixbuf, 9 makeDesktopItem, 10 copyDesktopItems, 11}: 12let 13 version = "2.63.1"; 14in 15python3Packages.buildPythonApplication rec { 16 inherit version; 17 pname = "pyfa"; 18 format = "other"; 19 20 src = fetchFromGitHub { 21 owner = "pyfa-org"; 22 repo = "Pyfa"; 23 tag = "v${version}"; 24 hash = "sha256-kpTJ7cgS/W0mUtplERiEYJA+FszPILCI+0AVbk6MVAA="; 25 }; 26 27 desktopItems = [ 28 (makeDesktopItem { 29 name = pname; 30 exec = "${pname} %U"; 31 icon = "pyfa"; 32 desktopName = pname; 33 genericName = "Python fitting assistant for Eve Online"; 34 categories = [ "Game" ]; 35 }) 36 ]; 37 38 build-system = [ python3Packages.setuptools ]; 39 dependencies = with python3Packages; [ 40 wxpython 41 logbook 42 matplotlib 43 python-dateutil 44 requests 45 sqlalchemy_1_4 46 cryptography 47 markdown2 48 beautifulsoup4 49 pyaml 50 roman 51 numpy 52 python-jose 53 requests-cache 54 ]; 55 56 buildInputs = [ 57 gsettings-desktop-schemas 58 adwaita-icon-theme 59 gdk-pixbuf 60 ]; 61 62 dontWrapGApps = true; 63 nativeBuildInputs = [ 64 python3Packages.pyinstaller 65 wrapGAppsHook3 66 copyDesktopItems 67 ]; 68 69 # 70 # upstream does not include setup.py 71 # 72 patchPhase = '' 73 cat > setup.py <<EOF 74 from setuptools import setup 75 setup( 76 name = "${pname}", 77 version = "${version}", 78 scripts = ["pyfa.py"], 79 packages = setuptools.find_packages(), 80 ) 81 EOF 82 ''; 83 84 configurePhase = '' 85 runHook preConfigure 86 87 python3 db_update.py 88 89 runHook postConfigure 90 ''; 91 92 buildPhase = '' 93 runHook preBuild 94 95 pyinstaller --clean --noconfirm pyfa.spec 96 97 runHook postBuild 98 ''; 99 100 # 101 # pyinstaller builds up dist/pyfa/pyfa binary and 102 # dist/pyfa/apps directory with libraries and everything else. 103 # creating a symbolic link out in $out/bin to $out/share/pyfa to avoid 104 # exposing the innards of pyfa to the rest of the env. 105 # 106 installPhase = '' 107 runHook preInstall 108 109 mkdir -p $out/bin 110 mkdir -p $out/share/pixmaps 111 mkdir -p $out/share/icons/hicolor/64x64/apps/ 112 113 cp -r dist/pyfa $out/share/ 114 cp imgs/gui/pyfa64.png $out/share/pixmaps/pyfa.png 115 cp imgs/gui/pyfa64.png $out/share/icons/hicolor/64x64/apps/${pname}.png 116 ln -sf $out/share/pyfa/pyfa $out/bin/pyfa 117 118 runHook postInstall 119 ''; 120 121 fixupPhase = '' 122 runHook preFixup 123 124 wrapProgramShell $out/share/pyfa/pyfa \ 125 ''${gappsWrapperArgs[@]} \ 126 127 runHook postFixup 128 ''; 129 130 doCheck = true; 131 132 meta = { 133 description = "Python fitting assistant, cross-platform fitting tool for EVE Online"; 134 homepage = "https://github.com/pyfa-org/Pyfa"; 135 license = lib.licenses.gpl3Plus; 136 maintainers = with lib.maintainers; [ 137 toasteruwu 138 cholli 139 paschoal 140 ]; 141 mainProgram = "pyfa"; 142 platforms = lib.platforms.linux; 143 }; 144}