Flake: take dhall-lang as input

This commit is contained in:
Ehmry - 2019-12-22 04:50:19 +00:00
parent 74002e1e1a
commit 34238f66da
5 changed files with 44 additions and 18 deletions

View File

@ -1,16 +1,22 @@
{
"inputs": {
"dhallLang": {
"inputs": {},
"narHash": "sha256-8JaeNB0fOj09L1cQL8i+0eSuNvl9MbgiuFU5bc4Aeb0=",
"originalUrl": "git+https://github.com/dhall-lang/dhall-lang.git?ref=v12.0.0",
"url": "git+https://github.com/dhall-lang/dhall-lang.git?ref=v12.0.0&rev=9f248138f69ee5e22192dc3d0417d5c77b189e04"
},
"nixpkgs": {
"inputs": {},
"narHash": "sha256-wJg4DA700SoQbEz61448sR6BgxRa1R92K3vvCV1g+HY=",
"originalUri": "git+https://github.com/nixos/nixpkgs.git?ref=18.09-beta&rev=1d4de0d552ae9aa66a5b8dee5fb0650a4372d148",
"uri": "git+https://github.com/nixos/nixpkgs.git?ref=18.09-beta&rev=1d4de0d552ae9aa66a5b8dee5fb0650a4372d148"
"originalUrl": "git+https://github.com/nixos/nixpkgs.git?ref=18.09-beta&rev=1d4de0d552ae9aa66a5b8dee5fb0650a4372d148",
"url": "git+https://github.com/nixos/nixpkgs.git?ref=18.09-beta&rev=1d4de0d552ae9aa66a5b8dee5fb0650a4372d148"
},
"nixpkgsStaticLinux": {
"inputs": {},
"narHash": "sha256-famU3pJZ4vkElV9qc71HmyRVSvcrAhfMZ0UJKpmmKP8=",
"originalUri": "git+https://github.com/nh2/nixpkgs.git?ref=static-haskell-nix-stack-dhall-working",
"uri": "git+https://github.com/nh2/nixpkgs.git?ref=static-haskell-nix-stack-dhall-working&rev=925aac04f4ca58aceb83beef18cb7dae0715421b"
"originalUrl": "git+https://github.com/nh2/nixpkgs.git?ref=static-haskell-nix-stack-dhall-working",
"url": "git+https://github.com/nh2/nixpkgs.git?ref=static-haskell-nix-stack-dhall-working&rev=925aac04f4ca58aceb83beef18cb7dae0715421b"
}
},
"version": 3

View File

@ -14,11 +14,15 @@
"git+https://github.com/nh2/nixpkgs.git?ref=static-haskell-nix-stack-dhall-working";
flake = false;
};
dhallLang = {
uri = "git+https://github.com/dhall-lang/dhall-lang.git?ref=v12.0.0";
flake = false;
};
};
outputs = { self, nixpkgs, nixpkgsStaticLinux }: {
outputs = { self, nixpkgs, nixpkgsStaticLinux, dhallLang }: {
hydraJobs.x86_64-linux = import ./release.nix {
inherit nixpkgs nixpkgsStaticLinux;
inherit nixpkgs nixpkgsStaticLinux dhallLang;
system = "x86_64-linux";
};
packages.x86_64-linux = with self.hydraJobs.x86_64-linux; {

View File

@ -15,17 +15,18 @@ let
|| base == "index.html"
);
filteredSource = builtins.filterSource predicate src;
filteredSource =
if builtins.isPath src then builtins.filterSource predicate src else src;
in
runCommand "dhall-sdist"
( { LANG = "en_US.UTF-8"; }
( { inherit filteredSource; LANG = "en_US.UTF-8"; }
// lib.optionalAttrs (stdenv.buildPlatform.libc == "glibc")
{ LOCALE_ARCHIVE = "${glibcLocales}/lib/locale/locale-archive"; }
)
''
${coreutils}/bin/mkdir $out
${coreutils}/bin/cp --recursive ${filteredSource} src
${coreutils}/bin/cp --recursive $filteredSource src
cd src
${coreutils}/bin/chmod --recursive u+w .
${coreutils}/bin/mkdir dist

View File

@ -1,12 +1,13 @@
let
pinned = import ./pinnedNixpkgs.nix;
defaultCompiler = "ghc843";
in
{ nixpkgs ? pinned.nixpkgs
, nixpkgsStaticLinux ? pinned.nixpkgsStaticLinux
, dhallLang ? null
, compiler ? defaultCompiler
, coverage ? false
, system ? builtins.currentSystem
@ -205,13 +206,26 @@ let
}
);
dhall =
applyCoverage
(haskellPackagesNew.callCabal2nix
"dhall"
(pkgsNew.sdist ../dhall)
{ }
);
dhall = let
src = if builtins.pathExists ../dhall/dhall-lang/Prelude then
../dhall
else
let
predicate = path: type:
let base = baseNameOf path;
in !(pkgs.lib.hasSuffix ".nix" base
|| base == "dist"
|| base == "result"
|| base == ".git"
|| base == "index.html");
filter = builtins.filterSource predicate;
in pkgs.runCommand "dhall-sdist-input" { } ''
mkdir -p $out/dhall-lang
cp --recursive ${filter ../dhall}/* $out
cp --recursive ${dhallLang}/* $out/dhall-lang
'';
in applyCoverage
(haskellPackagesNew.callCabal2nix "dhall" (pkgsNew.sdist src) { });
dhall-no-http =
pkgsNew.haskell.lib.appendConfigureFlag

View File

@ -3,12 +3,13 @@ let pinned = import ./nix/pinnedNixpkgs.nix;
in { src ? { rev = ""; }
, nixpkgs ? pinned.nixpkgs
, nixpkgsStaticLinux ? pinned.nixpkgsStaticLinux
, dhallLang ? null
, system ? builtins.currentSystem
}:
let
callShared = args:
import ./nix/shared.nix ({ inherit nixpkgs nixpkgsStaticLinux system; } // args);
import ./nix/shared.nix ({ inherit nixpkgs nixpkgsStaticLinux dhallLang system; } // args);
shared_7_10_3 = callShared { compiler = "ghc7103"; };