47 lines
1.0 KiB
Nix
47 lines
1.0 KiB
Nix
|
{ lib, stdenv, fetchFromGitHub, xmm7360-pci, python3Packages, makeWrapper }:
|
||
|
|
||
|
let
|
||
|
inherit (xmm7360-pci) pname version src;
|
||
|
|
||
|
pythonPath = with python3Packages; makePythonPath [
|
||
|
python
|
||
|
configargparse
|
||
|
dbus-python
|
||
|
pyroute2
|
||
|
];
|
||
|
|
||
|
in stdenv.mkDerivation {
|
||
|
pname = "${pname}-tools";
|
||
|
inherit version src;
|
||
|
|
||
|
nativeBuildInputs = [ makeWrapper ];
|
||
|
|
||
|
buildInputs = [ python3Packages.python ];
|
||
|
|
||
|
dontBuild = true;
|
||
|
|
||
|
installPhase = ''
|
||
|
runHook preInstall
|
||
|
|
||
|
mkdir -p $out/bin $out/lib
|
||
|
cp -a rpc/* $out/lib
|
||
|
|
||
|
pushd $out/lib
|
||
|
find . -executable -type f | while read file; do
|
||
|
makeWrapper ${python3Packages.python.interpreter} $out/bin/''${file%.py} \
|
||
|
--add-flags "$out/lib/''${file}" \
|
||
|
--prefix NIX_PYTHONPATH : "${pythonPath}"
|
||
|
done
|
||
|
|
||
|
runHook postInstall
|
||
|
'';
|
||
|
|
||
|
meta = with lib; {
|
||
|
description = xmm7360-pci.meta.description + " (tools)";
|
||
|
homepage = src.meta.homepage;
|
||
|
license = licenses.gpl2;
|
||
|
maintainers = with maintainers; [ aw ];
|
||
|
platforms = platforms.linux;
|
||
|
};
|
||
|
}
|