-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:
.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
[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:
- [ ] 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
(define pkg-desc
"twtxt client")
(define version
- "0.11.0")
+ "0.12.0")
(define pkg-authors
'("Siraaj Khandkar <siraaj@khandkar.net>"))
(define deps
(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