Switch to buildPythonApplication.
This commit is contained in:
parent
b224a78b89
commit
bf419b6f4a
@ -14,41 +14,88 @@
|
|||||||
makeWrapper,
|
makeWrapper,
|
||||||
lib,
|
lib,
|
||||||
python3,
|
python3,
|
||||||
|
# python3Packages,
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
stdenv.mkDerivation {
|
let
|
||||||
name = "amd_s2idle";
|
version = "0.2.7";
|
||||||
src = pkgs.fetchgit {
|
in
|
||||||
url = "https://gitlab.freedesktop.org/drm/amd.git";
|
python3.pkgs.buildPythonApplication {
|
||||||
rev = "0f486d26c05044cebe2c61143bfd56899eef716f";
|
pname = "amd-debug-tools";
|
||||||
sha256 = "sha256-Q1QTaxuvtVKEizO7OHudhcZzxrgcYRgGJOvLDQPMGZ0=";
|
version = version;
|
||||||
};
|
pyproject = true;
|
||||||
buildInputs = [ ];
|
|
||||||
nativeBuildInputs = [ makeWrapper ];
|
# name = "amd-debug-tools";
|
||||||
phases = [
|
# format = "pyproject";
|
||||||
"installPhase"
|
nativeBuildInputs = with python3.pkgs; [
|
||||||
# "fixupPhase"
|
setuptools
|
||||||
|
setuptools-git-versioning
|
||||||
|
setuptools-git
|
||||||
|
pyudev
|
||||||
];
|
];
|
||||||
installPhase = ''
|
propagatedBuildInputs = with python3.pkgs; [
|
||||||
runHook preInstall
|
pyudev
|
||||||
mkdir -p $out/bin
|
pandas
|
||||||
cp $src/scripts/amd_s2idle.py $out/bin/amd_s2idle
|
jinja2
|
||||||
runHook postInstall
|
tabulate
|
||||||
|
seaborn
|
||||||
|
# cysystemd
|
||||||
|
jinja2
|
||||||
|
matplotlib
|
||||||
|
seaborn
|
||||||
|
];
|
||||||
|
src = pkgs.fetchgit {
|
||||||
|
url = "https://git.kernel.org/pub/scm/linux/kernel/git/superm1/amd-debug-tools.git";
|
||||||
|
tag = version;
|
||||||
|
sha256 = "sha256-6X9cUKN0BkkKcYGU+YJYCGT+l5iUZDN+D8Fqq/ns98Q=";
|
||||||
|
leaveDotGit = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
postPatch = ''
|
||||||
|
substituteInPlace pyproject.toml \
|
||||||
|
--replace-fail ', "setuptools-git-versioning>=2.0,<3"' ""
|
||||||
'';
|
'';
|
||||||
postInstall = ''
|
|
||||||
sed -i 's@#!/usr/bin/python3@#!/usr/bin/env python3@g' $out/bin/amd_s2idle
|
meta = with lib; {
|
||||||
wrapProgram $out/bin/amd_s2idle --prefix PATH : ${
|
description = "Debug tools for AMD zen systems";
|
||||||
lib.makeBinPath [
|
homepage = "https://git.kernel.org/pub/scm/linux/kernel/git/superm1/amd-debug-tools.git/";
|
||||||
(python3.withPackages (python-pkgs: [
|
license = licenses.mit;
|
||||||
python-pkgs.distro # For https://gitlab.freedesktop.org/drm/amd/-/blob/master/scripts/amd_s2idle.py
|
platforms = platforms.linux;
|
||||||
python-pkgs.pyudev # For https://gitlab.freedesktop.org/drm/amd/-/blob/master/scripts/amd_s2idle.py
|
};
|
||||||
python-pkgs.systemd # For https://gitlab.freedesktop.org/drm/amd/-/blob/master/scripts/amd_s2idle.py
|
|
||||||
python-pkgs.packaging # For https://gitlab.freedesktop.org/drm/amd/-/blob/master/scripts/amd_s2idle.py
|
|
||||||
]))
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
'';
|
# stdenv.mkDerivation {
|
||||||
# fixupPhase = ''
|
# name = "amd_s2idle";
|
||||||
# patchShebangs $out/bin/.amd_s2idle-wrapped
|
# src = pkgs.fetchgit {
|
||||||
|
# url = "https://gitlab.freedesktop.org/drm/amd.git";
|
||||||
|
# rev = "0f486d26c05044cebe2c61143bfd56899eef716f";
|
||||||
|
# sha256 = "sha256-Q1QTaxuvtVKEizO7OHudhcZzxrgcYRgGJOvLDQPMGZ0=";
|
||||||
|
# };
|
||||||
|
# buildInputs = [ ];
|
||||||
|
# nativeBuildInputs = [ makeWrapper ];
|
||||||
|
# phases = [
|
||||||
|
# "installPhase"
|
||||||
|
# # "fixupPhase"
|
||||||
|
# ];
|
||||||
|
# installPhase = ''
|
||||||
|
# runHook preInstall
|
||||||
|
# mkdir -p $out/bin
|
||||||
|
# cp $src/scripts/amd_s2idle.py $out/bin/amd_s2idle
|
||||||
|
# runHook postInstall
|
||||||
# '';
|
# '';
|
||||||
}
|
# postInstall = ''
|
||||||
|
# sed -i 's@#!/usr/bin/python3@#!/usr/bin/env python3@g' $out/bin/amd_s2idle
|
||||||
|
# wrapProgram $out/bin/amd_s2idle --prefix PATH : ${
|
||||||
|
# lib.makeBinPath [
|
||||||
|
# (python3.withPackages (python-pkgs: [
|
||||||
|
# python-pkgs.distro # For https://gitlab.freedesktop.org/drm/amd/-/blob/master/scripts/amd_s2idle.py
|
||||||
|
# python-pkgs.pyudev # For https://gitlab.freedesktop.org/drm/amd/-/blob/master/scripts/amd_s2idle.py
|
||||||
|
# python-pkgs.systemd # For https://gitlab.freedesktop.org/drm/amd/-/blob/master/scripts/amd_s2idle.py
|
||||||
|
# python-pkgs.packaging # For https://gitlab.freedesktop.org/drm/amd/-/blob/master/scripts/amd_s2idle.py
|
||||||
|
# ]))
|
||||||
|
# ]
|
||||||
|
# }
|
||||||
|
# '';
|
||||||
|
# # fixupPhase = ''
|
||||||
|
# # patchShebangs $out/bin/.amd_s2idle-wrapped
|
||||||
|
# # '';
|
||||||
|
# }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user