summary refs log tree commit diff
path: root/pkgs/tools/misc
diff options
context:
space:
mode:
authorBjørn Forsman <bjorn.forsman@gmail.com>2014-02-26 23:58:24 +0100
committerBjørn Forsman <bjorn.forsman@gmail.com>2014-07-21 18:43:33 +0200
commitf8778ed82cd8b110ea58f8f94ba73f85982ec863 (patch)
tree8d3f423a7d989e0f975dd16e78229e5ed8995efe /pkgs/tools/misc
parent5cde295b1d367e664052c72bc751a31949bf86a7 (diff)
downloadnixlib-f8778ed82cd8b110ea58f8f94ba73f85982ec863.tar
nixlib-f8778ed82cd8b110ea58f8f94ba73f85982ec863.tar.gz
nixlib-f8778ed82cd8b110ea58f8f94ba73f85982ec863.tar.bz2
nixlib-f8778ed82cd8b110ea58f8f94ba73f85982ec863.tar.lz
nixlib-f8778ed82cd8b110ea58f8f94ba73f85982ec863.tar.xz
nixlib-f8778ed82cd8b110ea58f8f94ba73f85982ec863.tar.zst
nixlib-f8778ed82cd8b110ea58f8f94ba73f85982ec863.zip
openopc: new package
"OPC (OLE for Process Control) toolkit designed for use with Python"

This package contains a python module (OpenOPC) and a command line
client (opc). The OpenOPC Gateway Service for Windows is also copied to
$out, for reference.

It only works with python2.7 (not python3.x), so I'm not adding it to
python-packages.nix.

Also add needed dependency, python-pyro3, a distributed object
middleware for Python (IPC/RPC).

http://openopc.sourceforge.net/
Diffstat (limited to 'pkgs/tools/misc')
-rw-r--r--pkgs/tools/misc/openopc/default.nix46
1 files changed, 46 insertions, 0 deletions
diff --git a/pkgs/tools/misc/openopc/default.nix b/pkgs/tools/misc/openopc/default.nix
new file mode 100644
index 000000000000..2fce3807ca7e
--- /dev/null
+++ b/pkgs/tools/misc/openopc/default.nix
@@ -0,0 +1,46 @@
+{ stdenv, fetchurl, pythonFull }:
+
+stdenv.mkDerivation rec {
+  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"
+    mkdir -p "$out/${pythonFull.python.sitePackages}"
+    mkdir -p "$out/libexec/opc"
+
+    cp src/OpenOPC.py "$out/${pythonFull.python.sitePackages}"
+    cp src/opc.py "$out/libexec/opc/"
+
+    cat > "$out/bin/opc" << __EOF__
+    #!${stdenv.shell}
+    export PYTHONPATH="$out/${pythonFull.python.sitePackages}"
+    exec ${pythonFull}/bin/${pythonFull.python.executable} "$out/libexec/opc/opc.py" "\$@"
+    __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 ];
+  };
+}