Skip to content

Commit

Permalink
Add support for suse linux target (philss#40)
Browse files Browse the repository at this point in the history
  • Loading branch information
fabriziosestito authored Nov 8, 2022
1 parent b06b47e commit b001ec2
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/rustler_precompiled.ex
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,9 @@ defmodule RustlerPrecompiled do

target_system.os =~ "linux" ->
arch = with "amd64" <- target_system.arch, do: "x86_64"
vendor = with vendor when vendor in ~w(pc redhat) <- target_system.vendor, do: "unknown"

vendor =
with vendor when vendor in ~w(pc redhat suse) <- target_system.vendor, do: "unknown"

%{target_system | arch: arch, vendor: vendor}

Expand Down
13 changes: 13 additions & 0 deletions test/rustler_precompiled_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,19 @@ defmodule RustlerPrecompiledTest do
RustlerPrecompiled.target(config, @available_targets)
end

test "x86_64 in a PC running SUSE Linux" do
target_system = %{arch: "x86_64", vendor: "suse", os: "linux", abi: "gnu"}

config = %{
target_system: target_system,
nif_version: "2.14",
os_type: {:unix, :linux}
}

assert {:ok, "nif-2.14-x86_64-unknown-linux-gnu"} =
RustlerPrecompiled.target(config, @available_targets)
end

test "x86_64 or amd64 in a PC running Linux" do
target_system = %{arch: "amd64", vendor: "pc", os: "linux", abi: "gnu"}

Expand Down

0 comments on commit b001ec2

Please sign in to comment.