git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #128722 from peterhoeg/p/weidu
commit2dd054292c87bdf93756e4d028905b9b0c23422f authorSandro <sandro.jaeckel@gmail.com> dateMon 5 Jul 2021, 23:13 (5 years ago) parent3ac484e9bf8cea
3 files changed+119
pkgs/development/tools/elkhound/default.nix+50 pkgs/tools/games/weidu/default.nix+65 pkgs/top-level/all-packages.nix+4
pkgs/development/tools/elkhound/default.nixnew file+50
@@ -0,0 +1,50 @@
1+{ stdenv
2+, lib
3+, fetchFromGitHub
4+, bison
5+, cmake
6+, flex
7+, perl
8+}:
9+
10+stdenv.mkDerivation rec {
11+ pname = "elkhound";
12+ version = "unstable-2020-04-13";
13+
14+ src = fetchFromGitHub {
15+ owner = "WeiDUorg";
16+ repo = pname;
17+ rev = "a7eb4bb2151c00cc080613a770d37560f62a285c";
18+ sha256 = "sha256-Y96OFpBNrD3vrKoEZ4KdJuI1Q4RmYANsu7H3ZzfaA6g=";
19+ };
20+
21+ postPatch = ''
22+ patchShebangs scripts
23+ '';
24+
25+ sourceRoot = "source/src";
26+
27+ nativeBuildInputs = [ bison cmake flex perl ];
28+
29+ installPhase = ''
30+ runHook preInstall
31+
32+ install -Dm555 -t $out/bin ast/astgen elkhound/elkhound
33+ for d in ast elkhound smbase; do
34+ install -Dm444 -t $out/lib $d/*.a
35+ install -Dm444 -t $out/include/$d $src/src/$d/*.h
36+ done
37+ install -Dm444 -t $out/share/doc/${pname} $src/src/elkhound/*.txt
38+
39+ runHook postInstall
40+ '';
41+
42+ meta = with lib; {
43+ description = "A parser generator which emits GLR parsers, either in OCaml or C++";
44+ homepage = "https://scottmcpeak.com/elkhound/";
45+ license = licenses.bsd3;
46+ maintainers = with maintainers; [ peterhoeg ];
47+ # possibly works on Darwin
48+ platforms = platforms.linux;
49+ };
50+}
pkgs/tools/games/weidu/default.nixnew file+65
@@ -0,0 +1,65 @@
1+{ stdenv
2+, lib
3+, fetchFromGitHub
4+, elkhound
5+, ocaml-ng
6+, perl
7+, which
8+}:
9+
10+let
11+ # 1. Needs ocaml >= 4.04 and <= 4.11
12+ # 2. ocaml 4.10 defaults to safe (immutable) strings so we need a version with
13+ # that disabled as weidu is strongly dependent on mutable strings
14+ ocaml' = ocaml-ng.ocamlPackages_4_10.ocaml.overrideAttrs (old: {
15+ configureFlags = old.configureFlags ++ [
16+ # https://github.com/WeiDUorg/weidu/issues/197
17+ "--disable-force-safe-string"
18+ ];
19+ });
20+
21+in
22+stdenv.mkDerivation rec {
23+ pname = "weidu";
24+ version = "247.00";
25+
26+ src = fetchFromGitHub {
27+ owner = "WeiDUorg";
28+ repo = pname;
29+ rev = "v${version}";
30+ sha256 = "sha256-vAIIYn0urQnnL82mdfwJtahrS3uWPFferm+0F13TKcw=";
31+ };
32+
33+ postPatch = ''
34+ substitute sample.Configuration Configuration \
35+ --replace /usr/bin ${lib.makeBinPath [ ocaml' ]} \
36+ --replace elkhound ${elkhound}/bin/elkhound
37+
38+ mkdir -p obj/{.depend,x86_LINUX}
39+ '';
40+
41+ nativeBuildInputs = [ elkhound ocaml' perl which ];
42+
43+ buildFlags = [ "weidu" "weinstall" "tolower" ];
44+
45+ installPhase = ''
46+ runHook preInstall
47+
48+ for b in tolower weidu weinstall; do
49+ install -Dm555 $b.asm.exe $out/bin/$b
50+ done
51+
52+ install -Dm444 -t $out/share/doc/weidu README* COPYING
53+
54+ runHook postInstall
55+ '';
56+
57+ meta = with lib; {
58+ description = "InfinityEngine Modding Engine";
59+ homepage = "https://weidu.org";
60+ license = licenses.gpl2Only;
61+ maintainers = with maintainers; [ peterhoeg ];
62+ # should work fine on both Darwin and Windows
63+ platforms = platforms.linux;
64+ };
65+}
pkgs/top-level/all-packages.nix+4
@@ -873,6 +873,10 @@ in
873873 libgamemode32 = pkgsi686Linux.gamemode.lib;
874874 };
875875
876+ elkhound = callPackage ../development/tools/elkhound { };
877+
878+ weidu = callPackage ../tools/games/weidu { };
879+
876880 gfshare = callPackage ../tools/security/gfshare { };
877881
878882 gobgp = callPackage ../tools/networking/gobgp { };