depot/third_party/nixpkgs/pkgs/applications/editors/deadpixi-sam/default.nix
Default email 81047829ea Project import generated by Copybara.
GitOrigin-RevId: 48d63e924a2666baf37f4f14a18f19347fbd54a2
2022-02-10 15:34:41 -05:00

38 lines
1.1 KiB
Nix

{ lib, stdenv, fetchFromGitHub, freetype, libX11, libXi, libXt, libXft }:
stdenv.mkDerivation rec {
pname = "deadpixi-sam-unstable";
version = "2020-07-14";
src = fetchFromGitHub {
owner = "deadpixi";
repo = "sam";
rev = "5d8acb35d78c327d76f00a54857cbd566ed9bc11";
sha256 = "sha256-+vRh6nDPc3UnmEdqROHRel5Te0h5m4eiaERs492xciQ=";
};
postPatch = ''
substituteInPlace config.mk.def \
--replace "/usr/include/freetype2" "${freetype.dev}/include/freetype2" \
--replace "CC=gcc" "CC=${stdenv.cc.targetPrefix}cc"
'';
CFLAGS = "-D_DARWIN_C_SOURCE";
makeFlags = [ "DESTDIR=$(out)" ];
buildInputs = [ libX11 libXi libXt libXft ];
# build fails when run in parallel
enableParallelBuilding = false;
postInstall = ''
mkdir -p $out/share/applications
mv deadpixi-sam.desktop $out/share/applications
'';
meta = with lib; {
homepage = "https://github.com/deadpixi/sam";
description = "Updated version of the sam text editor";
license = licenses.lpl-102;
maintainers = with maintainers; [ ramkromberg ];
platforms = platforms.unix;
};
}