scdoc: refactor
- one parameter per line - use rec-less, overlay-style overridable recursive attributes (in effect since https://github.com/NixOS/nixpkgs/pull/119942) - remove references to pname - SRI hash - multiple outputs - remove with nesting (following https://nix.dev/anti-patterns/language#with-attrset-expression) - simplify meta - add AndersonTorres as maintainer
This commit is contained in:
parent
f4f1591cc0
commit
6576a7b6e6
|
@ -1,38 +1,41 @@
|
|||
{ lib, stdenv, fetchFromSourcehut, buildPackages }:
|
||||
{ lib
|
||||
, stdenv
|
||||
, fetchFromSourcehut
|
||||
, buildPackages
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
stdenv.mkDerivation (finalAttrs: {
|
||||
pname = "scdoc";
|
||||
version = "1.11.2";
|
||||
|
||||
src = fetchFromSourcehut {
|
||||
owner = "~sircmpwn";
|
||||
repo = pname;
|
||||
rev = version;
|
||||
sha256 = "07c2vmdgqifbynm19zjnrk7h102pzrriv73izmx8pmd7b3xl5mfq";
|
||||
repo = "scdoc";
|
||||
rev = finalAttrs.version;
|
||||
hash = "sha256-2NVC+1in1Yt6/XGcHXP+V4AAz8xW/hSq9ctF/Frdgh0=";
|
||||
};
|
||||
|
||||
outputs = [ "out" "man" "dev" ];
|
||||
|
||||
postPatch = ''
|
||||
substituteInPlace Makefile \
|
||||
--replace "-static" "" \
|
||||
--replace "/usr/local" "$out"
|
||||
--replace "-static" ""
|
||||
'';
|
||||
|
||||
makeFlags = lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [
|
||||
"HOST_SCDOC=${buildPackages.scdoc}/bin/scdoc"
|
||||
makeFlags = [
|
||||
"PREFIX=${placeholder "out"}"
|
||||
] ++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [
|
||||
"HOST_SCDOC=${lib.getExe buildPackages.scdoc}"
|
||||
];
|
||||
|
||||
doCheck = true;
|
||||
|
||||
meta = with lib; {
|
||||
description = "A simple man page generator";
|
||||
longDescription = ''
|
||||
scdoc is a simple man page generator written for POSIX systems written in
|
||||
C99.
|
||||
'';
|
||||
meta = {
|
||||
description = "A simple man page generator written in C99 for POSIX systems";
|
||||
homepage = "https://git.sr.ht/~sircmpwn/scdoc";
|
||||
changelog = "https://git.sr.ht/~sircmpwn/scdoc/refs/${version}";
|
||||
license = licenses.mit;
|
||||
platforms = platforms.unix;
|
||||
maintainers = with maintainers; [ primeos ];
|
||||
changelog = "https://git.sr.ht/~sircmpwn/scdoc/refs/${finalAttrs.version}";
|
||||
license = lib.licenses.mit;
|
||||
maintainers = with lib.maintainers; [ primeos AndersonTorres ];
|
||||
platforms = lib.platforms.unix;
|
||||
};
|
||||
}
|
||||
})
|
||||
|
|
Loading…
Reference in a new issue