diff --git a/Mk/Uses/cabal.mk b/Mk/Uses/cabal.mk index dd7f0d917dbe..2037696ab369 100644 --- a/Mk/Uses/cabal.mk +++ b/Mk/Uses/cabal.mk @@ -1,283 +1,277 @@ # Provide support for building Haskell packages using Cabal. # # Feature: cabal # Usage: USES=cabal or USES=cabal:ARGS # 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: # # USE_CABAL List of Haskell packages required to build a port. # Should be listed along with version, like profunctors-5.3 # Package revision can be specified too with # usual "_" syntax: invariant-0.5.1_1 # When creating a new port, the initial list can be built # using make-use-cabal auxiliary target. # # 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. # # EXECUTABLES List of executable Cabal targets to be built and installed. # default: ${PORTNAME} # # opt_USE_CABAL Variant of USE_CABAL to be used with options framework. # opt_CABAL_FLAGS Variant of CABAL_FLAGS to be used with options framework. # Note that it works a bit differently from CABAL_FLAGS: # it appends "${opt_CABAL_FLAGS}" when the option is enabled # and "-${opt_CABAL_FLAGS}" otherwise. # opt_EXECUTABLES Variant of EXECUTABLES to be used with options framework. # # FOO_DATADIR_VARS Additional environment vars to add to FOO executable's # wrapper script. # # CABAL_PROJECT Sets how to treat existing cabal.project file. Possible # values are "remove" and "append". # # MAINTAINER: haskell@FreeBSD.org .if !defined(_INCLUDE_USES_CABAL_MK) _INCLUDE_USES_CABAL_MK= yes _valid_ARGS= hpack nodefault _cabal_project_valid_VALUES= append remove . for arg in ${cabal_ARGS} . if !${_valid_ARGS:M${arg}} IGNORE= USES=cabal: invalid arguments: ${arg} . endif . endfor . if defined(CABAL_PROJECT) && !${_cabal_project_valid_VALUES:M${CABAL_PROJECT}} IGNORE= CABAL_PROJECT: invalid value: ${CABAL_PROJECT} . endif . if ${ARCH} == i386 && defined(USE_CABAL) && ${USE_CABAL:Mbasement-0.0.14} # Upstream issue: https://github.com/haskell-foundation/foundation/issues/565 BROKEN= basement-0.0.14 package doesn't compile on i386 . endif PKGNAMEPREFIX?= hs- EXECUTABLES?= ${PORTNAME} CABAL_CMD?= cabal CABAL_PORT= devel/hs-cabal-install CABAL_HOME= ${WRKDIR}/cabal-home CABAL_LIBEXEC= libexec/cabal CABAL_EXTRACT_SUFX= .tar.gz CABAL_ARCH= ${ARCH:S/amd64/x86_64/:C/armv.*/arm/:S/powerpc64/ppc64/} CABAL_DEPSDIR= ${WRKSRC}/${CABAL_DEPS_SUBDIR} CABAL_DEPS_SUBDIR= _cabal_deps HPACK_CMD?= hpack _CABAL2TUPLE_CMD= cabal2tuple . if defined(BUILD_DEPENDS) && ${BUILD_DEPENDS:Mghc?*\:lang/ghc?*} CABAL_WITH_ARGS= --with-compiler=${BUILD_DEPENDS:Mghc?*\:lang/ghc?*:C/\:.*//} \ --with-hsc2hs=${LOCALBASE}/bin/hsc2hs-${BUILD_DEPENDS:Mghc?*\:lang/ghc?*:C/\:.*//} . else BUILD_DEPENDS+= ghc:lang/ghc . endif . if !defined(CABAL_BOOTSTRAP) BUILD_DEPENDS+= cabal:${CABAL_PORT} . endif . if ${cabal_ARGS:Mhpack} EXTRACT_DEPENDS+= hpack:devel/hs-hpack . endif # Inherited via lang/ghc we need to depend on libffi.so and libgmp.so (stage q/a) LIB_DEPENDS+= libgmp.so:math/gmp \ libffi.so:devel/libffi DIST_SUBDIR?= cabal . if !defined(USE_GITHUB) && !defined(USE_GITLAB) && !${cabal_ARGS:Mnodefault} _hackage_is_default= yes . else _hackage_is_default= no . endif . if ${_hackage_is_default} == yes MASTER_SITES= https://hackage.haskell.org/package/${PORTNAME}-${PORTVERSION}/ \ http://hackage.haskell.org/package/${PORTNAME}-${PORTVERSION}/ 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 _USES_patch= 701:cabal-post-patch _USES_configure=301:cabal-pre-configure _USES_stage= 751:cabal-post-install-script BUILD_TARGET?= ${EXECUTABLES:S/^/exe:&/} . if defined(USE_LOCALE) LOCALE_ENV= LANG=${USE_LOCALE} LC_ALL=${USE_LOCALE} . endif _use_cabal= ${USE_CABAL:O:u} . for package in ${_use_cabal} _PKG_GROUP= ${package:C/[\.-]//g} _PKG_WITHOUT_REV= ${package:C/_[0-9]+//} _REV= ${package:C/[^_]*//:S/_//} 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 +_CABAL_EXTRACT_ONLY+= ${package:C/_[0-9]+//}/${package:C/_[0-9]+//}${CABAL_EXTRACT_SUFX} . endfor +. if !defined(EXTRACT_ONLY) +EXTRACT_ONLY= ${_DISTFILES:N*\.cabal} +. else +EXTRACT_ONLY+= ${_CABAL_EXTRACT_ONLY} +. endif # Auxiliary targets used during port creation/updating. # Fetches and unpacks package source from Hackage using only PORTNAME and PORTVERSION. cabal-extract: check-cabal ${WRKDIR} @${ECHO_MSG} "===> Fetching Cabal package index into ${CABAL_HOME}/.cabal" ${RM} -rf ${CABAL_HOME}/.cabal ${SETENV} HOME=${CABAL_HOME} ${CABAL_CMD} update . if ${_hackage_is_default} == yes cd ${WRKDIR} && \ ${SETENV} ${LOCALE_ENV} HOME=${CABAL_HOME} ${CABAL_CMD} get ${PORTNAME}-${PORTVERSION} . else ${MV} ${CABAL_HOME} /tmp/${PORTNAME}-cabal-home cd ${.CURDIR} && ${MAKE} extract CABAL_BOOTSTRAP=yes ${RM} -rf ${CABAL_HOME} ${MV} /tmp/${PORTNAME}-cabal-home ${CABAL_HOME} . if ${cabal_ARGS:Mhpack} @${ECHO_MSG} "===> Running ${HPACK_CMD} to generate .cabal file" cd ${WRKSRC} && ${SETENV} HOME=${CABAL_HOME} ${HPACK_CMD} . endif . endif # Calls cabal configure on the Haskell package located in ${WRKSRC} cabal-configure: check-cabal cd ${WRKSRC} && \ ${SETENV} ${LOCALE_ENV} HOME=${CABAL_HOME} ${CABAL_CMD} configure --disable-benchmarks --disable-tests --flags="${CABAL_FLAGS}" ${CABAL_WITH_ARGS} ${CONFIGURE_ARGS} # Calls cabal build on the Haskell package located in ${WRKSRC} cabal-build: check-cabal cd ${WRKSRC} && \ ${SETENV} ${LOCALE_ENV} HOME=${CABAL_HOME} ${CABAL_CMD} build --disable-benchmarks --disable-tests ${CABAL_WITH_ARGS} ${BUILD_ARGS} ${BUILD_TARGET} # Generates USE_CABAL= ... line ready to be pasted into the port based on the plan.json file generated by cabal configure. make-use-cabal: check-cabal2tuple @${ECHO_MSG} "===> Processing plan.json" @${_CABAL2TUPLE_CMD} ${WRKSRC} || (${ECHO_CMD} "Did you forget to make cabal-configure ?" ; exit 1) check-cabal: @if ! type ${CABAL_CMD} > /dev/null 2>&1; then \ ${ECHO_MSG} "===> cabal executable not found, install ${CABAL_PORT} or set CABAL_CMD"; exit 1; \ fi; \ check-cabal2tuple: @if ! type ${_CABAL2TUPLE_CMD} > /dev/null 2>&1; then \ ${ECHO_MSG} "===> cabal2tuple executable not found, install \"ports-mgmt/hs-cabal2tuple\""; exit 1; \ fi . if !defined(CABAL_BOOTSTRAP) # Main targets implementation. cabal-post-extract: # Remove the project file as requested . if "${CABAL_PROJECT}" == "remove" ${RM} ${WRKSRC}/cabal.project . endif # Save the original project file so that users can patch them . if "${CABAL_PROJECT}" == "append" ${MV} ${WRKSRC}/cabal.project ${WRKSRC}/cabal.project.${PORTNAME} . endif @/bin/test ! -f ${WRKSRC}/cabal.project || (echo "cabal.project file is already present in WRKSRC! Set CABAL_PROJECT variable." && false) # Move extracted dependencies into ${CABAL_DEPSDIR} directory ${MKDIR} ${CABAL_DEPSDIR} . for package in ${_use_cabal} # Copy revised .cabal file if present . if ${package:C/[^_]*//:S/_//} != "" cp ${DISTDIR}/${DIST_SUBDIR}/${package:C/_[0-9]+//}/revision/${package:C/[^_]*//:S/_//}.cabal `find ${WRKDIR}/${package:C/_[0-9]+//} -name '*.cabal' -depth 1` . endif # Move the dependency source itself cd ${WRKDIR} && \ mv ${package:C/_[0-9]+//} ${CABAL_DEPSDIR}/ . endfor # Create the cabal-install config ${MKDIR} ${CABAL_HOME}/.cabal ${ECHO_CMD} "jobs: ${MAKE_JOBS_NUMBER}" > ${CABAL_HOME}/.cabal/config cabal-post-patch: # Create our own cabal.project ${ECHO_CMD} "packages: ." > ${WRKSRC}/cabal.project . for package in ${_use_cabal} ${ECHO_CMD} " ${CABAL_DEPS_SUBDIR}/${package:C/_[0-9]+//}" >> ${WRKSRC}/cabal.project . endfor # Append the (possibly patched) original cabal.project, if requested . if "${CABAL_PROJECT}" == "append" ${CAT} ${WRKSRC}/cabal.project.${PORTNAME} >> ${WRKSRC}/cabal.project . endif cabal-pre-configure: # Generate .cabal file with hpack if requested . if ${cabal_ARGS:Mhpack} cd ${WRKSRC} && ${SETENV} HOME=${CABAL_HOME} hpack . endif . if !target(do-build) do-build: cd ${WRKSRC} && \ ${SETENV} ${MAKE_ENV} HOME=${CABAL_HOME} ${CABAL_CMD} new-build --offline --disable-benchmarks --disable-tests ${CABAL_WITH_ARGS} --flags "${CABAL_FLAGS}" ${BUILD_ARGS} ${BUILD_TARGET} . endif . if !target(do-install) do-install: ${MKDIR} ${STAGEDIR}${PREFIX}/${CABAL_LIBEXEC} . for exe in ${EXECUTABLES} ${INSTALL_PROGRAM} \ $$(find ${WRKSRC}/dist-newstyle -name ${exe} -type f -perm +111) \ ${STAGEDIR}${PREFIX}/${CABAL_LIBEXEC}/${exe} ${ECHO_CMD} '#!/bin/sh' > ${STAGEDIR}${PREFIX}/bin/${exe} ${ECHO_CMD} '' >> ${STAGEDIR}${PREFIX}/bin/${exe} ${ECHO_CMD} 'export ${exe:S/-/_/g}_datadir=${DATADIR}' >> ${STAGEDIR}${PREFIX}/bin/${exe} . for dep in ${${exe}_DATADIR_VARS} ${ECHO_CMD} 'export ${dep:S/-/_/g}_datadir=${DATADIR}' >> ${STAGEDIR}${PREFIX}/bin/${exe} . endfor ${ECHO_CMD} '' >> ${STAGEDIR}${PREFIX}/bin/${exe} ${ECHO_CMD} 'exec ${PREFIX}/${CABAL_LIBEXEC}/${exe} "$$@"' >> ${STAGEDIR}${PREFIX}/bin/${exe} ${CHMOD} +x ${STAGEDIR}${PREFIX}/bin/${exe} . endfor . endif . if !defined(SKIP_CABAL_PLIST) cabal-post-install-script: . for exe in ${EXECUTABLES} ${ECHO_CMD} 'bin/${exe}' >> ${TMPPLIST} ${ECHO_CMD} '${CABAL_LIBEXEC}/${exe}' >> ${TMPPLIST} . endfor . endif . endif # !defined(CABAL_BOOTSTRAP) .endif diff --git a/games/hedgewars-server/Makefile b/games/hedgewars-server/Makefile index 86a5a83dc99e..f9c5c608cc9b 100644 --- a/games/hedgewars-server/Makefile +++ b/games/hedgewars-server/Makefile @@ -1,73 +1,72 @@ PORTNAME= hedgewars PORTVERSION= 1.0.0 PORTREVISION= 5 CATEGORIES= games MASTER_SITES= http://www.hedgewars.org/download/releases/ \ http://mirror.amdmi3.ru/distfiles/ PKGNAMESUFFIX= -server DISTNAME= ${PORTNAME}-src-${DISTVERSION} DISTFILES= ${DISTNAME}${EXTRACT_SUFX} -EXTRACT_ONLY= ${DISTNAME}${EXTRACT_SUFX} MAINTAINER= haskell@FreeBSD.org COMMENT= Server part of free Worms-like turn based strategy game LICENSE= GPLv2 BUILD_DEPENDS= ghc-8.10.7:lang/ghc810 USES= cabal:nodefault tar:bzip2 WRKSRC_SUBDIR= gameServer USE_CABAL= ConfigFile-1.1.4 \ MissingH-1.4.3.0 \ SHA-1.6.4.4 \ aeson-1.5.2.0 \ assoc-1.0.1_1 \ attoparsec-0.13.2.4 \ base-compat-0.11.1 \ base-compat-batteries-0.11.1 \ base-orphans-0.8.2 \ bifunctors-5.5.7 \ cabal-doctest-1.0.8_1 \ comonad-5.0.6_1 \ conduit-1.3.2 \ distributive-0.6.2_1 \ dlist-0.8.0.8 \ entropy-0.4.1.6 \ hashable-1.3.0.0_1 \ hslogger-1.3.1.0_1 \ integer-logarithms-1.0.3_2 \ libyaml-0.1.2 \ mono-traversable-1.0.15.1 \ network-2.8.0.1 \ old-locale-1.0.0.7_2 \ old-time-1.1.0.3_2 \ primitive-0.7.0.1 \ random-1.1_1 \ regex-base-0.94.0.0_1 \ regex-compat-0.95.2.0_1 \ regex-posix-0.96.0.0_1 \ regex-tdfa-1.3.1.0_1 \ resourcet-1.2.4.1 \ sandi-0.5_1 \ scientific-0.3.6.2 \ split-0.2.3.4 \ tagged-0.8.6_2 \ th-abstraction-0.3.2.0 \ these-1.1 \ time-compat-1.9.3 \ transformers-compat-0.6.5 \ unliftio-core-0.2.0.1_1 \ unordered-containers-0.2.11.0 \ utf8-string-1.0.1.1_3 \ uuid-types-1.0.3_2 \ vector-0.12.1.2 \ vector-algorithms-0.8.0.3 \ yaml-0.11.4.0 \ zlib-0.6.2.1_1 EXECUTABLES= hedgewars-server checker .include diff --git a/lang/elm/Makefile b/lang/elm/Makefile index f85550b0cf6f..3bc4abd39bac 100644 --- a/lang/elm/Makefile +++ b/lang/elm/Makefile @@ -1,124 +1,122 @@ PORTNAME= elm PORTVERSION= 0.19.1 PORTREVISION= 5 CATEGORIES= lang MASTER_SITES= LOCAL/arrowd/:package_list DISTFILES= elm-compiler-bootstrap-${PORTVERSION}${EXTRACT_SUFX}:package_list -EXTRACT_ONLY= ${DISTNAME_DEFAULT}${EXTRACT_SUFX} \ - elm-compiler-bootstrap-${PORTVERSION}${EXTRACT_SUFX} MAINTAINER= haskell@FreeBSD.org COMMENT= Delightful language for reliable webapps LICENSE= BSD3CLAUSE BUILD_DEPENDS= ghc-8.10.7:lang/ghc810 USES= cabal USE_GITHUB= yes GH_ACCOUNT= elm GH_PROJECT= compiler CONFLICTS_INSTALL= elm # bin/elm (from mail/elm) USE_CABAL= ansi-terminal-0.8.2 \ ansi-wl-pprint-0.6.8.2_2 \ asn1-encoding-0.9.6_1 \ asn1-parse-0.9.5 \ asn1-types-0.3.4 \ async-2.2.2_1 \ attoparsec-0.13.2.4 \ base-orphans-0.8.2 \ basement-0.0.11_2 \ binary-0.8.8.0 \ blaze-builder-0.4.1.0 \ bytestring-builder-0.10.8.2.0 \ call-stack-0.2.0 \ case-insensitive-1.2.1.0 \ cereal-0.5.8.1 \ clock-0.8 \ colour-2.3.5 \ connection-0.3.1_1 \ containers-0.5.11.0_3 \ cookie-0.4.5 \ cryptonite-0.26 \ data-default-class-0.1.2.0 \ digest-0.0.1.2 \ edit-distance-0.2.2.1_1 \ file-embed-0.0.12.0 \ filelock-0.1.1.4 \ hashable-1.3.0.0_1 \ haskeline-0.8.0.0 \ hourglass-0.2.12 \ HTTP-4000.3.14_1 \ http-client-0.6.4.1 \ http-client-tls-0.3.5.3_1 \ http-types-0.12.3 \ HUnit-1.6.0.0 \ integer-logarithms-1.0.3_2 \ io-streams-1.5.1.0_1 \ io-streams-haproxy-1.0.1.0_3 \ language-glsl-0.3.0_1 \ lifted-base-0.2.3.12 \ memory-0.15.0_1 \ mime-types-0.1.0.9 \ monad-control-1.0.2.3 \ network-2.6.3.6 \ network-uri-2.6.3.0 \ old-locale-1.0.0.7_2 \ parsec-3.1.14.0_1 \ pem-0.2.4 \ prettyclass-1.0.0.0 \ primitive-0.7.0.1 \ random-1.1_1 \ raw-strings-qq-1.1 \ readable-0.3.1 \ regex-base-0.94.0.0_1 \ regex-posix-0.96.0.0_1 \ scientific-0.3.6.2 \ SHA-1.6.4.4 \ snap-core-1.0.4.1_1 \ snap-server-1.1.1.2 \ socks-0.6.1 \ streaming-commons-0.2.1.2 \ text-1.2.3.2 \ tls-1.5.4 \ transformers-base-0.4.5.2 \ transformers-compat-0.6.5 \ unix-compat-0.5.2_1 \ unordered-containers-0.2.10.0_1 \ utf8-string-1.0.1.1_3 \ vector-0.12.1.2 \ x509-1.7.5_1 \ x509-store-1.6.7_1 \ x509-system-1.6.6 \ x509-validation-1.6.11 \ zip-archive-0.4.1_1 \ zlib-0.6.2.1_1 \ zlib-bindings-0.1.1.5_2 MAKE_ENV= ELM_HOME=${WRKDIR}/elm-compiler-bootstrap-${PORTVERSION} post-extract: ${RM} ${WRKSRC}/worker/elm.cabal .PHONY: create-bootstrap # Create the bootstrapping elm packages and registry files # This is needed because it builds the reactor app, which is written in elm! create-bootstrap: # Prepare source ${MKDIR} ${WRKDIR} ${TAR} -xzf ${DISTDIR}/${DIST_SUBDIR}/${GH_ACCOUNT}-${GH_PROJECT}-${PORTVERSION}_GH${_GITHUB_REV}${EXTRACT_SUFX} -C ${WRKDIR} ${RM} ${WRKSRC}/worker/elm.cabal # Build with a custom home cd ${WRKSRC} && \ ${SETENV} ${MAKE_ENV} HOME=${CABAL_HOME} cabal new-update && \ ${SETENV} ${MAKE_ENV} HOME=${CABAL_HOME} cabal new-build --disable-benchmarks --disable-tests --flags ${CABAL_FLAGS} ${BUILD_ARGS} ${BUILD_TARGET} # Prepare the bootstrap to /tmp ${TAR} --numeric-owner -czf /tmp/elm-compiler-bootstrap-${PORTVERSION}${EXTRACT_SUFX} -C ${WRKDIR} \ elm-compiler-bootstrap-${PORTVERSION} # Now all that's left is manually placing the bootstrap file in ${DISTDIR}/cabal/ # And running make makesum to update the distfile .include