Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove TypeCompose dependency #9

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .envrc
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
dist
.stack-work
.devenv
1 change: 1 addition & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
HEAD
- Drop TypeCompose dependency
- Reorganize directory structure and make typed interface the central one.
- Add serialise instances.
- Drop Generic/Generic1/Typeable/Typeable1 instances for older GHCs
Expand Down
3 changes: 3 additions & 0 deletions default.nix
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
234 changes: 234 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

72 changes: 72 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
{
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 {
inherit overlays;
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
";
}];
};
});
};
}
51 changes: 51 additions & 0 deletions package.yaml
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: [email protected]
copyright: Copyright (c) 2012-2019, Greg Horn
category: Math
github: ghorn/spatial-math
tested-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
3 changes: 3 additions & 0 deletions shell.nix
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
Loading