From f634f09ae5d0663ff268632af3c7c69d0a11d96d Mon Sep 17 00:00:00 2001 From: Lin Runze Date: Mon, 25 Nov 2024 15:23:10 +0800 Subject: [PATCH] Use %global debug_package %{nil} instead of %undefine _enable_debug_packages to disable debuginfo --- disable-debuginfo.patch | 20 ++++++++++++++++++++ ghc-rpm-macros.spec | 7 ++++++- 2 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 disable-debuginfo.patch diff --git a/disable-debuginfo.patch b/disable-debuginfo.patch new file mode 100644 index 0000000..5619a97 --- /dev/null +++ b/disable-debuginfo.patch @@ -0,0 +1,20 @@ +diff --color -Naur origin/ghc-rpm-macros-2.5.2/macros.ghc ghc-rpm-macros-2.5.2/macros.ghc +--- origin/ghc-rpm-macros-2.5.2/macros.ghc 2024-11-25 15:20:50.898572173 +0800 ++++ ghc-rpm-macros-2.5.2/macros.ghc 2024-11-25 15:21:37.198575587 +0800 +@@ -12,14 +12,14 @@ + # ghc_bin_build: -W: use default ghc (ie ignore ghc_name) + %ghc_bin_build(W)\ + %ghc_fix_doc_perms\ +-%{?!ghc_debuginfo:%undefine _enable_debug_packages}\ ++%{?!ghc_debuginfo:%global debug_package %{nil}}\ + %cabal_configure\ + %cabal build %{?ghc_smp_mflags} %{?cabal_build_options} + + # ghc_lib_build_without_haddock [name] [version] + %ghc_lib_build_without_haddock()\ + %ghc_fix_doc_perms\ +-%{?!ghc_debuginfo:%undefine _enable_debug_packages}\ ++%{?!ghc_debuginfo:%global debug_package %{nil}}\ + %if 0%{?rhel} && 0%{?rhel} < 8\ + licensedirversion=%{?2:-%2}\ + %endif\ diff --git a/ghc-rpm-macros.spec b/ghc-rpm-macros.spec index f1b2257..ad52e8e 100644 --- a/ghc-rpm-macros.spec +++ b/ghc-rpm-macros.spec @@ -1,12 +1,14 @@ Name: ghc-rpm-macros Version: 2.5.2 -Release: 2 +Release: 3 Summary: RPM Macros for building packages for GHC License: GPL-3.0-or-later URL: https://src.fedoraproject.org/rpms/ghc-rpm-macros Source0: %{name}-%{version}.tar.xz # In openEuler, we use help as documents package's suffix instead of doc. Patch1: using-help-as-doc-packages-suffix.patch +# Use debug_package instead of _enable_debug_packages to disable debuginfo. +Patch2: disable-debuginfo.patch BuildRequires: xz Requires: rpm Requires: chrpath @@ -61,6 +63,9 @@ install -p -D -m 0644 Setup.hs %{buildroot}/%{_datadir}/%{name}/Setup.hs %{_rpmmacrodir}/macros.ghc-extra %changelog +* Mon Nov 25 2024 Lin Runze 2.5.2-3 +- Use debug_package instead of _enable_debug_packages to disable debuginfo + * Fri Aug 16 2024 Lin Runze 2.5.2-2 - Revert to 2.5.2 due to 2.6.4 is incompatible with ghc 9.6.3 -- Gitee