diff --git a/ghc-rpm-macros.spec b/ghc-rpm-macros.spec index 1115f01..ab9c591 100644 --- a/ghc-rpm-macros.spec +++ b/ghc-rpm-macros.spec @@ -10,7 +10,7 @@ #%%global without_hscolour 1 Name: ghc-rpm-macros -Version: 2.1.0 +Version: 2.2.0 Release: 1%{?dist} Summary: RPM macros for building Haskell packages for GHC @@ -190,6 +190,10 @@ EOF %changelog +* Mon Jun 7 2021 Jens Petersen - 2.2.0-1 +- ghc_fix_rpaths macro deletes all RPATHs, replacing ghc_fix_rpath(), for + https://fedoraproject.org/wiki/Changes/Broken_RPATH_will_fail_rpmbuild + * Wed Mar 24 2021 Jens Petersen - 2.1.0-1 - add ghc-filesystem subpackage to own /usr/share/doc/ghc/{,html/{,libraries/}} (#1926757) diff --git a/macros.ghc b/macros.ghc index bd8c190..8ecc585 100644 --- a/macros.ghc +++ b/macros.ghc @@ -167,7 +167,7 @@ fi\ %{!?_fileattrsdir:%global _use_internal_dependency_generator 0}\ %{!?_fileattrsdir:%global __find_requires %{_rpmconfigdir}/ghc-deps.sh %{buildroot}%{ghclibdir}}\ %cabal_install\ -%{?ghc_subpackaging:%ghc_fix_rpath %{subpkgs}}\ +%ghc_fix_rpaths\ %{nil} # ghc_lib_install [name] [version] @@ -178,47 +178,22 @@ fi\ %cabal_install\ %cabal_pkg_conf %{?1} %{?2}\ %ghc_gen_filelists %{?1} %{?2}\ -%{?ghc_subpackaging:%ghc_fix_rpath %{subpkgs}}\ +%ghc_fix_rpaths\ %{nil} -# ghc_fix_rpath lib-ver ... -%ghc_fix_rpath()\ -%if %{undefined disable_ghc_fix_rpath}\ +# ghc_fix_rpaths +%ghc_fix_rpaths\ +%if %{undefined disable_ghc_fix_rpaths}\ +echo "running ghc_fix_rpaths:"\ if ! type chrpath > /dev/null; then exit 1; fi\ -echo "ghc_fix_rpath %*"\ for i in $(find %{buildroot} -type f -executable -exec sh -c "file {} | grep -q 'dynamically linked'" \\; -print); do\ -for lib in %*; do\ if [ -x "$i" ]; then\ - rpath=$(chrpath $i | sed -e "s@^$i: R.*PATH=@@")\ - case $rpath in\ - *$PWD/$lib/dist/build*)\ - case %{ghc_version} in\ - 7.10.*)\ - pkgid=$(cd %{buildroot}%{ghclibdir}/package.conf.d; ls ${lib}* | sed -e "s/.conf$//")\ - syspath=$(%{_rpmconfigdir}/ghc-pkg-wrapper %{buildroot}%{ghclibdir} --global --package-db=%{buildroot}%{ghclibdir}/package.conf.d field $pkgid library-dirs) ;;\ - 8.0)\ - pkgid=$(cd %{buildroot}%{ghclibdir}; echo ${lib}*)\ - syspath=$(%{_rpmconfigdir}/ghc-pkg-wrapper %{buildroot}%{ghclibdir} --global --package-db=%{buildroot}%{ghclibdir}/package.conf.d field $lib library-dirs | grep $pkgid) ;;\ - *)\ - syspath="" ;;\ - esac\ - newrpath=$(echo $rpath | sed -e "s@$PWD/$lib/dist/build@${syspath}@g" -e "s/::/:/" -e "s/^://" -e "s/:$//")\ - if [ "$newrpath" = "%{_libdir}" ]; then\ - chrpath -d $i\ - else\ - chrpath -r $newrpath $i\ - fi\ - ;;\ - %{_libdir})\ - chrpath -d $i\ - ;;\ - esac\ + chrpath -d $i\ else\ echo "%%ghc_fix_rpath: no $i executable"\ exit 1\ fi\ done\ -done\ %endif # deprecated for f31