status-lib/nim_status_lib.nimble
Andrea Franz 45887b1724
Keycard initial integration (#63)
* add nim-keycard-go to makefile

* fix keycard-go build

* add keycard.nim

* remove test make task

* remove debug line from makefile

* fix import keycard_go

* add keycard-go to .PHONY

* add keycard start/stop/select methods

* use https url for submodule

* add KeycardApplication info and return it from select

* update nim-keycard-go version

* fix select return type

* actually return the result

* update nim-keycard-go

* add keycard methods to backend

* add base/mock keycard backends

* imports

* export keycard methods in backend

* update start/stop keycard implementation

* add KeycardStarted signal

* fix keycard started signal

* rename to KeycardConnected signal

* fix keycard signal renamed

* add keycardgo in makefile tasks

* add back build/.gitignore

* fix .gitignore

* fix .gitignore

* Makefile: export keycard vars

* add keycard lib to nimble file

* use spaces instead of tabs in non-recipe sections of Makefile

* use install_name_tool on libkeycard on macOS

* in GHA ubuntu environment install libpcsclite-dev with apt at start of workflow

* add Keycard exceptions

* remove useless test

* remove useless return

* move keycard types to /types

* reraise exception from status/keycard.nim

* remove unused import

* add keycard commands: opensecure channel, pair, verify pin, export key

* fix last keycard commands

* add exportKey params

* update nim-keycard-go

Co-authored-by: Michele Balistreri <michele@bitgamma.com>
Co-authored-by: Michael Bradley, Jr <michaelsbradleyjr@gmail.com>
2021-10-04 17:21:07 -04:00

58 lines
2.0 KiB
Nim

mode = ScriptMode.Verbose
version = "0.1.0"
author = "Status Research & Development GmbH"
description = "WIP refactor to extract business logic from status-desktop into a reusable library"
license = "MIT"
skipDirs = @["test"]
requires "nim >= 1.2.0"
import strutils
const release_opts =
" --define:danger" &
" --define:strip" &
" --hints:off" &
" --opt:size" &
" --passC:-flto" &
" --passL:-flto"
const debug_opts =
" --debugger:native" &
" --define:chronicles_line_numbers" &
" --define:debug" &
" --linetrace:on" &
" --stacktrace:on"
proc buildAndRun(name: string,
srcDir = "test_nim/",
outDir = "test_nim/build/",
params = "",
cmdParams = "",
lang = "c") =
mkDir outDir
exec "nim " &
lang &
(if getEnv("RELEASE").strip != "false": release_opts else: debug_opts) &
(if defined(windows): " --define:usePcreHeader" else: "") &
" --define:ssl" &
" --nimcache:nimcache/" & (if getEnv("RELEASE").strip != "false": "release/" else: "debug/") & name &
(if getEnv("PCRE_LDFLAGS").strip != "": " --passL:\"" & getEnv("PCRE_LDFLAGS") & "\"" else: "") &
" --passL:\"-L" & getEnv("STATUSGO_LIBDIR") & " -lstatus \"" &
" --passL:\"-L" & getEnv("KEYCARDGO_LIBDIR") & " -lkeycard \"" &
" --out:" & outDir & name &
" " &
srcDir & name & ".nim"
if defined(macosx):
exec "install_name_tool -add_rpath " & getEnv("STATUSGO_LIBDIR") & " " & outDir & name
exec "install_name_tool -change " & "libstatus." & getEnv("LIBSTATUS_EXT") & " @rpath/libstatus." & getEnv("LIBSTATUS_EXT") & " " & outDir & name
exec "install_name_tool -add_rpath " & getEnv("KEYCARDGO_LIBDIR") & " " & outDir & name
exec "install_name_tool -change " & "libkeycard." & getEnv("LIBKEYCARD_EXT") & " @rpath/libkeycard." & getEnv("LIBKEYCARD_EXT") & " " & outDir & name
if getEnv("RUN_AFTER_BUILD").strip != "false":
exec outDir & name
task tests, "Build and run all tests":
rmDir "test_nim/build/"
buildAndRun "test_all"