mirror of
https://github.com/ilyakooo0/Idris-dev.git
synced 2024-09-11 08:55:23 +03:00
Add the idris icon to the windows build
This commit is contained in:
parent
4e5474ae82
commit
f1c6f25e70
20
Setup.hs
20
Setup.hs
@ -10,6 +10,7 @@ import Distribution.Simple.LocalBuildInfo as L
|
||||
import qualified Distribution.Simple.Setup as S
|
||||
import qualified Distribution.Simple.Program as P
|
||||
import Distribution.Simple.Utils (createDirectoryIfMissingVerbose, rewriteFile)
|
||||
import Distribution.Compiler
|
||||
import Distribution.PackageDescription
|
||||
import Distribution.Text
|
||||
|
||||
@ -45,6 +46,9 @@ mymake = "make"
|
||||
make verbosity =
|
||||
P.runProgramInvocation verbosity . P.simpleProgramInvocation mymake
|
||||
|
||||
#ifdef mingw32_HOST_OS
|
||||
windres verbosity = P.runProgramInvocation verbosity . P.simpleProgramInvocation "windres"
|
||||
#endif
|
||||
-- -----------------------------------------------------------------------------
|
||||
-- Flags
|
||||
|
||||
@ -198,6 +202,21 @@ getVersion args flags = do
|
||||
let buildinfo = (emptyBuildInfo { cppOptions = ["-DVERSION="++hash] }) :: BuildInfo
|
||||
return (Just buildinfo, [])
|
||||
|
||||
|
||||
|
||||
idrisPreBuild args flags = do
|
||||
#ifdef mingw32_HOST_OS
|
||||
createDirectoryIfMissing True dir
|
||||
windres verbosity ["icons/idris_icon.rc","-o", dir++"idris_icon.o"]
|
||||
return (Nothing, [("idris", emptyBuildInfo { ldOptions = [dir ++ "idris_icon.o"] })])
|
||||
where
|
||||
verbosity = S.fromFlag $ S.buildVerbosity flags
|
||||
dir = dirPref
|
||||
dirPref = S.fromFlagOrDefault "dist" $ S.buildDistPref flags
|
||||
#else
|
||||
return (Nothing, [])
|
||||
#endif
|
||||
|
||||
idrisBuild _ flags _ local = unless (execOnly (configFlags local)) $ do
|
||||
buildStdLib
|
||||
buildRTS
|
||||
@ -247,6 +266,7 @@ idrisInstall verbosity copy pkg local = unless (execOnly (configFlags local)) $
|
||||
main = defaultMainWithHooks $ simpleUserHooks
|
||||
{ postClean = idrisClean
|
||||
, postConf = idrisConfigure
|
||||
, preBuild = idrisPreBuild
|
||||
, postBuild = idrisBuild
|
||||
, postCopy = \_ flags pkg local ->
|
||||
idrisInstall (S.fromFlag $ S.copyVerbosity flags)
|
||||
|
1
icons/idris_icon.rc
Normal file
1
icons/idris_icon.rc
Normal file
@ -0,0 +1 @@
|
||||
0 ICON "idris.ico"
|
@ -788,6 +788,9 @@ Extra-source-files:
|
||||
benchmarks/trivial/sortvec.idr
|
||||
benchmarks/trivial/sortvec.ipkg
|
||||
|
||||
icons/idris_icon.rc
|
||||
icons/idris.ico
|
||||
|
||||
source-repository head
|
||||
type: git
|
||||
location: git://github.com/idris-lang/Idris-dev.git
|
||||
|
Loading…
Reference in New Issue
Block a user