Skip to content
This repository has been archived by the owner on Feb 27, 2024. It is now read-only.

Commit

Permalink
feat(Meta): add support for setting meta.mainProgram
Browse files Browse the repository at this point in the history
  • Loading branch information
sternenseemann committed May 7, 2022
1 parent 866cc45 commit fb1655a
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/Distribution/Nixpkgs/Meta.hs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
module Distribution.Nixpkgs.Meta
( Meta, nullMeta
, NixpkgsPlatform (..)
, homepage, description, license, platforms, badPlatforms, hydraPlatforms, maintainers, broken
, homepage, description, license, platforms, badPlatforms, hydraPlatforms, mainProgram, maintainers, broken
) where

-- Avoid name clash with Prelude.<> exported by post-SMP versions of base.
Expand Down Expand Up @@ -100,6 +100,7 @@ instance NFData NixpkgsPlatform
-- (Just (Set.singleton (NixpkgsPlatformSingle (Platform X86_64 Linux))))
-- Nothing
-- (Just Set.empty)
-- (Just "example-binary")
-- (Set.fromList ["joe","jane"])
-- True))
-- :}
Expand All @@ -108,6 +109,7 @@ instance NFData NixpkgsPlatform
-- license = "unknown";
-- platforms = [ "x86_64-linux" ];
-- hydraPlatforms = lib.platforms.none;
-- mainProgram = "example-binary";
-- maintainers = [ lib.maintainers.jane lib.maintainers.joe ];
-- broken = true;
data Meta = Meta
Expand Down Expand Up @@ -137,6 +139,9 @@ data Meta = Meta
-- ^ Platforms for which the package should be tested, built and added to the
-- binary cache by Hydra. 'Nothing' prevents the attribute from being rendered.
-- See 'NixpkgsPlatform' on the precise representation of platforms.
, _mainProgram :: Maybe String
-- ^ Filename (as in basename) of the main executable provided by the described
-- package. @Nothing@ if it is a library or no obvious default can be chosen.
, _maintainers :: Set Identifier
-- ^ list of maintainers from @pkgs\/lib\/maintainers.nix@
, _broken :: Bool
Expand All @@ -156,6 +161,7 @@ instance Pretty Meta where
, maybe mempty (renderPlatforms "platforms") _platforms
, maybe mempty (renderPlatforms "badPlatforms") _badPlatforms
, maybe mempty (renderPlatforms "hydraPlatforms") _hydraPlatforms
, maybe mempty (attr "mainProgram" . string) _mainProgram
, listattrDoc "maintainers" mempty $ renderMaintainers _maintainers
, boolattr "broken" _broken _broken
]
Expand Down Expand Up @@ -293,6 +299,7 @@ nullMeta = Meta
, _platforms = error "undefined Meta.platforms"
, _badPlatforms = error "undefined Meta.badPlatforms"
, _hydraPlatforms = error "undefined Meta.hydraPlatforms"
, _mainProgram = error "undefined Meta.mainProgram"
, _maintainers = error "undefined Meta.maintainers"
, _broken = error "undefined Meta.broken"
}

0 comments on commit fb1655a

Please sign in to comment.