From e0d9777140423b9bf9433f4be89d4a9af1c2fc3b Mon Sep 17 00:00:00 2001 From: Junker Date: Tue, 30 Sep 2025 19:47:03 +0700 Subject: [PATCH] gnu: Add ctune. * gnu/packages/music.scm (ctune): New variable. * gnu/packages/patches/ctune-cmake-disable-git-clone.patch: New file. * gnu/local.mk (dist_patch_DATA): Register new patch. Change-Id: I3faf63279b958757d20e0fd2cae6f1e06d08818c Signed-off-by: Sughosha --- gnu/local.mk | 1 + gnu/packages/music.scm | 36 ++++++++ .../ctune-cmake-disable-git-clone.patch | 84 +++++++++++++++++++ 3 files changed, 121 insertions(+) create mode 100644 gnu/packages/patches/ctune-cmake-disable-git-clone.patch diff --git a/gnu/local.mk b/gnu/local.mk index 7d093d00514f48e5287cabd14dcd079d59ce2141..f5de4dbfbbe8874f471b065f85bc6ecf11d93bf0 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1143,6 +1143,7 @@ dist_patch_DATA = \ %D%/packages/patches/clucene-contribs-lib.patch \ %D%/packages/patches/csvkit-set-locale-for-tests.patch \ %D%/packages/patches/ctranslate2-local-build.patch \ + %D%/packages/patches/ctune-cmake-disable-git-clone.patch \ %D%/packages/patches/cube-nocheck.patch \ %D%/packages/patches/cups-relax-root-ownership-check.patch \ %D%/packages/patches/cura-engine-gcc-14.patch \ diff --git a/gnu/packages/music.scm b/gnu/packages/music.scm index bbd4104b0a2fd51e757bb3a13d2e670ae570eb94..a14ae098bca608b493789557a5b4ca02657b4a7d 100644 --- a/gnu/packages/music.scm +++ b/gnu/packages/music.scm @@ -61,6 +61,7 @@ ;;; Copyright © 2024 Nikita Domnitskii ;;; Copyright © 2024 Ashish SHUKLA ;;; Copyright © 2025 Janneke Nieuwenhuizen +;;; Copyright © 2025 Junker ;;; ;;; This file is part of GNU Guix. ;;; @@ -908,6 +909,41 @@ It is a fork of Clementine aimed at music collectors and audiophiles.") many input formats and provides a customisable Vi-style user interface.") (license license:gpl2+))) +(define-public ctune + (package + (name "ctune") + (version "1.3.4") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/An7ar35/ctune") + (commit (string-append "v" version)))) + (file-name (git-file-name name version)) + (patches (search-patches "ctune-cmake-disable-git-clone.patch")) + (sha256 + (base32 "05gs1a1pc303qrnd1bz0z0wkzxkpm310hqznnq6zz7nl4vs3b9nz")))) + (build-system cmake-build-system) + (arguments '(#:tests? #f)) ;no check target + (native-inputs (list pkg-config + json-c + ffmpeg-6 + pandoc ;for documentation + curl)) + (inputs (list openssl + curl + ncurses + (list util-linux "lib") ;for libuuid + ffmpeg + pulseaudio)) + (home-page "https://github.com/An7ar35/ctune") + (synopsis "Ncurses internet radio player for Linux") + (description "cTune is a ncurses based internet radio player written in C +for Linux. Aside from playing a radio stream you can search and browse stations +as well as keep a list of favourites. It uses the RadioBrowser API to search +and get radio stream information.") + (license license:agpl3+))) + (define-public denemo (package (name "denemo") diff --git a/gnu/packages/patches/ctune-cmake-disable-git-clone.patch b/gnu/packages/patches/ctune-cmake-disable-git-clone.patch new file mode 100644 index 0000000000000000000000000000000000000000..9fa4aae213ee25e0ace426e5fa2ea437bcc10265 --- /dev/null +++ b/gnu/packages/patches/ctune-cmake-disable-git-clone.patch @@ -0,0 +1,84 @@ +origin patch from nixos. +see: https://raw.githubusercontent.com/NixOS/nixpkgs/d916df777523d75f7c5acca79946652f032f633e/pkgs/by-name/ct/ctune/cmake_disable_git_clone.patch + +diff --git a/CMakeLists.txt.orig b/CMakeLists.txt +index ac0488e..a3724bc 100644 +--- a/CMakeLists.txt.orig ++++ b/CMakeLists.txt +@@ -50,14 +50,6 @@ include(FetchContent) + + set(CMAKE_VERBOSE_MAKEFILE ON) + +-#========================================== PRE-CHECKS ============================================# +-include(FindGit) +-find_package(Git) +- +-if (NOT Git_FOUND) +- message(FATAL_ERROR "Required package 'Git' not found on system.") +-endif () +- + #======================================== LIB IMPORTS =============================================# + # ======= # + # OpenSSL # +@@ -65,40 +57,17 @@ endif () + find_package(OpenSSL REQUIRED) + include_directories(${OPENSSL_INCLUDE_DIR}) + +-# ============== # +-# JSON-C library # +-# ============== # +-set(JSONC_DOWNLOAD_PATH "${TEMP_DIR_PATH}/libjsonc") +-set(JSONC_INSTALL_PATH "${CMAKE_EXTERNAL_OUTPUT_DIRECTORY}") +- +-add_custom_target(make-jsonc-install-dir ALL +- COMMAND ${CMAKE_COMMAND} -E make_directory ${JSONC_INSTALL_PATH} +-) +- +-ExternalProject_Add(libjsonc +- PREFIX "${JSONC_DOWNLOAD_PATH}" +- SOURCE_DIR "${JSONC_DOWNLOAD_PATH}/src/libjsonc-build" +- GIT_REPOSITORY "https://github.com/json-c/json-c.git" +- GIT_TAG "json-c-0.18-20240915" +- CMAKE_ARGS "-DBUILD_STATIC_LIBS=ON" +- "-DBUILD_SHARED_LIBS=OFF" +- "-DCMAKE_INSTALL_PREFIX:PATH=${JSONC_INSTALL_PATH}" +- "-DHAVE_ARC4RANDOM=OFF" +- "-DCMAKE_BUILD_TYPE=release" +- "-DCMAKE_POLICY_VERSION_MINIMUM=3.5" +-) +- +-set(JSONC_LIBRARIES +- ${CMAKE_EXTERNAL_OUTPUT_DIRECTORY}/lib/libjson-c.a +-# bsd +-) +- + # ============ # + # Curl library # + # ============ # + find_package(CURL REQUIRED) + include_directories(${CURL_INCLUDE_DIR}) + ++find_package(PkgConfig REQUIRED) ++pkg_check_modules(JSONC REQUIRED json-c) ++include_directories(${JSONC_INCLUDE_DIRS}) ++ ++ + # ================================ # + # nCurses - for the user interface # + # ================================ # +@@ -410,7 +379,7 @@ add_subdirectory(docs) + #endforeach() + + add_executable(ctune ${SOURCE_FILES}) +-add_dependencies(ctune ctune_logger libjsonc) ++add_dependencies(ctune ctune_logger) + include_directories(${CMAKE_EXTERNAL_OUTPUT_DIRECTORY}/include) + + add_dependencies(ctune ${CTUNE_PLUGIN_LIST_AUDIO_PLAYER}) +@@ -450,4 +419,4 @@ if(TARGET uninstall) + + add_custom_target(uninstall + COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_SOURCE_DIR}/CMakeUninstall.cmake) +-endif() +\ No newline at end of file ++endif()