Skip to content

Instantly share code, notes, and snippets.

@thotypous
Last active April 12, 2020 13:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thotypous/cf40bbb2cb7b3d89a0d1671e839c1e7e to your computer and use it in GitHub Desktop.
Save thotypous/cf40bbb2cb7b3d89a0d1671e839c1e7e to your computer and use it in GitHub Desktop.
bluespec-git PKGBUILD
diff --git a/src/comp/Makefile b/src/comp/Makefile
index 5e38ec2..b832d80 100644
--- a/src/comp/Makefile
+++ b/src/comp/Makefile
@@ -63,6 +63,8 @@ TCL_LIBS = -ltcl$(TCL_VER) -ltk$(TCL_VER) -litcl$(ITCL_VER) \
ifeq ($(OSTYPE), Darwin)
TCL_ARGS += -I$(shell xcrun --show-sdk-path)/System/Library/Frameworks/Tk.framework/Headers
TCL_LIBS += -L"$(shell dirname $(shell $(FIND) /System/Library/Tcl -type f -name libitcl$(ITCL_VER).dylib))"
+else
+TCL_LIBS += -L/usr/lib/itcl$(ITCL_VER) -optl-Wl,-rpath,/usr/lib/itcl$(ITCL_VER)
endif
# STP
@@ -94,6 +96,8 @@ WISHFLAGS = -litk$(ITK_VER) $(shell pkg-config --libs x11)
WISHFLAGS += $(EXTRAWISHLIBS)
ifeq ($(OSTYPE), Darwin)
WISHFLAGS += -L"$(shell dirname $(shell $(FIND) /System/Library/Tcl -type f -name libitk$(ITK_VER).dylib))"
+else
+WISHFLAGS += -L/usr/lib/itk$(ITK_VER) -optl-Wl,-rpath,/usr/lib/itk$(ITK_VER)
endif
# -----
diff --git a/src/vendor/htcl/Makefile b/src/vendor/htcl/Makefile
index a5deb63..ec51a6b 100644
--- a/src/vendor/htcl/Makefile
+++ b/src/vendor/htcl/Makefile
@@ -1,9 +1,9 @@
-CFLAGS += -Wall $(shell pkg-config --silence-errors --cflags-only-I tcl || echo -I/usr/include/tcl)
+GHCFLAGS += -Wall $(shell pkg-config --silence-errors --cflags-only-I tcl || echo -I/usr/include/tcl)
GHC ?= ghc
# We use GHC to compile this, so it has the proper RTS includes
%.o: %.c
- $(GHC) $(CFLAGS) -c $<
+ $(GHC) $(GHCFLAGS) -c $<
libhtcl.a: haskell.o
ar -r $@ $(filter %.o, $+)
diff --git a/src/vendor/stp/src/sat/Makefile b/src/vendor/stp/src/sat/Makefile
index 0d0937d..912f7b1 100644
--- a/src/vendor/stp/src/sat/Makefile
+++ b/src/vendor/stp/src/sat/Makefile
@@ -13,6 +13,7 @@ export COPTIMIZE=$(CFLAGS_M32) $(CFLAGS_FPIC) -O3
core: $(LIB)
# $(LIB) depends on */lib$(SUB)_release.a and will be rebuilt only if they have been updated
+.NOTPARALLEL:
$(LIB): core/libcore_release.a core_prop/libcore_prop_release.a simp/libsimp_release.a utils/libutils_release.a cryptominisat2/libminisat.a $(OBJS)
$(RM) $@
$(call arcat,$@,$(filter %.a,$^))
# Maintainer: Jiuyang Liu <liujiuyang1994@gmail.com>
# Maintainer: Paulo Matias <matias@ufscar.br>
pkgname=bluespec-git
pkgver=r285.9dfe8f5
pkgrel=1
pkgdesc='Bluespec Compiler (BSC)'
arch=('x86_64')
url='https://github.com/B-Lang-org/bsc'
license=('BSD')
depends=('tk-itk' 'haskell-old-time' 'haskell-syb' 'haskell-regex-compat' 'haskell-split')
makedepends=('git' 'gperf' 'ghc' 'xorg-server-xvfb')
source=("git+https://github.com/b-lang-org/bsc.git"
"archlinux.patch")
sha256sums=('SKIP'
'32f1befc93b371c5a744cf01447c8386337641c2efae75090abea0a119e330aa')
_prefix="/opt/bluespec"
pkgver() {
cd "$srcdir/bsc"
printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}
prepare() {
cd "$srcdir/bsc"
git submodule update --init --recursive
patch -p1 -i "${srcdir}/archlinux.patch"
sed -i "s,^BINDIR=.*$,BINDIR=${_prefix}/bin," src/comp/wrapper.sh
}
build(){
cd "$srcdir/bsc"
make GHC="ghc -dynamic" GHCJOBS=2 GHCRTSFLAGS='+RTS -M5G -A128m -RTS'
}
package() {
cd "$srcdir/bsc"
install -d "${pkgdir}${_prefix}"
cp -dr --preserve=mode,timestamp ./inst/* "${pkgdir}${_prefix}"
install -d "${pkgdir}/usr/share/vim/vimfiles"
cp -dr --preserve=mode,timestamp ./util/vim/{ftdetect,indent,syntax} "${pkgdir}/usr/share/vim/vimfiles"
install -d "${pkgdir}/usr/bin"
local _prog
for _prog in bsc bluetcl bluewish; do
ln -s "${_prefix}/bin/${_prog}" "${pkgdir}/usr/bin"
done
install -Dm644 COPYING "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment