diff --git a/Setup.hs b/Setup.hs new file mode 100644 index 0000000..4d25b82 --- /dev/null +++ b/Setup.hs @@ -0,0 +1,14 @@ +import Distribution.Simple +import Distribution.Simple.LocalBuildInfo +import Distribution.Utils.Path +import System.Directory + +main :: IO () +main = + defaultMainWithHooks + simpleUserHooks + -- Place library in the location from which Cabal can bundle it. + { buildHook = \pkg lbi hooks flags -> do + copyFile "rust/target/debug/libgarnet_rs.a" $ getSymbolicPath (buildDir lbi) "libgarnet_rs.a" + buildHook simpleUserHooks pkg lbi hooks flags + } diff --git a/garnet.cabal b/garnet.cabal index 52f65d4..8c631eb 100644 --- a/garnet.cabal +++ b/garnet.cabal @@ -6,6 +6,13 @@ author: Patrick Aldis maintainer: george.thomas@obsidian.systems patrick.aldis@obsidian.systems +build-type: Custom + +custom-setup + setup-depends: + base, + Cabal, + directory, common common default-language: GHC2024 diff --git a/generate-bindings b/generate-bindings deleted file mode 100755 index 39111ba..0000000 --- a/generate-bindings +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail - -# Place library in the location from which Cabal can bundle it. -cp rust/target/debug/libgarnet_rs.a $(cabal list-bin . | sed -e 's=x/garnet/build/garnet/garnet=build=g')