1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/discourse_ynh.git synced 2024-09-03 18:26:18 +02:00

Merge pull request #10 from YunoHost-Apps/fix_arm

Fix ARM compatibility
This commit is contained in:
JimboJoe 2018-12-28 10:21:31 +01:00 committed by GitHub
commit e4010f2df6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 44 additions and 24 deletions

View file

@ -3,7 +3,7 @@
[![Integration level](https://dash.yunohost.org/integration/discourse.svg)](https://ci-apps.yunohost.org/jenkins/job/discourse%20%28Community%29/lastBuild/consoleFull)
[![Install Discourse with YunoHost](https://install-app.yunohost.org/install-with-yunohost.png)](https://install-app.yunohost.org/?app=discourse)
> *This package allow you to install discourse quickly and simply on a YunoHost server.
> *This package allows you to install discourse quickly and simply on a YunoHost server.
If you don't have YunoHost, please see [here](https://yunohost.org/#/install) to know how to install and enjoy it.*
## Disclaimer
@ -116,7 +116,7 @@ Please do your pull request to the [testing branch](https://github.com/YunoHost-
To try the testing branch, please proceed like that.
```
sudo yunohost app install https://github.com/YunoHost-Apps/discourse_ynh/tree/testing --verbose
sudo yunohost app install https://github.com/YunoHost-Apps/discourse_ynh/tree/testing --debug
or
sudo yunohost app upgrade discourse -u https://github.com/YunoHost-Apps/discourse_ynh/tree/testing --verbose
sudo yunohost app upgrade discourse -u https://github.com/YunoHost-Apps/discourse_ynh/tree/testing --debug
```

View file

@ -90,6 +90,14 @@ CREATE EXTENSION IF NOT EXISTS hstore; CREATE EXTENSION IF NOT EXISTS pg_trgm;"
#=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE
#=================================================
# Specific actions on ARM architecture
if [ -n "$(uname -m | grep arm)" ] ; then
# Unapply commit cf9b4a789b855b5199e98a13424e409854a8e848 that breaks ARM
# compatibility by pointing to a recent libv8 version
# This is due to this libv8 issue (https://github.com/cowboyd/libv8/issues/261)
# that prevents it from being compiled on ARM hence no binary gem is available yet
cp ../sources/patches_arm/* ../sources/patches
fi
# Download, check integrity, uncompress and patch the source from app.src
# Use the patch from https://meta.discourse.org/t/uglifier-error-during-assets-precompile/96970/4 to fix the Uglifier error
@ -198,14 +206,6 @@ if [ -n "$(uname -m | grep arm)" ] ; then
# Define the platform specifically to retrieve binaries
# for libv8 because it currently doesn't compile on ARM devices
exec_login_as $app bundle config specific_platform arm-linux
# Unapply commit cf9b4a789b855b5199e98a13424e409854a8e848 that breaks ARM
# compatibility by pointing to a recent libv8 version
# This is due to this libv8 issue (https://github.com/cowboyd/libv8/issues/261)
# that prevents it from being compiled on ARM hence no binary gem is available yet
(cd $final_path
wget https://github.com/discourse/discourse/commit/cf9b4a789b855b5199e98a13424e409854a8e848.diff -O libv8-patch.diff
patch -R -p1 < libv8-patch.diff
rm libv8-patch.diff)
fi
# Install dependencies
exec_login_as $app MAKEFLAGS=-j2 bundle install --jobs 2 --path vendor/bundle --with development

View file

@ -90,7 +90,14 @@ if ! ynh_is_upstream_up_to_date ; then
#=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE
#=================================================
# Specific actions on ARM architecture
if [ -n "$(uname -m | grep arm)" ] ; then
# Unapply commit cf9b4a789b855b5199e98a13424e409854a8e848 that breaks ARM
# compatibility by pointing to a recent libv8 version
# This is due to this libv8 issue (https://github.com/cowboyd/libv8/issues/261)
# that prevents it from being compiled on ARM hence no binary gem is available yet
cp ../sources/patches_arm/* ../sources/patches
fi
ynh_app_setting_set $app final_path $final_path
# Download, check integrity, uncompress and patch the source from app.src
ynh_setup_source "$final_path"
@ -175,17 +182,6 @@ if ! ynh_is_upstream_up_to_date ; then
gem install bundler
# Install without documentation
exec_as $app echo "gem: --no-ri --no-rdoc" >> "$final_path/.gemrc"
# Specific actions on ARM architecture
if [ -n "$(uname -m | grep arm)" ] ; then
# Unapply commit cf9b4a789b855b5199e98a13424e409854a8e848 that breaks ARM
# compatibility by pointing to a recent libv8 version
# This is due to this libv8 issue (https://github.com/cowboyd/libv8/issues/261)
# that prevents it from being compiled on ARM hence no binary gem is available yet
(cd $final_path
wget https://github.com/discourse/discourse/commit/cf9b4a789b855b5199e98a13424e409854a8e848.diff -O libv8-patch.diff
patch -R -p1 < libv8-patch.diff
rm libv8-patch.diff)
fi
# Install dependencies
exec_login_as $app bundle install --path vendor/bundle --with development)
# On ARM architecture, replace bundled libpsl by system native libpsl

View file

@ -0,0 +1,24 @@
diff --git a/Gemfile.lock b/Gemfile.lock
index 5752044b07..016f600bcc 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -171,7 +171,7 @@ GEM
jwt (1.5.6)
kgio (2.11.2)
kramdown (1.17.0)
- libv8 (6.7.288.46.1)
+ libv8 (6.3.292.48.1)
listen (3.1.5)
rb-fsevent (~> 0.9, >= 0.9.4)
rb-inotify (~> 0.9, >= 0.9.7)
@@ -198,8 +198,8 @@ GEM
method_source (0.8.2)
mini_mime (1.0.0)
mini_portile2 (2.3.0)
- mini_racer (0.2.0)
- libv8 (>= 6.3)
+ mini_racer (0.1.15)
+ libv8 (~> 6.3)
mini_scheduler (0.8.1)
mini_sql (0.1.10)
mini_suffix (0.3.0)