From 299f6e16e4df53be5e817a339f613b94e4bf08ad Mon Sep 17 00:00:00 2001 From: Anderson Torres Date: Tue, 27 Feb 2024 21:42:50 -0300 Subject: [PATCH 1/4] emacspeak: migrate to by-name Also, keep a green alias in order to not break things. --- .../editors/emacs/elisp-packages/manual-packages.nix | 4 ++-- .../default.nix => by-name/em/emacspeak/package.nix} | 0 2 files changed, 2 insertions(+), 2 deletions(-) rename pkgs/{applications/editors/emacs/elisp-packages/manual-packages/emacspeak/default.nix => by-name/em/emacspeak/package.nix} (100%) diff --git a/pkgs/applications/editors/emacs/elisp-packages/manual-packages.nix b/pkgs/applications/editors/emacs/elisp-packages/manual-packages.nix index 1c698809791bf..9a908039b8f5c 100644 --- a/pkgs/applications/editors/emacs/elisp-packages/manual-packages.nix +++ b/pkgs/applications/editors/emacs/elisp-packages/manual-packages.nix @@ -5,6 +5,8 @@ let inherit (self) callPackage; in { + inherit (pkgs) emacspeak; + acm = callPackage ./manual-packages/acm { }; acm-terminal = callPackage ./manual-packages/acm-terminal { }; @@ -31,8 +33,6 @@ in elisp-ffi = callPackage ./manual-packages/elisp-ffi { }; - emacspeak = callPackage ./manual-packages/emacspeak { }; - ess-R-object-popup = callPackage ./manual-packages/ess-R-object-popup { }; evil-markdown = callPackage ./manual-packages/evil-markdown { }; diff --git a/pkgs/applications/editors/emacs/elisp-packages/manual-packages/emacspeak/default.nix b/pkgs/by-name/em/emacspeak/package.nix similarity index 100% rename from pkgs/applications/editors/emacs/elisp-packages/manual-packages/emacspeak/default.nix rename to pkgs/by-name/em/emacspeak/package.nix From df2ba5129c6220ee05161555875411070766538c Mon Sep 17 00:00:00 2001 From: Anderson Torres Date: Tue, 27 Feb 2024 21:34:41 -0300 Subject: [PATCH 2/4] emacspeak: refactor - finalAttrs design pattern - set strictDeps - getExe emacs - get rid of nested with - set meta.changelog - set meta.mainProgram --- pkgs/by-name/em/emacspeak/package.nix | 31 ++++++++++++++++----------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/pkgs/by-name/em/emacspeak/package.nix b/pkgs/by-name/em/emacspeak/package.nix index 5294623584da0..14f52f9b09dbb 100644 --- a/pkgs/by-name/em/emacspeak/package.nix +++ b/pkgs/by-name/em/emacspeak/package.nix @@ -1,34 +1,37 @@ { lib -, stdenv +, emacs +, espeak-ng , fetchFromGitHub , makeWrapper -, emacs +, stdenv , tcl , tclx -, espeak-ng }: -stdenv.mkDerivation rec { +stdenv.mkDerivation (finalAttrs: { pname = "emacspeak"; version = "58.0"; src = fetchFromGitHub { owner = "tvraman"; - repo = pname; - rev = version; - hash= "sha256-5pWC17nvy3ZuG0bR//LqDVpKsH5hFSFf63Q33a1BfBk="; + repo = "emacspeak"; + rev = finalAttrs.version; + hash = "sha256-5pWC17nvy3ZuG0bR//LqDVpKsH5hFSFf63Q33a1BfBk="; }; nativeBuildInputs = [ emacs makeWrapper ]; + buildInputs = [ espeak-ng tcl tclx ]; + strictDeps = true; + preConfigure = '' make config ''; @@ -44,17 +47,19 @@ stdenv.mkDerivation rec { cp -a . "$d" find "$d" \( -type d -or \( -type f -executable \) \) -execdir chmod 755 {} + find "$d" -type f -not -executable -execdir chmod 644 {} + - makeWrapper ${emacs}/bin/emacs $out/bin/emacspeak \ + makeWrapper ${lib.getExe emacs} $out/bin/emacspeak \ --set DTK_PROGRAM "${placeholder "out"}/share/emacs/site-lisp/emacspeak/servers/espeak" \ --set TCLLIBPATH "${tclx}/lib" \ --add-flags '-l "${placeholder "out"}/share/emacs/site-lisp/emacspeak/lisp/emacspeak-setup.elc"' ''; - meta = with lib; { + meta = { homepage = "https://github.com/tvraman/emacspeak/"; description = "Emacs extension that provides spoken output"; - license = licenses.gpl2Plus; - maintainers = [ maintainers.AndersonTorres ]; - platforms = platforms.linux; + changelog = "https://github.com/tvraman/emacspeak/blob/${finalAttrs.src.rev}/etc/NEWS"; + license = with lib.licenses; [ gpl2Plus ]; + mainProgram = "emacspeak"; + maintainers = with lib.maintainers; [ AndersonTorres ]; + platforms = lib.platforms.linux; }; -} +}) From bfca69f9d4ea4f901066938635efa343531ca180 Mon Sep 17 00:00:00 2001 From: Anderson Torres Date: Wed, 28 Feb 2024 18:29:10 -0300 Subject: [PATCH 3/4] emacspeak: set meta.broken --- pkgs/by-name/em/emacspeak/package.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkgs/by-name/em/emacspeak/package.nix b/pkgs/by-name/em/emacspeak/package.nix index 14f52f9b09dbb..11631f30123fd 100644 --- a/pkgs/by-name/em/emacspeak/package.nix +++ b/pkgs/by-name/em/emacspeak/package.nix @@ -61,5 +61,7 @@ stdenv.mkDerivation (finalAttrs: { mainProgram = "emacspeak"; maintainers = with lib.maintainers; [ AndersonTorres ]; platforms = lib.platforms.linux; + # Emacspeak requires a minimal Emacs version; let's use the broken flag + broken = lib.versionOlder (lib.getVersion emacs) "28.2"; }; }) From cff27f18aa1ac1d695ccc735bc09445956d2df82 Mon Sep 17 00:00:00 2001 From: Anderson Torres Date: Wed, 28 Feb 2024 18:39:28 -0300 Subject: [PATCH 4/4] emacspeak: 58.0 -> 59.0 Also, updates broken version according to the changelog. Co-authored-by: R. RyanTM --- pkgs/by-name/em/emacspeak/package.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/by-name/em/emacspeak/package.nix b/pkgs/by-name/em/emacspeak/package.nix index 11631f30123fd..6c18af7807ea9 100644 --- a/pkgs/by-name/em/emacspeak/package.nix +++ b/pkgs/by-name/em/emacspeak/package.nix @@ -10,13 +10,13 @@ stdenv.mkDerivation (finalAttrs: { pname = "emacspeak"; - version = "58.0"; + version = "59.0"; src = fetchFromGitHub { owner = "tvraman"; repo = "emacspeak"; rev = finalAttrs.version; - hash = "sha256-5pWC17nvy3ZuG0bR//LqDVpKsH5hFSFf63Q33a1BfBk="; + hash = "sha256-npS/wlqI7nBde/2S/rzp79jdfYXIIhgsVs5VizxEDAQ="; }; nativeBuildInputs = [ @@ -62,6 +62,6 @@ stdenv.mkDerivation (finalAttrs: { maintainers = with lib.maintainers; [ AndersonTorres ]; platforms = lib.platforms.linux; # Emacspeak requires a minimal Emacs version; let's use the broken flag - broken = lib.versionOlder (lib.getVersion emacs) "28.2"; + broken = lib.versionOlder (lib.getVersion emacs) "29.1"; }; })