nixpkgs/pkgs/by-name/op/opensp/package.nix
Silvan Mosberger 4f0dadbf38 treewide: format all inactive Nix files
After final improvements to the official formatter implementation,
this commit now performs the first treewide reformat of Nix files using it.
This is part of the implementation of RFC 166.

Only "inactive" files are reformatted, meaning only files that
aren't being touched by any PR with activity in the past 2 months.
This is to avoid conflicts for PRs that might soon be merged.
Later we can do a full treewide reformat to get the rest,
which should not cause as many conflicts.

A CI check has already been running for some time to ensure that new and
already-formatted files are formatted, so the files being reformatted here
should also stay formatted.

This commit was automatically created and can be verified using

    nix-build a08b3a4d19.tar.gz \
      --argstr baseRev b32a094368
    result/bin/apply-formatting $NIXPKGS_PATH
2024-12-10 20:26:33 +01:00

81 lines
2.0 KiB
Nix

{
lib,
stdenv,
fetchurl,
fetchpatch,
xmlto,
docbook_xml_dtd_412,
docbook_xsl,
autoconf,
automake,
libtool,
autoreconfHook,
}:
stdenv.mkDerivation rec {
pname = "opensp";
version = "1.5.2";
src = fetchurl {
url = "mirror://sourceforge/openjade/OpenSP-${version}.tar.gz";
sha256 = "1khpasr6l0a8nfz6kcf3s81vgdab8fm2dj291n5r2s53k228kx2p";
};
postPatch = ''
sed -i s,/usr/share/sgml/docbook/xml-dtd-4.1.2/,${docbook_xml_dtd_412}/xml/dtd/docbook/, \
docsrc/*.xml
'';
patches = [
(fetchpatch {
url = "https://gitweb.gentoo.org/repo/gentoo.git/plain/app-text/opensp/files/opensp-1.5.2-c11-using.patch?id=688d9675782dfc162d4e6cff04c668f7516118d0";
sha256 = "04q14s8qsad0bkjmj067dn831i0r6v7742rafdlnbfm5y249m2q6";
})
# Clang 16 defaults to C++17, which does not allow `register` as a storage class specifier.
./fix-register-storage-class.patch
];
setupHook = ./setup-hook.sh;
postFixup = ''
# Remove random ids in the release notes
sed -i -e 's/href="#idm.*"//g' $out/share/doc/OpenSP/releasenotes.html
sed -i -e 's/name="idm.*"//g' $out/share/doc/OpenSP/releasenotes.html
'';
preConfigure = lib.optionalString stdenv.hostPlatform.isCygwin ''
autoreconf -fi
'';
strictDeps = true;
nativeBuildInputs =
[
xmlto
docbook_xml_dtd_412
docbook_xsl
]
# Clang 16 fails to build due to inappropriate definitions in the `config.h` generated by the
# existing configure scripts. Regenerate them to make sure they detect its features correctly.
++ lib.optional stdenv.cc.isClang autoreconfHook
++ lib.optionals stdenv.hostPlatform.isCygwin [
autoconf
automake
libtool
];
env = lib.optionalAttrs stdenv.cc.isGNU {
NIX_CFLAGS_COMPILE = "-fpermissive";
};
doCheck = false; # fails
meta = with lib; {
description = "Suite of SGML/XML processing tools";
license = licenses.mit;
homepage = "https://openjade.sourceforge.net/";
platforms = platforms.unix;
maintainers = [ ];
};
}