mirror of
https://github.com/Swarsel/.dotfiles.git
synced 2025-12-06 09:07:21 +01:00
feat: improve EonTimer package
This commit is contained in:
parent
52c6bce5a1
commit
07a99987a7
13 changed files with 214 additions and 90 deletions
|
|
@ -25,6 +25,7 @@ let
|
|||
"vershell"
|
||||
"eontimer"
|
||||
"project"
|
||||
"fhs"
|
||||
];
|
||||
in
|
||||
lib.swarselsystems.mkPackages packageNames pkgs
|
||||
|
|
|
|||
|
|
@ -1,22 +1,34 @@
|
|||
{ pkgs, python3Packages, ... }:
|
||||
|
||||
python3Packages.buildPythonApplication rec {
|
||||
{ lib
|
||||
, python3
|
||||
, fetchFromGitHub
|
||||
, makeDesktopItem
|
||||
, writeShellScript
|
||||
, ...
|
||||
}:
|
||||
let
|
||||
wrapper = writeShellScript "eontimer-wrapper" ''
|
||||
export QT_QPA_PLATFORM=xcb
|
||||
exec @out@/bin/EonTimer
|
||||
'';
|
||||
in
|
||||
python3.pkgs.buildPythonApplication rec {
|
||||
pname = "eontimer";
|
||||
version = "3.0.0";
|
||||
version = "3.0.0-rc.6";
|
||||
pyproject = true;
|
||||
|
||||
src = pkgs.fetchFromGitHub {
|
||||
src = fetchFromGitHub {
|
||||
owner = "DasAmpharos";
|
||||
repo = "EonTimer";
|
||||
rev = "9449e6158f0aa6eaa24b3b1d0a427aa198b5c0e4";
|
||||
rev = version;
|
||||
hash = "sha256-+XN/VGGlEg2gVncRZrWDOZ2bfxt8xyIu22F2wHlG6YI=";
|
||||
};
|
||||
|
||||
build-system = with python3Packages; [
|
||||
setuptools
|
||||
build-system = [
|
||||
python3.pkgs.setuptools
|
||||
python3.pkgs.wheel
|
||||
];
|
||||
|
||||
dependencies = with python3Packages; [
|
||||
dependencies = with python3.pkgs; [
|
||||
altgraph
|
||||
certifi
|
||||
charset-normalizer
|
||||
|
|
@ -36,14 +48,48 @@ python3Packages.buildPythonApplication rec {
|
|||
urllib3
|
||||
];
|
||||
|
||||
nativeBuildInputs = [
|
||||
python3.pkgs.pyinstaller
|
||||
];
|
||||
|
||||
buildPhase = ''
|
||||
${pkgs.python3Packages.pyinstaller}/bin/pyinstaller EonTimer.spec
|
||||
runHook preBuild
|
||||
|
||||
pyinstaller --clean --noconfirm EonTimer.spec
|
||||
|
||||
runHook postBuild
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
|
||||
mkdir -p $out/bin
|
||||
mkdir -p $out/share/applications
|
||||
cp dist/EonTimer $out/bin/
|
||||
install -Dm755 -T ${wrapper} $out/bin/eontimer
|
||||
substituteInPlace $out/bin/eontimer --subst-var out
|
||||
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
postInstall = ''
|
||||
install -Dm755 -t $out/share/applications ${
|
||||
makeDesktopItem {
|
||||
name = "eontimer";
|
||||
desktopName = "EonTimer";
|
||||
comment = "Start EonTimer";
|
||||
exec = "eontimer";
|
||||
}
|
||||
}/share/applications/eontimer.desktop
|
||||
'';
|
||||
|
||||
|
||||
|
||||
meta = {
|
||||
description = "Pokémon RNG Timer";
|
||||
homepage = "https://github.com/DasAmpharos/EonTimer";
|
||||
license = lib.licenses.mit;
|
||||
maintainers = with lib.maintainers; [ ];
|
||||
mainProgram = "eon-timer";
|
||||
};
|
||||
}
|
||||
|
|
|
|||
11
pkgs/fhs/default.nix
Normal file
11
pkgs/fhs/default.nix
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
{ name, pkgs, ... }:
|
||||
let
|
||||
base = pkgs.appimageTools.defaultFhsEnvArgs;
|
||||
in
|
||||
pkgs.buildFHSEnv (base // {
|
||||
name = "fhs";
|
||||
targetPkgs = pkgs: (base.targetPkgs pkgs) ++ [ pkgs.pkg-config ];
|
||||
profile = "export FHS=1";
|
||||
runScript = "zsh";
|
||||
extraOutputsToInstall = [ "dev" ];
|
||||
})
|
||||
Loading…
Add table
Add a link
Reference in a new issue