Alexander Bantyev
edb3fce642
* Dynamically linked executables (ligo-bin) * Statically linked executables (ligo-static) * Docker (ligo-docker) * deb package (ligo-deb) * webide (ligo-editor) * webide docker (ligo-editor-docker) * website (ligo-website)
47 lines
1.1 KiB
Nix
47 lines
1.1 KiB
Nix
{ stdenv, lib, writeTextFile, ligo-static, dpkg }:
|
|
let
|
|
project = "ligo";
|
|
version = "0.0.0";
|
|
revision = lib.commitIdFromGitRepo ../.git;
|
|
pkgArch = "amd64";
|
|
bin = "${ligo-static}/bin/ligo";
|
|
pkgName = "${project}_0ubuntu${version}-${revision}_${pkgArch}";
|
|
depends = "";
|
|
maintainer = "ligolang ligolang.org";
|
|
description = "A friendly Smart Contract Language for Tezos";
|
|
|
|
writeControlFile = writeTextFile {
|
|
name = "control";
|
|
text = ''
|
|
Package: ${project}
|
|
Version: ${version}-${revision}
|
|
Priority: optional
|
|
Architecture: ${pkgArch}
|
|
Depends: ${depends}
|
|
Maintainer: ${maintainer}
|
|
Description: ${project}
|
|
${description}
|
|
'';
|
|
};
|
|
|
|
in stdenv.mkDerivation rec {
|
|
name = "${pkgName}.deb";
|
|
|
|
nativeBuildInputs = [ dpkg ];
|
|
|
|
phases = "packagePhase";
|
|
|
|
packagePhase = ''
|
|
mkdir ${pkgName}
|
|
mkdir -p ${pkgName}/usr/local/bin
|
|
cp ${bin} ${pkgName}/usr/local/bin/${project}
|
|
|
|
mkdir ${pkgName}/DEBIAN
|
|
cp ${writeControlFile} ${pkgName}/DEBIAN/control
|
|
|
|
dpkg-deb --build ${pkgName}
|
|
mkdir -p $out
|
|
cp ${name} $out/
|
|
'';
|
|
}
|