[Git][haskell-team/package-plan][master] Support cabal-install's new XDG Base Directory

Ilias Tsitsimpis (@iliastsi) gitlab at salsa.debian.org
Thu Oct 10 15:40:01 BST 2024



Ilias Tsitsimpis pushed to branch master at Debian Haskell Group / package-plan


Commits:
ab97313f by Ilias Tsitsimpis at 2024-10-10T17:21:14+03:00
Support cabal-install's new XDG Base Directory

- - - - -


2 changed files:

- .gitlab-ci.yml
- test-packages.pl


Changes:

=====================================
.gitlab-ci.yml
=====================================
@@ -2,12 +2,12 @@ image: debian:sid
 
 cache:
   paths:
-    - .cabal
+    - .cache/cabal
 build:
   stage: deploy
   script:
     - apt-get update
     - apt-get install -y --no-install-recommends cabal-install ghc dctrl-tools patchutils libtext-patch-perl libfile-slurp-perl libipc-run-perl liblist-moreutils-perl libdpkg-perl
     - apt-get install -y --no-install-recommends --no-install-suggests pkg-config libxft-dev libcairo-dev libatk1.0-dev libdbusmenu-glib-dev libdbusmenu-gtk3-dev libvte-2.91-dev libgsasl-dev  libgirepository1.0-dev libhdf5-serial-dev libxml2-dev libpcre3-dev libsdl2-dev libsdl2-image-dev libsdl2-mixer-dev libsdl2-ttf-dev libzmq3-dev libyaml-dev
-    - HOME=.cabal cabal update
-    - HOME=.cabal ./test-packages.pl
+    - HOME=/builds/haskell-team/package-plan cabal update
+    - HOME=/builds/haskell-team/package-plan ./test-packages.pl


=====================================
test-packages.pl
=====================================
@@ -239,7 +239,16 @@ for my $pkg (sort keys %packages) {
 }
 
 my $sandboxdir = cwd() . "/cabal-sandbox";
-my $cabaldir = defined $ENV{CABAL_DIR} ? $ENV{CABAL_DIR} : $ENV{HOME}."/.cabal";
+# Support the new XDG Base Directory Specification
+# See https://github.com/haskell/cabal/blob/master/release-notes/cabal-install-3.10.1.0.md
+my $cabaldir;
+if (defined $ENV{CABAL_DIR}) {
+    $cabaldir = $ENV{CABAL_DIR};
+} elsif (-d $ENV{HOME}."/.cabal") {
+    $cabaldir = $ENV{HOME}."/.cabal";
+} else {
+    $cabaldir = $ENV{HOME}."/.cache/cabal";
+}
 my $originaltarpath = "$cabaldir/packages/hackage.haskell.org/01-index.tar";
 my $tarpath = "$sandboxdir/packages/debian/00-index.tar";
 my $dbpath = "$sandboxdir/db";



View it on GitLab: https://salsa.debian.org/haskell-team/package-plan/-/commit/ab97313f80c7b0f475f95482d374058c98aefcb1

-- 
View it on GitLab: https://salsa.debian.org/haskell-team/package-plan/-/commit/ab97313f80c7b0f475f95482d374058c98aefcb1
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-haskell-commits/attachments/20241010/15ddc792/attachment-0001.htm>


More information about the Pkg-haskell-commits mailing list