2016-10-06 19:34:35 +01:00
|
|
|
{ stdenv, fetchurl, python }:
|
2014-02-26 22:58:24 +00:00
|
|
|
|
2016-10-06 19:34:35 +01:00
|
|
|
let
|
2017-05-05 20:13:26 +01:00
|
|
|
pythonEnv = python.withPackages(ps: [ps.Pyro]);
|
2016-10-06 19:34:35 +01:00
|
|
|
in stdenv.mkDerivation rec {
|
2014-02-26 22:58:24 +00:00
|
|
|
name = "openopc-${version}";
|
|
|
|
version = "1.2.0";
|
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "mirror://sourceforge/project/openopc/openopc/${version}/OpenOPC-${version}.source.tar.bz2";
|
|
|
|
sha256 = "0mm77fiipz5zy82l6pr3wk18bfril81milv2rdxr954c4gw5smyd";
|
|
|
|
};
|
|
|
|
|
|
|
|
# There is no setup.py or any other "build system" file in the source archive.
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p "$out/bin"
|
|
|
|
mkdir -p "$out/share/doc/openopc"
|
2016-10-06 19:34:35 +01:00
|
|
|
mkdir -p "$out/${pythonEnv.python.sitePackages}"
|
2014-02-26 22:58:24 +00:00
|
|
|
mkdir -p "$out/libexec/opc"
|
|
|
|
|
2016-10-06 19:34:35 +01:00
|
|
|
cp src/OpenOPC.py "$out/${pythonEnv.python.sitePackages}"
|
2014-02-26 22:58:24 +00:00
|
|
|
cp src/opc.py "$out/libexec/opc/"
|
|
|
|
|
|
|
|
cat > "$out/bin/opc" << __EOF__
|
|
|
|
#!${stdenv.shell}
|
2016-10-06 19:34:35 +01:00
|
|
|
export PYTHONPATH="$out/${pythonEnv.python.sitePackages}"
|
|
|
|
exec ${pythonEnv}/bin/${pythonEnv.python.executable} "$out/libexec/opc/opc.py" "\$@"
|
2014-02-26 22:58:24 +00:00
|
|
|
__EOF__
|
|
|
|
chmod a+x "$out/bin/opc"
|
|
|
|
|
|
|
|
cp -R *.txt doc/* "$out/share/doc/openopc/"
|
|
|
|
|
|
|
|
# Copy these MS Windows tools, for reference.
|
|
|
|
cp src/OpenOPCService.py src/SystemHealth.py "$out/libexec/opc/"
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "OPC (OLE for Process Control) toolkit designed for use with Python";
|
|
|
|
homepage = http://openopc.sourceforge.net/;
|
|
|
|
# """OpenOPC for Python is freely available under the terms of the GNU GPL.
|
|
|
|
# However, the OpenOPC library module is licensed under the "GPL + linking
|
|
|
|
# exception" license, which generally means that programs written using the
|
|
|
|
# OpenOPC library may be licensed under any terms."""
|
|
|
|
license = licenses.gpl2;
|
|
|
|
platforms = platforms.linux;
|
|
|
|
maintainers = [ maintainers.bjornfor ];
|
|
|
|
};
|
|
|
|
}
|