Commit f2f833d8 authored by FliegendeWurst's avatar FliegendeWurst
Browse files

gummy: 0.5.4 -> 0.6.0

parent 900df250
Loading
Loading
Loading
Loading
+0 −24
Original line number Diff line number Diff line
--- a/CMakeLists.txt	2023-10-18 17:14:06.368938573 +0200
+++ b/CMakeLists.txt	2023-10-18 17:16:54.361334970 +0200
@@ -9,17 +9,16 @@
 set(SPDLOG_FMT_EXTERNAL ON)
 
 FetchContent_Declare(json
-    URL https://github.com/nlohmann/json/releases/download/v3.11.2/json.tar.xz
+    SOURCE_DIR @nlohmann_json_src@
 )
 FetchContent_Declare(fmt
-    URL https://github.com/fmtlib/fmt/releases/download/9.1.0/fmt-9.1.0.zip
+	SOURCE_DIR @fmt_src@
 )
 FetchContent_Declare(spdlog
-    URL https://github.com/gabime/spdlog/archive/refs/tags/v1.11.0.tar.gz
+	SOURCE_DIR @spdlog_src@
 )
 FetchContent_Declare(cli11
-    GIT_REPOSITORY https://github.com/CLIUtils/CLI11
-    GIT_TAG 291c58789c031208f08f4f261a858b5b7083e8e2 #v2.3.2
+	SOURCE_DIR @cli11_src@
 )
 FetchContent_MakeAvailable(
     json
+8 −18
Original line number Diff line number Diff line
{ lib
, stdenv
, fetchFromGitHub
, fetchFromGitea
, substituteAll
, testers
, gummy
@@ -20,13 +20,14 @@

stdenv.mkDerivation rec {
  pname = "gummy";
  version = "0.5.4";
  version = "0.6.0";

  src = fetchFromGitHub {
    owner = "fushko";
  src = fetchFromGitea {
    domain = "codeberg.org";
    owner = "fusco";
    repo = "gummy";
    rev = version;
    sha256 = "sha256-cRYmBeHvTpw+cwAZzw5qjMRFPINRa7xRXixZzPKwE84=";
    hash = "sha256-kATieFf+dEpcYgSEPoETacP7R+u2dOrg7rOhIkNQ1uE=";
  };

  nativeBuildInputs = [
@@ -51,21 +52,10 @@ stdenv.mkDerivation rec {
    "-DUDEV_RULES_DIR=${placeholder "out"}/lib/udev/rules.d"
  ];

  patches = [
    # prevent CMake from trying to get libraries on the Internet
    (substituteAll {
      src = ./cmake_no_fetch.patch;
      nlohmann_json_src = nlohmann_json.src;
      fmt_src = fmt.src;
      spdlog_src = spdlog.src;
      cli11_src = cli11.src;
    })
  ];

  # Fixes the "gummy start" command, without this it cannot find the binary.
  # Setting this through cmake does not seem to work.
  postPatch = ''
    substituteInPlace gummy/gummyd/gummyd/api.cpp \
    substituteInPlace gummyd/gummyd/api.cpp \
      --replace "CMAKE_INSTALL_DAEMON_PATH" "\"${placeholder "out"}/libexec/gummyd\""
  '';

@@ -79,7 +69,7 @@ stdenv.mkDerivation rec {
  passthru.tests.version = testers.testVersion { package = gummy; };

  meta = with lib; {
    homepage = "https://github.com/Fushko/gummy";
    homepage = "https://codeberg.org/fusco/gummy";
    description = "Brightness and temperature manager for X11";
    longDescription = ''
      CLI screen manager for X11 that allows automatic and manual brightness/temperature adjustments,