mirror of
https://github.com/YunoHost-Apps/discourse_ynh.git
synced 2024-09-03 18:26:18 +02:00
Add source patch to fix ARM compatibility
This commit is contained in:
parent
eff99bec17
commit
a0ed89ce0d
3 changed files with 41 additions and 21 deletions
|
@ -90,6 +90,14 @@ CREATE EXTENSION IF NOT EXISTS hstore; CREATE EXTENSION IF NOT EXISTS pg_trgm;"
|
||||||
#=================================================
|
#=================================================
|
||||||
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
# 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
|
# 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
|
# 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
|
# Define the platform specifically to retrieve binaries
|
||||||
# for libv8 because it currently doesn't compile on ARM devices
|
# for libv8 because it currently doesn't compile on ARM devices
|
||||||
exec_login_as $app bundle config specific_platform arm-linux
|
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
|
fi
|
||||||
# Install dependencies
|
# Install dependencies
|
||||||
exec_login_as $app MAKEFLAGS=-j2 bundle install --jobs 2 --path vendor/bundle --with development
|
exec_login_as $app MAKEFLAGS=-j2 bundle install --jobs 2 --path vendor/bundle --with development
|
||||||
|
|
|
@ -90,7 +90,14 @@ if ! ynh_is_upstream_up_to_date ; then
|
||||||
#=================================================
|
#=================================================
|
||||||
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
# 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
|
ynh_app_setting_set $app final_path $final_path
|
||||||
# Download, check integrity, uncompress and patch the source from app.src
|
# Download, check integrity, uncompress and patch the source from app.src
|
||||||
ynh_setup_source "$final_path"
|
ynh_setup_source "$final_path"
|
||||||
|
@ -175,17 +182,6 @@ if ! ynh_is_upstream_up_to_date ; then
|
||||||
gem install bundler
|
gem install bundler
|
||||||
# Install without documentation
|
# Install without documentation
|
||||||
exec_as $app echo "gem: --no-ri --no-rdoc" >> "$final_path/.gemrc"
|
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
|
# Install dependencies
|
||||||
exec_login_as $app bundle install --path vendor/bundle --with development)
|
exec_login_as $app bundle install --path vendor/bundle --with development)
|
||||||
# On ARM architecture, replace bundled libpsl by system native libpsl
|
# On ARM architecture, replace bundled libpsl by system native libpsl
|
||||||
|
|
|
@ -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)
|
Loading…
Reference in a new issue