Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
gargantext-ihaskell
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gargantext
gargantext-ihaskell
Commits
d4a754b3
Commit
d4a754b3
authored
Feb 06, 2018
by
Vaibhav Sagar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
release-8.4.nix: init
parent
45d88a03
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
203 additions
and
0 deletions
+203
-0
release-8.4.nix
release-8.4.nix
+203
-0
No files found.
release-8.4.nix
0 → 100644
View file @
d4a754b3
{
nixpkgs_
?
import
<
nixpkgs
>
{},
packages
?
(
_
:
[]),
rtsopts
?
"-M3g -N2"
,
systemPackages
?
(
_
:
[])
}:
let
nixpkgs
=
import
(
nixpkgs_
.
fetchFromGitHub
{
owner
=
"NixOS"
;
repo
=
"nixpkgs"
;
rev
=
"c21625023e2c9e54124559c55598ea911915e8ac"
;
sha256
=
"1bfdh5ysf8y4bnhnlf0klgcw3dxy6wf3xhapwx8cpr5k08imhn7s"
;
})
{};
inherit
(
builtins
)
any
elem
filterSource
listToAttrs
;
lib
=
nixpkgs
.
lib
;
cleanSource
=
name
:
type
:
let
baseName
=
baseNameOf
(
toString
name
);
in
lib
.
cleanSourceFilter
name
type
&&
!
(
(
type
==
"directory"
&&
(
elem
baseName
[
".stack-work"
"dist"
]))
||
any
(
lib
.
flip
lib
.
hasSuffix
baseName
)
[
".hi"
".ipynb"
".nix"
".sock"
".yaml"
".yml"
]
);
ihaskellSourceFilter
=
src
:
name
:
type
:
let
relPath
=
lib
.
removePrefix
(
toString
src
+
"/"
)
(
toString
name
);
in
cleanSource
name
type
&&
(
any
(
lib
.
flip
lib
.
hasPrefix
relPath
)
[
"src"
"main"
"html"
"Setup.hs"
"ihaskell.cabal"
"LICENSE"
]);
ihaskell-src
=
filterSource
(
ihaskellSourceFilter
./.
)
./.
;
ipython-kernel-src
=
filterSource
cleanSource
./ipython-kernel
;
ghc-parser-src
=
filterSource
cleanSource
./ghc-parser
;
ihaskell-display-src
=
filterSource
cleanSource
./ihaskell-display
;
plot
=
nixpkgs
.
fetchFromGitHub
{
owner
=
"amcphail"
;
repo
=
"plot"
;
rev
=
"cc5cdff696aa99e1001124917c3b87b95529c4e3"
;
sha256
=
"13abrymry4nqyl9gmjrj8lhplbg4xag7x41n89yyw822360d3drh"
;
};
gtk2hs
=
nixpkgs
.
fetchFromGitHub
{
owner
=
"gtk2hs"
;
repo
=
"gtk2hs"
;
rev
=
"ba28ee939b6321c89d11ac2480a5065b7c05a0ea"
;
sha256
=
"0cx9fs05c3sscywn4zg6g0kag64xyq7x4y38khir3516fgnj7zaa"
;
};
displays
=
self
:
builtins
.
listToAttrs
(
map
(
display
:
{
name
=
display
;
value
=
self
.
callCabal2nix
display
"
${
ihaskell-display-src
}
/
${
display
}
"
{};
})
[
"ihaskell-aeson"
"ihaskell-blaze"
"ihaskell-charts"
"ihaskell-diagrams"
"ihaskell-gnuplot"
"ihaskell-hatex"
"ihaskell-juicypixels"
"ihaskell-magic"
"ihaskell-plot"
"ihaskell-rlangqq"
"ihaskell-static-canvas"
"ihaskell-widgets"
]);
haskellPackages
=
nixpkgs
.
haskell
.
packages
.
ghc841
.
override
{
overrides
=
self
:
super
:
{
ihaskell
=
nixpkgs
.
haskell
.
lib
.
overrideCabal
(
self
.
callCabal2nix
"ihaskell"
ihaskell-src
{})
(
_drv
:
{
postPatch
=
let
# The tests seem to 'buffer' when run during nix-build, so this is
# a throw-away test to get everything running smoothly and passing.
originalTest
=
''
describe "Code Evaluation" $ do''
;
replacementTest
=
''
describe "Code Evaluation" $ do
it "gets rid of the test failure with Nix" $
let throwAway string _ = evaluationComparing (const $ shouldBe True True) string
in throwAway "True" ["True"]''
;
in
''
substituteInPlace ./src/tests/IHaskell/Test/Eval.hs --replace \
'
${
originalTest
}
' '
${
replacementTest
}
'
''
;
preCheck
=
''
export HOME=$(
${
nixpkgs
.
pkgs
.
coreutils
}
/bin/mktemp -d)
export PATH=$PWD/dist/build/ihaskell:$PATH
export GHC_PACKAGE_PATH=$PWD/dist/package.conf.inplace/:$GHC_PACKAGE_PATH
''
;
});
ghc-parser
=
self
.
callCabal2nix
"ghc-parser"
ghc-parser-src
{};
ipython-kernel
=
self
.
callCabal2nix
"ipython-kernel"
ipython-kernel-src
{};
here
=
nixpkgs
.
haskell
.
lib
.
doJailbreak
super
.
here
;
hlint
=
super
.
hlint
.
overrideScope
(
_self
:
_super
:
{
haskell-src-exts
=
self
.
haskell-src-exts
;
});
hourglass
=
super
.
hourglass
.
overrideAttrs
(
oldAttrs
:
{
src
=
nixpkgs
.
fetchFromGitHub
{
owner
=
"vincenthz"
;
repo
=
"hs-hourglass"
;
rev
=
"b9c4e2bc3a77454a10d5396ffd9f4147aa3ebc62"
;
sha256
=
"1rxai65xk6pcj3jahh62x543r1lgmzd4xjaj538nsb1aww0jyk77"
;
};
});
http-types
=
nixpkgs
.
haskell
.
lib
.
dontCheck
super
.
http-types
;
tls
=
nixpkgs
.
haskell
.
lib
.
overrideCabal
super
.
tls
(
_drv
:
{
postPatch
=
let
original
=
''
instance Monoid Credentials where
mempty = Credentials []
mappend (Credentials l1) (Credentials l2) = Credentials (l1 ++ l2)
''
;
replacement
=
''
instance Semigroup Credentials where
(<>) (Credentials l1) (Credentials l2) = Credentials (l1 ++ l2)
instance Monoid Credentials where
mempty = Credentials []
''
;
in
''
substituteInPlace ./Network/TLS/Credentials.hs --replace \
'
${
original
}
' '
${
replacement
}
'
''
;
});
x509
=
nixpkgs
.
haskell
.
lib
.
overrideCabal
super
.
x509
(
_drv
:
{
postPatch
=
let
original
=
''
instance Monoid DistinguishedName where
mempty = DistinguishedName []
mappend (DistinguishedName l1) (DistinguishedName l2) = DistinguishedName (l1++l2)
''
;
replacement
=
''
instance Semigroup DistinguishedName where
(<>) (DistinguishedName l1) (DistinguishedName l2) = DistinguishedName (l1++l2)
instance Monoid DistinguishedName where
mempty = DistinguishedName []
''
;
in
''
substituteInPlace ./Data/X509/DistinguishedName.hs --replace \
'
${
original
}
' '
${
replacement
}
'
''
;
});
x509-store
=
nixpkgs
.
haskell
.
lib
.
overrideCabal
super
.
x509-store
(
_drv
:
{
postPatch
=
let
original
=
''
instance Monoid CertificateStore where
mempty = CertificateStore M.empty
mappend s1@(CertificateStore _) s2@(CertificateStore _) = CertificateStores [s1,s2]
mappend (CertificateStores l) s2@(CertificateStore _) = CertificateStores (l ++ [s2])
mappend s1@(CertificateStore _) (CertificateStores l) = CertificateStores ([s1] ++ l)
mappend (CertificateStores l1) (CertificateStores l2) = CertificateStores (l1 ++ l2)
''
;
replacement
=
''
instance Semigroup CertificateStore where
(<>) s1@(CertificateStore _) s2@(CertificateStore _) = CertificateStores [s1,s2]
(<>) (CertificateStores l) s2@(CertificateStore _) = CertificateStores (l ++ [s2])
(<>) s1@(CertificateStore _) (CertificateStores l) = CertificateStores ([s1] ++ l)
(<>) (CertificateStores l1) (CertificateStores l2) = CertificateStores (l1 ++ l2)
instance Monoid CertificateStore where
mempty = CertificateStore M.empty
''
;
in
''
substituteInPlace ./Data/X509/CertificateStore.hs --replace \
'
${
original
}
' '
${
replacement
}
'
''
;
});
# plot = self.callCabal2nix "plot" plot {};
# diagrams-cairo = nixpkgs.haskell.lib.doJailbreak super.diagrams-cairo;
# shelly = nixpkgs.haskell.lib.doJailbreak super.shelly;
# static-canvas = nixpkgs.haskell.lib.doJailbreak super.static-canvas;
# testing-feat = nixpkgs.haskell.lib.doJailbreak super.testing-feat;
# cairo = super.cairo.overrideAttrs (oldAttrs: {
# src = "${gtk2hs}/cairo";
# });
# glib = super.glib.overrideAttrs (oldAttrs: {
# src = "${gtk2hs}/glib";
# });
# pango = super.pango.overrideAttrs (oldAttrs: {
# src = "${gtk2hs}/pango";
# });
# gtk2hs-buildtools = super.callHackage "gtk2hs-buildtools" "0.13.3.0" {};
# hmatrix = super.hmatrix_0_18_1_0;
# singletons = super.callHackage "singletons" "2.3.1" {};
# th-desugar = super.callHackage "th-desugar" "1.7" {};
}
//
displays
self
;
};
ihaskellEnv
=
haskellPackages
.
ghcWithPackages
(
self
:
[
self
.
ihaskell
]
++
packages
self
);
jupyter
=
nixpkgs
.
python3
.
withPackages
(
ps
:
[
ps
.
jupyter
ps
.
notebook
]);
ihaskellSh
=
cmd
:
extraArgs
:
nixpkgs
.
writeScriptBin
"ihaskell-
${
cmd
}
"
''
#!
${
nixpkgs
.
stdenv
.
shell
}
export GHC_PACKAGE_PATH="$(echo
${
ihaskellEnv
}
/lib/*/package.conf.d| tr ' ' ':'):$GHC_PACKAGE_PATH"
export PATH="
${
nixpkgs
.
stdenv
.
lib
.
makeBinPath
([
ihaskellEnv
jupyter
]
++
systemPackages
nixpkgs
)
}
"
${
ihaskellEnv
}
/bin/ihaskell install -l $(
${
ihaskellEnv
}
/bin/ghc --print-libdir) --use-rtsopts="
${
rtsopts
}
" &&
${
jupyter
}
/bin/jupyter
${
cmd
}
${
extraArgs
}
"$@"
''
;
in
nixpkgs
.
buildEnv
{
name
=
"ihaskell-with-packages"
;
buildInputs
=
[
nixpkgs
.
makeWrapper
];
paths
=
[
ihaskellEnv
jupyter
];
postBuild
=
''
ln -s
${
ihaskellSh
"notebook"
""
}
/bin/ihaskell-notebook $out/bin/
ln -s
${
ihaskellSh
"nbconvert"
""
}
/bin/ihaskell-nbconvert $out/bin/
ln -s
${
ihaskellSh
"console"
"--kernel=haskell"
}
/bin/ihaskell-console $out/bin/
for prg in $out/bin"/"*;do
if [[ -f $prg && -x $prg ]]; then
wrapProgram $prg --set PYTHONPATH "$(echo
${
jupyter
}
/lib/*/site-packages)"
fi
done
''
;
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment