2021-12-06 16:07:01 +00:00
|
|
|
{ config, lib, stdenv, fetchurl, fetchpatch, zlib, pkg-config, mpg123, libogg, libvorbis, portaudio, libsndfile, flac
|
2021-09-22 15:38:15 +00:00
|
|
|
, usePulseAudio ? config.pulseaudio or stdenv.isLinux, libpulseaudio }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-06-28 23:13:55 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2021-09-18 10:52:07 +00:00
|
|
|
pname = "libopenmpt";
|
|
|
|
version = "0.5.11";
|
|
|
|
|
|
|
|
outputs = [ "out" "lib" "dev" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "https://lib.openmpt.org/files/libopenmpt/src/libopenmpt-${version}+release.autotools.tar.gz";
|
2021-09-18 10:52:07 +00:00
|
|
|
sha256 = "1c54lldr2imjzhlhq5lvwhj7d5794xm97cby9pznr5wdjjay0sa4";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
patches = [
|
|
|
|
# Fix pending upstream inclusion for gcc-12 include headers:
|
|
|
|
# https://github.com/OpenMPT/openmpt/pull/8
|
|
|
|
(fetchpatch {
|
|
|
|
name = "gcc-12.patch";
|
|
|
|
url = "https://github.com/OpenMPT/openmpt/commit/6e7a43190ef2f9ba0b3efc19b9527261b69ec8f7.patch";
|
|
|
|
sha256 = "081m1rf09bbrlg52aihaajmld5dcnwbp6y7zpyik92mm332r330h";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
nativeBuildInputs = [ pkg-config ];
|
2020-04-24 23:36:52 +00:00
|
|
|
buildInputs = [ zlib mpg123 libogg libvorbis portaudio libsndfile flac ]
|
2021-01-17 00:15:33 +00:00
|
|
|
++ lib.optional usePulseAudio libpulseaudio;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-01-17 00:15:33 +00:00
|
|
|
configureFlags = lib.optional (!usePulseAudio) "--without-pulseaudio";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-06-28 23:13:55 +00:00
|
|
|
doCheck = true;
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "A cross-platform command-line based module file player";
|
|
|
|
homepage = "https://lib.openmpt.org/libopenmpt/";
|
|
|
|
license = licenses.bsd3;
|
2021-06-28 23:13:55 +00:00
|
|
|
maintainers = with maintainers; [ OPNA2608 ];
|
|
|
|
platforms = platforms.unix;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|