2021-11-13 09:07:22 +00:00
|
|
|
{ config, lib, stdenv, fetchurl, fetchpatch, zlib, pkg-config, mpg123, libogg, libvorbis, portaudio, libsndfile, flac
|
2021-09-18 00:34:26 +00:00
|
|
|
, usePulseAudio ? config.pulseaudio or stdenv.isLinux, libpulseaudio }:
|
2016-10-08 21:08:18 +00:00
|
|
|
|
2021-05-29 01:59:43 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2021-09-05 00:54:17 +00:00
|
|
|
pname = "libopenmpt";
|
2021-09-08 11:01:15 +00:00
|
|
|
version = "0.5.11";
|
2019-01-12 07:52:37 +00:00
|
|
|
|
2021-09-05 00:57:48 +00:00
|
|
|
outputs = [ "out" "lib" "dev" ];
|
|
|
|
|
2016-10-08 21:08:18 +00:00
|
|
|
src = fetchurl {
|
2019-01-12 07:52:37 +00:00
|
|
|
url = "https://lib.openmpt.org/files/libopenmpt/src/libopenmpt-${version}+release.autotools.tar.gz";
|
2021-09-08 11:01:15 +00:00
|
|
|
sha256 = "1c54lldr2imjzhlhq5lvwhj7d5794xm97cby9pznr5wdjjay0sa4";
|
2016-10-08 21:08:18 +00:00
|
|
|
};
|
2019-01-12 07:52:37 +00:00
|
|
|
|
2021-11-13 09:07:22 +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";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2019-01-12 07:52:37 +00:00
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2021-01-19 06:50:56 +00:00
|
|
|
nativeBuildInputs = [ pkg-config ];
|
2019-01-12 07:52:37 +00:00
|
|
|
buildInputs = [ zlib mpg123 libogg libvorbis portaudio libsndfile flac ]
|
2021-01-15 13:21:58 +00:00
|
|
|
++ lib.optional usePulseAudio libpulseaudio;
|
2019-01-12 07:52:37 +00:00
|
|
|
|
2021-01-15 13:21:58 +00:00
|
|
|
configureFlags = lib.optional (!usePulseAudio) "--without-pulseaudio";
|
2016-10-08 21:08:18 +00:00
|
|
|
|
2021-05-29 01:59:43 +00:00
|
|
|
doCheck = true;
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2016-10-08 21:08:18 +00:00
|
|
|
description = "A cross-platform command-line based module file player";
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "https://lib.openmpt.org/libopenmpt/";
|
2016-10-08 21:08:18 +00:00
|
|
|
license = licenses.bsd3;
|
2021-05-29 01:59:43 +00:00
|
|
|
maintainers = with maintainers; [ OPNA2608 ];
|
|
|
|
platforms = platforms.unix;
|
2016-10-08 21:08:18 +00:00
|
|
|
};
|
|
|
|
}
|