2016-11-21 17:15:29 +03:00
|
|
|
{ stdenv, fetchFromGitHub, pkgconfig, makeWrapper
|
2018-01-06 07:21:04 +03:00
|
|
|
, lua52Packages, libXft, ncurses, ninja, readline, zlib }:
|
2016-11-21 17:15:29 +03:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "wordgrinder-${version}";
|
2018-01-06 07:21:04 +03:00
|
|
|
version = "0.7.1";
|
2016-11-21 17:15:29 +03:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
repo = "wordgrinder";
|
|
|
|
owner = "davidgiven";
|
2018-01-06 07:21:04 +03:00
|
|
|
rev = "${version}";
|
|
|
|
sha256 = "19n4vn8zyvcvgwygm63d3jcmiwh6a2ikrrqqmkm8fvhdvwkqgr9k";
|
2016-11-21 17:15:29 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
makeFlags = [
|
|
|
|
"PREFIX=$(out)"
|
|
|
|
"LUA_INCLUDE=${lua52Packages.lua}/include"
|
|
|
|
"LUA_LIB=${lua52Packages.lua}/lib/liblua.so"
|
2018-01-06 10:56:14 +03:00
|
|
|
] ++ stdenv.lib.optional stdenv.isLinux "XFT_PACKAGE=--libs=\{-lX11 -lXft\}";
|
2016-11-21 17:15:29 +03:00
|
|
|
|
2018-01-06 07:21:04 +03:00
|
|
|
dontUseNinjaBuild = true;
|
|
|
|
dontUseNinjaInstall = true;
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
pkgconfig
|
|
|
|
makeWrapper
|
|
|
|
ninja
|
|
|
|
];
|
2016-11-21 17:15:29 +03:00
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
libXft
|
|
|
|
lua52Packages.lua
|
|
|
|
ncurses
|
|
|
|
readline
|
|
|
|
zlib
|
|
|
|
];
|
|
|
|
|
|
|
|
# To be able to find <Xft.h>
|
2018-01-06 10:56:14 +03:00
|
|
|
NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.isLinux "-I${libXft.dev}/include/X11";
|
2016-11-21 17:15:29 +03: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";
|
2018-01-06 10:56:14 +03:00
|
|
|
'' + stdenv.lib.optionalString stdenv.isLinux ''
|
2016-11-21 17:15:29 +03:00
|
|
|
wrapProgram $out/bin/xwordgrinder --set LUA_CPATH "${lua52Packages.luafilesystem}/lib/lua/5.2/lfs.so";
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "Text-based word processor";
|
|
|
|
homepage = https://cowlark.com/wordgrinder;
|
|
|
|
license = licenses.mit;
|
2019-02-20 21:52:48 +03:00
|
|
|
maintainers = with maintainers; [ matthiasbeyer ];
|
2018-01-06 10:56:14 +03:00
|
|
|
platforms = with stdenv.lib.platforms; linux ++ darwin;
|
2016-11-21 17:15:29 +03:00
|
|
|
};
|
|
|
|
}
|