Skip to content

Commit d4fd6e8

Browse files
authored
Merge pull request #56 from smunix/fix.devshell
fix devshell + macosx builds
2 parents e0a628b + 660c1e1 commit d4fd6e8

File tree

4 files changed

+51
-128
lines changed

4 files changed

+51
-128
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@ jobs:
55
runs-on: ${{matrix.os}}
66
strategy:
77
matrix:
8-
os: [ubuntu-latest] # TODO fix macos support : [ubuntu-latest, macos-latest]
8+
os: [ubuntu-latest, macos-latest]
99
steps:
1010
- uses: actions/checkout@v2.4.0
1111
with:
1212
# Nix Flakes doesn't work on shallow clones
1313
fetch-depth: 0
1414
- uses: cachix/install-nix-action@v15
1515
with:
16-
install_url: https://releases.nixos.org/nix/nix-2.5.1/install
16+
install_url: https://releases.nixos.org/nix/nix-2.6.1/install
1717
extra_nix_config: |
1818
experimental-features = nix-command flakes
1919
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}

flake.lock

Lines changed: 25 additions & 108 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
22
description = "Souffle Datalog bindings for Haskell";
33
inputs = {
4-
np.url = "github:nixos/nixpkgs?ref=haskell-updates";
4+
np.url = "github:nixos/nixpkgs?ref=master";
55
fu.url = "github:numtide/flake-utils?ref=master";
6-
hls.url = "github:haskell/haskell-language-server?ref=master";
6+
ds.url = "github:numtide/devshell?ref=master";
77
};
8-
outputs = { self, np, fu, hls }:
8+
outputs = { self, np, fu, ds }:
99
with fu.lib;
1010
eachSystem [ "x86_64-linux" "x86_64-darwin" ] (system:
1111
let
@@ -38,7 +38,7 @@
3838
${hlint}/bin/hlint ${souffle-haskell.src} -c
3939
'';
4040
};
41-
overlays = [ overlay hls.overlay ];
41+
overlays = [ overlay ds.overlay ];
4242
in with (import np { inherit system config overlays; }); rec {
4343
inherit overlays;
4444
packages = flattenTree
@@ -47,17 +47,18 @@
4747
apps = {
4848
souffle-haskell-lint = mkApp { drv = souffle-haskell-lint; };
4949
};
50-
devShell = with haskellPackages;
51-
shellFor {
52-
packages = p: with p; [ hspec-discover packages.souffle-haskell ];
53-
buildInputs = [
54-
cabal-install
55-
ghc
56-
haskell-language-server
57-
hspec-discover
58-
souffle
59-
souffle-haskell-lint
60-
];
61-
};
50+
devShell = devshell.mkShell {
51+
name = "SOUFFLE-HASKELL";
52+
packages = with haskellPackages; [
53+
cabal-install
54+
ghc
55+
haskell-language-server
56+
hlint
57+
hpack
58+
hspec-discover
59+
souffle
60+
souffle-haskell-lint
61+
];
62+
};
6263
});
6364
}

nix/souffle.nix

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{ pkgs, cc ? 10, ... }:
1+
{ pkgs, cc ? 11, ... }:
22

33
with pkgs;
44
lib.makeOverridable ({ stdenv ? (if pkgs.stdenv.isDarwin then
@@ -17,9 +17,14 @@ else
1717
patches = [ ../patches/1-souffle-2.1-macosx.patch ];
1818
cmakeFlags = [ "-DSOUFFLE_GIT=OFF" "-DSOUFFLE_BASH_COMPLETION=OFF" ];
1919
ninjaFlags = [ "-v" ];
20+
# LLVM uses -Werror but also runs clang on assembly files, which
21+
# makes -fno-strict-overflow break the build.
22+
hardeningDisable = [ "strictoverflow" ];
2023
postPatch = ''
2124
substituteInPlace CMakeLists.txt \
2225
--replace "DESTINATION \''${BASH_COMPLETION_COMPLETIONSDIR}" "DESTINATION $out/share/completions/"
26+
substituteInPlace CMakeLists.txt \
27+
--replace "-fuse-ld=lld" "-fuse-ld=ld"
2328
'';
2429
postInstall = ''
2530
wrapProgram "$out/bin/souffle" --prefix PATH : "${
@@ -28,7 +33,7 @@ else
2833
'';
2934
nativeBuildInputs = with pkgs;
3035
[ bison cmake flex git mcpp makeWrapper ninja perl ]
31-
++ (lib.optionals pkgs.stdenv.isLinux [ lsb-release ]);
36+
++ (lib.optionals stdenv.isLinux [ lsb-release ]);
3237
buildInputs = with pkgs; [ ncurses zlib sqlite libffi ];
3338
propagatedBuildInputs = with pkgs; [ ncurses zlib sqlite libffi ];
3439
outputs = [ "out" ];

0 commit comments

Comments
 (0)