55 fetchFromGitHub ,
66 fetchNpmDeps ,
77 fetchurl ,
8- httplz ,
98 binaryen ,
109 gzip ,
1110 nodejs ,
@@ -88,30 +87,11 @@ rustPlatform.buildRustPackage rec {
8887
8988 # patch a build-time dependency download
9089 (
91- realpath $cargoDepsCopy/* | grep lindera-unidic # debug for when version number changes
92- cd $cargoDepsCopy/lindera-unidic-0.32.2
93- #oldHash=$(sha256sum build.rs | cut -d " " -f 1)
94-
95- # serve lindera-unidic on localhost vacant port
96- httplz_port="${
97- if stdenv . buildPlatform . isDarwin then
98- ''$(python -c 'import socket; s=socket.socket(); s.bind(("", 0)); print(s.getsockname()[1]); s.close()')''
99- else
100- "34567"
101- } "
102- mkdir .lindera-http-plz
103- ln -s ${ lindera-unidic-src } .lindera-http-plz/unidic-mecab-2.1.2.tar.gz
104- httplz --port "$httplz_port" -- .lindera-http-plz/ &
105- echo $! >$TMPDIR/.httplz_pid
106-
107- # file:// does not work
108- substituteInPlace build.rs --replace-fail \
109- "https://dlwqk3ibdg1xh.cloudfront.net/unidic-mecab-2.1.2.tar.gz" \
110- "http://localhost:$httplz_port/unidic-mecab-2.1.2.tar.gz"
111-
112- # not needed with useFetchCargoVendor=true, but kept in case it is required again
113- #newHash=$(sha256sum build.rs | cut -d " " -f 1)
114- #substituteInPlace .cargo-checksum.json --replace-fail $oldHash $newHash
90+ patch -d $cargoDepsCopy/lindera-assets-*/ -p1 < ${ ./lindera-assets-support-file-paths.patch }
91+
92+ substituteInPlace $cargoDepsCopy/lindera-unidic-*/build.rs --replace-fail \
93+ "${ lindera-unidic-src . url } " \
94+ "file://${ lindera-unidic-src } "
11595 )
11696 '' ;
11797
@@ -126,7 +106,6 @@ rustPlatform.buildRustPackage rec {
126106 rustc . llvmPackages . lld
127107 wasm-bindgen-cli_0_2_92
128108 wasm-pack
129- httplz
130109 ]
131110 ++ lib . optionals stdenv . buildPlatform . isDarwin [
132111 python3
@@ -162,11 +141,6 @@ rustPlatform.buildRustPackage rec {
162141 )
163142 '' ;
164143
165- # the file is also fetched during checkPhase
166- preInstall = ''
167- kill ${ lib . optionalString stdenv . hostPlatform . isDarwin "-9" } $(cat $TMPDIR/.httplz_pid)
168- '' ;
169-
170144 buildFeatures = [ "extended" ] ;
171145
172146 doInstallCheck = true ;
0 commit comments