mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-12 00:33:10 +00:00
Merge pull request #128722 from peterhoeg/p/weidu
This commit is contained in:
commit
2dd054292c
50
pkgs/development/tools/elkhound/default.nix
Normal file
50
pkgs/development/tools/elkhound/default.nix
Normal file
@ -0,0 +1,50 @@
|
||||
{ stdenv
|
||||
, lib
|
||||
, fetchFromGitHub
|
||||
, bison
|
||||
, cmake
|
||||
, flex
|
||||
, perl
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "elkhound";
|
||||
version = "unstable-2020-04-13";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "WeiDUorg";
|
||||
repo = pname;
|
||||
rev = "a7eb4bb2151c00cc080613a770d37560f62a285c";
|
||||
sha256 = "sha256-Y96OFpBNrD3vrKoEZ4KdJuI1Q4RmYANsu7H3ZzfaA6g=";
|
||||
};
|
||||
|
||||
postPatch = ''
|
||||
patchShebangs scripts
|
||||
'';
|
||||
|
||||
sourceRoot = "source/src";
|
||||
|
||||
nativeBuildInputs = [ bison cmake flex perl ];
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
|
||||
install -Dm555 -t $out/bin ast/astgen elkhound/elkhound
|
||||
for d in ast elkhound smbase; do
|
||||
install -Dm444 -t $out/lib $d/*.a
|
||||
install -Dm444 -t $out/include/$d $src/src/$d/*.h
|
||||
done
|
||||
install -Dm444 -t $out/share/doc/${pname} $src/src/elkhound/*.txt
|
||||
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
description = "A parser generator which emits GLR parsers, either in OCaml or C++";
|
||||
homepage = "https://scottmcpeak.com/elkhound/";
|
||||
license = licenses.bsd3;
|
||||
maintainers = with maintainers; [ peterhoeg ];
|
||||
# possibly works on Darwin
|
||||
platforms = platforms.linux;
|
||||
};
|
||||
}
|
65
pkgs/tools/games/weidu/default.nix
Normal file
65
pkgs/tools/games/weidu/default.nix
Normal file
@ -0,0 +1,65 @@
|
||||
{ stdenv
|
||||
, lib
|
||||
, fetchFromGitHub
|
||||
, elkhound
|
||||
, ocaml-ng
|
||||
, perl
|
||||
, which
|
||||
}:
|
||||
|
||||
let
|
||||
# 1. Needs ocaml >= 4.04 and <= 4.11
|
||||
# 2. ocaml 4.10 defaults to safe (immutable) strings so we need a version with
|
||||
# that disabled as weidu is strongly dependent on mutable strings
|
||||
ocaml' = ocaml-ng.ocamlPackages_4_10.ocaml.overrideAttrs (old: {
|
||||
configureFlags = old.configureFlags ++ [
|
||||
# https://github.com/WeiDUorg/weidu/issues/197
|
||||
"--disable-force-safe-string"
|
||||
];
|
||||
});
|
||||
|
||||
in
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "weidu";
|
||||
version = "247.00";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "WeiDUorg";
|
||||
repo = pname;
|
||||
rev = "v${version}";
|
||||
sha256 = "sha256-vAIIYn0urQnnL82mdfwJtahrS3uWPFferm+0F13TKcw=";
|
||||
};
|
||||
|
||||
postPatch = ''
|
||||
substitute sample.Configuration Configuration \
|
||||
--replace /usr/bin ${lib.makeBinPath [ ocaml' ]} \
|
||||
--replace elkhound ${elkhound}/bin/elkhound
|
||||
|
||||
mkdir -p obj/{.depend,x86_LINUX}
|
||||
'';
|
||||
|
||||
nativeBuildInputs = [ elkhound ocaml' perl which ];
|
||||
|
||||
buildFlags = [ "weidu" "weinstall" "tolower" ];
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
|
||||
for b in tolower weidu weinstall; do
|
||||
install -Dm555 $b.asm.exe $out/bin/$b
|
||||
done
|
||||
|
||||
install -Dm444 -t $out/share/doc/weidu README* COPYING
|
||||
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
description = "InfinityEngine Modding Engine";
|
||||
homepage = "https://weidu.org";
|
||||
license = licenses.gpl2Only;
|
||||
maintainers = with maintainers; [ peterhoeg ];
|
||||
# should work fine on both Darwin and Windows
|
||||
platforms = platforms.linux;
|
||||
};
|
||||
}
|
@ -873,6 +873,10 @@ in
|
||||
libgamemode32 = pkgsi686Linux.gamemode.lib;
|
||||
};
|
||||
|
||||
elkhound = callPackage ../development/tools/elkhound { };
|
||||
|
||||
weidu = callPackage ../tools/games/weidu { };
|
||||
|
||||
gfshare = callPackage ../tools/security/gfshare { };
|
||||
|
||||
gobgp = callPackage ../tools/networking/gobgp { };
|
||||
|
Loading…
Reference in New Issue
Block a user