Uses/cabal.mk: Introduce CABAL_REVISION knob.

This knob allows pulling in a revised .cabal file for a Haskell package
being ported. This allows us to drop local patches that were serving the
same purpose.
This commit is contained in:
Gleb Popov 2022-11-16 14:43:45 +03:00
parent c50d10c0cd
commit 9e425fc882
13 changed files with 33 additions and 296 deletions

View File

@ -19,6 +19,9 @@
# When creating a new port, the initial list can be built
# using make-use-cabal auxiliary target.
#
# CABAL_REVISION Specifies a Haskell package revision. Set this to an
# integer to pull in revised .cabal file from Hackage.
#
# CABAL_FLAGS List of Cabal flags to be passed verbatim into --flags
# argument of cabal-install utility. Used for both
# cabal configure and cabal build.
@ -125,6 +128,9 @@ MASTER_SITES+= https://hackage.haskell.org/package/${_hackage_group} \
. if ${_hackage_is_default} == yes
DISTFILES+= ${PORTNAME}-${PORTVERSION}/${PORTNAME}-${PORTVERSION}${CABAL_EXTRACT_SUFX}
. ifdef CABAL_REVISION
DISTFILES+= ${PORTNAME}-${PORTVERSION}/revision/${CABAL_REVISION}.cabal
. endif
. else
_hackage_group= :cabal_mk_hackage
. endif
@ -201,6 +207,11 @@ cabal-build: check-cabal
make-use-cabal: check-cabal2tuple
@${ECHO_MSG} "===> Processing plan.json"
@${_CABAL2TUPLE_CMD} ${WRKSRC} || (${ECHO_CMD} "Did you forget to make cabal-configure ?" ; exit 1)
. if ${_hackage_is_default} == yes
@if ${GREP} -q 'x-revision' ${WRKSRC}/*.cabal; then \
${ECHO_MSG} "Downloaded .cabal file contains x-revision, make sure to add CABAL_REVISION=" `${GREP} 'x-revision' ${WRKSRC}/*.cabal | ${SED} -e s/x-revision://`; \
fi
. endif
check-cabal:
@if ! type ${CABAL_CMD} > /dev/null 2>&1; then \
@ -225,6 +236,10 @@ cabal-post-extract:
@${TEST} ! -f ${WRKSRC}/cabal.project || \
(${ECHO_CMD} "cabal.project file is already present in WRKSRC! Set CABAL_PROJECT variable." && false)
. endif
# Copy revised .cabal file if present
. if defined(CABAL_REVISION) && ${_hackage_is_default} == yes
${CP} ${DISTDIR}/${DIST_SUBDIR}/${PORTNAME}-${PORTVERSION}/revision/${CABAL_REVISION}.cabal `find ${WRKSRC} -name '*.cabal' -depth 1`
. endif
# Move extracted dependencies into ${CABAL_DEPSDIR} directory
${MKDIR} ${CABAL_DEPSDIR}
@ -232,11 +247,11 @@ cabal-post-extract:
. for pkg_name xrev in ${package:C/_[0-9]+//} x${package:C/[^_]*//:S/_//}
# Copy revised .cabal file if present
. if ${xrev} != "x"
cp ${DISTDIR}/${DIST_SUBDIR}/${pkg_name}/revision/${xrev:S/x//}.cabal `find ${WRKDIR}/${pkg_name} -name '*.cabal' -depth 1`
${CP} ${DISTDIR}/${DIST_SUBDIR}/${pkg_name}/revision/${xrev:S/x//}.cabal `find ${WRKDIR}/${pkg_name} -name '*.cabal' -depth 1`
. endif
# Move the dependency source itself
cd ${WRKDIR} && \
mv ${pkg_name} ${CABAL_DEPSDIR}/
${MV} ${pkg_name} ${CABAL_DEPSDIR}/
. endfor
. endfor
# Create the cabal-install config

View File

@ -11,6 +11,7 @@ LICENSE= BSD3CLAUSE
USES= cabal
CABAL_REVISION= 2
USE_CABAL= OneTuple-0.3.1_3 \
QuickCheck-2.14.2 \
StateVar-1.2.2 \

View File

@ -1,6 +1,8 @@
TIMESTAMP = 1668511709
TIMESTAMP = 1668587368
SHA256 (cabal/aeson-pretty-0.8.9/aeson-pretty-0.8.9.tar.gz) = 5dbc4f451dfa1e667b2c6ec5170714fed1905dc9cae6a1134b3376f355fa2a08
SIZE (cabal/aeson-pretty-0.8.9/aeson-pretty-0.8.9.tar.gz) = 5802
SHA256 (cabal/aeson-pretty-0.8.9/revision/2.cabal) = f7b1808efab1b9edd0efbdfc2cd47e7dfe8bbd42ee970d1d3780112a4de125a1
SIZE (cabal/aeson-pretty-0.8.9/revision/2.cabal) = 2559
SHA256 (cabal/OneTuple-0.3.1/OneTuple-0.3.1.tar.gz) = 98853682d52fb4cc37a45cd186fbd77cf2565d3df5171acc4cf026427e103eef
SIZE (cabal/OneTuple-0.3.1/OneTuple-0.3.1.tar.gz) = 5148
SHA256 (cabal/OneTuple-0.3.1/revision/3.cabal) = fc32cb744477befa450a538ea4975cc523f0a2f1585cb5a36e9936a3d18e9a3c

View File

@ -1,27 +0,0 @@
--- aeson-pretty.cabal.orig 2001-09-09 01:46:40 UTC
+++ aeson-pretty.cabal
@@ -1,6 +1,7 @@ version: 0.8.9
cabal-version: 2.0
name: aeson-pretty
version: 0.8.9
+x-revision: 2
license: BSD3
license-file: LICENSE
category: Text, Web, JSON, Pretty Printer
@@ -41,14 +42,14 @@ library
Data.Aeson.Encode.Pretty
build-depends:
- aeson ^>= 1.0 || ^>=1.1 || ^>=1.2 || ^>=1.3 || ^>=1.4 || ^>=1.5 || ^>=2.0,
+ aeson ^>= 1.0 || ^>=1.1 || ^>=1.2 || ^>=1.3 || ^>=1.4 || ^>=1.5 || ^>=2.0 || ^>=2.1,
base >= 4.5,
base-compat >= 0.9,
bytestring >= 0.9,
scientific >= 0.3,
vector >= 0.9,
text >= 0.11,
- unordered-containers >= 0.1.3.0
+ unordered-containers >= 0.2.14.0
if !impl(ghc >= 8.0)
build-depends:

View File

@ -11,6 +11,7 @@ LICENSE= LGPL21
USES= cabal
CABAL_REVISION= 1
USE_CABAL= polyparse-1.13_5
.include <bsd.port.mk>

View File

@ -1,6 +1,8 @@
TIMESTAMP = 1668511758
TIMESTAMP = 1668595648
SHA256 (cabal/cpphs-1.20.9.1/cpphs-1.20.9.1.tar.gz) = 7f59b10bc3374004cee3c04fa4ee4a1b90d0dca84a3d0e436d5861a1aa3b919f
SIZE (cabal/cpphs-1.20.9.1/cpphs-1.20.9.1.tar.gz) = 45496
SHA256 (cabal/cpphs-1.20.9.1/revision/1.cabal) = 0ad26fef4e6be4cb13e1df93aab7bdbe9c3d3bc6c63b84d9e29cc0f691fe12b9
SIZE (cabal/cpphs-1.20.9.1/revision/1.cabal) = 3331
SHA256 (cabal/polyparse-1.13/polyparse-1.13.tar.gz) = 1c4c72980e1e5a4f07fea65ca08b2399581d2a6aa21eb1078f7ad286c279707b
SIZE (cabal/polyparse-1.13/polyparse-1.13.tar.gz) = 33144
SHA256 (cabal/polyparse-1.13/revision/5.cabal) = aca2fc54c5c90eaa85e59368ae3533cdc8a4bb85bb9d3e6de885f8e66eb11917

View File

@ -1,20 +0,0 @@
--- cpphs.cabal.orig 2001-09-09 01:46:40 UTC
+++ cpphs.cabal
@@ -52,7 +52,7 @@ Library
Hs-Source-Dirs: . old
else
- Build-Depends: time >=1.5 && <1.11
+ Build-Depends: time >=1.5
Hs-Source-Dirs: . new
Exposed-Modules:
@@ -81,7 +81,7 @@ Executable cpphs
Hs-Source-Dirs: . old
else
- Build-Depends: time >=1.5 && <1.11
+ Build-Depends: time >=1.5
Hs-Source-Dirs: . new
Other-Modules:

View File

@ -11,6 +11,7 @@ LICENSE= BSD3CLAUSE
USES= cabal
CABAL_REVISION= 2
USE_CABAL= ansi-terminal-0.11.3 \
ansi-wl-pprint-0.6.9_3 \
colour-2.3.6 \

View File

@ -1,6 +1,8 @@
TIMESTAMP = 1668511776
TIMESTAMP = 1668595900
SHA256 (cabal/hasktags-0.72.0/hasktags-0.72.0.tar.gz) = adadb5800ab2996f0198a6fc6af959dee6d69339c204cc9789f83e67024fe726
SIZE (cabal/hasktags-0.72.0/hasktags-0.72.0.tar.gz) = 59000
SHA256 (cabal/hasktags-0.72.0/revision/2.cabal) = 1d3cb246cf1b374bcbf5dfab2dd0f99c9c0898412281583ef89fe9bdc6347b38
SIZE (cabal/hasktags-0.72.0/revision/2.cabal) = 2866
SHA256 (cabal/ansi-terminal-0.11.3/ansi-terminal-0.11.3.tar.gz) = f4d563ecf71fb1d304bcdcad478d97efd9f61f6d9d4797a5d56e7722a92a9e6b
SIZE (cabal/ansi-terminal-0.11.3/ansi-terminal-0.11.3.tar.gz) = 37868
SHA256 (cabal/ansi-wl-pprint-0.6.9/ansi-wl-pprint-0.6.9.tar.gz) = a7b2e8e7cd3f02f2954e8b17dc60a0ccd889f49e2068ebb15abfa1d42f7a4eac

View File

@ -1,216 +0,0 @@
--- hasktags.cabal.orig 2001-09-09 01:46:40 UTC
+++ hasktags.cabal
@@ -1,106 +1,107 @@
-Name: hasktags
-Version: 0.72.0
-Copyright: The University Court of the University of Glasgow
-License: BSD3
-License-File: LICENSE
-Author: The GHC Team
-Maintainer:
- Jack Henahan <jhenahan@me.com>,
- Marc Weber <marco-oweber@gmx.de>,
- Marco Túlio Pimenta Gontijo <marcotmarcot@gmail.com>
-homepage: http://github.com/MarcWeber/hasktags
-bug-reports: http://github.com/MarcWeber/hasktags/issues
-Synopsis: Produces ctags "tags" and etags "TAGS" files for Haskell programs
-Description:
- Produces ctags "tags" and etags "TAGS" files for Haskell programs.
-Category: Development
-build-type: Simple
-cabal-version: >=1.10
-extra-source-files:
- README.md,
- TODO,
- testcases/HUnitBase.lhs
- testcases/Repair.lhs
- testcases/blockcomment.hs
- testcases/constructor.hs
- testcases/module.hs
- testcases/space.hs
- testcases/substring.hs
- testcases/tabs.hs
- testcases/testcase1.hs
- testcases/testcase2.hs
- testcases/testcase3.lhs
- testcases/testcase4.hs
- testcases/testcase8.hs
- testcases/twoblockcommentshs.hs
- testcases/twoblockcommentslhs.lhs
- testcases/twoblockcommentstogether.hs
- testcases/typesig.hs
- testcases/expected_failures_testing_suite.hs
- testcases/testcase9.hs
- testcases/testcase10.hs
- testcases/testcase11.hs
- testcases/simple.hs
- testcases/monad-base-control.hs
- testcases/16-regression.hs
- testcases/9.hs
- testcases/9-too.hs
-
-Flag debug
- Default: False
- Description: When set to true tokens will be print at various places. This helps understanding why hasktags does not behave the way it should
-
-source-repository head
- type: git
- location: http://github.com/MarcWeber/hasktags
-
-library
- default-language: Haskell2010
- hs-source-dirs: src
- ghc-options: -Wall
- exposed-modules: Hasktags
- other-modules: Tags, DebugShow
- build-depends:
- utf8-string,
- base >= 4 && < 5,
- bytestring >= 0.9 && < 0.11,
- directory >= 1.2.6 && < 1.4,
- filepath,
- json >= 0.5 && < 0.11,
- microlens-platform >= 0.3.8.0 && < 0.5
-
-Executable hasktags
- Main-Is: src/Main.hs
- Build-Depends:
- base,
- directory,
- filepath,
- hasktags,
- optparse-applicative,
- containers
- other-modules: Paths_hasktags
- ghc-options: -Wall
- default-language: Haskell2010
-
- if flag(debug)
- cpp-options: -Ddebug
-
-Test-Suite testsuite
- Type: exitcode-stdio-1.0
- Main-Is: Test.hs
- hs-source-dirs: src, tests
- Build-Depends:
- utf8-string,
- base,
- bytestring,
- directory,
- filepath,
- json,
- HUnit,
- microlens-platform
- other-modules: Tags, Hasktags, DebugShow
- ghc-options: -Wall
- default-language: Haskell2010
-
- if flag(debug)
- cpp-options: -Ddebug
+Name: hasktags
+Version: 0.72.0
+x-revision: 2
+Copyright: The University Court of the University of Glasgow
+License: BSD3
+License-File: LICENSE
+Author: The GHC Team
+Maintainer:
+ Jack Henahan <jhenahan@me.com>,
+ Marc Weber <marco-oweber@gmx.de>,
+ Marco Túlio Pimenta Gontijo <marcotmarcot@gmail.com>
+homepage: http://github.com/MarcWeber/hasktags
+bug-reports: http://github.com/MarcWeber/hasktags/issues
+Synopsis: Produces ctags "tags" and etags "TAGS" files for Haskell programs
+Description:
+ Produces ctags "tags" and etags "TAGS" files for Haskell programs.
+Category: Development
+build-type: Simple
+cabal-version: >=1.10
+extra-source-files:
+ README.md,
+ TODO,
+ testcases/HUnitBase.lhs
+ testcases/Repair.lhs
+ testcases/blockcomment.hs
+ testcases/constructor.hs
+ testcases/module.hs
+ testcases/space.hs
+ testcases/substring.hs
+ testcases/tabs.hs
+ testcases/testcase1.hs
+ testcases/testcase2.hs
+ testcases/testcase3.lhs
+ testcases/testcase4.hs
+ testcases/testcase8.hs
+ testcases/twoblockcommentshs.hs
+ testcases/twoblockcommentslhs.lhs
+ testcases/twoblockcommentstogether.hs
+ testcases/typesig.hs
+ testcases/expected_failures_testing_suite.hs
+ testcases/testcase9.hs
+ testcases/testcase10.hs
+ testcases/testcase11.hs
+ testcases/simple.hs
+ testcases/monad-base-control.hs
+ testcases/16-regression.hs
+ testcases/9.hs
+ testcases/9-too.hs
+
+Flag debug
+ Default: False
+ Description: When set to true tokens will be print at various places. This helps understanding why hasktags does not behave the way it should
+
+source-repository head
+ type: git
+ location: http://github.com/MarcWeber/hasktags
+
+library
+ default-language: Haskell2010
+ hs-source-dirs: src
+ ghc-options: -Wall
+ exposed-modules: Hasktags
+ other-modules: Tags, DebugShow
+ build-depends:
+ utf8-string,
+ base >= 4.8 && < 5,
+ bytestring >= 0.9 && < 0.12,
+ directory >= 1.2.6 && < 1.4,
+ filepath,
+ json >= 0.5 && < 0.11,
+ microlens-platform >= 0.3.8.0 && < 0.5
+
+Executable hasktags
+ Main-Is: src/Main.hs
+ Build-Depends:
+ base,
+ directory,
+ filepath,
+ hasktags,
+ optparse-applicative,
+ containers
+ other-modules: Paths_hasktags
+ ghc-options: -Wall
+ default-language: Haskell2010
+
+ if flag(debug)
+ cpp-options: -Ddebug
+
+Test-Suite testsuite
+ Type: exitcode-stdio-1.0
+ Main-Is: Test.hs
+ hs-source-dirs: src, tests
+ Build-Depends:
+ utf8-string,
+ base,
+ bytestring,
+ directory,
+ filepath,
+ json,
+ HUnit,
+ microlens-platform
+ other-modules: Tags, Hasktags, DebugShow
+ ghc-options: -Wall
+ default-language: Haskell2010
+
+ if flag(debug)
+ cpp-options: -Ddebug

View File

@ -13,6 +13,7 @@ USES= cabal
USE_LOCALE= en_US.UTF-8
CABAL_REVISION= 2
USE_CABAL= alex-3.2.7.1 \
ansi-terminal-0.11.3 \
ansi-wl-pprint-0.6.9_3 \

View File

@ -1,6 +1,8 @@
TIMESTAMP = 1668511823
TIMESTAMP = 1668598670
SHA256 (cabal/hjsmin-0.2.0.4/hjsmin-0.2.0.4.tar.gz) = 81b9947714d8d2b73d0aba9e2e02af7e30c13b2cf8144df8904564d9642e57e4
SIZE (cabal/hjsmin-0.2.0.4/hjsmin-0.2.0.4.tar.gz) = 5233
SHA256 (cabal/hjsmin-0.2.0.4/revision/2.cabal) = 4e81260f019081f1bdd7e4e285b35f2f09eea83ff9cd721aaa4e0ba979228fa0
SIZE (cabal/hjsmin-0.2.0.4/revision/2.cabal) = 2237
SHA256 (cabal/alex-3.2.7.1/alex-3.2.7.1.tar.gz) = 9bd2f1a27e8f1b2ffdb5b2fbd3ed82b6f0e85191459a1b24ffcbef4e68a81bec
SIZE (cabal/alex-3.2.7.1/alex-3.2.7.1.tar.gz) = 108229
SHA256 (cabal/ansi-terminal-0.11.3/ansi-terminal-0.11.3.tar.gz) = f4d563ecf71fb1d304bcdcad478d97efd9f61f6d9d4797a5d56e7722a92a9e6b

View File

@ -1,27 +0,0 @@
--- hjsmin.cabal.orig 2001-09-09 01:46:40 UTC
+++ hjsmin.cabal
@@ -1,5 +1,6 @@ version: 0.2.0.4
name: hjsmin
version: 0.2.0.4
+x-revision: 2
license: BSD3
license-file: LICENSE
author: Alan Zimmerman <alan.zimm@gmail.com>
@@ -30,7 +31,7 @@ library
exposed-modules: Text.Jasmine
build-depends: base >= 4.8 && < 5
- , bytestring == 0.10.*
+ , bytestring >= 0.10 && < 0.12
, language-javascript >= 0.6 && < 0.8
, text == 1.2.*
@@ -45,7 +46,7 @@ executable hjsmin
other-modules: Text.Jasmine
build-depends: base >= 4.8 && < 5
- , bytestring == 0.10.*
+ , bytestring
, language-javascript
, optparse-applicative >= 0.7
, text