Skip to content

Instantly share code, notes, and snippets.

@lukaslaobeyer
Created February 12, 2020 05:00
Show Gist options
  • Save lukaslaobeyer/d397cea659a7dc890423101e973af671 to your computer and use it in GitHub Desktop.
Save lukaslaobeyer/d397cea659a7dc890423101e973af671 to your computer and use it in GitHub Desktop.
Sketch Synthesizer Nix Expressions
with import <nixpkgs> {};
let
sketch-backend = callPackage ./sketch-backend.nix {};
sketch-frontend = callPackage ./sketch-frontend.nix { sketch-backend = sketch-backend; };
in
mkShell {
buildInputs = [ sketch-backend sketch-frontend ];
}
{ stdenv, fetchurl
, bison, flex
}:
stdenv.mkDerivation rec {
name = "sketch-backend-v${version}";
version = "1.7.5";
src = fetchurl {
url = "https://people.csail.mit.edu/asolar/sketch-${version}.tar.gz";
sha256 = "0cbx1svx94h7qgcvcc8hisq6dbjs8bh8xq0zbyly66sc3bsc70l4";
};
buildInputs = [ bison flex ];
preConfigure = ''
cd sketch-backend
'';
}
{ stdenv, fetchurl
, openjdk
, sketch-backend
}:
stdenv.mkDerivation rec {
name = "sketch-frontend-v${version}";
version = "1.7.5";
src = fetchurl {
url = "https://people.csail.mit.edu/asolar/sketch-${version}.tar.gz";
sha256 = "0cbx1svx94h7qgcvcc8hisq6dbjs8bh8xq0zbyly66sc3bsc70l4";
};
buildInputs = [ sketch-backend openjdk ];
preConfigure = ''
cd sketch-frontend
'';
installPhase = ''
mkdir -p $out/bin
install -m 644 *jar "$out/bin" && install -m 755 sketch "$out/bin"
'';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment