Created
March 23, 2022 18:41
-
-
Save kquick/b28da7ee3939fc0a54eff1f7976ab0ae to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
# $ nix develop | |
# $ nix build [see result/bin when completed] | |
# $ nix develop .#llvm-pretty-bc-parser.llvm_9.default | |
# $ nix develop .#llvm-pretty-bc-parser.llvm_9.ghc882 | |
# $ nix develop .#llvm-pretty-bc-parser.ghc882.llvm_9 | |
description = "The llvm-pretty-bc-parser library and tool"; | |
inputs = { | |
nixpkgs.url = github:nixos/nixpkgs/ebbca75; | |
# nixpkgs.url = github:nixos/nixpkgs/nixpkgs-unstable; | |
levers = { | |
url = "github:kquick/nix-levers"; | |
inputs.nixpkgs.follows = "nixpkgs"; | |
}; | |
llvm-pretty-src = { | |
# url = "/home/kquick/work/VSpells/llvm-pretty"; | |
url = "github:elliottt/llvm-pretty"; | |
flake = false; | |
}; | |
parameterized-utils-src = { | |
url = "github:GaloisInc/parameterized-utils"; | |
flake = false; | |
}; | |
tasty-checklist-src = { | |
url = "github:kquick/tasty-checklist"; | |
flake = false; | |
}; | |
}; | |
outputs = { self, nixpkgs, levers | |
, llvm-pretty-src | |
, parameterized-utils-src | |
, tasty-checklist-src | |
}: rec | |
{ | |
defaultPackage = levers.eachSystem (s: | |
self.packages.${s}.llvm-pretty-bc-parser.default); | |
devShell = levers.eachSystem (s: defaultPackage.${s}.env); | |
packages = levers.eachSystem (system: | |
let mkHaskell = levers.mkHaskellPkg { | |
inherit nixpkgs system; | |
llvmver = [ "llvm_9" "llvm_10" "llvm_8" ]; | |
}; | |
haskellAdj = drv: with pkgs.haskell.lib; dontHaddock (dontCheck drv); | |
pkgs = import nixpkgs { inherit system; }; | |
in rec | |
{ | |
llvm-pretty = mkHaskell "llvm-pretty" llvm-pretty-src {}; | |
llvm-pretty-bc-parser = mkHaskell "llvm-pretty-bc-parser" self { | |
adjustDrv = args: drv: | |
with pkgs.haskell.lib; | |
addExtraLibraries (haskellAdj drv) | |
[ pkgs.${args.llvmver} ]; | |
inherit llvm-pretty; | |
}; | |
parameterized-utils = mkHaskell "parameterized-utils" parameterized-utils-src {}; | |
tasty-checklist = mkHaskell "tasty-checklist" tasty-checklist-src { | |
inherit parameterized-utils; | |
}; | |
}); | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment