Introduce a cysystemd package.

This commit is contained in:
Tom Alexander 2025-08-17 20:32:20 -04:00
parent bf419b6f4a
commit c87957b8cb
No known key found for this signature in database
GPG Key ID: D3A179C9A53C0EDE
2 changed files with 82 additions and 42 deletions

View File

@ -0,0 +1,76 @@
# unpackPhase
# patchPhase
# configurePhase
# buildPhase
# checkPhase
# installPhase
# fixupPhase
# installCheckPhase
# distPhase
{
stdenv,
pkgs,
sqlite,
makeWrapper,
lib,
python3,
systemd,
# setuptools,
# cython,
pkg-config,
# python3Packages,
...
}:
let
version = "1.6.3";
in
python3.pkgs.buildPythonPackage {
pname = "cysystemd";
version = version;
pyproject = true;
# format = "pyproject";
build-system = [
python3.pkgs.setuptools
python3.pkgs.cython
];
buildInputs = [ systemd ];
nativeBuildInputs = with python3.pkgs; [
# setuptools
# setuptools-git-versioning
# setuptools-git
# pyudev
# pkgs.systemd
pkg-config
];
propagatedBuildInputs = with python3.pkgs; [
# pyudev
# pandas
# jinja2
# tabulate
# seaborn
# cysystemd
# jinja2
# matplotlib
# seaborn
];
src = pkgs.fetchgit {
url = "https://github.com/mosquito/cysystemd.git";
tag = version;
sha256 = "sha256-xumrQgoKfFeKdRQUIYXXiXEcNd76i4wo/EIDm8BN7oU=";
# leaveDotGit = true;
};
# postPatch = ''
# substituteInPlace pyproject.toml \
# --replace-fail ', "setuptools-git-versioning>=2.0,<3"' ""
# '';
meta = with lib; {
description = " systemd wrapper on Cython";
homepage = "https://github.com/mosquito/cysystemd";
license = licenses.asl20;
platforms = platforms.linux;
};
}

View File

@ -14,6 +14,7 @@
makeWrapper, makeWrapper,
lib, lib,
python3, python3,
callPackage,
# python3Packages, # python3Packages,
... ...
}: }:
@ -32,17 +33,16 @@ python3.pkgs.buildPythonApplication {
setuptools-git-versioning setuptools-git-versioning
setuptools-git setuptools-git
pyudev pyudev
pkgs.systemd
]; ];
propagatedBuildInputs = with python3.pkgs; [ propagatedBuildInputs = with python3.pkgs; [
pyudev (callPackage ./cysystemd.nix { })
pandas
jinja2
tabulate
seaborn
# cysystemd
jinja2 jinja2
matplotlib matplotlib
pandas
pyudev
seaborn seaborn
tabulate
]; ];
src = pkgs.fetchgit { src = pkgs.fetchgit {
url = "https://git.kernel.org/pub/scm/linux/kernel/git/superm1/amd-debug-tools.git"; url = "https://git.kernel.org/pub/scm/linux/kernel/git/superm1/amd-debug-tools.git";
@ -63,39 +63,3 @@ python3.pkgs.buildPythonApplication {
platforms = platforms.linux; platforms = platforms.linux;
}; };
} }
# stdenv.mkDerivation {
# name = "amd_s2idle";
# 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
# # '';
# }