nixpkgs/pkgs/tools/typesetting/lowdown/default.nix
2021-03-17 01:41:03 +01:00

42 lines
1.2 KiB
Nix

{ lib, stdenv, fetchurl, fixDarwinDylibNames, which }:
stdenv.mkDerivation rec {
pname = "lowdown";
version = "0.8.3";
outputs = [ "out" "lib" "dev" "man" ];
src = fetchurl {
url = "https://kristaps.bsd.lv/lowdown/snapshots/lowdown-${version}.tar.gz";
sha512 = "17q1jd2vih26yjjc4f9kg0qihrym8h0ydnli6z8p3h4rdwm4kfnvckrpkwminz5wl0k5z6d65dk7q4pynyfynp31d6s7q4yzkkqy6kc";
};
nativeBuildInputs = [ which ]
++ lib.optionals stdenv.isDarwin [ fixDarwinDylibNames ];
configurePhase = ''
runHook preConfigure
./configure PREFIX=''${!outputDev} \
BINDIR=''${!outputBin}/bin \
LIBDIR=''${!outputLib}/lib \
MANDIR=''${!outputMan}/share/man
runHook postConfigure
'';
# Fix lib extension so that fixDarwinDylibNames detects it
postInstall = lib.optionalString stdenv.isDarwin ''
mv $lib/lib/liblowdown.{so,dylib}
'';
patches = lib.optional (!stdenv.hostPlatform.isStatic) ./shared.patch;
meta = with lib; {
homepage = "https://kristaps.bsd.lv/lowdown/";
description = "Simple markdown translator";
license = licenses.isc;
maintainers = [ maintainers.sternenseemann ];
platforms = platforms.unix;
};
}