Skip to content

hslua, lua: Cope with the lua bindings moving from hslua to lua #527

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
Oct 23, 2021

Conversation

expipiplus1
Copy link
Contributor

No description provided.

Copy link
Member

@cdepillabout cdepillabout left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems reasonable, thanks!

@expipiplus1 expipiplus1 merged commit 8aeef87 into NixOS:master Oct 23, 2021
@expipiplus1
Copy link
Contributor Author

hslua builds properly with this.

@expipiplus1 expipiplus1 deleted the ellie-hslua branch October 23, 2021 05:38
@sternenseemann
Copy link
Member

Why are we disabling pkg-config btw? Usually pkg-config is more robust when possible.

@expipiplus1
Copy link
Contributor Author

expipiplus1 commented Oct 23, 2021

good question, I just cargo-culted it from hslua! dates to

commit f1448006ce288f0d43fd7448a829ed3ed7294523
Author: Peter Simons <[email protected]>
Date:   Mon Jul 23 12:46:24 2018 +0200

    hslua: fix post-processing failure caused by use of 'each'

    We have to commit to which BuildInfo attribute we expect the "lua" system
    dependency in. Using "each" no longer works now that replace fails if the
    expected binding does not exist.

diff --git a/src/Distribution/Nixpkgs/Haskell/FromCabal/Flags.hs b/src/Distribution/Nixpkgs/Haskell/FromCabal/Flags.hs
index 1c849dc..9d3814f 100644
--- a/src/Distribution/Nixpkgs/Haskell/FromCabal/Flags.hs
+++ b/src/Distribution/Nixpkgs/Haskell/FromCabal/Flags.hs
@@ -46,7 +46,7 @@ configureCabalFlags' (PackageIdentifier name version)
  | name == "hlibsass" && version >= mkVersion [0,1,5]
                                 = [enable "externalLibsass"]
  | name == "hmatrix"            = [enable "openblas", enable "disable-default-paths"]
- | name == "hslua"              = [enable "system-lua"]
+ | name == "hslua"              = [enable "system-lua", disable "use-pkgconfig"]
  | name == "idris"              = [enable "gmp", enable "ffi", enable "curses", ("execonly", version `withinRange` orLaterVersion (mkVersion [1,1,
1])) ]
  | name == "io-streams"         = [enable "NoInteractiveTests"]
  | name == "liquid-fixpoint"    = [enable "build-external"]
diff --git a/src/Distribution/Nixpkgs/Haskell/FromCabal/PostProcess.hs b/src/Distribution/Nixpkgs/Haskell/FromCabal/PostProcess.hs
index 3dfe534..cb85452 100644
--- a/src/Distribution/Nixpkgs/Haskell/FromCabal/PostProcess.hs
+++ b/src/Distribution/Nixpkgs/Haskell/FromCabal/PostProcess.hs
@@ -117,8 +117,8 @@ hooks =
   , ("holy-project", set doCheck False)         -- attempts to access the network
   , ("hoogle", set testTarget "--test-option=--no-net")
   , ("hsignal < 0.2.7.4", set phaseOverrides "prePatch = \"rm -v Setup.lhs\";") -- https://github.com/amcphail/hsignal/issues/1
-  , ("hslua < 0.9.3", over (libraryDepends . each) (replace (pkg "lua") (pkg "lua5_1")))
-  , ("hslua >= 0.9.3", over (libraryDepends . each) (replace (pkg "lua") (pkg "lua5_3")))
+  , ("hslua < 0.9.3", over (libraryDepends . system) (replace (pkg "lua") (pkg "lua5_1")))
+  , ("hslua >= 0.9.3", over (libraryDepends . system) (replace (pkg "lua") (pkg "lua5_3")))
   , ("hspec-core >= 2.4.4", hspecCoreOverrides)
   , ("http-client", set doCheck False)          -- attempts to access the network
   , ("http-client-openssl >= 0.2.0.1", set doCheck False) -- attempts to access the network

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.

3 participants