mirror of
https://github.com/nillerusr/source-engine.git
synced 2025-02-05 03:34:15 +00:00
create .desktop file, pass parameters to hl2_launcher
This commit is contained in:
parent
6850933db7
commit
ad1491d944
34
build.nix
34
build.nix
@ -1,16 +1,46 @@
|
|||||||
{ callPackage
|
{ callPackage
|
||||||
, symlinkJoin
|
, symlinkJoin
|
||||||
|
, fetchurl
|
||||||
|
, makeDesktopItem
|
||||||
|
, copyDesktopItems
|
||||||
, hl2-unwrapped ? callPackage ./hl2-unwrapped.nix { }
|
, hl2-unwrapped ? callPackage ./hl2-unwrapped.nix { }
|
||||||
, hl2-wrapper ? callPackage ./hl2-wrapper.nix { inherit hl2-unwrapped; }
|
, hl2-wrapper ? callPackage ./hl2-wrapper.nix { inherit hl2-unwrapped; }
|
||||||
}:
|
}:
|
||||||
|
|
||||||
symlinkJoin {
|
let
|
||||||
name = "hl2";
|
name = "hl2";
|
||||||
|
|
||||||
|
icon = fetchurl {
|
||||||
|
url = "https://upload.wikimedia.org/wikipedia/commons/1/14/Half-Life_2_Logo.svg";
|
||||||
|
hash = "sha256-/4GlYVAUSZiK7eLjM/HymcGphk5s2uCPOQuB1XOstuI=";
|
||||||
|
};
|
||||||
|
in
|
||||||
|
symlinkJoin rec{
|
||||||
|
inherit name;
|
||||||
|
|
||||||
paths = [
|
paths = [
|
||||||
hl2-unwrapped
|
hl2-unwrapped
|
||||||
hl2-wrapper
|
hl2-wrapper
|
||||||
|
] ++ desktopItems;
|
||||||
|
|
||||||
|
nativeBuildInputs = [
|
||||||
|
copyDesktopItems
|
||||||
];
|
];
|
||||||
|
|
||||||
postBuild = "ln -s $out/bin/hl2-wrapper $out/bin/hl2";
|
postBuild = ''
|
||||||
|
ln -s $out/bin/hl2-wrapper $out/bin/${name}
|
||||||
|
|
||||||
|
install -Dm444 ${icon} $out/share/icons/hicolor/scalable/apps/${name}.svg
|
||||||
|
'';
|
||||||
|
|
||||||
|
desktopItems = [
|
||||||
|
(makeDesktopItem {
|
||||||
|
name = "${name}";
|
||||||
|
exec = "${name}";
|
||||||
|
icon = "${name}";
|
||||||
|
desktopName = "Half-Life 2";
|
||||||
|
comment = "Built from the leaked source code";
|
||||||
|
categories = [ "Game" ];
|
||||||
|
})
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
@ -43,6 +43,6 @@ stdenv.mkDerivation {
|
|||||||
wafConfigureFlags = [
|
wafConfigureFlags = [
|
||||||
"-T fastnative"
|
"-T fastnative"
|
||||||
"--disable-warns"
|
"--disable-warns"
|
||||||
"--build-flags=-Wno-error=format-security,-O3"
|
"--build-flags=-Wno-error=format-security"
|
||||||
] ++ extraWafConfigureFlags;
|
] ++ extraWafConfigureFlags;
|
||||||
}
|
}
|
||||||
|
@ -53,6 +53,10 @@ writeShellScriptBin "hl2-wrapper" ''
|
|||||||
resource_path="$2"
|
resource_path="$2"
|
||||||
shift 2
|
shift 2
|
||||||
;;
|
;;
|
||||||
|
-p | --parameters) # Sets parameters passed to hl2 launcher (encapsulated with quotes)
|
||||||
|
launcher_parameters="$2"
|
||||||
|
shift 2
|
||||||
|
;;
|
||||||
--impermanent) # Don't save newly created files that are not in symlimked folders (you probably don't want to use this)
|
--impermanent) # Don't save newly created files that are not in symlimked folders (you probably don't want to use this)
|
||||||
impermanent=true
|
impermanent=true
|
||||||
shift 1
|
shift 1
|
||||||
@ -101,5 +105,5 @@ writeShellScriptBin "hl2-wrapper" ''
|
|||||||
|
|
||||||
trap cleanup EXIT
|
trap cleanup EXIT
|
||||||
|
|
||||||
( cd $tmp_dir ; ./hl2_launcher )
|
( cd $tmp_dir ; ./hl2_launcher $launcher_parameters )
|
||||||
''
|
''
|
||||||
|
Loading…
x
Reference in New Issue
Block a user