depot/third_party/nixpkgs/pkgs/development/tools/mblock-mlink/default.nix
Default email 889482aab3 Project import generated by Copybara.
GitOrigin-RevId: f2537a505d45c31fe5d9c27ea9829b6f4c4e6ac5
2022-06-26 12:26:21 +02:00

40 lines
1,023 B
Nix

{ stdenv, lib, fetchurl, dpkg, makeWrapper, autoPatchelfHook }:
stdenv.mkDerivation rec {
pname = "mblock-mlink";
version = "1.2.0";
src = fetchurl {
url = "https://dl.makeblock.com/mblock5/linux/mLink-${version}-amd64.deb";
sha256 = "sha256-KLxj81ZjbEvhhaz0seNB4WXX5ybeZ7/WcT1dGfdWle0=";
};
unpackPhase = ''
${dpkg}/bin/dpkg -x $src $out
'';
buildInputs = [
stdenv.cc.cc.lib
];
nativeBuildInputs = [
autoPatchelfHook
];
installPhase = ''
mv $out/usr/local/makeblock $out/usr/makeblock
rmdir $out/usr/local
mkdir -p $out/bin
echo $out/usr/makeblock/mLink/mnode $out/usr/makeblock/mLink/app.js > $out/bin/mlink
chmod +x $out/bin/mlink
'';
meta = with lib; {
description = "Driver for mBlock web version";
homepage = "https://mblock.makeblock.com/en-us/download/";
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
license = licenses.unfree;
platforms = [ "x86_64-linux" ];
maintainers = [ maintainers.mausch ];
};
}