[Pkg-haskell-commits] darcs: haskell-devscripts: Add support for building ghcjs packages

David Fox dsf at seereason.com
Tue Mar 31 17:25:45 UTC 2015


Tue Mar 31 17:20:00 UTC 2015  David Fox <dsf at seereason.com>
  * Add support for building ghcjs packages

    M ./Dh_Haskell.sh -5 +17
    M ./hlibrary.mk +21

Tue Mar 31 17:20:00 UTC 2015  David Fox <dsf at seereason.com>
  * Add support for building ghcjs packages
diff -rN -u old-haskell-devscripts/Dh_Haskell.sh new-haskell-devscripts/Dh_Haskell.sh
--- old-haskell-devscripts/Dh_Haskell.sh	2015-03-31 17:25:44.990419576 +0000
+++ new-haskell-devscripts/Dh_Haskell.sh	2015-03-31 17:25:45.010419600 +0000
@@ -6,6 +6,14 @@
   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 @@
 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 @@
 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 @@
 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_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 @@
     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 -rN -u old-haskell-devscripts/hlibrary.mk new-haskell-devscripts/hlibrary.mk
--- old-haskell-devscripts/hlibrary.mk	2015-03-31 17:25:44.986419570 +0000
+++ new-haskell-devscripts/hlibrary.mk	2015-03-31 17:25:45.010419600 +0000
@@ -129,12 +129,16 @@
 
 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 @@
 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/*




More information about the Pkg-haskell-commits mailing list