sane-scripts: split sane-lib-ssdp into an actual, nix-level library
This commit is contained in:
@@ -5,15 +5,6 @@
|
|||||||
}:
|
}:
|
||||||
|
|
||||||
let
|
let
|
||||||
# for a python script that needs the lib/ directory
|
|
||||||
# TODO: would be better to package the lib directory as its own python library
|
|
||||||
pythonWithLib = args: static-nix-shell.mkPython3Bin (args // {
|
|
||||||
postInstall = args.postInstall or "" + ''
|
|
||||||
mkdir -p $out/bin/lib
|
|
||||||
cp -R lib/* $out/bin/lib/
|
|
||||||
'';
|
|
||||||
});
|
|
||||||
|
|
||||||
sane-lib = {
|
sane-lib = {
|
||||||
bt = python3Packages.buildPythonPackage {
|
bt = python3Packages.buildPythonPackage {
|
||||||
pname = "sane-lib-bt";
|
pname = "sane-lib-bt";
|
||||||
@@ -24,6 +15,15 @@ let
|
|||||||
"sane_bt"
|
"sane_bt"
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
ssdp = python3Packages.buildPythonPackage {
|
||||||
|
pname = "sane-lib-ssdp";
|
||||||
|
version = "0.1.0";
|
||||||
|
format = "setuptools";
|
||||||
|
src = ./src/lib/ssdp;
|
||||||
|
pythonImportChecks = [
|
||||||
|
"sane_ssdp"
|
||||||
|
];
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
nix-shell-scripts = {
|
nix-shell-scripts = {
|
||||||
@@ -45,7 +45,7 @@ let
|
|||||||
pkgs = [ "transmission" ];
|
pkgs = [ "transmission" ];
|
||||||
pyPkgs = [ "sane-lib.bt" ];
|
pyPkgs = [ "sane-lib.bt" ];
|
||||||
};
|
};
|
||||||
bt-rm = pythonWithLib {
|
bt-rm = static-nix-shell.mkPython3Bin {
|
||||||
pname = "sane-bt-rm";
|
pname = "sane-bt-rm";
|
||||||
src = ./src;
|
src = ./src;
|
||||||
pkgs = [ "transmission" ];
|
pkgs = [ "transmission" ];
|
||||||
@@ -90,19 +90,13 @@ let
|
|||||||
pname = "sane-ip-check-upnp";
|
pname = "sane-ip-check-upnp";
|
||||||
src = ./src;
|
src = ./src;
|
||||||
pkgs = [ "miniupnpc" ];
|
pkgs = [ "miniupnpc" ];
|
||||||
postInstall = ''
|
pyPkgs = [ "sane-lib.ssdp" ];
|
||||||
mkdir -p $out/bin/lib
|
|
||||||
cp -R lib/* $out/bin/lib/
|
|
||||||
'';
|
|
||||||
};
|
};
|
||||||
ip-port-forward = static-nix-shell.mkPython3Bin {
|
ip-port-forward = static-nix-shell.mkPython3Bin {
|
||||||
pname = "sane-ip-port-forward";
|
pname = "sane-ip-port-forward";
|
||||||
src = ./src;
|
src = ./src;
|
||||||
pkgs = [ "inetutils" "miniupnpc" ];
|
pkgs = [ "inetutils" "miniupnpc" ];
|
||||||
postInstall = ''
|
pyPkgs = [ "sane-lib.ssdp" ];
|
||||||
mkdir -p $out/bin/lib
|
|
||||||
cp -R lib/* $out/bin/lib/
|
|
||||||
'';
|
|
||||||
};
|
};
|
||||||
ip-reconnect = static-nix-shell.mkPython3Bin {
|
ip-reconnect = static-nix-shell.mkPython3Bin {
|
||||||
pname = "sane-ip-reconnect";
|
pname = "sane-ip-reconnect";
|
||||||
|
9
pkgs/additional/sane-scripts/src/lib/ssdp/setup.py
Normal file
9
pkgs/additional/sane-scripts/src/lib/ssdp/setup.py
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
#!/usr/bin/env python
|
||||||
|
|
||||||
|
from distutils.core import setup
|
||||||
|
|
||||||
|
setup(
|
||||||
|
name='sane-lib-ssdp',
|
||||||
|
version='0.1.0',
|
||||||
|
description='utilities for sane-scripts',
|
||||||
|
)
|
@@ -1,5 +1,5 @@
|
|||||||
#!/usr/bin/env nix-shell
|
#!/usr/bin/env nix-shell
|
||||||
#!nix-shell -i python3 -p "python3.withPackages (ps: [ ])" -p miniupnpc
|
#!nix-shell -i python3 -p "python3.withPackages (ps: [ ps.sane-lib.ssdp ])" -p miniupnpc
|
||||||
|
|
||||||
# best to run this with an external timeout. e.g.
|
# best to run this with an external timeout. e.g.
|
||||||
# - `timeout 60 sane-ip-check-upnp`
|
# - `timeout 60 sane-ip-check-upnp`
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
#!/usr/bin/env nix-shell
|
#!/usr/bin/env nix-shell
|
||||||
#!nix-shell -i python3 -p "python3.withPackages (ps: [ ])" -p inetutils -p miniupnpc
|
#!nix-shell -i python3 -p "python3.withPackages (ps: [ ps.sane-lib.ssdp ])" -p inetutils -p miniupnpc
|
||||||
|
|
||||||
'''
|
'''
|
||||||
USAGE: sane-ip-port-forward [options] [proto:port[:desc]]*
|
USAGE: sane-ip-port-forward [options] [proto:port[:desc]]*
|
||||||
|
Reference in New Issue
Block a user