Files
nixpkgs/pkgs/by-name/li/libmodplug/package.nix
Marcin Serwin c9821d8e12 libmodplug: use the configured includedir in pc file
This should make no difference at the moment because pc file is patched
in the fixup phase by the global hook which I'm intending to remove.

Signed-off-by: Marcin Serwin <marcin@serwin.dev>
2026-02-15 20:35:55 +01:00

46 lines
1.2 KiB
Nix
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
{
lib,
stdenv,
fetchurl,
file,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "libmodplug";
version = "0.8.9.0";
src = fetchurl {
url = "mirror://sourceforge/project/modplug-xmms/libmodplug/${finalAttrs.version}/libmodplug-${finalAttrs.version}.tar.gz";
sha256 = "1pnri98a603xk47smnxr551svbmgbzcw018mq1k6srbrq6kaaz25";
};
postPatch = ''
# Unfortunately, upstream appears inactive and the patches from the fork dont apply cleanly.
# Modify `src/fastmix.cpp` to remove usage of the register storage class, which is
# not allowed in C++17 and is an error in clang 16.
substituteInPlace src/fastmix.cpp --replace-fail 'register ' ""
substituteInPlace libmodplug.pc.in \
--replace-fail 'includedir=''${prefix}/include' 'includedir=@includedir@'
'';
outputs = [
"out"
"dev"
];
preConfigure = ''
substituteInPlace configure \
--replace ' -mmacosx-version-min=10.5' "" \
--replace /usr/bin/file ${file}/bin/file
'';
meta = {
description = "MOD playing library";
homepage = "https://modplug-xmms.sourceforge.net/";
license = lib.licenses.publicDomain;
platforms = lib.platforms.unix;
maintainers = with lib.maintainers; [ raskin ];
};
})