nixpkgs/pkgs/applications/office/wordgrinder/default.nix
Matthias Beyer 31bee0cc7c
wordgrinder: Fix build
First I tried to fix the build like this:

> This fixes the build of the wordgrinder package by disabling the build
> of "xwordgrinder", the non-curses frontend of wordgrinder.
>
> For re-enabling the build, this patch shall be reverted and then go on
> from there.
>
> I opted for disabling the x frontend of this program because the whole
> purpose of this is to use a curses writing program (at least for me).
> It seems that hacking around the new build system in nixpkgs is a
> non-trivial task and I wanted to get this package out of the door as
> fast as possible because I already delayed the fix by a few days (or is
> it weeks already), so this is the simple fix.
>
> If someone wants to have the X frontend again, I can invest more time at
> some point.

But then the almighty aszlig came around and told me how to do it right. So here
we go, with a patch from me that is acutally from aszlig (see #60122).

This fixes the build.

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Signed-off-by: aszlig <aszlig@nix.build>
Fixes: 6b2bd330fa ("wordgrinder: Fix sha256 hash")
Fixes: 19a3abc1b8 ("wordgrinder: 0.7.1 -> 0.7.2")
Merges: https://github.com/NixOS/nixpkgs/pull/60122
Cc: @devhell
2019-04-26 09:05:05 +02:00

60 lines
1.6 KiB
Nix

{ stdenv, fetchFromGitHub, pkgconfig, makeWrapper
, lua52Packages, libXft, ncurses, ninja, readline, zlib }:
stdenv.mkDerivation rec {
name = "wordgrinder-${version}";
version = "0.7.2";
src = fetchFromGitHub {
repo = "wordgrinder";
owner = "davidgiven";
rev = "${version}";
sha256 = "08lnq5wmspfqdjmqm15gizcq0xr7mg4h62qhvwj63v0sd6ks1cal";
};
makeFlags = [
"PREFIX=$(out)"
"LUA_INCLUDE=${lua52Packages.lua}/include"
"LUA_LIB=${lua52Packages.lua}/lib/liblua.so"
];
preBuild = stdenv.lib.optionalString stdenv.isLinux ''
makeFlagsArray+=('XFT_PACKAGE=--cflags={} --libs={-lX11 -lXft}')
'';
dontUseNinjaBuild = true;
dontUseNinjaInstall = true;
nativeBuildInputs = [
pkgconfig
makeWrapper
ninja
];
buildInputs = [
libXft
lua52Packages.lua
ncurses
readline
zlib
];
# To be able to find <Xft.h>
NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.isLinux "-I${libXft.dev}/include/X11";
# 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";
'' + stdenv.lib.optionalString stdenv.isLinux ''
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;
maintainers = with maintainers; [ matthiasbeyer ];
platforms = with stdenv.lib.platforms; linux ++ darwin;
};
}