nvfetcher-0.7.0.0: Generate nix sources expr for the latest version of packages
Copyright(c) 2021-2025 berberman
LicenseMIT
Maintainerberberman <[email protected]>
Stabilityexperimental
Portabilityportable
Safe HaskellNone
LanguageHaskell2010

NvFetcher.ExtractSrc

Description

This module provides function that extracts files contents from package sources. Because we use nix-instantiate to build drv, so nixpkgs (NIX_PATH) is required.

Synopsis

Types

data ExtractSrcQ Source #

Extract file contents from package source Matched files will be copied to build dir. All matched directories are ignored. Only files will be processed.

Instances

Instances details
Generic ExtractSrcQ Source # 
Instance details

Defined in NvFetcher.Types

Associated Types

type Rep ExtractSrcQ 
Instance details

Defined in NvFetcher.Types

type Rep ExtractSrcQ = D1 ('MetaData "ExtractSrcQ" "NvFetcher.Types" "nvfetcher-0.7.0.0-AhFFh7reJc9KmNyxRtjlmD" 'False) (C1 ('MetaCons "ExtractSrcQ" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (NixFetcher 'Fetched)) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (NonEmpty Glob))))
Show ExtractSrcQ Source # 
Instance details

Defined in NvFetcher.Types

Binary ExtractSrcQ Source # 
Instance details

Defined in NvFetcher.Types

NFData ExtractSrcQ Source # 
Instance details

Defined in NvFetcher.Types

Methods

rnf :: ExtractSrcQ -> () #

Eq ExtractSrcQ Source # 
Instance details

Defined in NvFetcher.Types

Ord ExtractSrcQ Source # 
Instance details

Defined in NvFetcher.Types

Hashable ExtractSrcQ Source # 
Instance details

Defined in NvFetcher.Types

Pretty ExtractSrcQ Source # 
Instance details

Defined in NvFetcher.Types

Methods

pretty :: ExtractSrcQ -> Doc ann #

prettyList :: [ExtractSrcQ] -> Doc ann #

type Rep ExtractSrcQ Source # 
Instance details

Defined in NvFetcher.Types

type Rep ExtractSrcQ = D1 ('MetaData "ExtractSrcQ" "NvFetcher.Types" "nvfetcher-0.7.0.0-AhFFh7reJc9KmNyxRtjlmD" 'False) (C1 ('MetaCons "ExtractSrcQ" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (NixFetcher 'Fetched)) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (NonEmpty Glob))))
type RuleResult ExtractSrcQ Source #

Rule result for extracting source files. Text is the file contents, only available if the second element of the tuple in ExtractSrcQ is True. The key of the result map is the file path relative to the package source, and the value is the file path relative to the build directory.

Instance details

Defined in NvFetcher.Types

newtype Glob Source #

Zsh style glob pattern Notably, recursive wildcards like **/ are supported.

Constructors

Glob FilePath 

Instances

Instances details
IsString Glob Source # 
Instance details

Defined in NvFetcher.Types

Methods

fromString :: String -> Glob #

Generic Glob Source # 
Instance details

Defined in NvFetcher.Types

Associated Types

type Rep Glob 
Instance details

Defined in NvFetcher.Types

type Rep Glob = D1 ('MetaData "Glob" "NvFetcher.Types" "nvfetcher-0.7.0.0-AhFFh7reJc9KmNyxRtjlmD" 'True) (C1 ('MetaCons "Glob" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 FilePath)))

Methods

from :: Glob -> Rep Glob x #

to :: Rep Glob x -> Glob #

Show Glob Source # 
Instance details

Defined in NvFetcher.Types

Methods

showsPrec :: Int -> Glob -> ShowS #

show :: Glob -> String #

showList :: [Glob] -> ShowS #

Binary Glob Source # 
Instance details

Defined in NvFetcher.Types

Methods

put :: Glob -> Put #

get :: Get Glob #

putList :: [Glob] -> Put #

NFData Glob Source # 
Instance details

Defined in NvFetcher.Types

Methods

rnf :: Glob -> () #

Eq Glob Source # 
Instance details

Defined in NvFetcher.Types

Methods

(==) :: Glob -> Glob -> Bool #

(/=) :: Glob -> Glob -> Bool #

Ord Glob Source # 
Instance details

Defined in NvFetcher.Types

Methods

compare :: Glob -> Glob -> Ordering #

(<) :: Glob -> Glob -> Bool #

(<=) :: Glob -> Glob -> Bool #

(>) :: Glob -> Glob -> Bool #

(>=) :: Glob -> Glob -> Bool #

max :: Glob -> Glob -> Glob #

min :: Glob -> Glob -> Glob #

Hashable Glob Source # 
Instance details

Defined in NvFetcher.Types

Methods

hashWithSalt :: Int -> Glob -> Int #

hash :: Glob -> Int #

Pretty Glob Source # 
Instance details

Defined in NvFetcher.Types

Methods

pretty :: Glob -> Doc ann #

prettyList :: [Glob] -> Doc ann #

type Rep Glob Source # 
Instance details

Defined in NvFetcher.Types

type Rep Glob = D1 ('MetaData "Glob" "NvFetcher.Types" "nvfetcher-0.7.0.0-AhFFh7reJc9KmNyxRtjlmD" 'True) (C1 ('MetaCons "Glob" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 FilePath)))

Rules

extractSrcRule :: Rules () Source #

Rules of extract source

Functions

extractSrc Source #

Arguments

:: NixFetcher 'Fetched

prefetched source

-> Glob

glob pattern

-> Action (HashMap FilePath FilePath) 

Run extract source

extractSrcs Source #

Arguments

:: NixFetcher 'Fetched

prefetched source

-> NonEmpty Glob

glob patterns

-> Action (HashMap FilePath FilePath) 

Run extract source with many sources