blob: e39a82248542a3836ff216b452736329c1616852 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
|
{ lib, buildNimPackage, fetchFromGitHub, openssl, pcre }:
buildNimPackage (finalAttrs: {
pname = "min";
version = "0.43.0";
src = fetchFromGitHub {
owner = "h3rald";
repo = "min";
rev = "v${finalAttrs.version}";
hash = "sha256-4coeasFZrbwYQ6FM0ENkh/pPcvN3rCuheUpmHr1f3wM=";
};
lockFile = ./lock.json;
buildInputs = [ openssl pcre ];
prePatch = ''
# substitude our code for their code for data
substituteInPlace min.nimble \
--replace-fail 'import' "" \
--replace-warn 'minpkg/core/meta' "" \
--replace-warn 'pkgVersion' '"${finalAttrs.version}"' \
--replace-warn 'pkgAuthor' '""' \
--replace-warn 'pkgDescription' '""' \
--replace-warn 'pkgName' '"${finalAttrs.pname}"' \
# remove vendorabilities
find . -name '*.a' -delete
find minpkg/lib -name '*.nim' \
-exec sed 's|{\.passL:.*\.}|discard|g' -i {} \;
'';
NIX_LDFLAGS = [ "-lpcre" ];
meta = {
description =
"A functional, concatenative programming language with a minimalist syntax";
homepage = "https://min-lang.org/";
changelog = "https://github.com/h3rald/min/releases/tag/${finalAttrs.src.rev}";
license = lib.licenses.mit;
mainProgram = "min";
maintainers = with lib.maintainers; [ ehmry ];
};
})
|