gdritter repos void-extra-packages / fdc351d
Add setup script + new cabal build style The setup script assumes that void-extra-packages and void-packages are checked out side-by-side in the same directory, and will copy things from one into the other. (We can't use symlinks, because xbps-pkg thinks that symlinks are a sign of a subpackage!) This also adds the haskell-cabal build style, which abstracts out the process of setting up a sandbox and installing things with Cabal. Getty Ritter 6 years ago
3 changed file(s) with 55 addition(s) and 15 deletion(s). Collapse all Expand all
1 #
2 # This helper is for templates built using Haskell cabal.
3 do_build() {
4 cabal sandbox init
5 cabal update
6 cabal install ${makejobs} --only-dependencies
7 cabal configure -v --prefix=/usr
8 cabal build ${makejobs}
9 }
10
11 do_install() {
12 vbin dist/build/${pkgname}/${pkgname}
13 if [ -e LICENSE ]; then
14 vlicense LICENSE
15 fi
16 }
1 #!/bin/bash -e
2
3 function die {
4 printf "\x1b[91merror: %s\x1b[39m\n" "$@" >&2
5 exit 99
6 }
7
8 function info {
9 printf "\x1b[93m%s\x1b[39m\n" "$@" >&2
10 }
11
12 if [ ! -e ../void-packages ]; then
13 die "../void-packages repo not found"
14 fi
15
16 if [ ! -e ../void-packages/srcpkgs ]; then
17 die "../void-packages/src repo not found"
18 fi
19
20 if [ ! -e ../void-packages/common/build-style/haskell-cabal.sh ]; then
21 info "Installing haskell-cabal build style"
22 cp haskell-cabal.sh ../void-packages/common/build-style/.
23 fi
24
25 for thing in ./srcpkgs/*; do
26 PKG=$(basename "${thing}")
27 ROOT="../void-packages/srcpkgs/$PKG"
28 if [ -e "$ROOT" ]; then
29 if ( cd "$ROOT" && git ls-files --error-unmatch "template" >/dev/null 2>&1 ); then
30 info "$PKG already exists in void-packages repo!"
31 elif ! diff "srcpkgs/$PKG/template" "$ROOT/template" >/dev/null; then
32 info "Package $PKG has modifications in void-packages"
33 fi
34 else
35 mkdir -p "$ROOT"
36 cp "srcpkgs/$PKG/template" "$ROOT/template"
37 fi
38 done
33 version="$(date +%F | sed 's/-//g')"
44 revision=2
55 hostmakedepends="ghc cabal-install git"
6 makedepends=""
7 depends=""
6 build_style="haskell-cabal"
87 short_desc="Project template initializer for Haskell"
98 maintainer="Getty Ritter <charter-pkg@infinitenegativeutility.com>"
109 license="BSD"
1413 do_fetch() {
1514 git clone https://github.com/aisamanra/charter.git ${wrksrc}
1615 }
17
18 do_build() {
19 cabal sandbox init
20 cabal update
21 cabal install ${makejobs} --only-dependencies
22 cabal configure -v --prefix=/usr
23 cabal build ${makejobs}
24 }
25
26 do_install() {
27 vbin dist/build/${pkgname}/${pkgname}
28 vlicense LICENSE
29 }