Skip to content
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

Add an exception to the LGPL for the generated libraries to allow static linking #195

Merged
merged 1 commit into from Nov 3, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions bindings/genBuildInfo.hs
Expand Up @@ -101,8 +101,8 @@ writeSetup fname info =
where tshow :: Show a => a -> Text
tshow = T.pack . show

writeLicense :: FilePath -> IO ()
writeLicense fname = B.writeFile fname (TE.encodeUtf8 PI.licenseText)
writeLicense :: FilePath -> ProjectInfo -> IO ()
writeLicense fname info = B.writeFile fname (TE.encodeUtf8 $ PI.licenseText (name info))

writeStackYaml :: FilePath -> IO ()
writeStackYaml fname =
Expand Down Expand Up @@ -138,6 +138,6 @@ main = do
info <- readGIRInfo (dir </> "pkg.info")
writeCabal (dir </> T.unpack (name info) <.> "cabal") info
writeSetup (dir </> "Setup.hs") info
writeLicense (dir </> "LICENSE")
writeLicense (dir </> "LICENSE") info
writeStackYaml (dir </> "stack.yaml")
writeReadme (dir </> "README.md") info
2 changes: 1 addition & 1 deletion cmdline/haskell-gi.hs
Expand Up @@ -221,7 +221,7 @@ processMod options ovs extraPaths name = do
putStrLn "\t\t+ Setup.hs"
utf8WriteFile (p "Setup.hs") setupHs
putStrLn "\t\t+ LICENSE"
utf8WriteFile (p "LICENSE") licenseText
utf8WriteFile (p "LICENSE") (licenseText name)

dump :: Options -> Overrides -> Text -> IO ()
dump options ovs name = do
Expand Down
22 changes: 20 additions & 2 deletions lib/Data/GI/CodeGen/ProjectInfo.hs
Expand Up @@ -14,6 +14,7 @@ module Data.GI.CodeGen.ProjectInfo
, standardDeps
) where

import Data.Monoid ((<>))
import Data.Text (Text)
import qualified Data.Text as T (unlines)

Expand Down Expand Up @@ -66,8 +67,25 @@ standardDeps = ["bytestring >= 0.10 && < 1",
category :: Text
category = "Bindings"

licenseText :: Text
licenseText = T.unlines
staticLinkingException :: Text -> Text
staticLinkingException name = T.unlines
["The " <> name <> " library and included works are provided under the terms of the"
CLowcay marked this conversation as resolved.
Show resolved Hide resolved
,"GNU Library General Public License (LGPL) version 2.1 with the following"
,"exception:"
,""
,"Static linking of applications or any other source to the " <> name <> " library"
,"does not constitute a modified or derivative work and does not require"
,"the author(s) to provide source code for said work, to link against the"
,"shared " <> name <> " libraries, or to link their applications against a"
,"user-supplied version of " <> name <> ". If you link applications to a modified"
,"version of " <> name <> ", then the changes to " <> name <> " must be provided under the"
,"terms of the LGPL."
,""
,"----------------------------------------------------------------------------"
,""]

licenseText :: Text -> Text
licenseText name = staticLinkingException name <> T.unlines
[" GNU LESSER GENERAL PUBLIC LICENSE"
," Version 2.1, February 1999"
,""
Expand Down