NixOS / cabal2nix

Generate Nix build instructions from a Cabal file
https://haskell4nix.readthedocs.io
Other
362 stars 156 forks source link

Add libNixName for graphene-gobject #609

Closed cdepillabout closed 1 year ago

cdepillabout commented 1 year ago

This is part of the fix for https://github.com/NixOS/nixpkgs/pull/262103

cdepillabout commented 1 year ago

Without this fix, hackage2nix generates the derivation for gi-graphene as:

"gi-graphene" = callPackage
  ({ mkDerivation, base, bytestring, Cabal, containers, gi-glib
   , gi-gobject, graphene-gobject, haskell-gi, haskell-gi-base
   , haskell-gi-overloading, text, transformers
   }:
   mkDerivation {
     pname = "gi-graphene";
     version = "1.0.7";
     sha256 = "1slpywv49m815qk78cz5lfpwym2dvi6qrmij4j61sb3xk034k33s";
     setupHaskellDepends = [ base Cabal gi-glib gi-gobject haskell-gi ];
     libraryHaskellDepends = [
       base bytestring containers gi-glib gi-gobject haskell-gi
       haskell-gi-base haskell-gi-overloading text transformers
     ];
     libraryPkgconfigDepends = [ graphene-gobject ];
     description = "Graphene bindings";
     license = lib.licenses.lgpl21Only;
     hydraPlatforms = lib.platforms.none;
     broken = true;
   }) {graphene-gobject = null;};

With this PR, gi-graphene is generated as:

"gi-graphene" = callPackage
  ({ mkDerivation, base, bytestring, Cabal, containers, gi-glib
   , gi-gobject, graphene, haskell-gi, haskell-gi-base
   , haskell-gi-overloading, text, transformers
   }:
   mkDerivation {
     pname = "gi-graphene";
     version = "1.0.7";
     sha256 = "1slpywv49m815qk78cz5lfpwym2dvi6qrmij4j61sb3xk034k33s";
     setupHaskellDepends = [ base Cabal gi-glib gi-gobject haskell-gi ];
     libraryHaskellDepends = [
       base bytestring containers gi-glib gi-gobject haskell-gi
       haskell-gi-base haskell-gi-overloading text transformers
     ];
     libraryPkgconfigDepends = [ graphene ];
     description = "Graphene bindings";
     license = lib.licenses.lgpl21Only;
     hydraPlatforms = lib.platforms.none;
     broken = true;
   }) {inherit (pkgs) graphene;};

You can see that the graphene-gobject pkgconfig depend is now pulled correctly from the Nixpkgs top-level graphene package.

cdepillabout commented 1 year ago

CI is failing on ghc-9.4, but it doesn't look related to this PR.

maralorn commented 1 year ago

thx!