2 Commits

Author SHA1 Message Date
5024a2be4c Revert flake.nix 2025-02-08 10:24:14 -06:00
fccee3e61c Static linking part 2
Some checks failed
Test, Build, and Release / test (push) Failing after 3h6m55s
Test, Build, and Release / build (push) Has been cancelled
2025-02-07 19:22:31 -06:00
4 changed files with 47 additions and 61 deletions

View File

@ -55,9 +55,7 @@ tricu < !version -- Print tricu version
## Installation and Use ## Installation and Use
[Releases are available for Linux.](https://git.eversole.co/James/tricu/releases) You can easily build and run this project using [Nix](https://nixos.org/download/).
Or you can easily build and run this project using [Nix](https://nixos.org/download/).
- Quick Start (REPL): - Quick Start (REPL):
- `nix run git+https://git.eversole.co/James/tricu` - `nix run git+https://git.eversole.co/James/tricu`

View File

@ -2,57 +2,46 @@
description = "tricu"; description = "tricu";
inputs = { inputs = {
nixpkgs = { nixpkgs.url = "github:NixOS/nixpkgs";
url = "https://github.com/nh2/nixpkgs/archive/ede5282c487a1fd2de64303ba59adad6726f1225.tar.gz"; flake-utils.url = "github:numtide/flake-utils";
type = "tarball";
flake = false;
};
static-haskell-nix = {
url = "github:nh2/static-haskell-nix";
flake = false;
};
}; };
outputs = { self, nixpkgs, static-haskell-nix }: outputs = { self, nixpkgs, flake-utils }:
let flake-utils.lib.eachDefaultSystem (system:
system = "x86_64-linux"; let
compiler = "ghc948"; pkgs = nixpkgs.legacyPackages.${system};
packageName = "tricu"; packageName = "tricu";
containerPackageName = "${packageName}-container";
overlay = self: super: { customGHC = pkgs.haskellPackages.ghcWithPackages (hpkgs: with hpkgs; [
haskell = super.haskell // { megaparsec
packages = super.haskell.packages // { ]);
${compiler} = super.haskell.packages.${compiler}.override {
overrides = final: prev: { haskellPackages = pkgs.haskellPackages;
${packageName} = prev.callCabal2nix packageName ./. {};
}; enableSharedExecutables = false;
}; enableSharedLibraries = false;
};
tricu = pkgs.haskell.lib.justStaticExecutables self.packages.${system}.default;
in {
packages.${packageName} =
haskellPackages.callCabal2nix packageName self rec {};
packages.default = self.packages.${system}.${packageName};
defaultPackage = self.packages.${system}.default;
devShells.default = pkgs.mkShell {
buildInputs = with pkgs; [
haskellPackages.cabal-install
haskellPackages.ghc-events
haskellPackages.ghcid
customGHC
upx
];
inputsFrom = builtins.attrValues self.packages.${system};
}; };
}; devShell = self.devShells.${system}.default;
overlays = [overlay]; });
normalPkgs = import nixpkgs { inherit overlays system; };
survey = import "${static-haskell-nix}/survey" { inherit compiler normalPkgs; };
tricuStatic = survey.haskellPackages.${packageName};
in {
packages.${system}.default = tricuStatic;
devShells.default = normalPkgs.mkShell {
buildInputs = with normalPkgs; [
normalPkgs.haskellPackages.cabal-install
normalPkgs.haskellPackages.ghc-events
normalPkgs.haskellPackages.ghcid
normalPkgs.upx
];
inputsFrom = builtins.attrValues self.packages.${system};
};
devShell = self.devShells.${system}.default;
};
} }

View File

@ -6,23 +6,22 @@ import Lexer
import Parser import Parser
import Research import Research
import Control.Exception (IOException, SomeException, catch, displayException) import Control.Exception (IOException, SomeException, catch
, displayException)
import Control.Monad (forM_) import Control.Monad (forM_)
import Control.Monad.IO.Class (liftIO)
import Control.Monad.Catch (handle, MonadCatch) import Control.Monad.Catch (handle, MonadCatch)
import Control.Monad.IO.Class (liftIO)
import Control.Monad.Trans.Class (lift) import Control.Monad.Trans.Class (lift)
import Control.Monad.Trans.Maybe (MaybeT(..), runMaybeT) import Control.Monad.Trans.Maybe (MaybeT(..), runMaybeT)
import Data.Char (isSpace, isUpper) import Data.Char (isSpace, isUpper)
import Data.List ( dropWhile import Data.List (dropWhile, dropWhileEnd, isPrefixOf)
, dropWhileEnd
, isPrefixOf)
import System.Console.Haskeline
import Paths_tricu (version)
import Data.Version (showVersion) import Data.Version (showVersion)
import qualified Data.Text as T import Paths_tricu (version)
import qualified Data.Text.IO as T import System.Console.Haskeline
import qualified Data.Map as Map import qualified Data.Map as Map
import qualified Data.Text as T
import qualified Data.Text.IO as T
repl :: Env -> IO () repl :: Env -> IO ()
repl env = runInputT settings (withInterrupt (loop env Decode)) repl env = runInputT settings (withInterrupt (loop env Decode))

View File

@ -1,7 +1,7 @@
cabal-version: 1.12 cabal-version: 1.12
name: tricu name: tricu
version: 0.18.0 version: 0.18.1
description: A micro-language for exploring Tree Calculus description: A micro-language for exploring Tree Calculus
author: James Eversole author: James Eversole
maintainer: james@eversole.co maintainer: james@eversole.co