Skip to content

Commit

Permalink
[yosys] enable libyoys, and several cleanups (#3501)
Browse files Browse the repository at this point in the history
* [yosys] enable libyoys, and several cleanups

  - enable libyosys
  - correct version to match upstream
  - whitespace fixes
  - fix Product array

* [yosys] fix libyosys build on apple

* Update Y/Yosys/build_tarballs.jl

Co-authored-by: Mosè Giordano <[email protected]>

Co-authored-by: Mosè Giordano <[email protected]>
  • Loading branch information
sjkelly and giordano authored Aug 15, 2021
1 parent 0aee9c3 commit 8660298
Showing 1 changed file with 15 additions and 9 deletions.
24 changes: 15 additions & 9 deletions Y/Yosys/build_tarballs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using BinaryBuilder, Pkg

name = "Yosys"
version = v"0.1.0"
version = v"0.9.0"

# Collection of sources required to complete build
sources = [
Expand All @@ -14,7 +14,7 @@ dependencies = [
Dependency("boost_jll"; compat="=1.76.0"), # max gcc7
Dependency("Readline_jll"),
Dependency("Tcl_jll"),
Dependency("Zlib_jll"; compat="~1.2.11"),
Dependency("Zlib_jll"; compat="1.2.12"),
Dependency("Libffi_jll"; compat="~3.2.2"),
]

Expand All @@ -23,11 +23,16 @@ script = raw"""
cd yosys
if [[ "${target}" == *-apple-* ]] || [[ "${target}" == *-freebsd* ]]; then
CONFIG=clang
OS=Darwin
else
CONFIG=gcc
OS=Linux
fi
make ENABLE_LIBYOSYS=1 OS=${OS} CONFIG=${CONFIG} PREFIX=${prefix} -j${nproc}
make install OS=${OS} PREFIX=${prefix} ENABLE_LIBYOSYS=1
if [[ "${target}" == *-apple-* ]]; then
mv ${prefix}/lib/yosys/libyosys.so ${prefix}/lib/yosys/libyosys.dylib
fi
make CONFIG=${CONFIG} PREFIX=${prefix} -j${nproc}
make install PREFIX=${prefix}
"""

# These are the platforms we will build for by default, unless further
Expand All @@ -39,11 +44,12 @@ filter!(x -> cxxstring_abi(x) != "cxx03", 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)
ExecutableProduct("yosys", :yosys),
ExecutableProduct("yosys-config", :yosys_config),
ExecutableProduct("yosys-filterlib", :yosys_filterlib),
ExecutableProduct("yosys-smtbmc", :yosys_smtbmc),
ExecutableProduct("yosys-abc", :yosys_abc),
LibraryProduct("libyosys", :libyosys, ["lib/yosys"])
]

# Build the tarballs, and possibly a `build.jl` as well.
Expand Down

0 comments on commit 8660298

Please sign in to comment.