# cabal/cfg - "Build" settings for package #--------------------------------------------------------------------- [technotes] 1. The source tarballs and/or components for this package are retri- eved from online during the first build, stored in the package itself, and reused in subsequent builds. The rules related to going online again are explained further down. This is one of a limited number of packages in this distro that is permitted to go online at build time. #--------------------------------------------------------------------- 2. The "cabal" package provides a copy of the Haskell "cabal" executa- ble. The package needs existing copies of the "cabal" executable and "ghc" compiler to build itself [including an updated copy of the "cabal" executable]. The build procedure uses the first copies of "cabal" and "ghc" found in the PATH list or the copies in the "cabal" and/or "ghc0910" pack- ages, whatever is available. The copies in the PATH list take priori- ty. #--------------------------------------------------------------------- 3. It's recommended that the "cabal" package be backed up prior to any rebuild. The "cabal" and "ghc0910" packages are relocatable. This means that the developer should be able to do something like this: cd $PRODTREE rm -fr boot-cabal cp -a cabal/ boot-cabal rm -fr boot-ghc0910 cp -a ghc0910/ boot-ghc0910 PATH=$PRODTREE/boot-cabal/bin:$PATH PATH=$PRODTREE/boot-ghc0910/bin:$PATH to create copies of the packages that can be used both as backups and to rebuild the packages. #--------------------------------------------------------------------- 4. If the environment variable "GHCOFFLINE" is set to "true" -- or to certain aliases for "true" such as "yes" -- the "cabal" build pro- cedure doesn't go online. Instead, the package rebuilds itself using sources that existed, and were saved, at the time of the last online build. In this case, the "cabal" and "ghc" executables used to do the build need to be compatible with the old sources. Presently, in this mode, the build procedure turns "dnsmasq" off auto- matically. #--------------------------------------------------------------------- 5. If "GHCOFFLINE" is set to something else, or is unset, the "cabal" build procedure goes online. It downloads new "cabal" sources, uses them, and stores them in the package itself. In this case, the "cabal" and "ghc" executables used to do the build need to be compatible with the latest upstream sources. Presently, in this mode, the build procedure turns "dnsmasq" on auto- matically. #--------------------------------------------------------------------- [buildtimes] 00.51 hours (or 030.83 minutes) - ThinkPad W530 i7 4x2 32GB RAM - 250526 #--------------------------------------------------------------------- [settings] compiler = gcc # ghc 9.10 doesn't support newer clang configure = none defer = glibc64 license = tbd purge = no unpack = none setpaths = libgmp #--------------------------------------------------------------------- [depends] cabal:forward # Package may need itself to build ghc0910:forward libgmp numactl zlib #--------------------------------------------------------------------- [build] PATH=$PATH:$PRODTREE/cabal/bin:$PRODTREE/ghc0910/bin export LD=ld hash cabal && hash ghc cabal --version ghc --version PP=$PRODTREE/cabal BINDIR=$PP/bin GHCHOME=$PP/ghchome BUILDBIN=$GHCHOME/.local/bin mkdir -p $BINDIR $GHCHOME OLDHOME=$HOME export HOME=$GHCHOME #--------------------------------------------------------------------- rm -fr $BINDIR/* rm -fr $BUILDBIN/ rm -fr $GHCHOME/.local/state/ mkdir -p $BUILDBIN/ mkdir -p $GHCHOME/.local/state/ #--------------------------------------------------------------------- if [ "@$GHCOFFLINE" == "@1" ]; then GHCOFFLINE=true ; fi if [ "@$GHCOFFLINE" == "@on" ]; then GHCOFFLINE=true ; fi if [ "@$GHCOFFLINE" == "@yes" ]; then GHCOFFLINE=true ; fi echo GHCOFFLINE=$GHCOFFLINE if [ "@$GHCOFFLINE" == "@true" ]; then echo Building offline killany dnsmasq || true else echo Building online service dnsmasq start || true cabal update fi #--------------------------------------------------------------------- PKGLIST=" cabal-install " #--------------------------------------------------------------------- for pkg in $PKGLIST do echo ==== `date` $pkg start echo cabal --installdir=$BUILDBIN/ \ --overwrite-policy=always install $pkg cabal --installdir=$BUILDBIN/ \ --overwrite-policy=always install $pkg echo ==== `date` $pkg end done #--------------------------------------------------------------------- cp -p $BUILDBIN/* $BINDIR/ strip $BINDIR/* || true HOME=$OLDHOME #--------------------------------------------------------------------- # Original URLs. These URLs were valid at one point, but may have died # since then. If you download newer versions of tarballs [etc.], don't # delete the original versions, as you may not be able to replace # them. [urls] url_debian = tbd url_home = tbd url_lfs = tbd url_tarball = n/a # See "technotes" in "cfg" file #--------------------------------------------------------------------- [history] 250526 Added package 250526 Started with 250526