aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc Coquand <marc@mccd.space>2024-05-17 12:03:09 -0500
committerMarc Coquand <marc@mccd.space>2024-05-17 12:03:09 -0500
commit8dbf8014991bd7456dfa09b85f07c04086d70459 (patch)
tree6c9470e99e1713757d1487d18a16d04d4b981885
parentefe45feea10551feda95d647dccecd973cfe5320 (diff)
downloadstitch-8dbf8014991bd7456dfa09b85f07c04086d70459.tar.gz
stitch-8dbf8014991bd7456dfa09b85f07c04086d70459.tar.bz2
stitch-8dbf8014991bd7456dfa09b85f07c04086d70459.zip
stuff
-rw-r--r--.gitignore1
-rw-r--r--README21
-rw-r--r--bin/dune16
-rw-r--r--dune-project1
-rw-r--r--flake.nix26
-rw-r--r--stitch.opam7
-rw-r--r--stitch.opam.template14
7 files changed, 62 insertions, 24 deletions
diff --git a/.gitignore b/.gitignore
index 8267c6a..93b9482 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1,3 @@
_build/*
.direnv
+result
diff --git a/README b/README
index 350fd3a..aa89a21 100644
--- a/README
+++ b/README
@@ -37,17 +37,21 @@ _________________
Stitch does not have any opinion about which file format you use for
file capturing, use org, markdown, whatever you want. You can also
- customize the grep command to speed up performance.
+ customize the grep command to speed up performance. It only requires
+ that each note is contained to one file
Stitch does not come with any note capturing system built in, but
instead makes it easy for you to set up your own system in with your
preferred editor. There is a basic example included in the manpages.
+ Stitch comes as a single static binary, but uses grep, sort, cut, find
+ to work.
+
1.1 FEATURES
~~~~~~~~~~~~
- - Single binary
+ - Single static binary (though it makes use of coreutils)
- No need for any DB, just files
- UNIXy & fast
- Work with any file format, markdown, ruby markup, org etc.
@@ -91,12 +95,21 @@ _________________
dune exec -- stitch --help=groff
+ To prepare for release, run
+
+ dune build --profile release
+
+ Binary will be found in ./_build/default/bin/stitch
+
1.6 ROADMAP
~~~~~~~~~~~
- Support sort
- - Support easy tagging
+ - Support tagging commands
+ - Support command pipign and hotkeys
+ - Line wrapping
+ - Support URL shortening.
2 KNOWN ISSUES
@@ -111,6 +124,8 @@ _________________
uniform file name that we can regexp (and also tweak). I am not sure
yet what's best.
+ - The binary file is kinda big, 5mb. I'd love to slim it down.
+
3 Author
========
diff --git a/bin/dune b/bin/dune
index 962b989..3031405 100644
--- a/bin/dune
+++ b/bin/dune
@@ -1,5 +1,7 @@
(executable
(public_name stitch)
+ (package stitch)
+ (flags (:standard -cclib -static -cclib -no-pie))
(name main)
(libraries
stitch
@@ -10,3 +12,17 @@
notty.unix
shexp.process
lambda-term))
+
+
+; Rule to generate a man page for stitch
+(rule
+ (target stitch.1)
+ (action (with-outputs-to %{target} (run stitch --help=groff)))
+)
+
+; Install the man page
+(install
+ (section man)
+ (files stitch.1)
+ (package stitch)
+)
diff --git a/dune-project b/dune-project
index b15e4b7..e1425fe 100644
--- a/dune-project
+++ b/dune-project
@@ -1,6 +1,7 @@
(lang dune 3.11)
(name stitch)
+(version efe45fe-dirty)
(generate_opam_files true)
diff --git a/flake.nix b/flake.nix
index c6d15f0..a51608b 100644
--- a/flake.nix
+++ b/flake.nix
@@ -33,9 +33,14 @@
${package} = prev.${package}.overrideAttrs (_: {
# Prevent the ocaml dependencies from leaking into dependent environments
doNixSupport = false;
- buildInputs =
- [ pkgs."gmp" pkgs."libev" pkgs."openssl" pkgs."libargon2" ];
- DUNE_PROFILE = "release";
+ buildInputs = [
+ pkgs.glibc.static
+ pkgs.zlib.static
+ pkgs.binutils-unwrapped
+ pkgs.ocaml
+ pkgs.musl
+ pkgs.gcc
+ ];
});
};
scope' = scope.overrideScope' overlay;
@@ -49,21 +54,6 @@
packages.default = main;
-
- defaultPackage = pkgs.stdenv.mkDerivation {
- name = "stitch";
- src = ./.;
- buildInputs = devPackages;
- buildPhase = ''
- dune build --profile release
- '';
-
- installPhase = ''
- echo "building to $out"
- cp _build/install/default/bin/stitch/ $out
- '';
- };
-
apps.stitch.default = {
type = "app";
program = "${main}/bin/stitch";
diff --git a/stitch.opam b/stitch.opam
index 18a5bde..0bf5454 100644
--- a/stitch.opam
+++ b/stitch.opam
@@ -1,5 +1,6 @@
# This file is generated by dune, edit dune-project instead
opam-version: "2.0"
+version: "efe45fe-dirty"
synopsis: "A Note Composer"
description:
"A minimal CLI tool that allows you to compose notes together. Useful as part of a bigger system for building a PKM."
@@ -18,7 +19,7 @@ depends: [
"odoc" {with-doc}
]
build: [
- ["dune" "subst"] {dev}
+ ["dune" "subst"] {release}
[
"dune"
"build"
@@ -27,7 +28,7 @@ build: [
"-j"
jobs
"@install"
- "@runtest" {with-test}
- "@doc" {with-doc}
+ "--profile"
+ "release"
]
]
diff --git a/stitch.opam.template b/stitch.opam.template
new file mode 100644
index 0000000..0244e4f
--- /dev/null
+++ b/stitch.opam.template
@@ -0,0 +1,14 @@
+build: [
+ ["dune" "subst"] {release}
+ [
+ "dune"
+ "build"
+ "-p"
+ name
+ "-j"
+ jobs
+ "@install"
+ "--profile"
+ "release"
+ ]
+]