From f8585fb65537173761778e93b32cb8c9420efbb7 Mon Sep 17 00:00:00 2001 From: emaryn Date: Sat, 10 May 2025 00:59:32 +0800 Subject: [PATCH] ezstream: clean & fix on darwin --- pkgs/by-name/ez/ezstream/package.nix | 54 ++++++++++++++++++---------- 1 file changed, 36 insertions(+), 18 deletions(-) diff --git a/pkgs/by-name/ez/ezstream/package.nix b/pkgs/by-name/ez/ezstream/package.nix index 5ea87bb73e51..02b6ceba1e4c 100644 --- a/pkgs/by-name/ez/ezstream/package.nix +++ b/pkgs/by-name/ez/ezstream/package.nix @@ -2,38 +2,56 @@ lib, stdenv, fetchurl, - check, + + # nativeBuildInputs + pkg-config, + + # buildInputs libiconv, libshout, - taglib, libxml2, - pkg-config, + taglib, + + # checkInputs + check, }: -stdenv.mkDerivation rec { +stdenv.mkDerivation (finalAttrs: { pname = "ezstream"; version = "1.0.2"; src = fetchurl { - url = "https://ftp.osuosl.org/pub/xiph/releases/ezstream/${pname}-${version}.tar.gz"; + url = "https://ftp.osuosl.org/pub/xiph/releases/ezstream/ezstream-${finalAttrs.version}.tar.gz"; hash = "sha256-Ed6Jf0ValbpYVGvc1AqV072mmGbsX3h5qDsCQSbFTCo="; }; + postPatch = lib.optionalString stdenv.hostPlatform.isDarwin '' + substituteInPlace src/playlist.c \ + --replace-fail "#include " $'#include \n#include ' + substituteInPlace tests/Makefile.am \ + --replace-fail "check_playlist " "" + substituteInPlace tests/check_mdata.c \ + --replace-fail 'ck_assert_int_eq(mdata_run_program(md, SRCDIR "/test-meta03-huge.sh"), 0);' "" + ''; + + nativeBuildInputs = [ pkg-config ]; + + buildInputs = [ + check + libiconv + libshout + libxml2 + check + taglib + ]; + checkInputs = [ check ]; - buildInputs = [ - libiconv - libshout - taglib - libxml2 - ]; - nativeBuildInputs = [ pkg-config ]; - doCheck = true; - meta = with lib; { + meta = { description = "Command line source client for Icecast media streaming servers"; longDescription = '' Ezstream is a command line source client for Icecast media @@ -45,8 +63,8 @@ stdenv.mkDerivation rec { very little CPU resources. ''; homepage = "https://icecast.org/ezstream/"; - license = licenses.gpl2Only; - maintainers = [ maintainers.barrucadu ]; - platforms = platforms.all; + license = lib.licenses.gpl2Only; + maintainers = [ lib.maintainers.barrucadu ]; + platforms = lib.platforms.all; }; -} +})