Packages
nerves_system_osd32mp1
0.22.2
0.25.0
0.24.5
0.24.4
0.24.3
0.24.2
0.24.1
0.24.0
0.23.0
0.22.3
0.22.2
0.22.1
0.22.0
0.21.1
0.21.0
0.20.1
0.20.0
0.19.1
0.19.0
0.18.1
0.18.0
0.17.0
0.16.1
0.16.0
0.15.1
0.15.0
0.14.2
0.14.1
0.14.0
0.13.2
0.13.1
0.13.0
0.12.2
0.12.1
0.12.0
0.11.2
0.11.1
0.11.0
0.10.0
0.9.4
0.9.3
0.9.2
0.9.1
0.9.0
0.8.3
0.8.2
0.8.1
0.8.0
0.7.2
0.7.1
0.7.0
0.6.1
0.6.0
0.5.0
0.4.3
0.4.2
0.4.1
0.4.0
0.3.2
0.3.1
0.3.0
0.2.0
Nerves System - OSD32MP1
Current section
Files
Jump to
Current section
Files
nerves_system_osd32mp1
mix.exs
mix.exs
defmodule NervesSystemOsd32mp1.MixProject do
use Mix.Project
@github_organization "nerves-project"
@app :nerves_system_osd32mp1
@source_url "https://github.com/#{@github_organization}/#{@app}"
@version Path.join(__DIR__, "VERSION")
|> File.read!()
|> String.trim()
def project do
[
app: @app,
version: @version,
# Because we're using OTP 27, we need to enforce Elixir 1.17 or later.
elixir: "~> 1.17",
compilers: Mix.compilers() ++ [:nerves_package],
nerves_package: nerves_package(),
description: description(),
package: package(),
deps: deps(),
aliases: [loadconfig: [&bootstrap/1]],
docs: docs()
]
end
def application do
[]
end
defp bootstrap(args) do
set_target()
Application.start(:nerves_bootstrap)
Mix.Task.run("loadconfig", args)
end
def cli do
[preferred_envs: %{docs: :docs, "hex.build": :docs, "hex.publish": :docs}]
end
defp nerves_package do
[
type: :system,
artifact_sites: [
{:github_releases, "#{@github_organization}/#{@app}"}
],
build_runner_opts: build_runner_opts(),
platform: Nerves.System.BR,
platform_config: [
defconfig: "nerves_defconfig"
],
# The :env key is an optional experimental feature for adding environment
# variables to the crosscompile environment. These are intended for
# llvm-based tooling that may need more precise processor information.
env: [
{"TARGET_ARCH", "arm"},
{"TARGET_CPU", "cortex_a7"},
{"TARGET_OS", "linux"},
{"TARGET_ABI", "gnueabihf"},
{"TARGET_GCC_FLAGS",
"-mabi=aapcs-linux -mfpu=vfpv4-d16 -marm -fstack-protector-strong -mfloat-abi=hard -mcpu=cortex-a7 -fPIE -pie -Wl,-z,now -Wl,-z,relro"}
],
checksum: package_files()
]
end
defp deps do
[
{:nerves, "~> 1.11", runtime: false},
{:nerves_system_br, "1.31.5", runtime: false},
{:nerves_toolchain_armv7_nerves_linux_gnueabihf, "~> 13.2.0", runtime: false},
{:nerves_system_linter, "~> 0.4", only: [:dev, :test], runtime: false},
{:ex_doc, "~> 0.22", only: :docs, runtime: false}
]
end
defp description do
"""
Nerves System - OSD32MP1
"""
end
defp docs do
[
extras: ["README.md", "CHANGELOG.md"],
main: "readme",
assets: %{"assets" => "./assets"},
source_ref: "v#{@version}",
source_url: @source_url,
skip_undefined_reference_warnings_on: ["CHANGELOG.md"]
]
end
defp package do
[
files: package_files(),
licenses: ["GPL-2.0-only", "GPL-2.0-or-later"],
links: %{
"GitHub" => @source_url,
"REUSE Compliance" =>
"https://api.reuse.software/info/github.com/#{@github_organization}/#{@app}"
}
]
end
defp package_files do
[
"fwup_include",
"linux",
"rootfs_overlay",
"uboot",
"CHANGELOG.md",
"extlinux.conf",
"fwup-revert.conf",
"fwup.conf",
"LICENSES/*",
"mix.exs",
"nerves_defconfig",
"osd32mp1-brk.dts",
"post-build.sh",
"post-createfs.sh",
"README.md",
"REUSE.toml",
"VERSION"
]
end
defp build_runner_opts() do
# Download source files first to get download errors right away.
[make_args: primary_site() ++ ["source", "all", "legal-info"]]
end
defp primary_site() do
case System.get_env("BR2_PRIMARY_SITE") do
nil -> []
primary_site -> ["BR2_PRIMARY_SITE=#{primary_site}"]
end
end
defp set_target() do
if function_exported?(Mix, :target, 1) do
apply(Mix, :target, [:target])
else
System.put_env("MIX_TARGET", "osd32mp1")
end
end
end