@@ -0,0 +1,30 @@
1+{ stdenv, fetchFromGitHub, rustPlatform, openssl, pkgconfig, python3, xorg, cmake, libgit2 }:
2+
3+rustPlatform.buildRustPackage rec {
4+ pname = "amp";
5+ # The latest release (0.5.2) does not compile, so we use a git snapshot instead.
6+ version = "unstable-2019-06-09";
7+
8+ src = fetchFromGitHub {
9+ owner = "jmacdonald";
10+ repo = pname;
11+ rev = "2c88e82a88ada8a5fd2620ef225192395a4533a2";
12+ sha256 = "0ha1xiabq31s687gkrnszf3zc7b3sfdl79iyg5ygbc49mzvarp8c";
13+ };
14+
15+ cargoSha256 = "1bvj2zg19ak4vi47vjkqlybz011kn5zq1j7zznr76zrryacw4lz1";
16+
17+ nativeBuildInputs = [ cmake pkgconfig ];
18+ buildInputs = [ openssl python3 xorg.libxcb libgit2 ];
19+
20+ # Tests need to write to the theme directory in HOME.
21+ preCheck = "export HOME=`mktemp -d`";
22+
23+ meta = with stdenv.lib; {
24+ description = "A modern text editor inspired by Vim";
25+ homepage = "https://amp.rs";
26+ license = [ licenses.gpl3 ];
27+ maintainers = [ maintainers.sb0 ];
28+ platforms = platforms.unix;
29+ };
30+}