Skip to content

Instantly share code, notes, and snippets.

@jonringer
Created January 31, 2022 14:42
Show Gist options
  • Save jonringer/36d869cdd9adc1d72e75587193956ca1 to your computer and use it in GitHub Desktop.
Save jonringer/36d869cdd9adc1d72e75587193956ca1 to your computer and use it in GitHub Desktop.
lib60870.nix
{ lib
, stdenv
, fetchFromGitHub
, cmake
, mbedtls
}:
stdenv.mkDerivation rec {
pname = "lib60870";
version = "2.3.1";
src = fetchFromGitHub {
owner = "mz-automation";
repo = pname;
rev = "v${version}";
sha256 = "0g6fr7lfblxk8g6s6qgfb4hw8fl0m0xx40q3wkff08w5z5nrc32d";
};
# unpack mbedtls into the directory which cmake expects
prePatch = ''
cd lib60870-C
ln -s ${mbedtls} dependencies/mbedtls-2.16.1
'';
nativeBuildInputs = [
cmake
];
meta = with lib; {
description = "Official repository for lib60870 an implementation of the IEC 60870-5-101/104 protocol";
homepage = "https://github.com/mz-automation/lib60870";
license = licenses.gpl3;
maintainers = with maintainers; [ jonringer ];
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment