From ad97c00f6e0ff9648075945f1405e37d77b075d1 Mon Sep 17 00:00:00 2001 From: Sasha Krassovsky Date: Thu, 29 Oct 2020 22:49:36 -0700 Subject: [PATCH 1/2] verilator: create package --- common/build-style/autoconf.sh | 40 ++++++++++++++++++++++ common/environment/build-style/autoconf.sh | 1 + srcpkgs/verilator/template | 12 +++++++ 3 files changed, 53 insertions(+) create mode 100644 common/build-style/autoconf.sh create mode 100644 common/environment/build-style/autoconf.sh create mode 100644 srcpkgs/verilator/template diff --git a/common/build-style/autoconf.sh b/common/build-style/autoconf.sh new file mode 100644 index 00000000000..8bb4a2f5a9a --- /dev/null +++ b/common/build-style/autoconf.sh @@ -0,0 +1,40 @@ +# +# THis helper is for templates using autoconf. +# +do_configure() { + autoconf + ./configure ${configure_args} --prefix /usr +} + +do_build() { + : ${make_cmd:=make} + + ${make_cmd} ${makejobs} ${make_build_args} ${make_build_target} +} + +do_check() { + if [ -z "$make_cmd" ] && [ -z "$make_check_target" ]; then + if make -q check 2>/dev/null; then + : + else + if [ $? -eq 2 ]; then + msg_warn 'No target to "make check".\n' + return 0 + fi + fi + fi + + : ${make_cmd:=make} + : ${make_check_target:=check} + + ${make_cmd} ${make_check_args} ${make_check_target} +} + +do_install() { + : ${make_cmd:=make} + : ${make_install_target:=install} + + ${make_cmd} DESTDIR=${DESTDIR} ${make_install_args} ${make_install_target} +} + + diff --git a/common/environment/build-style/autoconf.sh b/common/environment/build-style/autoconf.sh new file mode 100644 index 00000000000..881f67e0e1f --- /dev/null +++ b/common/environment/build-style/autoconf.sh @@ -0,0 +1 @@ +hostmakedepends+=" autoconf" diff --git a/srcpkgs/verilator/template b/srcpkgs/verilator/template new file mode 100644 index 00000000000..1d527973075 --- /dev/null +++ b/srcpkgs/verilator/template @@ -0,0 +1,12 @@ +# Template file for 'foo' +pkgname=verilator +version=4.102 +revision=1 +build_style=autoconf +makedepends="flex" +short_desc="C++ Library for RTL emulation" +maintainer="krassovskysasha@gmail.com" +license="GPL-3.0" +homepage="https://veripool.org/wiki/verilator" +distfiles="https://github.com/verilator/verilator/archive/v${version}.tar.gz" +checksum="4e4f4aff00af9a15a61c94b67ed070cd6312ddcc0f0d340a6df2199480064cef" From a0823f8a3e8678539dba9a00502a8d7b0efdf7b5 Mon Sep 17 00:00:00 2001 From: Sasha Krassovsky Date: Fri, 30 Oct 2020 11:35:12 -0700 Subject: [PATCH 2/2] Change autoconf to pre_configure --- common/build-style/autoconf.sh | 40 ---------------------- common/environment/build-style/autoconf.sh | 1 - srcpkgs/verilator/template | 8 ++++- 3 files changed, 7 insertions(+), 42 deletions(-) delete mode 100644 common/build-style/autoconf.sh delete mode 100644 common/environment/build-style/autoconf.sh diff --git a/common/build-style/autoconf.sh b/common/build-style/autoconf.sh deleted file mode 100644 index 8bb4a2f5a9a..00000000000 --- a/common/build-style/autoconf.sh +++ /dev/null @@ -1,40 +0,0 @@ -# -# THis helper is for templates using autoconf. -# -do_configure() { - autoconf - ./configure ${configure_args} --prefix /usr -} - -do_build() { - : ${make_cmd:=make} - - ${make_cmd} ${makejobs} ${make_build_args} ${make_build_target} -} - -do_check() { - if [ -z "$make_cmd" ] && [ -z "$make_check_target" ]; then - if make -q check 2>/dev/null; then - : - else - if [ $? -eq 2 ]; then - msg_warn 'No target to "make check".\n' - return 0 - fi - fi - fi - - : ${make_cmd:=make} - : ${make_check_target:=check} - - ${make_cmd} ${make_check_args} ${make_check_target} -} - -do_install() { - : ${make_cmd:=make} - : ${make_install_target:=install} - - ${make_cmd} DESTDIR=${DESTDIR} ${make_install_args} ${make_install_target} -} - - diff --git a/common/environment/build-style/autoconf.sh b/common/environment/build-style/autoconf.sh deleted file mode 100644 index 881f67e0e1f..00000000000 --- a/common/environment/build-style/autoconf.sh +++ /dev/null @@ -1 +0,0 @@ -hostmakedepends+=" autoconf" diff --git a/srcpkgs/verilator/template b/srcpkgs/verilator/template index 1d527973075..89a29766ba6 100644 --- a/srcpkgs/verilator/template +++ b/srcpkgs/verilator/template @@ -2,7 +2,9 @@ pkgname=verilator version=4.102 revision=1 -build_style=autoconf +build_style=configure +configure_args="--prefix /usr" +hostmakedepends="autoconf" makedepends="flex" short_desc="C++ Library for RTL emulation" maintainer="krassovskysasha@gmail.com" @@ -10,3 +12,7 @@ license="GPL-3.0" homepage="https://veripool.org/wiki/verilator" distfiles="https://github.com/verilator/verilator/archive/v${version}.tar.gz" checksum="4e4f4aff00af9a15a61c94b67ed070cd6312ddcc0f0d340a6df2199480064cef" + +pre_configure() { + autoconf +} \ No newline at end of file