linux_xanmod: 5.11.14 -> 5.11.15
[NixPkgs.git] / pkgs / tools / typesetting / lowdown / default.nix
blobb9b5e806a4eccbd471cbc87532ee769b86837b59
1 { lib, stdenv, fetchurl, fixDarwinDylibNames, which }:
3 stdenv.mkDerivation rec {
4   pname = "lowdown";
5   version = "0.8.4";
7   outputs = [ "out" "lib" "dev" "man" ];
9   src = fetchurl {
10     url = "https://kristaps.bsd.lv/lowdown/snapshots/lowdown-${version}.tar.gz";
11     sha512 = "1rbsngfw36lyc8s6qxl8hgb1pzj0gdzlb7yqkfblb8fpgs2z0ggyhnfszrqfir8s569i7a9yk9bdx2ggwqhjj56hmi2i4inlnb3rmni";
12   };
14   nativeBuildInputs = [ which ]
15     ++ lib.optionals stdenv.isDarwin [ fixDarwinDylibNames ];
17   configurePhase = ''
18     runHook preConfigure
19     ./configure PREFIX=''${!outputDev} \
20                 BINDIR=''${!outputBin}/bin \
21                 LIBDIR=''${!outputLib}/lib \
22                 MANDIR=''${!outputMan}/share/man
23     runHook postConfigure
24   '';
26   # Fix lib extension so that fixDarwinDylibNames detects it
27   postInstall = lib.optionalString stdenv.isDarwin ''
28     mv $lib/lib/liblowdown.{so,dylib}
29   '';
31   patches = lib.optional (!stdenv.hostPlatform.isStatic) ./shared.patch;
33   doCheck = stdenv.hostPlatform == stdenv.buildPlatform;
34   checkTarget = "regress";
36   meta = with lib; {
37     homepage = "https://kristaps.bsd.lv/lowdown/";
38     description = "Simple markdown translator";
39     license = licenses.isc;
40     maintainers = [ maintainers.sternenseemann ];
41     platforms = platforms.unix;
42   };