From c980fd89ea3f2bbfc907b36cd8ff12c8ac62599c Mon Sep 17 00:00:00 2001 From: Roland Coeurjoly Date: Fri, 24 May 2024 11:55:35 +0200 Subject: [PATCH 1/3] Add flake.nix support --- flake.lock | 60 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ flake.nix | 22 ++++++++++++++++++++ 2 files changed, 82 insertions(+) create mode 100644 flake.lock create mode 100644 flake.nix diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..2d201ed --- /dev/null +++ b/flake.lock @@ -0,0 +1,60 @@ +{ + "nodes": { + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1710146030, + "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1716542837, + "narHash": "sha256-lJHzC1gvdVVgi0UyYmk/iLoGLsRnYVc4briX3SKStn4=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "c9102f72fb0153c771da2d26926e89948f7d3f84", + "type": "github" + }, + "original": { + "owner": "nixos", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..24e8d8b --- /dev/null +++ b/flake.nix @@ -0,0 +1,22 @@ +{ + description = "A flake for the Haskell Verismith project"; + + inputs = { + nixpkgs.url = "github:nixos/nixpkgs/"; + flake-utils.url = "github:numtide/flake-utils"; + }; + + outputs = { self, nixpkgs, flake-utils, ... } @ inputs: + flake-utils.lib.eachDefaultSystem (system: + let + pkgs = import nixpkgs { + inherit system; + }; + in { + packages = { + verismith = pkgs.haskellPackages.callCabal2nix "verismith" (./.) {}; + }; + defaultPackage = self.packages.${system}.verismith; + } + ); +} From 41e1c387927cdc6f9e188bc71ec9a4aadb02fc5e Mon Sep 17 00:00:00 2001 From: Roland Coeurjoly Date: Fri, 24 May 2024 11:55:47 +0200 Subject: [PATCH 2/3] import Verismith.Utils to avoid test/Parser.hs:73:13: error: [GHC-88464] Variable not in scope: showT :: GenVerilog a -> c --- test/Parser.hs | 1 + 1 file changed, 1 insertion(+) diff --git a/test/Parser.hs b/test/Parser.hs index f5a3219..116e9ed 100644 --- a/test/Parser.hs +++ b/test/Parser.hs @@ -27,6 +27,7 @@ import Verismith import Verismith.Verilog.Lex import Verismith.Verilog.Parser import Verismith.Verilog.Preprocess (uncomment) +import Verismith.Utils smallConfig :: Config smallConfig = defaultConfig & configProperty . propSize .~ 5 From 15a2d75eebae78a473b15066290c14319a88b05f Mon Sep 17 00:00:00 2001 From: Roland Coeurjoly Date: Fri, 24 May 2024 11:56:02 +0200 Subject: [PATCH 3/3] Expand tasty-hedgehog version range to avoid cabal error --- verismith.cabal | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/verismith.cabal b/verismith.cabal index be83797..1f34691 100644 --- a/verismith.cabal +++ b/verismith.cabal @@ -161,7 +161,7 @@ test-suite test , lens >=4.16.1 && <5.3 , parsec >= 3.1 && < 3.2 , tasty >=1.0.1.1 && <1.5 - , tasty-hedgehog >=1.0 && <1.2 + , tasty-hedgehog >=1.0 && <1.5 , tasty-hunit >=0.10 && <0.11 , text >=1.2 && <2.1 default-extensions: OverloadedStrings