~ruther/guix-local

e0d9777140423b9bf9433f4be89d4a9af1c2fc3b — Junker 4 months ago 457a773
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 <sughosha@disroot.org>
3 files changed, 121 insertions(+), 0 deletions(-)

M gnu/local.mk
M gnu/packages/music.scm
A gnu/packages/patches/ctune-cmake-disable-git-clone.patch
M gnu/local.mk => gnu/local.mk +1 -0
@@ 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			\

M gnu/packages/music.scm => gnu/packages/music.scm +36 -0
@@ 61,6 61,7 @@
;;; Copyright © 2024 Nikita Domnitskii <nikita@domnitskii.me>
;;; Copyright © 2024 Ashish SHUKLA <ashish.is@lostca.se>
;;; Copyright © 2025 Janneke Nieuwenhuizen <janneke@gnu.org>
;;; Copyright © 2025 Junker <dk@junkeria.club>
;;;
;;; 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")

A gnu/packages/patches/ctune-cmake-disable-git-clone.patch => gnu/packages/patches/ctune-cmake-disable-git-clone.patch +84 -0
@@ 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()