mirror of
https://github.com/nix-community/emacs-overlay.git
synced 2025-12-06 02:40:25 -08:00
Add emacs package (updating from github emacs mirror)
This commit is contained in:
parent
bc0f4cef90
commit
168536c0cb
7 changed files with 64 additions and 9 deletions
19
default.nix
19
default.nix
|
|
@ -19,6 +19,24 @@ let
|
|||
});
|
||||
|
||||
in {
|
||||
|
||||
emacsGit = let
|
||||
repoMeta = super.lib.importJSON (./. + "/repos/emacs.json");
|
||||
name = "emacs-git-${version}";
|
||||
version = builtins.substring 0 7 repoMeta.rev;
|
||||
in (super.emacs.override { srcRepo = true; }).overrideAttrs(old: {
|
||||
inherit name version;
|
||||
src = super.fetchFromGitHub {
|
||||
owner = "emacs-mirror";
|
||||
repo = "emacs";
|
||||
inherit (repoMeta) sha256 rev;
|
||||
};
|
||||
patches = [
|
||||
./patches/tramp-detect-wrapped-gvfsd.patch
|
||||
./patches/clean-env.patch
|
||||
];
|
||||
});
|
||||
|
||||
emacsPackagesNgFor = emacs:
|
||||
(super.emacsPackagesNgFor emacs).overrideScope'(eself: esuper: {
|
||||
xelb = mkExDrv eself "xelb" {
|
||||
|
|
@ -28,4 +46,5 @@ in {
|
|||
packageRequires = [ eself.xelb ];
|
||||
};
|
||||
});
|
||||
|
||||
}
|
||||
|
|
|
|||
0
patches/.gitkeep
Normal file
0
patches/.gitkeep
Normal file
16
patches/clean-env.patch
Normal file
16
patches/clean-env.patch
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
Dump temacs in an empty environment to prevent -dev paths from ending
|
||||
up in the dumped image.
|
||||
|
||||
diff --git a/src/Makefile.in b/src/Makefile.in
|
||||
index fd05a45df5..13f529c253 100644
|
||||
--- a/src/Makefile.in
|
||||
+++ b/src/Makefile.in
|
||||
@@ -570,7 +570,7 @@ emacs$(EXEEXT): temacs$(EXEEXT) \
|
||||
lisp.mk $(etc)/DOC $(lisp) \
|
||||
$(lispsource)/international/charprop.el ${charsets}
|
||||
ifeq ($(DUMPING),unexec)
|
||||
- LC_ALL=C $(RUN_TEMACS) -batch $(BUILD_DETAILS) -l loadup --temacs=dump
|
||||
+ env -i LC_ALL=C $(RUN_TEMACS) -batch $(BUILD_DETAILS) -l loadup --temacs=dump
|
||||
ifneq ($(PAXCTL_dumped),)
|
||||
$(PAXCTL_dumped) emacs$(EXEEXT)
|
||||
endif
|
||||
14
patches/tramp-detect-wrapped-gvfsd.patch
Normal file
14
patches/tramp-detect-wrapped-gvfsd.patch
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
diff --git a/lisp/net/tramp-gvfs.el b/lisp/net/tramp-gvfs.el
|
||||
index f370abba31..f2806263a9 100644
|
||||
--- a/lisp/net/tramp-gvfs.el
|
||||
+++ b/lisp/net/tramp-gvfs.el
|
||||
@@ -164,7 +164,8 @@ tramp-gvfs-enabled
|
||||
(and (featurep 'dbusbind)
|
||||
(tramp-compat-funcall 'dbus-get-unique-name :system)
|
||||
(tramp-compat-funcall 'dbus-get-unique-name :session)
|
||||
- (or (tramp-compat-process-running-p "gvfs-fuse-daemon")
|
||||
+ (or (tramp-compat-process-running-p ".gvfsd-fuse-wrapped")
|
||||
+ (tramp-compat-process-running-p "gvfs-fuse-daemon")
|
||||
(tramp-compat-process-running-p "gvfsd-fuse"))))
|
||||
"Non-nil when GVFS is available.")
|
||||
|
||||
1
repos/emacs.json
Normal file
1
repos/emacs.json
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"rev": "a48726ebae2f44ed15b97cb72bc7eca199d8de47", "sha256": "1ldn6cjxhc42dj3rg7balpnq8k5a55karwqy7yld7as6cj2zx703", "version": "20190723.0"}
|
||||
11
test.nix
11
test.nix
|
|
@ -1,6 +1,9 @@
|
|||
with import <nixpkgs> {
|
||||
overlays = [ (import ./default.nix) ];
|
||||
};
|
||||
emacsWithPackages(epkgs: [
|
||||
{ pkgs ? import <nixpkgs> { overlays = [ (import ./default.nix) ]; } }:
|
||||
|
||||
let
|
||||
package = pkgs.emacsGit;
|
||||
emacsPackages = pkgs.emacsPackagesNgGen package;
|
||||
emacsWithPackages = emacsPackages.emacsWithPackages;
|
||||
in emacsWithPackages(epkgs: [
|
||||
epkgs.exwm
|
||||
])
|
||||
|
|
|
|||
12
update
12
update
|
|
@ -3,21 +3,23 @@
|
|||
set -euxo pipefail
|
||||
|
||||
function update_repo() {
|
||||
repo=$1
|
||||
owner=$1
|
||||
repo=$2
|
||||
echo $repo
|
||||
|
||||
# Get relevant data (commit id and timestamp) for the latest commit
|
||||
commit_data=$(curl "https://github.com/ch11ng/$repo/commits/master.atom" | xmlstarlet sel -N atom="http://www.w3.org/2005/Atom" -t -m /atom:feed/atom:entry -v "concat(atom:id,'/',atom:updated)" -n | head -n 1)
|
||||
commit_data=$(curl "https://github.com/$owner/$repo/commits/master.atom" | xmlstarlet sel -N atom="http://www.w3.org/2005/Atom" -t -m /atom:feed/atom:entry -v "concat(atom:id,'/',atom:updated)" -n | head -n 1)
|
||||
|
||||
# Extract commit sha and build a version number based on date: YYYYMMDD.0
|
||||
commit_sha=$(echo $commit_data | cut -d '/' -f 2)
|
||||
version_number=$(echo $commit_data | cut -d '/' -f 3 | cut -d 'T' -f 1 | sed 's/-//g').0
|
||||
|
||||
digest=$(nix-prefetch-url --unpack "https://github.com/ch11ng/$repo/archive/${commit_sha}.tar.gz")
|
||||
digest=$(nix-prefetch-url --unpack "https://github.com/$owner/$repo/archive/${commit_sha}.tar.gz")
|
||||
echo "{\"rev\": \"${commit_sha}\", \"sha256\": \"${digest}\", \"version\": \"${version_number}\"}" > repos/$repo.json
|
||||
}
|
||||
|
||||
update_repo exwm
|
||||
update_repo xelb
|
||||
update_repo ch11ng exwm
|
||||
update_repo ch11ng xelb
|
||||
update_repo emacs-mirror emacs
|
||||
|
||||
nix-build --no-out-link --show-trace ./test.nix
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue