Skip to content

Commit

Permalink
init yosys
Browse files Browse the repository at this point in the history
Co-authored-by: Mosè Giordano <[email protected]>
  • Loading branch information
sjkelly and giordano committed Aug 6, 2021
1 parent dee0d1a commit 87b6996
Showing 1 changed file with 50 additions and 0 deletions.
50 changes: 50 additions & 0 deletions Y/Yosys/build_tarballs.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Note that this script can accept some limited command-line arguments, run
# `julia build_tarballs.jl --help` to see a usage message.
using BinaryBuilder, Pkg

name = "Yosys"
version = v"0.1.0"

# Collection of sources required to complete build
sources = [
GitSource("https://github.com/YosysHQ/yosys.git", "2e421feb0ea526468493ab008f3c72beb12c2bc6")
]

dependencies = [
Dependency("boost_jll"; compat="=1.76.0"), # max gcc7
Dependency("Readline_jll"),
Dependency("Tcl_jll"),
Dependency("Zlib_jll"; compat="~1.2.11"),
Dependency("Libffi_jll"; compat="~3.2.2"),
]

# Bash recipe for building across all platforms
script = raw"""
cd yosys
if [[ "${target}" == *-apple-* ]] || [[ "${target}" == *-freebsd* ]]; then
CONFIG=clang
else
CONFIG=gcc
fi
make CONFIG=${CONFIG} PREFIX=${prefix} -j${nproc}
make install PREFIX=${prefix}
"""

# These are the platforms we will build for by default, unless further
# platforms are passed in on the command line
#platforms = filter!(p -> arch(p) ∉ ("armv7l", "armv6l"), supported_platforms(exclude= x -> (Sys.iswindows(x) || Sys.isfreebsd(x))))
#platforms = expand_cxxstring_abis(platforms)
platforms = filter!(p -> Sys.islinux(p) || Sys.isapple(p) || Sys.isfreebsd(), supported_platforms())

# The products that we will ensure are always built
products = Product[
ExecutableProduct("yosys", :yosys)
ExecutableProduct("yosys-config", :yosys_config)
ExecutableProduct("yosys-filterlib", :yosys_filterlib)
ExecutableProduct("yosys-smtbmc", :yosys_smtbmc)
ExecutableProduct("yosys-abc", :yosys_abc)
]

# Build the tarballs, and possibly a `build.jl` as well.
# gcc7 constraint from boost
build_tarballs(ARGS, name, version, sources, script, platforms, products, dependencies; julia_compat="1.6", preferred_gcc_version=v"7")

0 comments on commit 87b6996

Please sign in to comment.