From b0b4b0e15f150a988c0932c887cb9e456064d696 Mon Sep 17 00:00:00 2001 From: qwqawawow <40905037+qwqawawow@users.noreply.github.com> Date: Sun, 22 Sep 2024 19:33:36 +0800 Subject: [PATCH] ncmpcpp: 0.9.2 -> 0.10 --- pkgs/applications/audio/ncmpcpp/default.nix | 103 +++++++++++++------- 1 file changed, 69 insertions(+), 34 deletions(-) diff --git a/pkgs/applications/audio/ncmpcpp/default.nix b/pkgs/applications/audio/ncmpcpp/default.nix index e2ecb813f552..fdc377118d27 100644 --- a/pkgs/applications/audio/ncmpcpp/default.nix +++ b/pkgs/applications/audio/ncmpcpp/default.nix @@ -1,53 +1,88 @@ -{ lib -, stdenv -, fetchurl -, boost -, libmpdclient -, ncurses -, pkg-config -, readline -, libiconv -, icu -, curl -, outputsSupport ? true # outputs screen -, visualizerSupport ? false, fftw # visualizer screen -, clockSupport ? true # clock screen -, taglibSupport ? true, taglib # tag editor +{ + lib, + stdenv, + fetchFromGitHub, + boost, + libmpdclient, + ncurses, + pkg-config, + readline, + libiconv, + icu, + curl, + autoconf, + automake, + libtool, + outputsSupport ? true, # outputs screen + visualizerSupport ? false, + fftw, # visualizer screen + clockSupport ? true, # clock screen + taglibSupport ? true, + taglib, # tag editor }: stdenv.mkDerivation rec { pname = "ncmpcpp"; - version = "0.9.2"; + version = "0.10"; - src = fetchurl { - url = "https://rybczak.net/ncmpcpp/stable/${pname}-${version}.tar.bz2"; - sha256 = "sha256-+qv2FXyMsbJKBZryduFi+p+aO5zTgQxDuRKIYMk4Ohs="; + src = fetchFromGitHub { + owner = "ncmpcpp"; + repo = "ncmpcpp"; + rev = "refs/tags/${version}"; + sha256 = "sha256-HRJQ+IOQ8xP1QkPlLI+VtDUWaI2m0Aw0fCDWHhgsOLY="; }; enableParallelBuilding = true; strictDeps = true; - configureFlags = [ "BOOST_LIB_SUFFIX=" ] - ++ lib.optional outputsSupport "--enable-outputs" - ++ lib.optional visualizerSupport "--enable-visualizer --with-fftw" - ++ lib.optional clockSupport "--enable-clock" - ++ lib.optional taglibSupport "--with-taglib"; + configureFlags = [ + "BOOST_LIB_SUFFIX=" + (lib.enableFeature outputsSupport "outputs") + (lib.enableFeature visualizerSupport "enable-visualizer") + (lib.withFeature visualizerSupport "fftw") + (lib.enableFeature clockSupport "clock") + (lib.withFeature taglibSupport "taglib") + ]; - nativeBuildInputs = [ pkg-config ] + nativeBuildInputs = [ + autoconf + automake + libtool + pkg-config + ]; + + buildInputs = [ + boost + libmpdclient + ncurses + readline + libiconv + icu + curl + ] ++ lib.optional visualizerSupport fftw ++ lib.optional taglibSupport taglib; - buildInputs = [ boost libmpdclient ncurses readline libiconv icu curl ] - ++ lib.optional visualizerSupport fftw - ++ lib.optional taglibSupport taglib; + preConfigure = + '' + ./autogen.sh + '' + + lib.optionalString stdenv.isDarwin '' + # std::result_of was removed in c++20 and unusable for clang16 + substituteInPlace ./configure \ + --replace-fail "std=c++20" "std=c++17" + ''; - meta = with lib; { + meta = { description = "Featureful ncurses based MPD client inspired by ncmpc"; - homepage = "https://rybczak.net/ncmpcpp/"; - changelog = "https://github.com/ncmpcpp/ncmpcpp/blob/${version}/CHANGELOG.md"; - license = licenses.gpl2Plus; - maintainers = with maintainers; [ koral lovek323 ]; - platforms = platforms.all; + homepage = "https://rybczak.net/ncmpcpp/"; + changelog = "https://github.com/ncmpcpp/ncmpcpp/blob/${version}/CHANGELOG.md"; + license = lib.licenses.gpl2Plus; + maintainers = with lib.maintainers; [ + koral + lovek323 + ]; + platforms = lib.platforms.all; mainProgram = "ncmpcpp"; }; }