@@ -0,0 +1,34 @@
1+{ stdenv, fetchFromGitHub, freetype, libX11, libXt, libXft
2+}:
3+
4+stdenv.mkDerivation rec {
5+ name = "deadpixi-sam-unstable";
6+ version = "2016-09-15";
7+ src = fetchFromGitHub {
8+ owner = "deadpixi";
9+ repo = "sam";
10+ rev = "a6a8872246e8634d884b0ce52bc3be9770ab1b0f";
11+ sha256 = "1zr8dl0vp1xic3dq69h4bp2fcxsjhrzasfl6ayvkibjd6z5dn07p";
12+ };
13+
14+ postPatch = ''
15+ substituteInPlace config.mk.def \
16+ --replace "/usr/include/freetype2" "${freetype.dev}/include/freetype2"
17+ '';
18+
19+ makeFlags = [ "DESTDIR=$(out)" ];
20+ buildInputs = [ libX11 libXt libXft ];
21+
22+ postInstall = ''
23+ mkdir -p $out/share/applications
24+ mv deadpixi-sam.desktop $out/share/applications
25+ '';
26+
27+ meta = with stdenv.lib; {
28+ inherit (src.meta) homepage;
29+ description = "Updated version of the sam text editor";
30+ license = with licenses; lpl-102;
31+ maintainers = with maintainers; [ ramkromberg ];
32+ platforms = with platforms; linux;
33+ };
34+}