|
124 | 124 |
|
125 | 125 | nativeBuildInputs = oa.nativeBuildInputs ++ [ pkgs.httplz]; |
126 | 126 | doCheck = false; |
127 | | - preBuild = '' |
| 127 | + buildPhase = |
| 128 | + # preBuild = |
| 129 | + '' |
128 | 130 | echo "PATCHING" |
129 | 131 | ls -l |
130 | 132 | set -x |
|
149 | 151 | # not needed with useFetchCargoVendor=true, but kept in case it is required again |
150 | 152 | #newHash=$(sha256sum build.rs | cut -d " " -f 1) |
151 | 153 | #substituteInPlace .cargo-checksum.json --replace-fail $oldHash $newHash |
152 | | - )''; |
| 154 | + ) |
| 155 | + '' |
| 156 | + + oa.buildPhase |
| 157 | + # + oa.buildPhaseCargoCommand |
| 158 | + ; |
153 | 159 |
|
154 | 160 | }); |
155 | 161 |
|
|
162 | 168 |
|
163 | 169 | fileSetForCrate = |
164 | 170 | crate: |
| 171 | + # "./${crate}" |
165 | 172 | lib.fileset.toSource { |
166 | 173 | root = ./.; |
167 | 174 | fileset = lib.fileset.unions [ |
168 | 175 | ./Cargo.toml |
169 | 176 | ./Cargo.lock |
170 | 177 | (lib.fileset.fileFilter (file: file.hasExt "md") ./.) |
171 | 178 | (craneLib.fileset.commonCargoSources ./crates/wordbase) |
172 | | - ./crates/wordbase-cli |
173 | 179 | (craneLib.fileset.commonCargoSources ./crates/jmdict-furigana) |
174 | 180 | ./crates/jmdict-furigana/README.md |
175 | 181 | ./crates/jmdict-furigana/src/jmdict_furigana.json.zip |
176 | 182 | (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 |
182 | 189 |
|
183 | 190 | # (craneLib.fileset.commonCargoSources ./crates/my-workspace-hack) |
184 | 191 | (craneLib.fileset.commonCargoSources crate) |
185 | 192 | ]; |
186 | | - }; |
| 193 | + } |
| 194 | + ; |
187 | 195 |
|
188 | 196 | # Build the top-level crates of the workspace as individual derivations. |
189 | 197 | # This allows consumers to only depend on (and build) only what they need. |
|
196 | 204 | wordbase-cli = craneLib.buildPackage ( |
197 | 205 | individualCrateArgs |
198 | 206 | // { |
| 207 | + # inherit (craneLib.crateNameFromCargoToml { inherit src; }) version; |
199 | 208 | pname = "wordbase-cli"; |
200 | 209 | cargoExtraArgs = "-p wordbase-cli"; |
201 | 210 | src = fileSetForCrate ./crates/wordbase-cli; |
|
248 | 257 | # taploExtraArgs = "--config ./taplo.toml"; |
249 | 258 | }; |
250 | 259 |
|
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 | | - # }; |
268 | 260 | }; |
269 | 261 |
|
270 | 262 | packages = { |
271 | 263 | inherit wordbase-cli; |
| 264 | + inherit cargoArtifacts; |
| 265 | + inherit cargoVendorDir; |
272 | 266 | }; |
273 | 267 |
|
274 | 268 | apps = { |
|
0 commit comments