Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "melpa2nix: update to work with Emacs HEAD" #277535

Merged
merged 1 commit into from
Dec 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pkgs/build-support/emacs/melpa.nix
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ import ./generic.nix { inherit lib stdenv emacs texinfo writeText gcc; } ({
src = fetchFromGitHub {
owner = "melpa";
repo = "package-build";
rev = "c48aa078c01b4f07b804270c4583a0a58ffea1c0";
sha256 = "sha256-MzPj375upIiYXdQR+wWXv3A1zMqbSrZlH0taLuxx/1M=";
rev = "c3c535e93d9dc92acd21ebc4b15016b5c3b90e7d";
sha256 = "17z0wbqdd6fspbj43yq8biff6wfggk74xgnaf1xx6ynsp1i74is5";
};

patches = [ ./package-build-dont-use-mtime.patch ];
Expand Down
26 changes: 13 additions & 13 deletions pkgs/build-support/emacs/melpa2nix.el
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,22 @@
;; Allow installing package tarfiles larger than 10MB
(setq large-file-warning-threshold nil)

(defun melpa2nix-build-package-1 (rcp)
(let* ((default-directory (package-recipe--working-tree rcp)))
(defun melpa2nix-build-package-1 (rcp version commit)
(let ((source-dir (package-recipe--working-tree rcp)))
(unwind-protect
(let ((files (package-build-expand-files-spec rcp t)))
(unless files
(error "Unable to find files matching recipe patterns"))
(if (> (length files) 1)
(package-build--build-multi-file-package rcp files)
(package-build--build-single-file-package rcp files))))))
(cond
((= (length files) 1)
(package-build--build-single-file-package
rcp version commit files source-dir))
((> (length files) 1)
(package-build--build-multi-file-package
rcp version commit files source-dir))
(t (error "Unable to find files matching recipe patterns")))))))

(defun melpa2nix-build-package ()
(unless noninteractive
(error "`melpa2nix-build-package' is to be used only with -batch"))
(if (not noninteractive)
(error "`melpa2nix-build-package' is to be used only with -batch"))
(pcase command-line-args-left
(`(,package ,version ,commit)
(let ((recipe (package-recipe-lookup package)))
(setf (oref recipe commit) commit)
(setf (oref recipe version) version)
(melpa2nix-build-package-1 recipe)))))
(melpa2nix-build-package-1 (package-recipe-lookup package) version commit))))
43 changes: 31 additions & 12 deletions pkgs/build-support/emacs/package-build-dont-use-mtime.patch
Original file line number Diff line number Diff line change
@@ -1,21 +1,40 @@
diff --git a/package-build.el b/package-build.el
index 29cdb61..c19be1b 100644
index e572045..9eb0f82 100644
--- a/package-build.el
+++ b/package-build.el
@@ -923,7 +923,6 @@ DIRECTORY is a temporary directory that contains the directory
that is put in the tarball."
(let* ((name (oref rcp name))
(version (oref rcp version))
- (time (oref rcp time))
(tar (expand-file-name (concat name "-" version ".tar")
package-build-archive-dir))
(dir (concat name "-" version)))
@@ -939,7 +938,7 @@ that is put in the tarball."
;; prevent a reproducible tarball as described at
@@ -415,7 +415,7 @@ (defun package-build--write-pkg-file (desc dir)
(princ ";; Local Variables:\n;; no-byte-compile: t\n;; End:\n"
(current-buffer)))))

-(defun package-build--create-tar (name version directory mtime)
+(defun package-build--create-tar (name version directory)
"Create a tar file containing the contents of VERSION of package NAME.
DIRECTORY is a temporary directory that contains the directory
that is put in the tarball. MTIME is used as the modification
@@ -434,7 +434,7 @@ (defun package-build--create-tar (name version directory mtime)
;; prevent a reproducable tarball as described at
;; https://reproducible-builds.org/docs/archives.
"--sort=name"
- (format "--mtime=@%d" time)
- (format "--mtime=@%d" mtime)
+ "--mtime=@0"
"--owner=0" "--group=0" "--numeric-owner"
"--pax-option=exthdr.name=%d/PaxHeaders/%f,delete=atime,delete=ctime"))
(when (and package-build-verbose noninteractive)
@@ -848,12 +848,11 @@ (defun package-build--build-multi-file-package (rcp version commit files source-
(package-build--desc-from-library
name version commit files 'tar)
(error "%s[-pkg].el matching package name is missing"
- name))))
- (mtime (package-build--get-commit-time rcp commit)))
+ name)))))
(package-build--copy-package-files files source-dir target)
(package-build--write-pkg-file desc target)
(package-build--generate-info-files files source-dir target)
- (package-build--create-tar name version tmp-dir mtime)
+ (package-build--create-tar name version tmp-dir)
(package-build--write-pkg-readme name files source-dir)
(package-build--write-archive-entry desc))
(delete-directory tmp-dir t nil))))
--
2.37.2