Skip to content

hackage2nix: don't discard platforms meta attr from postprocessing #560

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 20, 2022

Conversation

sternenseemann
Copy link
Member

Distribution.Nixpkgs.Haskell.FromCabal.PostProcess defines logic that in
some cases prescribes a list of platforms. Currently this gets discarded
in hackage2nix which is a bug introduced in #506.

Before said PR, hackage2nix used a fairly elaborate logic involving Set
subtraction which was necessary because the default value would be
allKnownPlatforms. Instead of that we can now use a very simple logic:
We use whatever is set or not set by PostProcess / cabal2nix in general
and then allow whatever is yielded by that to be overwritten by the
configuration passed to hackage2nix.

Distribution.Nixpkgs.Haskell.FromCabal.PostProcess defines logic that in
some cases prescribes a list of platforms. Currently this gets discarded
in hackage2nix which is a bug introduced in NixOS#506.

Before said PR, hackage2nix used a fairly elaborate logic involving Set
subtraction which was necessary because the default value would be
allKnownPlatforms. Instead of that we can now use a very simple logic:
We use whatever is set or not set by PostProcess / cabal2nix in general
and then allow whatever is yielded by that to be overwritten by the
configuration passed to hackage2nix.
@sternenseemann
Copy link
Member Author

hackage-packages.nix diff:

diff --git a/pkgs/development/haskell-modules/hackage-packages.nix b/pkgs/development/haskell-modules/hackage-packages.nix
index 58f770c82c1..b820fbac18d 100644
--- a/pkgs/development/haskell-modules/hackage-packages.nix
+++ b/pkgs/development/haskell-modules/hackage-packages.nix
@@ -21936,6 +21936,7 @@ self: {
        librarySystemDepends = [ libossp_uuid ole32 ];
        description = "Support for manipulating shortcuts (.lnk files) on Windows";
        license = lib.licenses.bsd3;
+       platforms = lib.platforms.windows;
      }) {inherit (pkgs) libossp_uuid; ole32 = null;};
 
   "Wired" = callPackage
@@ -27794,6 +27795,7 @@ self: {
        libraryPkgconfigDepends = [ alsa-lib ];
        description = "Binding to the ALSA Library API (Exceptions)";
        license = lib.licenses.bsd3;
+       platforms = lib.platforms.linux;
      }) {inherit (pkgs) alsa-lib;};
 
   "alsa-gui" = callPackage
@@ -43535,6 +43537,7 @@ self: {
        librarySystemDepends = [ lxc ];
        description = "Direct Haskell bindings to LXC (Linux containers) C API";
        license = lib.licenses.bsd3;
+       platforms = lib.platforms.linux;
      }) {inherit (pkgs) lxc;};
 
   "bindings-mmap" = callPackage
@@ -91972,6 +91975,7 @@ self: {
        ];
        description = "EventStore TCP Client";
        license = lib.licenses.bsd3;
+       platforms = lib.platforms.x86_64;
        hydraPlatforms = lib.platforms.none;
        broken = true;
      }) {};
@@ -134740,6 +134744,7 @@ self: {
        libraryToolDepends = [ CoreServices ];
        description = "File/folder watching for OS X";
        license = lib.licenses.bsd3;
+       platforms = lib.platforms.darwin;
      }) {inherit (pkgs.darwin.apple_sdk.frameworks) Cocoa; 
          inherit (pkgs.darwin.apple_sdk.frameworks) CoreServices;};
 
@@ -180041,6 +180046,7 @@ self: {
        doHaddock = false;
        description = "liblzma C library and headers for use by LZMA bindings";
        license = lib.licenses.publicDomain;
+       platforms = lib.platforms.windows;
      }) {};
 
   "lzma-conduit" = callPackage
@@ -246099,6 +246105,7 @@ self: {
        ];
        description = "A software defined radio library";
        license = lib.licenses.bsd3;
+       platforms = lib.platforms.x86_64;
        hydraPlatforms = lib.platforms.none;
        broken = true;
      }) {};

@sternenseemann sternenseemann merged commit 9d18320 into NixOS:master Jun 20, 2022
@sternenseemann sternenseemann deleted the hackage2nix-postprocess branch June 20, 2022 10:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants