-46
build.sh
-46
build.sh
···
1
-
#! /usr/bin/env bash
2
-
3
-
ff_filter() {
4
-
fontforge -c 'open(argv[1]).generate(argv[2])' "$1" "$2"
5
-
}
6
-
7
-
ttf_filter() {
8
-
# 1 - source file
9
-
# 2 - destination file
10
-
BNP=${BNP:="./BitsNPicas.jar"}
11
-
java -jar "$BNP" convertbitmap -f ttf -o "$2" "$1"
12
-
}
13
-
14
-
export_fonts() {
15
-
for i in src/*; do
16
-
local file_name
17
-
file_name=$(basename "${i%.*}")
18
-
ttf_filter "$i" "build/scientifica/ttf/$file_name.ttf"
19
-
ff_filter "$i" "build/scientifica/otb/$file_name.otb"
20
-
ff_filter "$i" "build/scientifica/bdf/$file_name.bdf"
21
-
done
22
-
}
23
-
24
-
export_plugins() {
25
-
cp -r ligature_plugins build/scientifica/ligature_plugins
26
-
}
27
-
28
-
main() {
29
-
rm -rf build
30
-
mkdir -p build/scientifica/{otb,ttf,bdf}
31
-
32
-
echo "[~] Exporting ligature plugins ..."
33
-
export_plugins
34
-
35
-
echo "[~] Exporting fonts ..."
36
-
export_fonts
37
-
38
-
echo "[~] Entering build directory ..."
39
-
cd build || echo "[!] Failed to enter build directory!"
40
-
tar c --file scientifica.tar scientifica
41
-
echo "[~] Leaving build directory ..."
42
-
43
-
echo "[!] Done!"
44
-
}
45
-
46
-
main
+44
flake.lock
+44
flake.lock
···
1
+
{
2
+
"nodes": {
3
+
"bitsnpicas-src": {
4
+
"flake": false,
5
+
"locked": {
6
+
"lastModified": 1632715939,
7
+
"narHash": "sha256-7QnQeKEAQry1aSXqmgwwTnuXVroUdpo+8t6aJhfO+1I=",
8
+
"owner": "kreativekorp",
9
+
"repo": "bitsnpicas",
10
+
"rev": "b47896afe02a381f5e76871a8c7da0ce50d76a99",
11
+
"type": "github"
12
+
},
13
+
"original": {
14
+
"owner": "kreativekorp",
15
+
"repo": "bitsnpicas",
16
+
"type": "github"
17
+
}
18
+
},
19
+
"nixpkgs": {
20
+
"locked": {
21
+
"lastModified": 1632918953,
22
+
"narHash": "sha256-XY3TKBfhP7wCu/SeqrwIkTWkyYHy5W1yRR8pxyzRY9Y=",
23
+
"owner": "NixOS",
24
+
"repo": "nixpkgs",
25
+
"rev": "ee90403e147b181300dffca5b0afa405e14f1945",
26
+
"type": "github"
27
+
},
28
+
"original": {
29
+
"owner": "NixOS",
30
+
"ref": "nixos-21.05",
31
+
"repo": "nixpkgs",
32
+
"type": "github"
33
+
}
34
+
},
35
+
"root": {
36
+
"inputs": {
37
+
"bitsnpicas-src": "bitsnpicas-src",
38
+
"nixpkgs": "nixpkgs"
39
+
}
40
+
}
41
+
},
42
+
"root": "root",
43
+
"version": 7
44
+
}
+8
-10
flake.nix
+8
-10
flake.nix
···
33
33
overlay = final: prev: rec {
34
34
35
35
bitsnpicas = with final; pkgs.writeScriptBin "bitsnpicas" ''
36
-
${jdk}/bin/java -jar ${bitsnpicas-src}/downloads/BitsNPicas.jar
36
+
${jdk}/bin/java -jar ${bitsnpicas-src}/downloads/BitsNPicas.jar "$@"
37
37
'';
38
38
39
39
scientifica = with final; pkgs.stdenvNoCC.mkDerivation {
40
40
pname = "scientifica";
41
41
version = "v2.3";
42
-
src = ./.;
42
+
src = ./src;
43
43
44
44
buildPhase = ''
45
45
runHook preBuild
46
46
47
-
fontforge=${pkgs.fontforge}/bin/fontforge
48
-
bitsnpicas=${self.packages.bitsnpicas}/bin/bitsnpicas
49
-
50
47
ff_filter() {
51
-
fontforge -c 'open(argv[1]).generate(argv[2])' "$@"
48
+
${pkgs.fontforge}/bin/fontforge -c 'open(argv[1]).generate(argv[2])' "$@"
52
49
}
53
50
54
51
ttf_filter() {
55
-
bitsnpicas convertbitmap -f ttf -o "$2" "$1"
52
+
${pkgs.bitsnpicas}/bin/bitsnpicas convertbitmap -f ttf -o "$2" "$1"
56
53
}
57
54
58
55
mkdir -p $out/{ttf,otb,bdf}
···
68
65
ff_filter "$i" "$out/bdf/$file_name.bdf"
69
66
done
70
67
71
-
# copy ligature plugins
72
-
cp -r $src/ligature_plugins $out/ligature_plugins
73
-
74
68
popd
75
69
76
70
runHook postBuild
71
+
'';
72
+
73
+
installPhase = ''
74
+
true
77
75
'';
78
76
79
77
};
+1
-1
ligature_plugins/README.md
+1
-1
ligature_plugins/README.md
···
15
15
cp ligature_plugins/rust.vim ~/.vim/after/syntax/
16
16
```
17
17
18
-
If you have `set conceallevel=0` if your `vimrc`, remove it.
18
+
If you have `set conceallevel=0` in your `vimrc`, remove it.
19
19
20
20
Big thanks to [romeovs](https://github.com/romeovs/) for
21
21
creating the haskell plugin and the idea of ligatures via