juhp / cabal-rpm

Haskell Cabal RPM packaging tool
https://hackage.haskell.org/package/cabal-rpm
GNU General Public License v3.0
25 stars 8 forks source link

Error building haskell-gi #51

Closed clumens closed 7 years ago

clumens commented 7 years ago

The build process fails on this line of the generated spec file, because the file does not exist:

mv %{buildroot}%{_ghcdocdir}/{,ghc-}%{name}

Simply removing this line makes it succeed. It's easy to see where it gets emitted, but I don't see how to fix it in such a way as to not break other things. Otherwise I'd attach a PR. Sorry.

I'll add the build log, or at least the part at the end where if fails.

clumens commented 7 years ago

build-log.txt

dashea commented 7 years ago

The line expands to mv <docdir>/%{name} <docdir>/ghc-%{name}, which ends up trying to move something like %{_ghcdocdir}/ghc-hspec-discover to %{_ghcdocdir}/ghc-ghc-hspec-discover.

Is the conditional on this line (https://github.com/juhp/cabal-rpm/blob/master/src/Commands/Spec.hs#L357), selfdep, supposed to be something else? The best I can figure is that the goal is to add the ghc- prefix back on to the docdir for packages that don't have ghc- in the name, but I'm not sure why that would be wanted.

Somewhat related, would it be possible to pass distinct arguments to mv instead of using brace expansion? That would be a lot more readable.

juhp commented 7 years ago

[thought I had already posted a comment, but apparently not]

Thanks for the report. Yes I think the generated path is incorrect and I need to use a new rpm macro to address that.

juhp commented 7 years ago

I pushed a small partial workaround for this.

It doesn't fix the path but avoids the mv for ghc-%{pkg_name}.spec packages: it should only happen for %{pkg_name}.spec packages.

juhp commented 7 years ago

@dashea I hope that indirectly answers your question: this was to move the license file from hspec-discover to ghc-hspec-discover. (But by default cabal-rpm does not make hspec-discover the base package, unless you pass --binary.)

juhp commented 7 years ago

This should be fixed fully now in git (at least for Fedora Rawhide where I added %_ghclicensedir).

juhp commented 7 years ago

Should be fixed in cabal-rpm-0.11.2