@@ -124,106 +124,6 @@ async function detectSDK(config) {
124124 return null ;
125125}
126126
127- async function detectLinux64bit ( config ) {
128- if ( process . platform !== 'linux' || process . arch !== 'x64' ) {
129- return null ;
130- }
131-
132- // detect if we're using a 64-bit Linux OS that's missing 32-bit libraries
133- const result = {
134- libGL : fs . existsSync ( '/usr/lib/libGL.so' ) ,
135- i386arch : null ,
136- 'libc6:i386' : null ,
137- 'libncurses5:i386' : null ,
138- 'libstdc++6:i386' : null ,
139- 'zlib1g:i386' : null ,
140- } ;
141-
142- await Promise . all ( [
143- ( async ( ) => {
144- let dpkg = config . get ( 'linux.dpkg' ) ;
145- if ( dpkg ) {
146- dpkg = await which ( dpkg , { nothrow : true } ) ;
147- }
148- if ( ! dpkg ) {
149- dpkg = await which ( 'dpkg' , { nothrow : true } ) ;
150- }
151-
152- const archs = { } ;
153- await new Promise ( ( resolve ) => {
154- let stdout = '' ;
155- const child = spawn ( dpkg , [ '--print-architecture' ] , { stdio : [ 'ignore' , 'pipe' , 'ignore' ] } ) ;
156- child . stdout . on ( 'data' , data => stdout += data . toString ( ) ) ;
157- child . on ( 'close' , code => {
158- if ( code === 0 ) {
159- for ( let line of stdout . split ( '\n' ) ) {
160- line = line . trim ( ) ;
161- if ( line ) {
162- archs [ line ] = 1 ;
163- }
164- }
165- }
166- resolve ( ) ;
167- } ) ;
168- } ) ;
169-
170- await new Promise ( ( resolve ) => {
171- let stdout = '' ;
172- const child = spawn ( dpkg , [ '--print-foreign-architectures' ] , { stdio : [ 'ignore' , 'pipe' , 'ignore' ] } ) ;
173- child . stdout . on ( 'data' , data => stdout += data . toString ( ) ) ;
174- child . on ( 'close' , code => {
175- if ( code === 0 ) {
176- for ( let line of stdout . split ( '\n' ) ) {
177- line = line . trim ( ) ;
178- if ( line ) {
179- archs [ line ] = 1 ;
180- }
181- }
182-
183- // now that we have the architectures, make sure we have the i386 architecture
184- result . i386arch = ! ! archs . i386 ;
185- }
186- resolve ( ) ;
187- } ) ;
188- } ) ;
189- } ) ( ) ,
190- ( async ( ) => {
191- let dpkgquery = config . get ( 'linux.dpkgquery' ) ;
192- if ( dpkgquery ) {
193- dpkgquery = await which ( dpkgquery , { nothrow : true } ) ;
194- }
195- if ( ! dpkgquery ) {
196- dpkgquery = await which ( 'dpkg-query' , { nothrow : true } ) ;
197- }
198- if ( ! dpkgquery ) {
199- return null ;
200- }
201-
202- const packages = [ 'libc6:i386' , 'libncurses5:i386' , 'libstdc++6:i386' , 'zlib1g:i386' ] ;
203- for ( const pkg of packages ) {
204- await new Promise ( ( resolve ) => {
205- let stdout = '' ;
206- const child = spawn ( dpkgquery , [ '-l' , pkg ] , { stdio : [ 'ignore' , 'pipe' , 'ignore' ] } ) ;
207- child . stdout . on ( 'data' , data => stdout += data . toString ( ) ) ;
208- child . on ( 'close' , code => {
209- result [ pkg ] = false ;
210- if ( code === 0 ) {
211- for ( let line of stdout . split ( '\n' ) ) {
212- line = line . trim ( ) ;
213- if ( line . includes ( pkg ) ) {
214- result [ pkg ] = true ;
215- }
216- }
217- }
218- resolve ( ) ;
219- } ) ;
220- } ) ;
221- }
222- } ) ( ) ,
223- ] ) ;
224-
225- return result ;
226- }
227127
228128/**
229129 * Detects current Android environment.
@@ -242,7 +142,6 @@ export async function detect(config, opts = {}) {
242142 detectJDK ( config , opts ) . then ( jdk => results . jdk = jdk ) ,
243143 detectSDK ( config ) . then ( sdk => results . sdk = sdk ) ,
244144 detectNDK ( config ) . then ( ndk => results . ndk = ndk ) ,
245- detectLinux64bit ( config ) . then ( linux64bit => results . linux64bit = linux64bit ) ,
246145 ] ) ;
247146
248147 const sdkHome = process . env . ANDROID_SDK_HOME && expand ( process . env . ANDROID_SDK_HOME ) ;
0 commit comments