nix-overlay/pkgs/openhexagon/openhexagon.nix

86 lines
2 KiB
Nix
Raw Normal View History

2021-01-06 23:55:24 +01:00
{ stdenv, fetchgit, makeWrapper,
cmake,
lua5_1,
sfml,
sparsehash,
ssvjsoncpp,
ssvutils,
ssvluawrapper,
ssvmenusystem,
ssvutilsjson,
ssvstart,
ssventitysystem,
rsync,
}:
stdenv.mkDerivation rec {
pname = "OpenHexagon";
version = "1.92b";
src = fetchgit {
url = "https://github.com/SuperV1234/SSVOpenHexagon";
rev = "refs/tags/${version}";
deepClone = true;
sha256 = "0qg7zxjswplzxnp6pmimvyly68zk3pd8jbv6a1ywv8jrfrdfpah1";
};
binpkg = builtins.fetchTarball {
url = "https://vittorioromeo.info/Downloads/OpenHexagon/Linux/OpenHexagonV1.92.tar.gz";
sha256 = "08rv97kr4cix2zshmi9avs92x5cryhg9f18abhpqbrpcr0mrganh";
};
nativeBuildInputs = [
cmake
makeWrapper
];
buildInputs = [
lua5_1
sfml
sparsehash
ssvjsoncpp
ssvutils
ssvluawrapper
ssvmenusystem
ssvutilsjson
ssvstart
ssventitysystem
];
preConfigure = ''
rm -r ./extlibs/*
ln -s ${ssventitysystem}/share ./extlibs/${ssventitysystem.pname};
ln -s ${ssvjsoncpp}/share ./extlibs/${ssvjsoncpp.pname};
ln -s ${ssvmenusystem}/share ./extlibs/${ssvmenusystem.pname};
ln -s ${ssvstart}/share ./extlibs/${ssvstart.pname};
ln -s ${ssvutils}/share ./extlibs/${ssvutils.pname};
ln -s ${ssvutilsjson}/share ./extlibs/${ssvutilsjson.pname};
ln -s ${ssvluawrapper}/share ./extlibs/${ssvluawrapper.pname};
'';
patches = [
./SSVOpenHexagon-Profiles-in-home-dir.patch
];
cmakeFlags = [
"-DLUA_INCLUDE_DIR=${lua5_1}/include"
];
installPhase = ''
install -Dm755 SSVOpenHexagon $out/bin/openhexagon
mkdir -p $out/share/OpenHexagon
cp -r ${src}/_RELEASE/{config.json,ConfigOverrides} $out/share/OpenHexagon
cp -r ${binpkg}/{Assets,Packs} $out/share/OpenHexagon
'';
postFixup = ''
wrapProgram "$out/bin/openhexagon" --run "cd $out/share/OpenHexagon/"
'';
meta = with stdenv.lib; {
description = "C++14 FOSS clone of Super Hexagon";
homepage = "https://openhexagon.org/";
license = licenses.afl3;
};
}