From 7021e94a4a367abedc9b0c42cd318154d323fccc Mon Sep 17 00:00:00 2001 From: Jens Petersen Date: Mon, 2 Dec 2024 22:58:30 +0800 Subject: [PATCH] Import rhbz#2271914 --- .gitignore | 1 + sources | 1 + stack-Setup-Platforms.patch | 11 + stack-disabled-global-warnings.patch | 49 +++++ stack-symlink-distro-ghc | 51 +++++ stack.spec | 298 +++++++++++++++++++++++++++ 6 files changed, 411 insertions(+) create mode 100644 .gitignore create mode 100644 sources create mode 100644 stack-Setup-Platforms.patch create mode 100644 stack-disabled-global-warnings.patch create mode 100755 stack-symlink-distro-ghc create mode 100644 stack.spec diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..11798ae --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/stack-2.15.7.tar.gz diff --git a/sources b/sources new file mode 100644 index 0000000..8851b21 --- /dev/null +++ b/sources @@ -0,0 +1 @@ +SHA512 (stack-2.15.7.tar.gz) = 0a0e2fca52b17e3fbc5091da9fc7dd639a50c37519ae8ea27954536381d63bda4e1f20ca047e061dc898cac35a0551c996ced6f8d87184fe8e5be03e03d3cb82 diff --git a/stack-Setup-Platforms.patch b/stack-Setup-Platforms.patch new file mode 100644 index 0000000..b557d44 --- /dev/null +++ b/stack-Setup-Platforms.patch @@ -0,0 +1,11 @@ +--- stack-2.15.7/src/Stack/Setup.hs~ 2024-05-12 22:50:14.000000000 +0800 ++++ stack-2.15.7/src/Stack/Setup.hs 2024-08-02 01:11:32.252316054 +0800 +@@ -2138,6 +2138,8 @@ + Platform Sparc Cabal.Linux -> pure "linux-sparc" + Platform AArch64 Cabal.OSX -> pure "macosx-aarch64" + Platform AArch64 Cabal.FreeBSD -> pure "freebsd-aarch64" ++ Platform PPC64 Cabal.Linux -> pure "linux-ppc64" ++ Platform S390X Cabal.Linux -> pure "linux-s390x" + Platform arch os -> + prettyThrowM $ UnsupportedSetupCombo os arch tool toolDir programsDir + diff --git a/stack-disabled-global-warnings.patch b/stack-disabled-global-warnings.patch new file mode 100644 index 0000000..fd4525d --- /dev/null +++ b/stack-disabled-global-warnings.patch @@ -0,0 +1,49 @@ +diff -up stack-2.15.7/src/Stack/Config.hs~ stack-2.15.7/src/Stack/Config.hs +--- stack-2.15.7/src/Stack/Config.hs~ 2024-05-12 22:50:13.000000000 +0800 ++++ stack-2.15.7/src/Stack/Config.hs 2024-08-02 01:21:01.138918479 +0800 +@@ -435,9 +435,9 @@ configFromConfigMonoid + fromFirst Constants.hackageBaseUrl configMonoid.hackageBaseUrl + hideSourcePaths = fromFirstTrue configMonoid.hideSourcePaths + recommendUpgrade = fromFirstTrue configMonoid.recommendUpgrade +- notifyIfNixOnPath = fromFirstTrue configMonoid.notifyIfNixOnPath +- notifyIfGhcUntested = fromFirstTrue configMonoid.notifyIfGhcUntested +- notifyIfCabalUntested = fromFirstTrue configMonoid.notifyIfCabalUntested ++ notifyIfNixOnPath = fromFirstFalse configMonoid.notifyIfNixOnPath ++ notifyIfGhcUntested = fromFirstFalse configMonoid.notifyIfGhcUntested ++ notifyIfCabalUntested = fromFirstFalse configMonoid.notifyIfCabalUntested + notifyIfArchUnknown = fromFirstTrue configMonoid.notifyIfArchUnknown + noRunCompile = fromFirstFalse configMonoid.noRunCompile + allowDifferentUser <- +diff -up stack-2.15.7/src/Stack/Types/ConfigMonoid.hs~ stack-2.15.7/src/Stack/Types/ConfigMonoid.hs +--- stack-2.15.7/src/Stack/Types/ConfigMonoid.hs~ 2024-05-12 22:50:14.000000000 +0800 ++++ stack-2.15.7/src/Stack/Types/ConfigMonoid.hs 2024-08-02 01:20:22.724711778 +0800 +@@ -170,11 +170,11 @@ data ConfigMonoid = ConfigMonoid + -- ^ See 'configHideSourcePaths' + , recommendUpgrade :: !FirstTrue + -- ^ See 'configRecommendUpgrade' +- , notifyIfNixOnPath :: !FirstTrue ++ , notifyIfNixOnPath :: !FirstFalse + -- ^ See 'configNotifyIfNixOnPath' +- , notifyIfGhcUntested :: !FirstTrue ++ , notifyIfGhcUntested :: !FirstFalse + -- ^ See 'configNotifyIfGhcUntested' +- , notifyIfCabalUntested :: !FirstTrue ++ , notifyIfCabalUntested :: !FirstFalse + -- ^ See 'configNotifyIfCabalUntested' + , notifyIfArchUnknown :: !FirstTrue + -- ^ See 'configNotifyIfArchUnknown' +@@ -317,11 +317,11 @@ parseConfigMonoidObject rootDir obj = do + let styles = fromMaybe mempty $ configMonoidStylesUS <|> configMonoidStylesGB + hideSourcePaths <- FirstTrue <$> obj ..:? configMonoidHideSourcePathsName + recommendUpgrade <- FirstTrue <$> obj ..:? configMonoidRecommendUpgradeName +- notifyIfNixOnPath <- FirstTrue <$> obj ..:? configMonoidNotifyIfNixOnPathName ++ notifyIfNixOnPath <- FirstFalse <$> obj ..:? configMonoidNotifyIfNixOnPathName + notifyIfGhcUntested <- +- FirstTrue <$> obj ..:? configMonoidNotifyIfGhcUntestedName ++ FirstFalse <$> obj ..:? configMonoidNotifyIfGhcUntestedName + notifyIfCabalUntested <- +- FirstTrue <$> obj ..:? configMonoidNotifyIfCabalUntestedName ++ FirstFalse <$> obj ..:? configMonoidNotifyIfCabalUntestedName + notifyIfArchUnknown <- + FirstTrue <$> obj ..:? configMonoidNotifyIfArchUnknownName + casaOpts <- jsonSubWarnings (obj ..:? configMonoidCasaOptsName ..!= mempty) diff --git a/stack-symlink-distro-ghc b/stack-symlink-distro-ghc new file mode 100755 index 0000000..894dba8 --- /dev/null +++ b/stack-symlink-distro-ghc @@ -0,0 +1,51 @@ +#!/bin/sh + +VERSION=$1 + +if [ -z "$VERSION" ]; then + echo "Usage: $0 X.Y.Z" + exit 1 +fi + +#set +x + +#FIXME lib +LIBDIR=/usr/lib64/ghc-$VERSION +if [ ! -d "$LIBDIR" ]; then + echo "$0: $LIBDIR does not exist: please install ghcX.Y first" + exit 1 +fi + +ARCH=$(arch) + +# stack/Cabal doesn't know ppc64le +if [ "$ARCH" = "ppc64le" ]; then + ARCH=ppc64 +fi + +STACK_PROGRAMS=$HOME/.stack/programs/$ARCH-linux + +STACK_GHCDIR=${STACK_PROGRAMS}/ghc-tinfo6-$VERSION + +if [ -e "$STACK_GHCDIR" ]; then + echo "$0: $STACK_GHCDIR exists: to replace, please remove first" + exit 0 +fi + +mkdir -p $STACK_GHCDIR/bin + +for i in ghc ghc-pkg ghci hp2ps hpc hsc2hs runghc runhaskell; do + if [ -x /usr/bin/$i-$VERSION ]; then + ln -s /usr/bin/$i-$VERSION $STACK_GHCDIR/bin/$i + elif [ -x /usr/bin/$i-ghc-$VERSION ]; then + ln -s /usr/bin/$i-ghc-$VERSION $STACK_GHCDIR/bin/$i + else + ln -s /usr/bin/$i $STACK_GHCDIR/bin/$i + fi +done + +ln -s /usr/bin/haddock-ghc-$VERSION $STACK_GHCDIR/bin/haddock + +if [ ! -f "${STACK_GHCDIR}.installed" ]; then + echo "installed" > $STACK_GHCDIR.installed +fi diff --git a/stack.spec b/stack.spec new file mode 100644 index 0000000..e518f72 --- /dev/null +++ b/stack.spec @@ -0,0 +1,298 @@ +# generated by cabal-rpm-2.2.2 +# https://docs.fedoraproject.org/en-US/packaging-guidelines/Haskell/ + +%global pkg_name stack +%global pkgver %{pkg_name}-%{version} +%{?haskell_setup} + +%bcond tests 0 + +Name: %{pkg_name} +Version: 2.15.7 +Release: 2%{?dist} +Summary: Haskell stable package build tool + +License: BSD-3-Clause +Url: https://haskellstack.org +# Begin cabal-rpm sources: +Source0: https://hackage.haskell.org/package/%{pkgver}/%{pkgver}.tar.gz +# End cabal-rpm sources +Source1: stack-symlink-distro-ghc + +Patch0: stack-disabled-global-warnings.patch +# https://github.com/commercialhaskell/stack/issues/6379 +Patch1: stack-Setup-Platforms.patch + +# Begin cabal-rpm deps: +BuildRequires: ghc-rpm-macros +BuildRequires: ghc-Cabal-devel +BuildRequires: ghc-aeson-devel +BuildRequires: ghc-aeson-warning-parser-devel +BuildRequires: ghc-ansi-terminal-devel +BuildRequires: ghc-array-devel +BuildRequires: ghc-async-devel +BuildRequires: ghc-attoparsec-devel +BuildRequires: ghc-base-devel +BuildRequires: ghc-base64-bytestring-devel +BuildRequires: ghc-bytestring-devel +BuildRequires: ghc-casa-client-devel +BuildRequires: ghc-companion-devel +BuildRequires: ghc-conduit-devel +BuildRequires: ghc-conduit-extra-devel +BuildRequires: ghc-containers-devel +BuildRequires: ghc-crypton-devel +BuildRequires: ghc-directory-devel +BuildRequires: ghc-echo-devel +BuildRequires: ghc-exceptions-devel +BuildRequires: ghc-extra-devel +BuildRequires: ghc-file-embed-devel +BuildRequires: ghc-filelock-devel +BuildRequires: ghc-filepath-devel +BuildRequires: ghc-fsnotify-devel +BuildRequires: ghc-generic-deriving-devel +BuildRequires: ghc-ghc-boot-devel +BuildRequires: ghc-githash-devel +BuildRequires: ghc-hi-file-parser-devel +BuildRequires: ghc-hpack-devel +BuildRequires: ghc-hpc-devel +BuildRequires: ghc-http-client-devel +BuildRequires: ghc-http-client-tls-devel +BuildRequires: ghc-http-conduit-devel +BuildRequires: ghc-http-download-devel +BuildRequires: ghc-http-types-devel +BuildRequires: ghc-memory-devel +BuildRequires: ghc-microlens-devel +BuildRequires: ghc-mtl-devel +BuildRequires: ghc-mustache-devel +BuildRequires: ghc-neat-interpolation-devel +BuildRequires: ghc-open-browser-devel +BuildRequires: ghc-optparse-applicative-devel +BuildRequires: ghc-optparse-simple-devel +BuildRequires: ghc-pantry-devel +BuildRequires: ghc-path-devel +BuildRequires: ghc-path-io-devel +BuildRequires: ghc-persistent-devel +BuildRequires: ghc-persistent-sqlite-devel +BuildRequires: ghc-pretty-devel +BuildRequires: ghc-process-devel +BuildRequires: ghc-project-template-devel +BuildRequires: ghc-random-devel +BuildRequires: ghc-rio-devel +BuildRequires: ghc-rio-prettyprint-devel +BuildRequires: ghc-split-devel +BuildRequires: ghc-stm-devel +BuildRequires: ghc-tar-devel +BuildRequires: ghc-template-haskell-devel +BuildRequires: ghc-text-devel +BuildRequires: ghc-time-devel +BuildRequires: ghc-transformers-devel +BuildRequires: ghc-unix-devel +BuildRequires: ghc-unix-compat-devel +BuildRequires: ghc-unordered-containers-devel +BuildRequires: ghc-vector-devel +BuildRequires: ghc-yaml-devel +BuildRequires: ghc-zlib-devel +%if %{with ghc_prof} +BuildRequires: ghc-Cabal-prof +BuildRequires: ghc-aeson-prof +BuildRequires: ghc-aeson-warning-parser-prof +BuildRequires: ghc-ansi-terminal-prof +BuildRequires: ghc-array-prof +BuildRequires: ghc-async-prof +BuildRequires: ghc-attoparsec-prof +BuildRequires: ghc-base-prof +BuildRequires: ghc-base64-bytestring-prof +BuildRequires: ghc-bytestring-prof +BuildRequires: ghc-casa-client-prof +BuildRequires: ghc-companion-prof +BuildRequires: ghc-conduit-prof +BuildRequires: ghc-conduit-extra-prof +BuildRequires: ghc-containers-prof +BuildRequires: ghc-crypton-prof +BuildRequires: ghc-directory-prof +BuildRequires: ghc-echo-prof +BuildRequires: ghc-exceptions-prof +BuildRequires: ghc-extra-prof +BuildRequires: ghc-file-embed-prof +BuildRequires: ghc-filelock-prof +BuildRequires: ghc-filepath-prof +BuildRequires: ghc-fsnotify-prof +BuildRequires: ghc-generic-deriving-prof +BuildRequires: ghc-ghc-boot-prof +BuildRequires: ghc-githash-prof +BuildRequires: ghc-hi-file-parser-prof +BuildRequires: ghc-hpack-prof +BuildRequires: ghc-hpc-prof +BuildRequires: ghc-http-client-prof +BuildRequires: ghc-http-client-tls-prof +BuildRequires: ghc-http-conduit-prof +BuildRequires: ghc-http-download-prof +BuildRequires: ghc-http-types-prof +BuildRequires: ghc-memory-prof +BuildRequires: ghc-microlens-prof +BuildRequires: ghc-mtl-prof +BuildRequires: ghc-mustache-prof +BuildRequires: ghc-neat-interpolation-prof +BuildRequires: ghc-open-browser-prof +BuildRequires: ghc-optparse-applicative-prof +BuildRequires: ghc-optparse-simple-prof +BuildRequires: ghc-pantry-prof +BuildRequires: ghc-path-prof +BuildRequires: ghc-path-io-prof +BuildRequires: ghc-persistent-prof +BuildRequires: ghc-persistent-sqlite-prof +BuildRequires: ghc-pretty-prof +BuildRequires: ghc-process-prof +BuildRequires: ghc-project-template-prof +BuildRequires: ghc-random-prof +BuildRequires: ghc-rio-prof +BuildRequires: ghc-rio-prettyprint-prof +BuildRequires: ghc-split-prof +BuildRequires: ghc-stm-prof +BuildRequires: ghc-tar-prof +BuildRequires: ghc-template-haskell-prof +BuildRequires: ghc-text-prof +BuildRequires: ghc-time-prof +BuildRequires: ghc-transformers-prof +BuildRequires: ghc-unix-prof +BuildRequires: ghc-unix-compat-prof +BuildRequires: ghc-unordered-containers-prof +BuildRequires: ghc-vector-prof +BuildRequires: ghc-yaml-prof +BuildRequires: ghc-zlib-prof +%endif +%if %{with tests} +BuildRequires: ghc-QuickCheck-devel +BuildRequires: ghc-hspec-devel +BuildRequires: ghc-hspec-discover-devel +BuildRequires: ghc-raw-strings-qq-devel +%endif +BuildRequires: help2man +# End cabal-rpm deps +Requires: gcc +Requires: gmp-devel +Recommends: zlib-devel + +%description +Stack is a cross-platform program for developing Haskell projects. +It is intended for Haskellers both new and experienced. + + +%package -n ghc-%{name} +Summary: Haskell %{name} library + +%description -n ghc-%{name} +This package provides the Haskell %{name} shared library. + + +%package -n ghc-%{name}-devel +Summary: Haskell %{name} library development files +Provides: ghc-%{name}-static = %{version}-%{release} +Provides: ghc-%{name}-static%{?_isa} = %{version}-%{release} +%if %{defined ghc_version} +Requires: ghc-compiler = %{ghc_version} +%endif +Requires: ghc-%{name}%{?_isa} = %{version}-%{release} + +%description -n ghc-%{name}-devel +This package provides the Haskell %{name} library development files. + + +%if %{with haddock} +%package -n ghc-%{name}-doc +Summary: Haskell %{name} library documentation +BuildArch: noarch +Requires: ghc-filesystem + +%description -n ghc-%{name}-doc +This package provides the Haskell %{name} library documentation. +%endif + + +%if %{with ghc_prof} +%package -n ghc-%{name}-prof +Summary: Haskell %{name} profiling library +Requires: ghc-%{name}-devel%{?_isa} = %{version}-%{release} +Supplements: (ghc-%{name}-devel and ghc-prof) + +%description -n ghc-%{name}-prof +This package provides the Haskell %{name} profiling library. +%endif + + +%prep +# Begin cabal-rpm setup: +%setup -q +%autopatch -p1 +# End cabal-rpm setup + + +%build +# Begin cabal-rpm build: +%ghc_lib_build +# End cabal-rpm build + + +%install +# Begin cabal-rpm install +%ghc_lib_install + +set noclobber +mkdir -p %{buildroot}%{bash_completions_dir} +%{buildroot}%{_bindir}/%{name} --bash-completion-script %{name} | sed s/filenames/default/ > %{buildroot}%{bash_completions_dir}/%{name} + +mkdir -p %{buildroot}%{_mandir}/man1/ +help2man --no-info %{buildroot}%{_bindir}/%{name} > %{buildroot}%{_mandir}/man1/%{name}.1 +# End cabal-rpm install + +install -p %{SOURCE1} %{buildroot}%{_bindir}/stack-symlink-distro-ghc + + +%check +%if %{with tests} +PATH=%{buildroot}%{_bindir}:$PATH +%cabal_test +%endif + + +%files +# Begin cabal-rpm files: +%license LICENSE +%doc CONTRIBUTING.md ChangeLog.md README.md +%{_bindir}/%{name} +%{bash_completions_dir}/%{name} +%{_mandir}/man1/%{name}.1* +# End cabal-rpm files +%{_bindir}/stack-symlink-distro-ghc + + +%files -n ghc-%{name} -f ghc-%{name}.files +# Begin cabal-rpm files: +%license LICENSE +# End cabal-rpm files + + +%files -n ghc-%{name}-devel -f ghc-%{name}-devel.files +%doc CONTRIBUTING.md ChangeLog.md README.md + + +%if %{with haddock} +%files -n ghc-%{name}-doc -f ghc-%{name}-doc.files +%license LICENSE +%endif + + +%if %{with ghc_prof} +%files -n ghc-%{name}-prof -f ghc-%{name}-prof.files +%endif + + +%changelog +* Tue Nov 26 2024 Jens Petersen - 2.15.7-2 +- disable tests since needs network access (#2271914) + +* Wed Oct 30 2024 Jens Petersen - 2.15.7-1 +- update to 2.15.7 + +* Wed Mar 27 2024 Jens Petersen - 2.9.3.1-1 +- spec file generated by cabal-rpm-2.2.0