all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Philip Kaludercic <philipk@posteo.net>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: Jonas Bernoulli <jonas@bernoul.li>,
	 emacs-devel@gnu.org, Eli Zaretskii <eliz@gnu.org>
Subject: Re: Request to add Package to GNU ELPA
Date: Sun, 09 Apr 2023 17:27:28 +0000	[thread overview]
Message-ID: <873559q83j.fsf@posteo.net> (raw)
In-Reply-To: <jwv8rf1hy6v.fsf-monnier+emacs@gnu.org> (Stefan Monnier's message of "Sun, 09 Apr 2023 11:29:46 -0400")

[-- Attachment #1: Type: text/plain, Size: 403 bytes --]

Stefan Monnier <monnier@iro.umontreal.ca> writes:

>> As mentioned in my other message, we are also missing
>> `loaddefs-generate'.  I am not exactly sure what motivated the change,
>> so I don't know if checking the version and doing what was done prior to
>> 29 would be enough:
>
> I'd check (fboundp 'loaddefs-generate) to select between the old and the
> new code.

Ok, I have modified the patch:


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Prepare-package.el-to-be-published-on-GNU-ELPA.patch --]
[-- Type: text/x-diff, Size: 6070 bytes --]

From e63ac132cc8d220e642836f8f246d82147793f57 Mon Sep 17 00:00:00 2001
From: Philip Kaludercic <philipk@posteo.net>
Date: Wed, 5 Apr 2023 23:16:39 +0200
Subject: [PATCH] Prepare package.el to be published on GNU ELPA

* lisp/emacs-lisp/package.el: Add Compat as a dependency.
(package--native-compile-async): Check if 'native-comp-available-p' is
bound.
(lm-homepage, lm-website): Use backwards-compatible alias
'lm-homepage'.
(package-buffer-info): Call 'lm-maintainer' if 'lm-maintainers' is not
defined.
(describe-package-1): Avoid using 'make-separator-line' if not bound.
(package-report-bug): Expand 'custom--standard-value' definition.

For the background and motivation behind these changes, please consult
this thread:
https://lists.gnu.org/archive/html/emacs-devel/2023-03/msg00995.html.
---
 lisp/emacs-lisp/package.el | 51 ++++++++++++++++++++++++--------------
 1 file changed, 32 insertions(+), 19 deletions(-)

diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el
index 0258ed52bee..2657a4f98b4 100644
--- a/lisp/emacs-lisp/package.el
+++ b/lisp/emacs-lisp/package.el
@@ -5,9 +5,12 @@
 ;; Author: Tom Tromey <tromey@redhat.com>
 ;;         Daniel Hackney <dan@haxney.org>
 ;; Created: 10 Mar 2007
-;; Version: 1.1.0
+;; Version: 1.1.1
 ;; Keywords: tools
-;; Package-Requires: ((tabulated-list "1.0"))
+;; Package-Requires: ((emacs "27.1") (compat "29.1.0.0"))
+
+;; This is a GNU ELPA :core package.  Avoid functionality that is not
+;; compatible with the version of Emacs recorded above.
 
 ;; This file is part of GNU Emacs.
 
@@ -147,6 +150,7 @@
 (eval-when-compile (require 'subr-x))
 (eval-when-compile (require 'epg))      ;For setf accessors.
 (eval-when-compile (require 'inline))   ;For `define-inline'
+(require 'compat nil 'noerror)
 (require 'seq)
 
 (require 'tabulated-list)
@@ -1084,16 +1088,20 @@ package-generate-autoloads
          (autoload-timestamps nil)
          (backup-inhibited t)
          (version-control 'never))
-    (loaddefs-generate
-     pkg-dir output-file nil
-     (prin1-to-string
-      '(add-to-list
-        'load-path
-        ;; Add the directory that will contain the autoload file to
-        ;; the load path.  We don't hard-code `pkg-dir', to avoid
-        ;; issues if the package directory is moved around.
-        (or (and load-file-name (file-name-directory load-file-name))
-            (car load-path)))))
+    (if (fboundp 'loaddefs-generate)
+        (loaddefs-generate
+         pkg-dir output-file nil
+         (prin1-to-string
+          '(add-to-list
+            'load-path
+            ;; Add the directory that will contain the autoload file to
+            ;; the load path.  We don't hard-code `pkg-dir', to avoid
+            ;; issues if the package directory is moved around.
+            (or (and load-file-name (file-name-directory load-file-name))
+                (car load-path)))))
+      (with-suppressed-warnings ((obsolete package-autoload-ensure-default-file))
+        (package-autoload-ensure-default-file output-file))
+      (make-directory-autoloads pkg-dir output-file))
     (let ((buf (find-buffer-visiting output-file)))
       (when buf (kill-buffer buf)))
     auto-name))
@@ -1124,7 +1132,8 @@ package--native-compile-async
   "Native compile installed package PKG-DESC asynchronously.
 This assumes that `pkg-desc' has already been activated with
 `package-activate-1'."
-  (when (native-comp-available-p)
+  (when (and (fboundp 'native-comp-available-p)
+             (native-comp-available-p))
     (let ((warning-minimum-level :error))
       (native-compile-async (package-desc-dir pkg-desc) t))))
 
@@ -1160,9 +1169,10 @@ package--prepare-dependencies
 
 (declare-function lm-header "lisp-mnt" (header))
 (declare-function lm-header-multiline "lisp-mnt" (header))
-(declare-function lm-website "lisp-mnt" (&optional file))
+(declare-function lm-homepage "lisp-mnt" (&optional file))
 (declare-function lm-keywords-list "lisp-mnt" (&optional file))
 (declare-function lm-maintainers "lisp-mnt" (&optional file))
+(declare-function lm-maintainer "lisp-mnt" (&optional file))
 (declare-function lm-authors "lisp-mnt" (&optional file))
 
 (defun package-buffer-info ()
@@ -1195,7 +1205,7 @@ package-buffer-info
             (or (lm-header "package-version") (lm-header "version")))
            (pkg-version (package-strip-rcs-id version-info))
            (keywords (lm-keywords-list))
-           (website (lm-website)))
+           (website (lm-homepage)))
       (unless pkg-version
          (if version-info
              (error "Unrecognized package version: %s" version-info)
@@ -1211,7 +1221,10 @@ package-buffer-info
        :maintainer
        ;; For backward compatibility, use a single string if there's only
        ;; one maintainer (the most common case).
-       (let ((maints (lm-maintainers))) (if (cdr maints) maints (car maints)))
+       (if (fboundp 'lm-maintainers)
+           (let ((maints (lm-maintainers)))
+             (if (cdr maints) maints (car maints)))
+         (lm-maintainer))
        :authors (lm-authors)))))
 
 (defun package--read-pkg-desc (kind)
@@ -2302,8 +2315,6 @@ package-strip-rcs-id
       ;; to make sure we use a "canonical name"!
       (if l (package-version-join l)))))
 
-(declare-function lm-website "lisp-mnt" (&optional file))
-
 ;;;###autoload
 (defun package-install-from-buffer ()
   "Install a package from the current buffer.
@@ -4571,7 +4582,9 @@ package-report-bug
       (dolist (ent (get (cdr group) 'custom-group))
         (when (and (custom-variable-p (car ent))
                    (boundp (car ent))
-                   (not (eq (custom--standard-value (car ent))
+                   (not (eq (if (fboundp 'custom--standard-value)
+                                (custom--standard-value (car ent))
+                              (eval (car (get (car ent) 'standard-value)) t))
                             (default-toplevel-value (car ent))))
                    (file-in-directory-p (car group) (package-desc-dir desc)))
           (push (car ent) vars))))
-- 
2.30.2


[-- Attachment #3: Type: text/plain, Size: 62 bytes --]


Eli, are you OK with this being done?

-- 
Philip Kaludercic

  reply	other threads:[~2023-04-09 17:27 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-30 13:42 Request to add Package to GNU ELPA Jonas Bernoulli
2023-03-30 16:40 ` Felician Nemeth
2023-03-30 17:37   ` Philip Kaludercic
2023-03-30 17:32 ` Philip Kaludercic
2023-03-31 17:15   ` Jonas Bernoulli
2023-04-05  8:59     ` Philip Kaludercic
2023-04-05 14:13       ` Jonas Bernoulli
2023-04-05 18:07         ` Philip Kaludercic
2023-04-05 18:26         ` Philip Kaludercic
2023-04-05 21:08           ` Philip Kaludercic
2023-04-06 15:46             ` Philip Kaludercic
2023-04-06 21:36               ` Stefan Monnier
2023-04-07  7:23                 ` Philip Kaludercic
2023-04-07 15:39                   ` Stefan Monnier
2023-04-08  8:24                     ` Philip Kaludercic
2023-04-09 15:29                       ` Stefan Monnier
2023-04-09 17:27                         ` Philip Kaludercic [this message]
2023-04-07 10:07                 ` Philip Kaludercic
2023-04-06 11:41           ` Jonas Bernoulli
2023-04-17 16:24       ` Adding package-vc to ELPA Philip Kaludercic
2023-09-16 17:20         ` Stefan Kangas
2023-09-17  8:02           ` Philip Kaludercic
2023-03-30 19:10 ` Request to add Package to GNU ELPA chad

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=873559q83j.fsf@posteo.net \
    --to=philipk@posteo.net \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=jonas@bernoul.li \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.