-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
and use Data.Functor.Compose from base. * use hpack to generate cabal * build with Nix * bump stack to use lts-20.4 * bump version to 0.5.0.2
- Loading branch information
Showing
14 changed files
with
477 additions
and
90 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
if ! has nix_direnv_version || ! nix_direnv_version 2.2.0; then | ||
source_url "https://raw.githubusercontent.com/nix-community/nix-direnv/2.2.0/direnvrc" "sha256-5EwyKnkJNQeXrRkYbwwRBcXbibosCJqyIUuz9Xq+LRc=" | ||
fi | ||
|
||
nix_direnv_watch_file devenv.nix | ||
nix_direnv_watch_file devenv.lock | ||
nix_direnv_watch_file devenv.yaml | ||
use flake . --impure |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
dist | ||
.stack-work | ||
.devenv |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
(import (fetchTarball https://github.com/edolstra/flake-compat/archive/master.tar.gz) { | ||
src = builtins.fetchGit ./.; | ||
}).defaultNix |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
{ | ||
inputs = { | ||
nixpkgs.url = "github:NixOS/nixpkgs?ref=haskell-updates"; | ||
devenv.url = "github:cachix/devenv"; | ||
nix-filter.url = "github:numtide/nix-filter"; | ||
}; | ||
|
||
outputs = { self, nixpkgs, devenv, nix-filter, ... }@inputs: | ||
with nix-filter.lib; | ||
let | ||
config = { allowBroken = true; }; | ||
overlays.default = final: previous: { | ||
haskellPackages = with final.haskell.lib; | ||
previous.haskellPackages.extend (hfinal: hprevous: | ||
with hfinal; { | ||
spatial-math = callCabal2nix "spatial-math" (filter { | ||
root = self; | ||
exclude = [ "stack.yaml" (matchExt "cabal") ]; | ||
}) { }; | ||
}); | ||
}; | ||
systems = [ | ||
"x86_64-linux" | ||
# "i686-linux" | ||
"x86_64-darwin" | ||
# "aarch64-linux" | ||
# "aarch64-darwin" | ||
]; | ||
forAllSystems = f: | ||
builtins.listToAttrs (map (name: { | ||
inherit name; | ||
value = f name; | ||
}) systems); | ||
in { | ||
packages = forAllSystems (system: | ||
let | ||
pkgs = import nixpkgs { | ||
inherit config system; | ||
overlays = [ overlays.default ]; | ||
}; | ||
in { | ||
default = pkgs.haskellPackages.spatial-math; | ||
}); | ||
devShells = forAllSystems (system: | ||
let | ||
pkgs = import nixpkgs { | ||
inherit config system; | ||
overlays = [ overlays.default ]; | ||
}; | ||
in { | ||
default = devenv.lib.mkShell { | ||
inherit inputs pkgs; | ||
modules = with pkgs.haskellPackages; with pkgs; [{ | ||
env = { name = "spatial-math"; }; | ||
packages = | ||
[ (ghcWithPackages (p: with p; [ haskell-language-server spatial-math ])) ]; | ||
scripts = { | ||
run-ghcid.exec = "${ghcid}/bin/ghcid -W -a -c 'cabal repl lib:spatial-math'"; | ||
setUp.exec = '' | ||
${hpack}/bin/hpack -f package.yaml | ||
${implicit-hie}/bin/gen-hie --cabal &> hie.yaml | ||
''; | ||
}; | ||
enterShell = " | ||
setUp | ||
"; | ||
}]; | ||
}; | ||
}); | ||
}; | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
name: spatial-math | ||
version: 0.5.0.2 | ||
synopsis: 3d math including quaternions/euler angles/dcms and utility functions | ||
license: BSD3 | ||
license-file: LICENSE | ||
author: Greg Horn | ||
maintainer: gregmainland@gmail.com | ||
copyright: Copyright (c) 2012-2019, Greg Horn | ||
category: Math | ||
github: ghorn/spatial-math | ||
test-with: GHC==9.2 | ||
|
||
extra-source-files: | ||
- README.md | ||
- changelog.txt | ||
|
||
library: | ||
source-dirs: src | ||
dependencies: | ||
- base | ||
- ghc-prim | ||
- cereal | ||
- binary | ||
- serialise | ||
- linear | ||
- lens | ||
ghc-options: -Wall -Werror | ||
|
||
tests: | ||
doctests: | ||
main: doctests.hs | ||
source-dirs: tests | ||
when: | ||
- condition: false | ||
other-modules: Main | ||
dependencies: | ||
- base | ||
- doctest | ||
ghc-options: -O2 -threaded -Wall -Werror | ||
build-tools: doctest-discover | ||
|
||
unit-tests: | ||
main: Main.hs | ||
source-dirs: tests | ||
dependencies: | ||
- base | ||
- spatial-math | ||
- QuickCheck | ||
- test-framework | ||
- test-framework-quickcheck2 | ||
ghc-options: -O2 -Wall -Werror |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
(import (fetchTarball https://github.com/edolstra/flake-compat/archive/master.tar.gz) { | ||
src = builtins.fetchGit ./.; | ||
}).shellNix |
Oops, something went wrong.