2021-01-15 22:18:51 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, freetype, libX11, libXi, libXt, libXft }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "deadpixi-sam-unstable";
|
2021-12-26 17:43:05 +00:00
|
|
|
version = "2020-07-14";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "deadpixi";
|
|
|
|
repo = "sam";
|
2021-12-26 17:43:05 +00:00
|
|
|
rev = "5d8acb35d78c327d76f00a54857cbd566ed9bc11";
|
|
|
|
sha256 = "sha256-+vRh6nDPc3UnmEdqROHRel5Te0h5m4eiaERs492xciQ=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace config.mk.def \
|
|
|
|
--replace "/usr/include/freetype2" "${freetype.dev}/include/freetype2" \
|
2022-05-18 14:49:53 +00:00
|
|
|
--replace "CC=gcc" "CC=${stdenv.cc.targetPrefix}cc" \
|
|
|
|
--replace "RXPATH=/usr/bin/ssh" "RXPATH=ssh"
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
CFLAGS = "-D_DARWIN_C_SOURCE";
|
|
|
|
makeFlags = [ "DESTDIR=$(out)" ];
|
|
|
|
buildInputs = [ libX11 libXi libXt libXft ];
|
2022-02-10 20:34:41 +00:00
|
|
|
# build fails when run in parallel
|
|
|
|
enableParallelBuilding = false;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
postInstall = ''
|
2022-05-18 14:49:53 +00:00
|
|
|
substituteInPlace deadpixi-sam.desktop \
|
|
|
|
--replace "accessories-text-editor" "$out/share/icons/hicolor/scalable/apps/sam.svg"
|
2020-04-24 23:36:52 +00:00
|
|
|
mkdir -p $out/share/applications
|
2022-05-18 14:49:53 +00:00
|
|
|
mkdir -p $out/share/icons/hicolor/scalable/apps
|
2020-04-24 23:36:52 +00:00
|
|
|
mv deadpixi-sam.desktop $out/share/applications
|
2022-05-18 14:49:53 +00:00
|
|
|
mv sam.svg $out/share/icons/hicolor/scalable/apps
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2021-12-26 17:43:05 +00:00
|
|
|
homepage = "https://github.com/deadpixi/sam";
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Updated version of the sam text editor";
|
2021-12-26 17:43:05 +00:00
|
|
|
license = licenses.lpl-102;
|
2020-04-24 23:36:52 +00:00
|
|
|
maintainers = with maintainers; [ ramkromberg ];
|
2021-12-26 17:43:05 +00:00
|
|
|
platforms = platforms.unix;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|