Skip to content

Commit 3a558d1

Browse files
committed
tries to rebuild lindera during wordbase-cli build
1 parent d06c07d commit 3a558d1

File tree

1 file changed

+20
-26
lines changed

1 file changed

+20
-26
lines changed

flake.nix

Lines changed: 20 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,9 @@
124124

125125
nativeBuildInputs = oa.nativeBuildInputs ++ [ pkgs.httplz];
126126
doCheck = false;
127-
preBuild = ''
127+
buildPhase =
128+
# preBuild =
129+
''
128130
echo "PATCHING"
129131
ls -l
130132
set -x
@@ -149,7 +151,11 @@
149151
# not needed with useFetchCargoVendor=true, but kept in case it is required again
150152
#newHash=$(sha256sum build.rs | cut -d " " -f 1)
151153
#substituteInPlace .cargo-checksum.json --replace-fail $oldHash $newHash
152-
)'';
154+
)
155+
''
156+
+ oa.buildPhase
157+
# + oa.buildPhaseCargoCommand
158+
;
153159

154160
});
155161

@@ -162,28 +168,30 @@
162168

163169
fileSetForCrate =
164170
crate:
171+
# "./${crate}"
165172
lib.fileset.toSource {
166173
root = ./.;
167174
fileset = lib.fileset.unions [
168175
./Cargo.toml
169176
./Cargo.lock
170177
(lib.fileset.fileFilter (file: file.hasExt "md") ./.)
171178
(craneLib.fileset.commonCargoSources ./crates/wordbase)
172-
./crates/wordbase-cli
173179
(craneLib.fileset.commonCargoSources ./crates/jmdict-furigana)
174180
./crates/jmdict-furigana/README.md
175181
./crates/jmdict-furigana/src/jmdict_furigana.json.zip
176182
(craneLib.fileset.commonCargoSources ./crates/wordbase-api)
177-
./crates/wordbase/src/records.html
178-
./crates/wordbase/README.md
179-
./crates/wordbase/migrations
180-
./crates/wordbase-api/README.md
181-
./.sqlx
183+
(craneLib.fileset.commonCargoSources ./crates/wordbase-sys)
184+
# ./crates/wordbase/src/records.html
185+
# ./crates/wordbase/README.md
186+
# ./crates/wordbase/migrations
187+
# ./crates/wordbase-api/README.md
188+
# ./.sqlx
182189

183190
# (craneLib.fileset.commonCargoSources ./crates/my-workspace-hack)
184191
(craneLib.fileset.commonCargoSources crate)
185192
];
186-
};
193+
}
194+
;
187195

188196
# Build the top-level crates of the workspace as individual derivations.
189197
# This allows consumers to only depend on (and build) only what they need.
@@ -196,6 +204,7 @@
196204
wordbase-cli = craneLib.buildPackage (
197205
individualCrateArgs
198206
// {
207+
# inherit (craneLib.crateNameFromCargoToml { inherit src; }) version;
199208
pname = "wordbase-cli";
200209
cargoExtraArgs = "-p wordbase-cli";
201210
src = fileSetForCrate ./crates/wordbase-cli;
@@ -248,27 +257,12 @@
248257
# taploExtraArgs = "--config ./taplo.toml";
249258
};
250259

251-
# Ensure that cargo-hakari is up to date
252-
# my-workspace-hakari = craneLib.mkCargoDerivation {
253-
# inherit src;
254-
# pname = "my-workspace-hakari";
255-
# cargoArtifacts = null;
256-
# doInstallCargoArtifacts = false;
257-
#
258-
# buildPhaseCargoCommand = ''
259-
# cargo hakari generate --diff # workspace-hack Cargo.toml is up-to-date
260-
# cargo hakari manage-deps --dry-run # all workspace crates depend on workspace-hack
261-
# cargo hakari verify
262-
# '';
263-
#
264-
# nativeBuildInputs = [
265-
# pkgs.cargo-hakari
266-
# ];
267-
# };
268260
};
269261

270262
packages = {
271263
inherit wordbase-cli;
264+
inherit cargoArtifacts;
265+
inherit cargoVendorDir;
272266
};
273267

274268
apps = {

0 commit comments

Comments
 (0)