1818let
1919 cluster' = launcherConfig . networkName ;
2020 yarn2nix = import ( fetchzip {
21- url = "https://github.com/moretea/yarn2nix/archive/v1.0.0.tar.gz" ;
22- sha256 = "02bzr9j83i1064r1r34cn74z7ccb84qb5iaivwdplaykyyydl1k8" ;
21+ # v1.0.0 with a PR to handle duplicate file names between @types/* and original/* – <https://github.com/nix-community/yarn2nix/pull/75>
22+ # TODO: use the version from recent Nixpkgs
23+ url = "https://github.com/nix-community/yarn2nix/archive/276994748d556e0812bb1bc5f92ac095b5da71d2.tar.gz" ;
24+ sha256 = "1fxiq43w8mfs0aiyj4kazwjl6b829a5r0jbx6bcs3kmil9asq3fg" ;
2325 } ) {
2426 inherit pkgs nodejs yarn ;
2527 } ;
@@ -140,38 +142,26 @@ yarn2nix.mkYarnPackage {
140142 #export DEBUG=electron-rebuild
141143
142144 ls -ltrha $NIX_BUILD_TOP/daedalus/node_modules/
143- function dup() {
144- cp -vr node_modules/'' ${1}/ node_modules/'' ${1}-temp
145- rm -v node_modules/'' ${1}
146- mv -v node_modules/'' ${1}-temp node_modules/'' ${1}
147- chmod -R +w node_modules/'' ${1}
148- }
149145
150- dup keccak
151- dup node-hid
152- dup usb
153- dup @ledgerhq
154- dup electron-chromedriver
155- dup blake-hash
156- dup blake2
157- dup tiny-secp256k1
158- dup usb-detection
146+ chmod -R +w node_modules/
159147
160148 # We ship debug version because the release one has issues with ledger nano s
161149 node_modules/.bin/electron-rebuild -w usb --useCache -s --debug
162150
163151 mkdir -p $out/bin $out/share/daedalus
164- cp -R dist/* $out/share/daedalus
152+ cp -R deps/daedalus/ dist/* $out/share/daedalus
165153 cp ${ newPackagePath } $out/share/daedalus/package.json
166154 pushd $out/share/daedalus
167155 ${ nukeAllRefs }
168156 popd
169157 mkdir -p $out/share/fonts
170158 ln -sv $out/share/daedalus/renderer/assets $out/share/fonts/daedalus
171159 mkdir -pv $out/share/daedalus/node_modules
172- cp -rv $node_modules/{\@babel,\@protobufjs,regenerator-runtime,node-fetch,\@trezor,runtypes,parse-uri,randombytes,safe-buffer,bip66,pushdata-bitcoin,bitcoin-ops,typeforce,varuint-bitcoin,create-hash,blake2b,nanoassert,blake2b-wasm,bs58check,bs58,base-x,create-hmac,wif,ms,keccak,semver-compare,long,define-properties,object-keys,has,function-bind,es-abstract,has-symbols,json-stable-stringify,tiny-worker,cashaddrjs,big-integer,inherits,bchaddrjs,cross-fetch,trezor-connect,js-chain-libs-node,bignumber.js,call-bind,get-intrinsic,base64-js,ieee754,cbor-web,util-deprecate,bech32,blake-hash,blake2,tiny-secp256k1,bn.js,elliptic,minimalistic-assert,minimalistic-crypto-utils,brorand,hash.js,hmac-drbg,int64-buffer,object.values,bytebuffer,protobufjs,usb-detection} $out/share/daedalus/node_modules/
160+ cp -rv $node_modules/{\@babel,\@protobufjs,regenerator-runtime,node-fetch,\@trezor,runtypes,parse-uri,randombytes,safe-buffer,bip66,pushdata-bitcoin,bitcoin-ops,typeforce,varuint-bitcoin,create-hash,blake2b,nanoassert,blake2b-wasm,bs58check,bs58,base-x,create-hmac,wif,ms,keccak,semver-compare,long,define-properties,object-keys,has,function-bind,es-abstract,has-symbols,json-stable-stringify,tiny-worker,cashaddrjs,big-integer,inherits,bchaddrjs,cross-fetch,trezor-connect,js-chain-libs-node,bignumber.js,call-bind,get-intrinsic,base64-js,ieee754,cbor-web,util-deprecate,bech32,blake-hash,blake2,tiny-secp256k1,bn.js,elliptic,minimalistic-assert,minimalistic-crypto-utils,brorand,hash.js,hmac-drbg,int64-buffer,object.values,bytebuffer,protobufjs,usb-detection,babel-runtime,bindings,brotli,buffer,clone,deep-equal,dfa,eventemitter2,file-uri-to-path,fontkit,functions-have-names,has-property-descriptors,has-tostringtag,is-arguments,is-date-object,is-regex,linebreak,node-hid,object-is,pdfkit,png-js,regexp.prototype.flags,restructure,tiny-inflate,unicode-properties,unicode-trie} $out/share/daedalus/node_modules/
173161 find $out $NIX_BUILD_TOP -name '*.node'
174162
163+ chmod -R +w $out
164+
175165 mkdir -pv $out/share/daedalus/build
176166 cp node_modules/usb/build/Debug/usb_bindings.node $out/share/daedalus/build/usb_bindings.node
177167 cp node_modules/node-hid/build/Debug/HID_hidraw.node $out/share/daedalus/build/HID_hidraw.node
@@ -181,12 +171,16 @@ yarn2nix.mkYarnPackage {
181171 done
182172
183173 node_modules/.bin/electron-rebuild -w usb-detection --useCache -s
184- cp node_modules/usb-detection/build/Release/detection.node $out/share/daedalus/build/detection.node
185- for file in $out/share/daedalus/build/detection.node; do
174+ mkdir -p $out/share/daedalus/node_modules/usb-detection/build/
175+ cp node_modules/usb-detection/build/Release/detection.node $out/share/daedalus/node_modules/usb-detection/build/detection.node
176+ for file in $out/share/daedalus/node_modules/usb-detection/build/detection.node; do
186177 $STRIP $file
187178 patchelf --shrink-rpath $file
188179 done
189180 '' ;
181+ distPhase = ''
182+ # unused
183+ '' ;
190184 #allowedReferences = [ "out" ];
191185 #allowedRequisites = [
192186 # systemd.lib
0 commit comments