dosbox-staging: writeShellScript into makeWrapper

This commit is contained in:
Joshua Fern
2021-10-10 17:06:02 -07:00
parent 076ce97202
commit f9b4e32ca8

View File

@@ -1,14 +1,9 @@
{ stdenv, lib, fetchFromGitHub, writeShellScript
, gtest, meson, ninja, pkg-config
{ lib, fetchFromGitHub, stdenv
, gtest, makeWrapper, meson, ninja, pkg-config
, alsa-lib, fluidsynth, libGL, libGLU, libogg, libpng, munt, opusfile, SDL2, SDL2_net
}:
let
dosbox_run = writeShellScript "dosbox" ''
$(dirname "$0")/dosbox-staging "$@"
'';
in stdenv.mkDerivation rec {
stdenv.mkDerivation rec {
pname = "dosbox-staging";
version = "0.77.1";
@@ -19,7 +14,7 @@ in stdenv.mkDerivation rec {
sha256 = "07jwmmm1bhfxavlhl854cj8l5iy5hqx5hpwkkjbcwqg7yh9jfs2x";
};
nativeBuildInputs = [ gtest meson ninja pkg-config ];
nativeBuildInputs = [ gtest makeWrapper meson ninja pkg-config ];
buildInputs = [ alsa-lib fluidsynth libGL libGLU libogg libpng munt opusfile SDL2 SDL2_net ];
hardeningDisable = [ "format" ];
@@ -39,7 +34,7 @@ in stdenv.mkDerivation rec {
# binary to be named dosbox, but get out of the way of vanilla dosbox if the user
# desires to install that as well.
mv $out/bin/dosbox $out/bin/${pname}
cp -r ${dosbox_run} "$out/bin/dosbox"
makeWrapper $out/bin/dosbox-staging $out/bin/dosbox
cp $out/share/man/man1/dosbox.1.gz $out/share/man/man1/${pname}.1.gz
'';