[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[PATCH 09/11] Add support for building ghcjs packages



---
 Dh_Haskell.sh | 22 +++++++++++++++++-----
 hlibrary.mk   | 21 +++++++++++++++++++++
 2 files changed, 38 insertions(+), 5 deletions(-)

diff --git a/Dh_Haskell.sh b/Dh_Haskell.sh
index 1e1fce6..7cc690a 100644
--- a/Dh_Haskell.sh
+++ b/Dh_Haskell.sh
@@ -6,6 +6,14 @@ os(){
   ghc -e 'putStr System.Info.os'
 }

+ghcjs_version(){
+  ghcjs --numeric-ghcjs-version
+}
+
+ghcjs_ghc_version(){
+  ghcjs --numeric-ghc-version
+}
+
 package_prefix(){
     echo $1 | sed -n -e 's|^\([^-]*\)-.*-[^-]*$|\1|p'
 }
@@ -35,6 +43,7 @@ packages_hc(){
 hc_libdir(){
     case $1 in
       ghc) echo "usr/lib/haskell-packages/ghc/lib";;
+      ghcjs) echo "usr/lib/ghcjs/.cabal/lib";;
       *) echo "Don't know package_libdir for $1" >&2; exit 1;;
     esac
 }
@@ -46,6 +55,7 @@ package_libdir(){
 hc_pkgdir(){
     case $1 in
  ghc) echo "var/lib/ghc/package.conf.d";;
+        ghcjs) echo
"usr/lib/ghcjs/.ghcjs/`cpu`-`os`-`ghcjs_version`-`ghcjs_ghc_version`/ghcjs/package.conf.d";;
         *) echo "Don't know pkgdir for $1" >&2; exit 1;;
     esac
 }
@@ -57,6 +67,7 @@ package_pkgdir(){
 hc_prefix(){
     case $1 in
       ghc) echo "usr";;
+      ghcjs) echo "usr/lib/ghcjs";;
       *) echo "Don't know prefix for compiler $1" >&2; exit 1;;
     esac
 }
@@ -64,6 +75,7 @@ hc_prefix(){
 hc_haddock(){
     case $1 in
  ghc) echo "haddock";;
+ ghcjs) echo "haddock-ghcjs";;
  *) echo "Don't know pkgdir for $1" >&2; exit 1;;
     esac
 }
@@ -333,11 +345,11 @@ clean_recipe(){
     MAKEFILE=$3
     DEB_LINTIAN_OVERRIDES_FILE=$4
     [ ! -x "${DEB_SETUP_BIN_NAME}" ] || ${DEB_SETUP_BIN_NAME} clean
-    rm -rf dist dist-ghc dist-hugs ${DEB_SETUP_BIN_NAME} Setup.hi
Setup.ho Setup.o .*config*
-    rm -f configure-ghc-stamp build-ghc-stamp build-hugs-stamp
build-haddock-stamp
-    rm -rf debian/tmp-inst-ghc
-    rm -f debian/extra-depends-ghc
-    rm -f debian/libghc-${CABAL_PACKAGE}-doc.links
+    rm -rf dist dist-ghc dist-ghcjs dist-hugs ${DEB_SETUP_BIN_NAME}
Setup.hi Setup.ho Setup.o .*config*
+    rm -f configure-ghc-stamp configure-ghcjs-stamp build-ghc-stamp
build-ghcjs-stamp build-hugs-stamp build-haddock-stamp
+    rm -rf debian/tmp-inst-ghc debian/tmp-inst-ghcjs
+    rm -f debian/extra-depends-ghc debian/extra-depends-ghcjs
+    rm -f debian/libghc-${CABAL_PACKAGE}-doc.links
debian/libghcjs-${CABAL_PACKAGE}-doc.links
     if [ -f ${DEB_LINTIAN_OVERRIDES_FILE} ] ; then \
       sed -i '/binary-or-shlib-defines-rpath/ d'
${DEB_LINTIAN_OVERRIDES_FILE} ; \
       find ${DEB_LINTIAN_OVERRIDES_FILE} -empty -delete; \
diff --git a/hlibrary.mk b/hlibrary.mk
index 2c8bd76..2d04d52 100644
--- a/hlibrary.mk
+++ b/hlibrary.mk
@@ -129,12 +129,16 @@ endif

 build/libghc-$(CABAL_PACKAGE)-prof
build/libghc-$(CABAL_PACKAGE)-dev:: build-ghc-stamp check-ghc-stamp

+build/libghcjs-$(CABAL_PACKAGE)-prof
build/libghcjs-$(CABAL_PACKAGE)-dev:: build-ghc-stamp check-ghc-stamp
+
 build-haddock-stamp:
  . /usr/share/haskell-devscripts/Dh_Haskell.sh && haddock_recipe
"$(DEB_SETUP_BIN_NAME)" "$(DEB_HADDOCK_OPTS)"
"$(DEB_DEFAULT_COMPILER)" "$(DEB_PACKAGES)"
  touch build-haddock-stamp

 build/libghc-$(CABAL_PACKAGE)-doc:: configure-ghc-stamp build-haddock-stamp

+build/libghcjs-$(CABAL_PACKAGE)-doc:: configure-ghc-stamp build-haddock-stamp
+
 dist-hugs: $(DEB_SETUP_BIN_NAME)
  $(DEB_SETUP_BIN_NAME) configure --hugs --prefix=/usr -v2
--builddir=dist-hugs $(DEB_SETUP_HUGS_CONFIGURE_ARGS)

@@ -144,22 +148,39 @@ build/libhugs-$(CABAL_PACKAGE):: dist-hugs
 debian/tmp-inst-ghc: $(DEB_SETUP_BIN_NAME) build-ghc-stamp
  $(DEB_SETUP_BIN_NAME) copy --builddir=dist-ghc --destdir=debian/tmp-inst-ghc

+debian/tmp-inst-ghcjs: $(DEB_SETUP_BIN_NAME) build-ghc-stamp
+ $(DEB_SETUP_BIN_NAME) copy --builddir=dist-ghcjs
--destdir=debian/tmp-inst-ghcjs
+
 debian/extra-depends-ghc: debian/tmp-inst-ghc
  . /usr/share/haskell-devscripts/Dh_Haskell.sh &&
extra_depends_recipe "$(DEB_SETUP_BIN_NAME)" ghc

+debian/extra-depends-ghcjs: debian/tmp-inst-ghcjs
+ . /usr/share/haskell-devscripts/Dh_Haskell.sh &&
extra_depends_recipe "$(DEB_SETUP_BIN_NAME)" ghcjs
+
 DEB_LINTIAN_OVERRIDES_FILE =
debian/libghc-$(CABAL_PACKAGE)-dev.lintian-overrides

 install/libghc-$(CABAL_PACKAGE)-dev:: debian/tmp-inst-ghc
debian/extra-depends-ghc
  . /usr/share/haskell-devscripts/Dh_Haskell.sh && \
   install_dev_recipe "$(DEB_SETUP_BIN_NAME)" "$(CABAL_PACKAGE)"
"$(CABAL_VERSION)" "$(HASKELL_HIDE_PACKAGES)"
"$(DEB_GHC_EXTRA_PACKAGES)" $(DEB_LINTIAN_OVERRIDES_FILE) "$(notdir
$@)"

+install/libghcjs-$(CABAL_PACKAGE)-dev:: debian/tmp-inst-ghcjs
debian/extra-depends-ghcjs
+ . /usr/share/haskell-devscripts/Dh_Haskell.sh && \
+  install_dev_recipe "$(DEB_SETUP_BIN_NAME)" "$(CABAL_PACKAGE)"
"$(CABAL_VERSION)" "$(HASKELL_HIDE_PACKAGES)"
"$(DEB_GHC_EXTRA_PACKAGES)" "$(DEB_LINTIAN_OVERRIDES_FILE)" "$(notdir
$@)"
+
 install/libghc-$(CABAL_PACKAGE)-prof:: debian/tmp-inst-ghc
install/libghc-$(CABAL_PACKAGE)-dev debian/extra-depends-ghc
  . /usr/share/haskell-devscripts/Dh_Haskell.sh && install_prof_recipe
"$(notdir $@)"

+install/libghcjs-$(CABAL_PACKAGE)-prof:: debian/tmp-inst-ghcjs
install/libghcjs-$(CABAL_PACKAGE)-dev debian/extra-depends-ghcjs
+ . /usr/share/haskell-devscripts/Dh_Haskell.sh && install_prof_recipe
"$(notdir $@)"
+
 install/libghc-$(CABAL_PACKAGE)-doc:: debian/tmp-inst-ghc
build-haddock-stamp debian/extra-depends-ghc
  . /usr/share/haskell-devscripts/Dh_Haskell.sh && \
   install_doc_recipe "$(CABAL_PACKAGE)" "$(CABAL_VERSION)"
"$(DEB_ENABLE_HOOGLE)" "$(notdir $@)"

+install/libghcjs-$(CABAL_PACKAGE)-doc:: debian/tmp-inst-ghcjs
build-haddock-stamp debian/extra-depends-ghcjs
+ . /usr/share/haskell-devscripts/Dh_Haskell.sh && \
+  install_doc_recipe "$(CABAL_PACKAGE)" "$(CABAL_VERSION)"
"$(DEB_ENABLE_HOOGLE)" "$(notdir $@)"
+
 install/libhugs-$(CABAL_PACKAGE):: $(DEB_SETUP_BIN_NAME) dist-hugs
debian/extra-depends-hugs
  $(DEB_SETUP_BIN_NAME) copy --destdir=debian/libhugs-$(CABAL_PACKAGE)
--builddir=dist-hugs
  rm -rf debian/libhugs-$(CABAL_PACKAGE)/usr/share/doc/*
-- 
1.9.1


Reply to: