From 58fbc33c3a605cee88a81fd5c87857eb3c22892e Mon Sep 17 00:00:00 2001 From: Shivam Mathur Date: Tue, 31 Dec 2019 05:46:33 +0530 Subject: [PATCH] Use tap shivammathur/homebrew-phalcon on darwin --- __tests__/extensions.test.ts | 4 ++-- dist/index.js | 2 ++ src/extensions.ts | 2 ++ src/scripts/ext/phalcon_darwin.sh | 19 ++++--------------- 4 files changed, 10 insertions(+), 17 deletions(-) diff --git a/__tests__/extensions.test.ts b/__tests__/extensions.test.ts index 61c41e2d..9a676cb9 100644 --- a/__tests__/extensions.test.ts +++ b/__tests__/extensions.test.ts @@ -80,10 +80,10 @@ describe('Extension tests', () => { expect(darwin).toContain('sudo pecl install pcov'); darwin = await extensions.addExtension('phalcon3', '7.0', 'darwin'); - expect(darwin).toContain('phalcon_darwin.sh phalcon3'); + expect(darwin).toContain('phalcon_darwin.sh phalcon3 7.0'); darwin = await extensions.addExtension('phalcon4', '7.3', 'darwin'); - expect(darwin).toContain('phalcon_darwin.sh phalcon4'); + expect(darwin).toContain('phalcon_darwin.sh phalcon4 7.3'); darwin = await extensions.addExtension('pcov', '5.6', 'darwin'); expect(darwin).toContain('sudo pecl install pcov'); diff --git a/dist/index.js b/dist/index.js index 3e440052..8d996a67 100644 --- a/dist/index.js +++ b/dist/index.js @@ -2362,6 +2362,8 @@ function addExtensionDarwin(extension_csv, version, pipe) { path.join(__dirname, '../src/scripts/ext/phalcon_darwin.sh') + ' ' + extension + + ' ' + + version + pipe; break; default: diff --git a/src/extensions.ts b/src/extensions.ts index 36583669..35ea232b 100644 --- a/src/extensions.ts +++ b/src/extensions.ts @@ -33,6 +33,8 @@ export async function addExtensionDarwin( path.join(__dirname, '../src/scripts/ext/phalcon_darwin.sh') + ' ' + extension + + ' ' + + version + pipe; break; default: diff --git a/src/scripts/ext/phalcon_darwin.sh b/src/scripts/ext/phalcon_darwin.sh index bdd17d8e..3ad34a6c 100644 --- a/src/scripts/ext/phalcon_darwin.sh +++ b/src/scripts/ext/phalcon_darwin.sh @@ -1,16 +1,5 @@ extension=$1 -ini_file=$(php -d "date.timezone=UTC" --ini | grep "Loaded Configuration" | sed -e "s|.*:s*||" | sed "s/ //g") -sudo pecl install psr -brew install autoconf automake libtool -git clone https://github.com/phalcon/cphalcon.git -cd cphalcon || echo "could not cd" -git checkout "$(git branch -r | grep -E "origin/${extension: -1}\.\d\.x" | sort -r | head -n 1 | sed "s/ //g")" -sed -i '' 's/zend_ulong/ulong/' build/php7/64bits/phalcon.zep.c -sed -i '' 's/ulong/zend_ulong/' build/php7/64bits/phalcon.zep.c -cd build/php7/64bits && sudo phpize -sudo ./configure --with-php-config=/usr/local/bin/php-config --enable-phalcon -sudo glibtoolize --force -sudo autoreconf -sudo make -i -j6 -sudo make install -echo "extension=phalcon.so" >>"$ini_file" \ No newline at end of file +extension_major=${extension: -1} +php_version=$2 +brew tap shivammathur/homebrew-phalcon +brew install phalcon@"$php_version"_"$extension_major" \ No newline at end of file