2021-01-17 02:09:27 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, pkg-config, makeWrapper
|
2018-01-06 04:21:04 +00:00
|
|
|
, lua52Packages, libXft, ncurses, ninja, readline, zlib }:
|
2016-11-21 14:15:29 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 13:41:18 +01:00
|
|
|
pname = "wordgrinder";
|
2020-10-24 11:29:52 +01:00
|
|
|
version = "0.8";
|
2016-11-21 14:15:29 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
repo = "wordgrinder";
|
|
|
|
owner = "davidgiven";
|
2019-09-09 00:38:31 +01:00
|
|
|
rev = version;
|
2020-10-24 11:29:52 +01:00
|
|
|
sha256 = "124d1bnn2aqs6ik8pdazzni6a0583prz9lfdjrbwyb97ipqga9pm";
|
2016-11-21 14:15:29 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
makeFlags = [
|
|
|
|
"PREFIX=$(out)"
|
|
|
|
"LUA_INCLUDE=${lua52Packages.lua}/include"
|
|
|
|
"LUA_LIB=${lua52Packages.lua}/lib/liblua.so"
|
2020-09-13 14:57:05 +01:00
|
|
|
"OBJDIR=$TMP/wg-build"
|
2019-04-23 20:46:47 +01:00
|
|
|
];
|
|
|
|
|
2021-01-15 05:42:41 +00:00
|
|
|
preBuild = lib.optionalString stdenv.isLinux ''
|
2019-04-23 20:46:47 +01:00
|
|
|
makeFlagsArray+=('XFT_PACKAGE=--cflags={} --libs={-lX11 -lXft}')
|
|
|
|
'';
|
2016-11-21 14:15:29 +00:00
|
|
|
|
2018-01-06 04:21:04 +00:00
|
|
|
dontUseNinjaBuild = true;
|
|
|
|
dontUseNinjaInstall = true;
|
2020-10-24 11:29:52 +01:00
|
|
|
dontConfigure = true;
|
2018-01-06 04:21:04 +00:00
|
|
|
|
|
|
|
nativeBuildInputs = [
|
2021-01-17 02:09:27 +00:00
|
|
|
pkg-config
|
2018-01-06 04:21:04 +00:00
|
|
|
makeWrapper
|
|
|
|
ninja
|
|
|
|
];
|
2016-11-21 14:15:29 +00:00
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
lua52Packages.lua
|
|
|
|
ncurses
|
|
|
|
readline
|
|
|
|
zlib
|
2021-01-15 05:42:41 +00:00
|
|
|
] ++ lib.optionals stdenv.isLinux [
|
2020-10-24 11:29:52 +01:00
|
|
|
libXft
|
2016-11-21 14:15:29 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
# To be able to find <Xft.h>
|
2021-01-15 05:42:41 +00:00
|
|
|
NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isLinux "-I${libXft.dev}/include/X11";
|
2016-11-21 14:15:29 +00:00
|
|
|
|
|
|
|
# Binaries look for LuaFileSystem library (lfs.so) at runtime
|
|
|
|
postInstall = ''
|
|
|
|
wrapProgram $out/bin/wordgrinder --set LUA_CPATH "${lua52Packages.luafilesystem}/lib/lua/5.2/lfs.so";
|
2021-01-15 05:42:41 +00:00
|
|
|
'' + lib.optionalString stdenv.isLinux ''
|
2016-11-21 14:15:29 +00:00
|
|
|
wrapProgram $out/bin/xwordgrinder --set LUA_CPATH "${lua52Packages.luafilesystem}/lib/lua/5.2/lfs.so";
|
|
|
|
'';
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2016-11-21 14:15:29 +00:00
|
|
|
description = "Text-based word processor";
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "https://cowlark.com/wordgrinder";
|
2016-11-21 14:15:29 +00:00
|
|
|
license = licenses.mit;
|
2019-02-20 18:52:48 +00:00
|
|
|
maintainers = with maintainers; [ matthiasbeyer ];
|
2021-01-15 05:42:41 +00:00
|
|
|
platforms = with lib.platforms; linux ++ darwin;
|
2016-11-21 14:15:29 +00:00
|
|
|
};
|
|
|
|
}
|