Skip to content

Commit

Permalink
copy naersk code over to cardano-base
Browse files Browse the repository at this point in the history
  • Loading branch information
cleverca22 authored and angerman committed Jun 6, 2020
1 parent 003fa63 commit 88b59e2
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 12 deletions.
6 changes: 2 additions & 4 deletions cabal.project
Expand Up @@ -39,8 +39,6 @@ source-repository-package
type: git
--location: https://github.com/input-output-hk/kes-mmm-sumed25519
location: https://github.com/TimSheard/kes-mmm-sumed25519
--tag: 5fefcf714c5f045f5328d897f191268cc2444926
tag: 509873ab0d8de79d189772ab1627c36c61001511
--sha256:0dkal9brmrrn9ifrp3vqgm23mm93a2drabg40snl4v285df1gh79
sha256:0lh69m8vnijpcf40lagx81v26x2xd0bc2fzfaaipbn6k6wfdhr1n
tag: 53c82e531712eec8787e34e550fb6487540e8d1c
--sha256: 0f36czh95x2xp3ncv3nxd3lcpanxzrylrbfi8xin6ddmcim12khx
subdir: kes-mmm-sumed25519-hs
8 changes: 1 addition & 7 deletions nix/default.nix
Expand Up @@ -33,13 +33,7 @@ let
// import ./util.nix { inherit haskell-nix; }
# also expose our sources and overlays
// { inherit overlays sources; };
})
(self: super: let
kesSrc = self.cardanoBaseHaskellPackages.kes-mmm-sumed.src;
kesOverlay = import "${kesSrc}/../nix/pkgs.nix";
kesPkgs = kesOverlay self {};
in {
inherit (kesPkgs) kes_mmm_sumed25519_c;
kes_mmm_sumed25519_c = pkgs.callPackage ./kes_mmm_sumed25519_c.nix {};
})
# And, of course, our haskell-nix-ified cabal project:
(import ./pkgs.nix)
Expand Down
2 changes: 1 addition & 1 deletion nix/haskell.nix
Expand Up @@ -16,7 +16,7 @@ let
# This creates the Haskell package set.
# https://input-output-hk.github.io/haskell.nix/user-guide/projects/
pkgSet = haskell-nix.cabalProject {
src = haskell-nix.haskellLib.cleanGit { src = ../.; };
src = haskell-nix.haskellLib.cleanGit { src = ../.; name = "cardano-base"; };
ghc = buildPackages.haskell-nix.compiler.${compiler};
modules = [

Expand Down
13 changes: 13 additions & 0 deletions nix/kes_mmm_sumed25519_c.nix
@@ -0,0 +1,13 @@
{ lib, callPackage, cardanoBaseHaskellPackages }:
let
sources = import ./sources.nix;
naersk = callPackage sources.naersk {};
kesSrc = cardanoBaseHaskellPackages.kes-mmm-sumed.src;
stripLastElement = input: lib.concatStringsSep "/" (lib.init (lib.splitString "/" input));
in
naersk.buildPackage {
root = stripLastElement kesSrc;
copyBins = true;
copyTarget = false;
copyLibs = true;
}
12 changes: 12 additions & 0 deletions nix/sources.json
Expand Up @@ -22,5 +22,17 @@
"type": "tarball",
"url": "https://github.com/input-output-hk/iohk-nix/archive/8eb95138be415ea7a02c80cc52cbc14edc0a9e05.tar.gz",
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
},
"naersk": {
"branch": "more-fixes",
"description": "Build rust crates in Nix. No configuration, no code generation, no IFD. Sandbox friendly.",
"homepage": "",
"owner": "input-output-hk",
"repo": "naersk",
"rev": "a3f5eb1b1d9326c4012260d50cda08ea6be17f67",
"sha256": "0kkfdzlvg29x4aic28jckpjqnh58j9fmvq7kh8w7i7746yslqvia",
"type": "tarball",
"url": "https://github.com/input-output-hk/naersk/archive/a3f5eb1b1d9326c4012260d50cda08ea6be17f67.tar.gz",
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
}
}
1 change: 1 addition & 0 deletions shell.nix
Expand Up @@ -32,6 +32,7 @@ let
pkgconfig
sqlite-interactive
git
kes_mmm_sumed25519_c
];

# Prevents cabal from choosing alternate plans, so that
Expand Down

0 comments on commit 88b59e2

Please sign in to comment.