From ed9ba0d843c227a4e52f1b5e73097a24be13acbb Mon Sep 17 00:00:00 2001 From: Thales Macedo Garitezi Date: Tue, 19 Jul 2022 11:52:17 -0300 Subject: [PATCH] chore: do not include rocksdb on raspbian --- mix.exs | 10 ++++++++-- rebar.config.erl | 11 ++++++++++- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/mix.exs b/mix.exs index f4ed355ed..41ce54972 100644 --- a/mix.exs +++ b/mix.exs @@ -622,8 +622,10 @@ defmodule EMQXUmbrella.MixProject do end defp enable_rocksdb?() do - not build_without_rocksdb?() or - "1" == System.get_env("BUILD_WITH_QUIC") + not Enum.any?([ + build_without_rocksdb?(), + raspbian?() + ]) or "1" == System.get_env("BUILD_WITH_ROCKSDB") end defp pkg_vsn() do @@ -655,6 +657,10 @@ defmodule EMQXUmbrella.MixProject do {:unix, :darwin} == :os.type() end + defp raspbian?() do + os_cmd("./scripts/get-distro.sh", []) =~ "raspbian" + end + defp build_without_jq?() do opt = System.get_env("BUILD_WITHOUT_JQ", "false") diff --git a/rebar.config.erl b/rebar.config.erl index 810c16207..6748f7ce8 100644 --- a/rebar.config.erl +++ b/rebar.config.erl @@ -89,7 +89,8 @@ is_quicer_supported() -> "1" == os:getenv("BUILD_WITH_QUIC"). is_rocksdb_supported() -> - not (false =/= os:getenv("BUILD_WITHOUT_ROCKSDB")) orelse + not (false =/= os:getenv("BUILD_WITHOUT_ROCKSDB") orelse + is_raspbian()) orelse "1" == os:getenv("BUILD_WITH_ROCKSDB"). is_macos() -> @@ -105,6 +106,14 @@ is_centos_6() -> false end. +is_raspbian() -> + case os_cmd("./scripts/get-distro.sh") of + "raspbian" ++ _ -> + true; + _ -> + false + end. + is_win32() -> win32 =:= element(1, os:type()).