1 { lib, stdenv, fetchurl, fixDarwinDylibNames, which }:
3 stdenv.mkDerivation rec {
7 outputs = [ "out" "lib" "dev" "man" ];
10 url = "https://kristaps.bsd.lv/lowdown/snapshots/lowdown-${version}.tar.gz";
11 sha512 = "1rbsngfw36lyc8s6qxl8hgb1pzj0gdzlb7yqkfblb8fpgs2z0ggyhnfszrqfir8s569i7a9yk9bdx2ggwqhjj56hmi2i4inlnb3rmni";
14 nativeBuildInputs = [ which ]
15 ++ lib.optionals stdenv.isDarwin [ fixDarwinDylibNames ];
19 ./configure PREFIX=''${!outputDev} \
20 BINDIR=''${!outputBin}/bin \
21 LIBDIR=''${!outputLib}/lib \
22 MANDIR=''${!outputMan}/share/man
26 # Fix lib extension so that fixDarwinDylibNames detects it
27 postInstall = lib.optionalString stdenv.isDarwin ''
28 mv $lib/lib/liblowdown.{so,dylib}
31 patches = lib.optional (!stdenv.hostPlatform.isStatic) ./shared.patch;
33 doCheck = stdenv.hostPlatform == stdenv.buildPlatform;
34 checkTarget = "regress";
37 homepage = "https://kristaps.bsd.lv/lowdown/";
38 description = "Simple markdown translator";
39 license = licenses.isc;
40 maintainers = [ maintainers.sternenseemann ];
41 platforms = platforms.unix;