1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-12-20 21:17:46 +00:00
nixpkgs/pkgs/applications/office/wordgrinder/default.nix

63 lines
1.7 KiB
Nix
Raw Normal View History

2016-11-21 14:15:29 +00:00
{ stdenv, fetchFromGitHub, pkgconfig, 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 {
pname = "wordgrinder";
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;
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"
];
preBuild = stdenv.lib.optionalString stdenv.isLinux ''
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;
dontConfigure = true;
2018-01-06 04:21:04 +00:00
nativeBuildInputs = [
pkgconfig
makeWrapper
ninja
];
2016-11-21 14:15:29 +00:00
buildInputs = [
lua52Packages.lua
ncurses
readline
zlib
] ++ stdenv.lib.optionals stdenv.isLinux [
libXft
2016-11-21 14:15:29 +00:00
];
# To be able to find <Xft.h>
2018-01-06 07:56:14 +00:00
NIX_CFLAGS_COMPILE = stdenv.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";
2018-01-06 07:56:14 +00:00
'' + stdenv.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";
'';
meta = with stdenv.lib; {
description = "Text-based word processor";
homepage = "https://cowlark.com/wordgrinder";
2016-11-21 14:15:29 +00:00
license = licenses.mit;
maintainers = with maintainers; [ matthiasbeyer ];
2018-01-06 07:56:14 +00:00
platforms = with stdenv.lib.platforms; linux ++ darwin;
2016-11-21 14:15:29 +00:00
};
}