nixpkgs/pkgs/tools/typesetting/lowdown/default.nix

42 lines
1.2 KiB
Nix
Raw Normal View History

2021-01-25 05:37:45 +00:00
{ lib, stdenv, fetchurl, fixDarwinDylibNames, which }:
2020-07-30 11:25:47 +00:00
stdenv.mkDerivation rec {
pname = "lowdown";
version = "0.8.2";
2020-07-30 11:25:47 +00:00
outputs = [ "out" "lib" "dev" "man" ];
2020-07-30 11:25:47 +00:00
src = fetchurl {
url = "https://kristaps.bsd.lv/lowdown/snapshots/lowdown-${version}.tar.gz";
sha512 = "07xy6yjs24zkwrr06ly4ln5czvm3azw6iznx6m8gbrmzblkcp3gz1jcl9wclcyl8bs4xhgmyzkf5k67b95s0jndhyb9ap5zy6ixnias";
2020-07-30 11:25:47 +00:00
};
2021-01-25 05:37:45 +00:00
nativeBuildInputs = [ which ]
++ lib.optionals stdenv.isDarwin [ fixDarwinDylibNames ];
2020-07-30 11:25:47 +00:00
configurePhase = ''
2021-02-09 14:16:58 +00:00
runHook preConfigure
2020-07-30 11:25:47 +00:00
./configure PREFIX=''${!outputDev} \
BINDIR=''${!outputBin}/bin \
LIBDIR=''${!outputLib}/lib \
MANDIR=''${!outputMan}/share/man
2021-02-09 14:16:58 +00:00
runHook postConfigure
2020-07-30 11:25:47 +00:00
'';
2021-01-25 05:37:45 +00:00
# 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; {
2020-07-30 11:25:47 +00:00
homepage = "https://kristaps.bsd.lv/lowdown/";
description = "Simple markdown translator";
license = licenses.isc;
maintainers = [ maintainers.sternenseemann ];
platforms = platforms.unix;
};
}