debian swirl logo

Back to the packages list haskell-intern

#!/usr/bin/make -f
# -*- mode: makefile; coding: utf-8 -*-
# Copyright © 2013 Jonas Smedegaard 
# Description: Main Debian packaging script for intern
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see .

include /usr/share/cdbs/1/rules/upstream-tarball.mk
include /usr/share/cdbs/1/rules/utils.mk
include /usr/share/cdbs/1/rules/debhelper.mk
include /usr/share/cdbs/1/class/hlibrary.mk

DEB_UPSTREAM_PACKAGE = intern
DEB_UPSTREAM_URL = http://hackage.haskell.org/packages/archive/$(DEB_UPSTREAM_PACKAGE)/$(DEB_UPSTREAM_TARBALL_VERSION)

# helper macros used below
expand-ghc-dep = $(comma) libghc-$2-$1 $(if $3,($3 $4)$(if $5,$(comma) libghc-$2-$1 ($5 $6)))
strip-ghc-deps = $(foreach dep,$2,$(call expand-ghc-dep,$1,$(word 1,$(subst $(comma),$(space),$(dep)))))
expand-ghc-deps = $(foreach dep,$2,$(call expand-ghc-dep,$1,$(word 1,$(subst $(comma),$(space),$(dep))),$(word 2,$(subst $(comma),$(space),$(dep))),$(word 3,$(subst $(comma),$(space),$(dep))),$(word 4,$(subst $(comma),$(space),$(dep))),$(word 5,$(subst $(comma),$(space),$(dep)))))

# Needed by upstream build
ghc-deps += text,<<,1.2
ghc-deps += hashable,<<,1.3
ghc-deps += unordered-containers,<<,0.3
#ghc-deps += intern,<<,1.0
bdeps = ghc
bdeps += , $(call expand-ghc-deps,dev,$(ghc-deps))

# Needed by upstream profiling build
bdeps-prof = ghc-prof
bdeps-prof += , $(call strip-ghc-deps,prof,$(ghc-deps))

# Needed by upstream documentation build
bdeps-indep = ghc-doc
bdeps-indep += , $(call strip-ghc-deps,doc,$(ghc-deps))

# Needed for our packaging
bdeps += , haskell-devscripts

# TODO: actually use CDBS_BUILD_DEPENDS_INDEP, instead of hardcoding
CDBS_BUILD_DEPENDS += , $(bdeps), $(bdeps-prof)
CDBS_BUILD_DEPENDS_INDEP += , $(bdeps-indep)

DEB_INSTALL_EXAMPLES_libghc-intern-dev = examples/*

Builds:

libghc-intern-dev
hash consing for data types - libraries
libghc-intern-doc
hash consing for data types - library documentation
libghc-intern-prof
hash consing for data types - profiling libraries