[arch-haskell] Fwd: gitit status update and why are deps needed for binaries

Magnus Therning magnus at therning.org
Tue Apr 14 21:29:14 UTC 2015


On Tue, Apr 14, 2015 at 03:41:26PM +0100, SP wrote:
> On 14/04/15 13:10, Magnus Therning wrote:
> > Patches are always welcome. :)
> 
> Naturally. If I find time I'll give it a shot.

Just playing around a little with one of the packages currently in the
repo comprising both a lib and a binary resulted in the attached
PKGBUILD (shake).  It might be close to what a solution could look
like.

/M

-- 
Magnus Therning                      OpenPGP: 0xAB4DFBA4 
email: magnus at therning.org   jabber: magnus at therning.org
twitter: magthe               http://therning.org/magnus

If you can explain how you do something, then you're very very bad at
it.
     -- John Hopfield
-------------- next part --------------
# custom variables
_hkgname=shake
_licensefile=LICENSE

# PKGBUILD options/directives
pkgname=(haskell-shake haskell-shake-bin)
pkgver=0.15
pkgrel=76
pkgdesc="Build system library, like Make, but more accurate dependencies."
url="http://www.shakebuild.com/"
license=("BSD3")
arch=('i686' 'x86_64')
makedepends=()
depends=("ghc=7.10.1-1"
         "haskell-extra=1.1-76"
         "haskell-hashable=1.2.3.2-76"
         "haskell-js-flot=0.8.3-76"
         "haskell-js-jquery=1.11.2-76"
         "haskell-old-time=1.1.0.3-76"
         "haskell-random=1.1-76"
         "haskell-unordered-containers=0.2.5.1-76"
         "haskell-utf8-string=1-76")
options=('strip' 'staticlibs')
source=("http://hackage.haskell.org/packages/archive/${_hkgname}/${pkgver}/${_hkgname}-${pkgver}.tar.gz")
sha256sums=("1376b82cce3fdc977e9affe72fb01888173d0fcf465a10a0357b3b44449df80b")

# PKGBUILD functions

prepare() {
    cd "${srcdir}/${_hkgname}-${pkgver}"
    
    # no cabal patch
    # no source patch
}

build() {
    cd "${srcdir}/${_hkgname}-${pkgver}"
    
    runhaskell Setup configure -O --enable-library-profiling --enable-shared \
        --prefix=/usr --docdir="/usr/share/doc/${pkgname}" \
        --libsubdir=\$compiler/site-local/\$pkgid \
            -f-portable
    runhaskell Setup build
    runhaskell Setup haddock --hoogle --html
    runhaskell Setup register --gen-script
    runhaskell Setup unregister --gen-script
    sed -i -r -e "s|ghc-pkg.*unregister[^ ]* |&'--force' |" unregister.sh
}

package_haskell-shake() {
    depends+=("haskell-shake-bin=${pkgver}-${pkgrel}")
    install="${pkgname}.install"

    cd "${srcdir}/${_hkgname}-${pkgver}"
    
    runhaskell Setup copy --destdir="${pkgdir}"
    install -D -m744 register.sh   "${pkgdir}/usr/share/haskell/${pkgname}/register.sh"
    install    -m744 unregister.sh "${pkgdir}/usr/share/haskell/${pkgname}/unregister.sh"
    install -d -m755 "${pkgdir}/usr/share/doc/ghc/html/libraries"
    ln -s "/usr/share/doc/${pkgname}/html" "${pkgdir}/usr/share/doc/ghc/html/libraries/${_hkgname}"
    rm -fr "${pkgdir}/usr/bin"
    install -D -m644 "${_licensefile}" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
    rm -f "${pkgdir}/usr/share/doc/${pkgname}/${_licensefile}"
}

package_haskell-shake-bin() {
    depends=()

    cd "${srcdir}/${_hkgname}-${pkgver}"
    
    runhaskell Setup copy --destdir="${pkgdir}"
    rm -fr "${pkgdir}/usr/lib"
    rm -fr "${pkgdir}/usr/share"
    install -D -m644 "${_licensefile}" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
    rm -f "${pkgdir}/usr/share/doc/${pkgname}/${_licensefile}"
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 163 bytes
Desc: not available
URL: <http://mail.haskell.org/pipermail/arch-haskell/attachments/20150414/6c679b3f/attachment.sig>


More information about the arch-haskell mailing list