forked from moodlehq/moodle-php-apache
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Using 2.4.0 release + custom patch (from macports project) seems to be the only working combination right now. Read the comments in the code and the links there. Resolves solr issue in moodlehq#16, waiting for the upstream as described in moodlehq#19
- Loading branch information
Showing
2 changed files
with
78 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e | ||
|
||
# Install 2.4.0 release version + macports patch. Only combination working right now. | ||
# See #16 and #19 for more information. | ||
hash=6e9e097c981e810d452657f23bf1945b7955f3cf | ||
patch=https://raw.githubusercontent.com/macports/macports-ports/master/php/php-solr/files/php72.patch | ||
|
||
# Download our 'tagged' source code from git. | ||
echo "Downloading solr extension source archive (${hash})" | ||
curl --location \ | ||
https://github.com/php/pecl-search_engine-solr/archive/${hash}.tar.gz \ | ||
-o /tmp/pecl-search_engine-solr-${hash}.tar.gz | ||
|
||
# Download patch | ||
if [ -n $patch ]; then | ||
curl --location \ | ||
$patch \ | ||
-o /tmp/solr.patch | ||
fi | ||
|
||
# Extract the compressed archive. | ||
cd /tmp | ||
tar -xvzf pecl-search_engine-solr-${hash}.tar.gz | ||
cd pecl-search_engine-solr-${hash} | ||
|
||
# Apply the patch | ||
if [ -n $patch ]; then | ||
patch -p0 < ../solr.patch | ||
fi | ||
|
||
# Compile the extension as required by a manual PECL installation. | ||
echo "Compile solr extension" | ||
phpize | ||
./configure | ||
make | ||
|
||
# Finally, install it. | ||
echo "Install solr extension" | ||
make install | ||
|
||
# Remove all the sources. | ||
echo "Cleanup temporary folder and files" | ||
rm /tmp/pecl-search_engine-solr-${hash} -rf | ||
rm /tmp/pecl-search_engine-solr-${hash}.tar.gz -f | ||
rm /tmp/solr.patch -f | ||
|
||
# Enable it. | ||
docker-php-ext-enable solr | ||
|
||
# Done with this hack. | ||
# Please, follow https://github.com/moodlehq/moodle-php-apache/issues/19. |