Skip to content

Commit a84134b

Browse files
committed
build: Fix nix build
nix source updates sdfsadf sdfsdfsadf nix dont fix libtoll nix fix
1 parent 621d45f commit a84134b

File tree

5 files changed

+30
-130
lines changed

5 files changed

+30
-130
lines changed

.github/workflows/checks.yaml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: "CI"
1+
name: "CI Nix"
22
on:
33
pull_request:
44
push:
@@ -18,13 +18,8 @@ jobs:
1818
# Configure Nix to enable flakes
1919
- run: echo "experimental-features = nix-command flakes" | sudo tee -a /etc/nix/nix.conf
2020

21-
2221
- name: Nix Flake Check
2322
run: nix -Lv flake check
24-
- name: Build emacsNg Rust Dependency
25-
# remove when nix build is fixed
26-
continue-on-error: true
27-
run: nix -Lv build .#emacsNG-rust
2823

2924
- uses: cachix/cachix-action@v10
3025
with:

flake.nix

Lines changed: 8 additions & 99 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
overlays = [
3939
self.overlays.default
4040
emacs-overlay.overlay
41-
rust-overlay.overlay
41+
(import rust-overlay)
4242
devshell.overlay
4343
];
4444
config = {};
@@ -92,7 +92,6 @@
9292
{
9393
inherit
9494
(pkgs)
95-
emacsng-rust
9695
emacsng
9796
;
9897
default = pkgs.emacsng;
@@ -111,87 +110,11 @@
111110
emacsng-source = emacsng-sources.emacsng.src;
112111
locked-date = prev.lib.removePrefix "nightly-" (prev.lib.removeSuffix "\n" (builtins.readFile ./rust-toolchain));
113112
in {
114-
emacsng-rust = with final; (
115-
let
116-
installPhase = ''
117-
tar --owner=0 --group=0 --numeric-owner --format=gnu \
118-
--sort=name --mtime="@$SOURCE_DATE_EPOCH" \
119-
-czf $out $name-versioned
120-
'';
121-
doVersionedUpdate = ''
122-
cargo vendor --versioned-dirs $name-versioned
123-
'';
124-
125-
emacsngLibDeps = prev.rustPlatform.fetchCargoTarball {
126-
src = emacsng-source + "/rust_src/remacs-lib";
127-
name = "emacsngLibDeps";
128-
cargoUpdateHook = let
129-
pathDir = emacsng-source + "/rust_src/crates";
130-
in
131-
''
132-
cp -r ${pathDir} crates
133-
sed -i 's|../crates/lisp_util|./crates/lisp_util|' Cargo.toml
134-
''
135-
+ doVersionedUpdate;
136-
sha256 = "sha256-ITFwTAKZoTkGBquxxay20r/H5638ndKpIcvQra2t4cg=";
137-
inherit installPhase;
138-
};
139-
140-
ngBindgen = prev.rustPlatform.fetchCargoTarball {
141-
src = emacsng-source + "/rust_src/ng-bindgen";
142-
sourceRoot = null;
143-
cargoUpdateHook = doVersionedUpdate;
144-
name = "ngBindgen";
145-
sha256 = "sha256-MsMfcZ/Oni5dsOeuA37bSYscQLTZOJe5D4dB8KAgc5s=";
146-
inherit installPhase;
147-
};
148-
149-
emacsngSrc = prev.rustPlatform.fetchCargoTarball {
150-
src = emacsng-source;
151-
cargoUpdateHook =
152-
''
153-
sed -e 's/@CARGO_.*@//' Cargo.in > Cargo.toml
154-
sed -e 's/@WEBRENDER_.*@//' rust_src/crates/webrender/Cargo.in > rust_src/crates/webrender/Cargo.toml
155-
''
156-
+ doVersionedUpdate;
157-
name = "emacsngSrc";
158-
sha256 = "sha256-nlzELzshSJWmSaWt5tewSbklnqnvdfWJeWfkdjCX1mo=";
159-
inherit installPhase;
160-
};
161-
162-
in
163-
stdenv.mkDerivation {
164-
name = "emacsng-rust";
165-
srcs = [
166-
emacsngLibDeps
167-
ngBindgen
168-
emacsngSrc
169-
];
170-
sourceRoot = ".";
171-
phases = ["unpackPhase" "installPhase"];
172-
installPhase = ''
173-
mkdir -p $out/.cargo/registry
174-
cat > $out/.cargo/config.toml << EOF
175-
[source.crates-io]
176-
registry = "https://github.com/rust-lang/crates.io-index"
177-
replace-with = "vendored-sources"
178-
[source.vendored-sources]
179-
directory = "$out/.cargo/registry"
180-
EOF
181-
cp -R emacsngLibDeps-vendor.tar.gz-versioned/* $out/.cargo/registry
182-
cp -R ngBindgen-vendor.tar.gz-versioned/* $out/.cargo/registry
183-
cp -R emacsngSrc-vendor.tar.gz-versioned/* $out/.cargo/registry
184-
'';
185-
}
186-
);
187-
188-
librusty_v8 = prev.callPackage ./nix/librusty_v8.nix {};
189-
190113
emacsng = with prev; let
191114
withWebrender = true;
192115
in
193116
(
194-
final.emacsGcc.override
117+
final.emacsGit.override
195118
{
196119
withImageMagick = true;
197120
inherit (prev) imagemagick;
@@ -218,6 +141,11 @@
218141
name = "emacsng-" + version;
219142
src = emacsng-source;
220143
version = builtins.substring 0 7 emacsng-source.rev;
144+
# https://github.com/NixOS/nixpkgs/blob/22.11/pkgs/applications/networking/browsers/firefox/common.nix#L574
145+
# Firefox use this.
146+
# guix has cargo-utils to fix checksum, won't be useful on nix though
147+
# https://github.com/ctrlcctrlv/revendor.guile
148+
dontFixLibtool = true;
221149

222150
preConfigure =
223151
(old.preConfigure or "")
@@ -236,7 +164,7 @@
236164
makeFlags =
237165
(old.makeFlags or [])
238166
++ [
239-
"CARGO_FLAGS=--offline" #nightly channel
167+
# "CARGO_FLAGS=--offline" #nightly channel
240168
];
241169

242170
#custom configure Flags Setting
@@ -272,25 +200,6 @@
272200
"--with-dbus"
273201
];
274202

275-
preBuild = let
276-
arch = rust.toRustTarget stdenv.hostPlatform;
277-
in
278-
(old.preBuild or "")
279-
+ ''
280-
_librusty_v8_setup() {
281-
for v in "$@"; do
282-
install -D ${final.librusty_v8} "target/$v/gn_out/obj/librusty_v8.a"
283-
done
284-
}
285-
_librusty_v8_setup "debug" "release" "${arch}/release"
286-
sed -i 's|deno = { git = "https://github.com/emacs-ng/deno", branch = "emacs-ng"|deno = { version = "1.9.2"|' rust_src/crates/js/Cargo.toml
287-
sed -i 's|deno_runtime = { git = "https://github.com/emacs-ng/deno", branch = "emacs-ng"|deno_runtime = { version = "0.13.0"|' rust_src/crates/js/Cargo.toml
288-
sed -i 's|deno_core = { git = "https://github.com/emacs-ng/deno", branch = "emacs-ng"|deno_core = { version = "0.86.0"|' rust_src/crates/js/Cargo.toml
289-
290-
sed -i 's|git = "https://github.com/servo/webrender.git", rev = ".*."|version = "0.61.0"|' rust_src/crates/webrender/Cargo.toml
291-
export HOME=${final.emacsng-rust}
292-
'';
293-
294203
postPatch =
295204
(old.postPatch or "")
296205
+ ''

nix/_sources/generated.json

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,21 @@
11
{
22
"emacsng": {
3-
"pinned": false,
4-
"cargoLock": null,
3+
"cargoLocks": null,
4+
"extract": null,
55
"name": "emacsng",
6+
"passthru": null,
7+
"pinned": false,
68
"src": {
79
"deepClone": false,
8-
"owner": "emacs-ng",
10+
"fetchSubmodules": true,
11+
"leaveDotGit": false,
912
"name": null,
13+
"owner": "declantsien",
1014
"repo": "emacs-ng",
11-
"type": "github",
12-
"sha256": "sha256-6J8qsl+fQExCY6oV4E/uko23YHAK1YNPQxdINANMrEk=",
13-
"rev": "1e465792a8337d6c12df06304cbc72677f78d090",
14-
"leaveDotGit": false,
15-
"fetchSubmodules": true
15+
"rev": "c18470efe98a3ec33ff18561377548527140cb27",
16+
"sha256": "sha256-QTxD6c+nu9ajsiJOqsH3YJXQ9r/ryrTB28uWskKuLJ4=",
17+
"type": "github"
1618
},
17-
"version": "1e465792a8337d6c12df06304cbc72677f78d090",
18-
"passthru": null,
19-
"extract": null,
20-
"rustGitDeps": null
19+
"version": "c18470efe98a3ec33ff18561377548527140cb27"
2120
}
2221
}

nix/_sources/generated.nix

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,15 @@
11
# This file was generated by nvfetcher, please do not modify it manually.
2+
{ fetchgit, fetchurl, fetchFromGitHub }:
23
{
3-
fetchgit,
4-
fetchurl,
5-
fetchFromGitHub,
6-
}: {
74
emacsng = {
85
pname = "emacsng";
9-
version = "1e465792a8337d6c12df06304cbc72677f78d090";
10-
src = fetchFromGitHub {
11-
owner = "emacs-ng";
6+
version = "c18470efe98a3ec33ff18561377548527140cb27";
7+
src = fetchFromGitHub ({
8+
owner = "declantsien";
129
repo = "emacs-ng";
13-
rev = "1e465792a8337d6c12df06304cbc72677f78d090";
10+
rev = "c18470efe98a3ec33ff18561377548527140cb27";
1411
fetchSubmodules = true;
15-
sha256 = "sha256-6J8qsl+fQExCY6oV4E/uko23YHAK1YNPQxdINANMrEk=";
16-
};
12+
sha256 = "sha256-QTxD6c+nu9ajsiJOqsH3YJXQ9r/ryrTB28uWskKuLJ4=";
13+
});
1714
};
1815
}

nix/sources.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# nvfetcher.toml
22
[emacsng]
3-
src.git = "https://github.com/emacs-ng/emacs-ng"
4-
fetch.github = "emacs-ng/emacs-ng"
5-
git.fetchSubmodules = true
3+
src.git = "https://github.com/declantsien/emacs-ng"
4+
src.branch = "vendor"
5+
fetch.github = "declantsien/emacs-ng"

0 commit comments

Comments
 (0)