MFH: r560282, r560704

Uses/cabal.mk: More correct fix for EXTRACT_ONLY problem from r559679.
Uses/cabal.mk: Add "nodefault" argument.
This commit is contained in:
Gleb Popov 2021-02-04 12:53:47 +00:00
parent 2271be0bf7
commit f72bdc3622
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/branches/2021Q1/; revision=564023

View File

@ -4,10 +4,13 @@
#
# Feature: cabal
# Usage: USES=cabal or USES=cabal:ARGS
# Valid ARGS: hpack
# Valid ARGS: hpack, nodefault
#
# hpack: The port doesn't have a .cabal file and needs devel/hs-hpack to
# generate it from package.yaml file
# nodefault: Do not fetch the default distribution file from Hackage. If
# USE_GITHUB or USE_GITLAB is specified in the port, this argument
# is implied.
#
# Variables, which can be set by the port:
#
@ -40,7 +43,7 @@
.if !defined(_INCLUDE_USES_CABAL_MK)
_INCLUDE_USES_CABAL_MK= yes
_valid_ARGS= hpack
_valid_ARGS= hpack nodefault
. for arg in ${cabal_ARGS}
. if !${_valid_ARGS:M${arg}}
@ -74,10 +77,18 @@ LIB_DEPENDS+= libgmp.so:math/gmp \
DIST_SUBDIR?= cabal
. if !defined(USE_GITHUB) && !defined(USE_GITLAB)
MASTER_SITES?= https://hackage.haskell.org/package/${PORTNAME}-${PORTVERSION}/ \
. if !defined(USE_GITHUB) && !defined(USE_GITLAB) && !${cabal_ARGS:Mnodefault}
MASTER_SITES= https://hackage.haskell.org/package/${PORTNAME}-${PORTVERSION}/ \
http://hackage.haskell.org/package/${PORTNAME}-${PORTVERSION}/
DISTFILES?= ${PORTNAME}-${PORTVERSION}${CABAL_EXTRACT_SUFX}
DISTFILES+= ${PORTNAME}-${PORTVERSION}${CABAL_EXTRACT_SUFX}
EXTRACT_ONLY+= ${PORTNAME}-${PORTVERSION}${CABAL_EXTRACT_SUFX}
. else
. if defined(USE_GITHUB) && !defined(DISTFILES) && !${USE_GITHUB:Mnodefault}
EXTRACT_ONLY+= ${DISTNAME_DEFAULT}${_GITHUB_EXTRACT_SUFX}
. endif
. if defined(USE_GITLAB) && !defined(DISTFILES) && !${USE_GITLAB:Mnodefault}
EXTRACT_ONLY+= ${DISTNAME}${_GITLAB_EXTRACT_SUFX}
. endif
. endif
_USES_extract= 701:cabal-post-extract
@ -101,15 +112,16 @@ MASTER_SITES+= https://hackage.haskell.org/package/:${package:C/[\.-]//g} \
http://hackage.haskell.org/package/:${package:C/[\.-]//g}
DISTFILES+= ${package:C/_[0-9]+//}/${package:C/_[0-9]+//}${CABAL_EXTRACT_SUFX}:${package:C/[\.-]//g}
. if !defined(CABAL_BOOTSTRAP)
EXTRACT_ONLY+= ${package:C/_[0-9]+//}/${package:C/_[0-9]+//}${CABAL_EXTRACT_SUFX}
. endif
. if ${package:C/[^_]*//:S/_//} != ""
DISTFILES+= ${package:C/_[0-9]+//}/revision/${package:C/[^_]*//:S/_//}.cabal:${package:C/[\.-]//g}
. endif
. endfor
. if !defined(CABAL_BOOTSTRAP)
EXTRACT_ONLY= ${DISTFILES:C/:.*//:N*\.cabal}
. endif
# Fetches and unpacks package source from Hackage using only PORTNAME and PORTVERSION.
cabal-extract: ${WRKDIR}