-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add scripts for building .deb and .rpm packages.
- Loading branch information
1 parent
890cecc
commit 0086a90
Showing
6 changed files
with
136 additions
and
177 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,179 +1,22 @@ | ||
# DESCRIPTION: Travis-CI config | ||
# | ||
# Copyright 2003-2019 by Todd Strader. Verilator is free software; you can | ||
# redistribute it and/or modify it under the terms of either the GNU Lesser | ||
# General Public License Version 3 or the Perl Artistic License Version 2.0. | ||
|
||
version: ~> 1.0 | ||
|
||
os: linux | ||
language: cpp | ||
cache: ccache | ||
|
||
env: | ||
global: | ||
- VERILATOR_CACHE=$HOME/verilator_cache | ||
- VERILATOR_ROOT=$PWD | ||
- VERILATOR_NUM_JOBS=$(echo `nproc` + 1 | bc) | ||
- VERILATOR_CONFIG_FLAGS="--enable-maintainer-mode --enable-longtests" | ||
- VERILATOR_AUTHOR_SITE=1 | ||
- OBJCACHE=ccache | ||
|
||
cache: | ||
directories: | ||
- $VERILATOR_CACHE | ||
services: | ||
- docker | ||
|
||
before_install: | ||
# Perl modules needed for testing | ||
- yes yes | sudo cpan -fi Unix::Processors Parallel::Forker Bit::Vector | ||
- sudo apt-get install gdb gtkwave | ||
- sudo apt-get install libgoogle-perftools-dev | ||
before_script: | ||
- bash -x ci/build_vcddiff.sh | ||
- bash -x ci/build_verilator.sh | ||
after_script: | ||
- ccache -s | ||
|
||
stages: | ||
- "Build Verilator" | ||
- test | ||
|
||
jobs: | ||
include: | ||
- if: type != cron | ||
stage: "Build Verilator" | ||
name: Build Verilator | ||
compiler: gcc | ||
script: echo "Done building Verilator" | ||
# Non-cron build will just run on whatever linux flavor we get | ||
- if: type != cron | ||
stage: test | ||
name: Dist test | ||
compiler: gcc | ||
script: ci/test.sh dist | ||
- if: type != cron | ||
stage: test | ||
name: Vlt test | ||
compiler: gcc | ||
script: ci/test.sh vlt | ||
- if: type != cron | ||
stage: test | ||
name: Vltmt test | ||
compiler: gcc | ||
script: ci/test.sh vltmt | ||
# Cron builds try different OS/compiler combinations | ||
- if: type = cron | ||
stage: "Build Verilator" | ||
name: Build xenial gcc Verilator | ||
os: linux | ||
dist: xenial | ||
compiler: gcc | ||
script: echo "Done building Verilator" | ||
- if: type = cron | ||
stage: test | ||
name: Xenial gcc dist test | ||
os: linux | ||
dist: xenial | ||
compiler: gcc | ||
script: ci/test.sh dist | ||
- if: type = cron | ||
stage: test | ||
name: Xenial gcc vlt test | ||
os: linux | ||
dist: xenial | ||
compiler: gcc | ||
script: ci/test.sh vlt | ||
- if: type = cron | ||
stage: test | ||
name: Xenial gcc vltmt test | ||
os: linux | ||
dist: xenial | ||
compiler: gcc | ||
script: ci/test.sh vltmt | ||
- if: type = cron | ||
stage: "Build Verilator" | ||
name: Build xenial clang Verilator | ||
os: linux | ||
dist: xenial | ||
compiler: clang | ||
script: echo "Done building Verilator" | ||
- if: type = cron | ||
stage: test | ||
name: Xenial clang dist test | ||
os: linux | ||
dist: xenial | ||
compiler: clang | ||
script: ci/test.sh dist | ||
- if: type = cron | ||
stage: test | ||
name: Xenial clang vlt test | ||
os: linux | ||
dist: xenial | ||
compiler: clang | ||
script: ci/test.sh vlt | ||
- if: type = cron | ||
stage: test | ||
name: Xenial clang vltmt test | ||
os: linux | ||
dist: xenial | ||
compiler: clang | ||
script: ci/test.sh vltmt | ||
# - if: type = cron | ||
# stage: "Build Verilator" | ||
# name: Build OSX gcc Verilator | ||
# os: osx | ||
# compiler: gcc | ||
# script: echo "Done building Verilator" | ||
# - if: type = cron | ||
# stage: test | ||
# name: OSX gcc dist test | ||
# os: osx | ||
# compiler: gcc | ||
# script: ci/test.sh dist | ||
# - if: type = cron | ||
# stage: test | ||
# name: OSX gcc vlt test | ||
# os: osx | ||
# compiler: gcc | ||
# script: ci/test.sh vlt | ||
# - if: type = cron | ||
# stage: test | ||
# name: OSX gcc vltmt test | ||
# os: osx | ||
# compiler: gcc | ||
# script: ci/test.sh vltmt | ||
- if: type = cron | ||
stage: "Build Verilator" | ||
name: Build trusty gcc Verilator | ||
os: linux | ||
dist: trusty | ||
compiler: gcc | ||
script: echo "Done building Verilator" | ||
- if: type = cron | ||
stage: test | ||
name: Trusty gcc dist test | ||
os: linux | ||
dist: trusty | ||
compiler: gcc | ||
script: ci/test.sh dist | ||
- if: type = cron | ||
stage: test | ||
name: Trusty gcc vlt test | ||
os: linux | ||
dist: trusty | ||
compiler: gcc | ||
script: ci/test.sh vlt | ||
- if: type = cron | ||
stage: test | ||
os: linux | ||
dist: trusty | ||
name: Trusty gcc vltmt test | ||
compiler: gcc | ||
script: ci/test.sh vltmt | ||
|
||
notifications: | ||
email: | ||
if: repo = verilator/verilator | ||
recipients: | ||
- wsnyder@wsnyder.org | ||
- todd.strader@gmail.com | ||
- docker build -f Dockerfile.ubuntu -t verilator-ubuntu . | ||
- docker build -f Dockerfile.centos -t verilator-centos . | ||
|
||
script: | ||
- docker run --rm -e PACKAGE_VERSION=${TRAVIS_TAG:-0.0-UNTAGGED} -v $PWD:/usr/src/app verilator-ubuntu ./build-deb.sh | ||
- docker run --rm -e PACKAGE_VERSION=${TRAVIS_TAG:-0.0-UNTAGGED} -v $PWD:/usr/src/app verilator-centos ./build-rpm.sh | ||
|
||
deploy: | ||
provider: releases | ||
api_key: | ||
secure: "jr4NxwYNXdG7GfPbTwoIXUeY7NxPFbKfo29CW8tt67dBI+clIN/EhNJKQ05qtS5gvmGamVQxhD5rZ0g2Fb7crJSk3oI6196WcYLTNDvp2pl+IanYyPYRucQdAxwd7L0/uyaz9E74IGfr3tlzzDqvlUhOWEZC6cGiIHL0t2Fi6YRpMzes7o/E4T2TvzRvSs/mqYP4sWpeUjK7NjXjqlbHhOPEGxfTwgY+lglPRmNo4A1nYJK7Kv7uGQJ675ye6aF643uX15W/uwetdEUoa08ObF7GiIsLdiv7NXAZgohoqBXeqoRuax+Xc0af4xn+lD0ix4sFxTqOR/XXawjEeVCpQtFI4knTkMIwyDr78EabLu7efxvBaeIwT3ZPET0ayOLMfFUf0SG7pPMIkrmY8T4TVR2mwzodncn4Ym/rKg1HClI3Pf58B1/+fgnAmqbHfW4KFNrVzBd2/2F4Xz0GCZAB9OoeBmQb044Ixy7ccX/zVgcypLkrY/4mWjx7IMBHC4P8Xpepz7jheWZfBr+HS/aD3U6ErjOkELK/EbECKtO/NBEEQj2KanPsmHU4HhdexhIu1KYyjoq+1p8oczZb5uD4BgwprRZhVNJXlV71G5Rrz5DFT6U0MHkLWJe5QiZtZE+WPRAMrtJWTXFjjDSmEGyNlI10R/qvFiB09LTXDmtPH1Q=" | ||
file: | ||
- verilator_${TRAVIS_TAG}_amd64.deb | ||
- verilator-${TRAVIS_TAG}.x86_64.rpm | ||
skip_cleanup: true | ||
on: | ||
repo: sifive/verilator | ||
tags: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
FROM centos:7 | ||
RUN yum update -y && yum install -y \ | ||
autoconf \ | ||
bison \ | ||
flex \ | ||
gcc-c++ \ | ||
git \ | ||
glibc-static \ | ||
libstdc++-static \ | ||
perl-version \ | ||
rsync \ | ||
rpm-build \ | ||
make | ||
WORKDIR /usr/src/app |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
FROM ubuntu:16.04 | ||
RUN apt-get update && apt-get install -y \ | ||
autoconf \ | ||
bison \ | ||
flex \ | ||
g++ \ | ||
make | ||
WORKDIR /usr/src/app |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/bin/bash | ||
|
||
set -eux | ||
|
||
pkg_arch=amd64 | ||
pkg_dir=$(realpath ./verilator_${PACKAGE_VERSION}_${pkg_arch}) | ||
|
||
autoconf | ||
./configure | ||
make clean | ||
make | ||
make test | ||
make install DESTDIR=$pkg_dir | ||
|
||
mkdir $pkg_dir/DEBIAN | ||
cat << EOF > $pkg_dir/DEBIAN/control | ||
Package: verilator | ||
Version: ${PACKAGE_VERSION} | ||
Architecture: ${pkg_arch} | ||
Maintainer: Richard Xia <rxia@sifive.com> | ||
Depends: perl (>= 5.22.1) | ||
Description: fast free Verilog simulator | ||
EOF | ||
|
||
dpkg-deb --build $pkg_dir |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#!/bin/bash | ||
|
||
set -eux | ||
|
||
pkg_arch=x86_64 | ||
pkg_distro=centos | ||
pkg_dir=$(realpath ./verilator_${PACKAGE_VERSION}_${pkg_arch}_${pkg_distro}) | ||
|
||
pkg_version=$(echo ${PACKAGE_VERSION} | cut -d- -f1) | ||
pkg_release=$(echo ${PACKAGE_VERSION} | cut -d- -f2) | ||
|
||
autoconf | ||
./configure | ||
make clean | ||
make | ||
make test | ||
make install DESTDIR=$pkg_dir | ||
|
||
cat << EOF > verilator.spec | ||
Name: verilator | ||
Version: ${pkg_version} | ||
Release: ${pkg_release} | ||
Requires: perl >= 5.2.11 | ||
Summary: Verilog HDL simulator | ||
License: Perl Artistic License and GNU Lesser General Public License | ||
%description | ||
Verilog HDL simulator | ||
%prep | ||
%build | ||
%install | ||
rsync -a ${pkg_dir}/ %buildroot/ | ||
%files | ||
%defattr(0644, root,root) | ||
%attr(0755, root,root) /usr/local/bin/verilator* | ||
/usr/local/share/man/man1/verilator* | ||
/usr/local/share/pkgconfig/verilator.pc | ||
/usr/local/share/verilator/* | ||
EOF | ||
|
||
rpmbuild -bb verilator.spec | ||
cp /root/rpmbuild/RPMS/${pkg_arch}/verilator-${PACKAGE_VERSION}.${pkg_arch}.rpm ./ |