Switch to compiled executable 0.12.0
authorSiraaj Khandkar <siraaj@khandkar.net>
Sun, 21 Mar 2021 16:21:17 +0000 (12:21 -0400)
committerSiraaj Khandkar <siraaj@khandkar.net>
Sun, 21 Mar 2021 16:22:50 +0000 (12:22 -0400)
.gitignore
Makefile
README.md
TODO
info.rkt
tt.rkt

index 724bbe1..c49c556 100644 (file)
@@ -1 +1 @@
-compiled/
+tt
index 882fda6..a801484 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,8 +1,18 @@
-SRC_FILE := tt.rkt
+PKG_NAME := tt
+EXE_FILE := $(PKG_NAME)
+SRC_FILE := $(EXE_FILE).rkt
+PREFIX   := $(HOME)
+
+.PHONY: build
+build: $(EXE_FILE)
+
+$(EXE_FILE): $(SRC_FILE)
+       raco exe -o $@ $<
 
 .PHONY: install
-install:
-       raco pkg install --deps search-auto
+install: $(EXE_FILE)
+       mkdir -p $(PREFIX)/bin/
+       cp $(EXE_FILE) $(PREFIX)/bin/
 
 .PHONY: test
 test:
@@ -10,11 +20,11 @@ test:
 
 .PHONY: remove
 remove:
-       raco pkg remove tt
+       raco pkg remove $(PKG_NAME)
 
 .PHONY: clean
 clean:
-       rm -rf compiled
+       rm -f $(EXE_FILE)
 
 ### dev helpers ###
 # scmindent.rkt : https://github.com/ds26gte/scmindent
index 3c8630d..1daf22d 100644 (file)
--- a/README.md
+++ b/README.md
@@ -25,9 +25,7 @@ instructions
 [Racket](https://download.racket-lang.org/)
 
 ### installation
-1. Run `make install` or `raco pkg install`
-2. Add `$HOME/.racket/7.9/bin` to your `$PATH`
-   (replacing `7.9` with whatever version you have installed)
+`make build && make install` will build and copy `tt` binary into `$PREFIX/bin`.
 
 ### usage
 Download feeds from the Internet:
diff --git a/TODO b/TODO
index de2aaf6..5368d46 100644 (file)
--- a/TODO
+++ b/TODO
@@ -1,7 +1,7 @@
 - [ ] Convert to Typed Racket
   - requires: build executable (otherwise too slow)
-- [ ] Build executable
-  - requires: fix of "collection not found" when executing the built executable
+- [x] Build executable
+  Implies fix of "collection not found" when executing the built executable
     outside the source directory:
 
     collection-path: collection not found
index 232640e..7b384b7 100644 (file)
--- a/info.rkt
+++ b/info.rkt
@@ -6,7 +6,7 @@
 (define pkg-desc
   "twtxt client")
 (define version
-  "0.11.0")
+  "0.12.0")
 (define pkg-authors
   '("Siraaj Khandkar <siraaj@khandkar.net>"))
 (define deps
diff --git a/tt.rkt b/tt.rkt
index f7731c4..03db6e6 100644 (file)
--- a/tt.rkt
+++ b/tt.rkt
@@ -2,12 +2,13 @@
 
 (require openssl/sha1)
 (require racket/date)
-(require (prefix-in info: setup/getinfo))
 (require
   net/http-client
   net/url-string
   net/url-structs)
 
+(require (prefix-in info: "info.rkt"))
+
 (module+ test
   (require rackunit))
 
 (define user-agent
   (let*
     ([prog-name      "tt"]
-     [prog-version   ((info:get-info (list prog-name)) 'version)]
+     [prog-version   (info:#%info-lookup 'version)]
      [prog-uri       "https://github.com/xandkar/tt"]
      [user-feed-file (expand-user-path "~/twtxt-me.txt")]
      [user
This page took 0.025047 seconds and 4 git commands to generate.