From 9e425fc8821515b2456a20b11bfe75a492d60b5a Mon Sep 17 00:00:00 2001 From: Gleb Popov Date: Wed, 16 Nov 2022 14:43:45 +0300 Subject: [PATCH] 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. --- Mk/Uses/cabal.mk | 19 +- converters/hs-aeson-pretty/Makefile | 1 + converters/hs-aeson-pretty/distinfo | 4 +- .../files/patch-aeson-pretty.cabal | 27 --- devel/hs-cpphs/Makefile | 1 + devel/hs-cpphs/distinfo | 4 +- devel/hs-cpphs/files/patch-cpphs.cabal | 20 -- devel/hs-hasktags/Makefile | 1 + devel/hs-hasktags/distinfo | 4 +- devel/hs-hasktags/files/patch-hasktags.cabal | 216 ------------------ www/hs-hjsmin/Makefile | 1 + www/hs-hjsmin/distinfo | 4 +- www/hs-hjsmin/files/patch-hjsmin.cabal | 27 --- 13 files changed, 33 insertions(+), 296 deletions(-) delete mode 100644 converters/hs-aeson-pretty/files/patch-aeson-pretty.cabal delete mode 100644 devel/hs-cpphs/files/patch-cpphs.cabal delete mode 100644 devel/hs-hasktags/files/patch-hasktags.cabal delete mode 100644 www/hs-hjsmin/files/patch-hjsmin.cabal diff --git a/Mk/Uses/cabal.mk b/Mk/Uses/cabal.mk index 8d5308673f0b8..7d2aafc1534af 100644 --- a/Mk/Uses/cabal.mk +++ b/Mk/Uses/cabal.mk @@ -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 diff --git a/converters/hs-aeson-pretty/Makefile b/converters/hs-aeson-pretty/Makefile index 8b1bb8cab451a..465a27a47f71a 100644 --- a/converters/hs-aeson-pretty/Makefile +++ b/converters/hs-aeson-pretty/Makefile @@ -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 \ diff --git a/converters/hs-aeson-pretty/distinfo b/converters/hs-aeson-pretty/distinfo index c256374881556..767fee52f9611 100644 --- a/converters/hs-aeson-pretty/distinfo +++ b/converters/hs-aeson-pretty/distinfo @@ -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 diff --git a/converters/hs-aeson-pretty/files/patch-aeson-pretty.cabal b/converters/hs-aeson-pretty/files/patch-aeson-pretty.cabal deleted file mode 100644 index d018ee11b2e06..0000000000000 --- a/converters/hs-aeson-pretty/files/patch-aeson-pretty.cabal +++ /dev/null @@ -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: diff --git a/devel/hs-cpphs/Makefile b/devel/hs-cpphs/Makefile index 7a6e081460668..9f65f515fca1d 100644 --- a/devel/hs-cpphs/Makefile +++ b/devel/hs-cpphs/Makefile @@ -11,6 +11,7 @@ LICENSE= LGPL21 USES= cabal +CABAL_REVISION= 1 USE_CABAL= polyparse-1.13_5 .include diff --git a/devel/hs-cpphs/distinfo b/devel/hs-cpphs/distinfo index 456fcdce1b710..7c2a33e14962a 100644 --- a/devel/hs-cpphs/distinfo +++ b/devel/hs-cpphs/distinfo @@ -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 diff --git a/devel/hs-cpphs/files/patch-cpphs.cabal b/devel/hs-cpphs/files/patch-cpphs.cabal deleted file mode 100644 index c73f980262397..0000000000000 --- a/devel/hs-cpphs/files/patch-cpphs.cabal +++ /dev/null @@ -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: diff --git a/devel/hs-hasktags/Makefile b/devel/hs-hasktags/Makefile index b75b4458b957c..d541b72e93f15 100644 --- a/devel/hs-hasktags/Makefile +++ b/devel/hs-hasktags/Makefile @@ -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 \ diff --git a/devel/hs-hasktags/distinfo b/devel/hs-hasktags/distinfo index 2a45860883e2b..e3e52afa6c3f8 100644 --- a/devel/hs-hasktags/distinfo +++ b/devel/hs-hasktags/distinfo @@ -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 diff --git a/devel/hs-hasktags/files/patch-hasktags.cabal b/devel/hs-hasktags/files/patch-hasktags.cabal deleted file mode 100644 index dcf7a7c235bf2..0000000000000 --- a/devel/hs-hasktags/files/patch-hasktags.cabal +++ /dev/null @@ -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 , -- Marc Weber , -- Marco TĂșlio Pimenta Gontijo --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 , -+ Marc Weber , -+ Marco TĂșlio Pimenta Gontijo -+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 diff --git a/www/hs-hjsmin/Makefile b/www/hs-hjsmin/Makefile index 72ca9f2c7ea23..980aaafd69467 100644 --- a/www/hs-hjsmin/Makefile +++ b/www/hs-hjsmin/Makefile @@ -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 \ diff --git a/www/hs-hjsmin/distinfo b/www/hs-hjsmin/distinfo index 1cf398d1a8bbf..2c9c804d166e5 100644 --- a/www/hs-hjsmin/distinfo +++ b/www/hs-hjsmin/distinfo @@ -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 diff --git a/www/hs-hjsmin/files/patch-hjsmin.cabal b/www/hs-hjsmin/files/patch-hjsmin.cabal deleted file mode 100644 index ff696287318c0..0000000000000 --- a/www/hs-hjsmin/files/patch-hjsmin.cabal +++ /dev/null @@ -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 -@@ -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