electron_32: fix log spam when building on aarch64-linux (#378988)
[NixPkgs.git] / pkgs / by-name / ng / ngn-k / package.nix
blob4268f816f087e18399ac992e344d13de21e7357d
1 { lib
2 , stdenv
3 , stdenvNoLibs
4 , fetchFromGitea
5 , runtimeShell
6 }:
8 stdenv.mkDerivation {
9   pname = "ngn-k";
10   version = "0-unstable-2025-01-04";
12   src = fetchFromGitea {
13     domain = "codeberg.org";
14     owner = "ngn";
15     repo = "k";
16     rev = "feb51a61443dac03213c4e97edd8df679a4a3aaa";
17     sha256 = "14v2bwbgaxi1rsq5xabp5dmv0bl0vga3lhzwdxyvsyl9q7qybf55";
18   };
20   patches = [
21     ./repl-license-path.patch
22     ./repl-argv-1.patch
23   ];
25   postPatch = ''
26     # don't use hardcoded /bin/sh
27     for f in repl.k m.c;do
28       substituteInPlace "$f" --replace-fail "/bin/sh" "${runtimeShell}"
29     done
30   '';
32   makeFlags = [ "-e" ];
33   buildFlags = [
34     "k"
35     "libk.so"
36   ];
37   checkTarget = "t";
39   outputs = [ "out" "dev" "lib" ];
41   # TODO(@sternenseemann): package bulgarian translation
42   installPhase = ''
43     runHook preInstall
44     install -Dm755 k "$out/bin/k"
45     install -Dm755 repl.k "$out/bin/k-repl"
46     install -Dm755 libk.so "$lib/lib/libk.so"
47     install -Dm644 k.h "$dev/include/k.h"
48     install -Dm644 LICENSE -t "$out/share/ngn-k"
49     substituteInPlace "$out/bin/k-repl" --replace-fail "#!k" "#!$out/bin/k"
50     runHook postInstall
51   '';
53   meta = {
54     description = "Simple fast vector programming language";
55     homepage = "https://codeberg.org/ngn/k";
56     license = lib.licenses.agpl3Only;
57     maintainers = [ lib.maintainers.sternenseemann ];
58     platforms = [ "x86_64-linux" "x86_64-freebsd" ];
59   };