installdeps: Support NixOS.

Add a `default.nix` with the list of dependencies.

Detect NixOS in installdeps and display the `nix-shell` command to
build.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
This commit is contained in:
Rafael Kitover 2021-02-27 05:10:55 +00:00
parent 544715ddaa
commit e55ed5c0f4
No known key found for this signature in database
GPG Key ID: 08AB596679D86240
2 changed files with 23 additions and 1 deletions

5
default.nix Normal file
View File

@ -0,0 +1,5 @@
with import <nixpkgs> {};
stdenv.mkDerivation {
name = "visualboyadvance-m";
buildInputs = [ ninja cmake gcc nasm gettext pkg-config ccache zip sfml zlib ffmpeg wxGTK31-gtk3 mesa glfw SDL2 gtk3-x11 ];
}

View File

@ -177,10 +177,13 @@ linux_installdeps() {
elif [ -f /etc/gentoo-release ]; then
gentoo_installdeps
elif [ -f /etc/os-release ]; then
case "$(. /etc/os-release; echo "$ID_LIKE")" in
case "$(. /etc/os-release; echo "${ID_LIKE:-$ID}")" in
*suse*)
suse_installdeps
;;
nixos)
nixos_installdeps
;;
esac
elif [ -x /usr/bin/pacman ]; then
archlinux_installdeps
@ -807,6 +810,18 @@ suse_installdeps() {
build_instructions
}
nixos_installdeps() {
nixos=1
cat <<EOF
To build run:
nix-shell --command 'mkdir build; cd build; $CMAKE .. $cmake_flags -G Ninja; ninja'
EOF
}
archlinux_require_yaourt() {
if ! command -v yaourt >/dev/null; then
(
@ -1199,3 +1214,5 @@ EOF
}
main "$@"
# vim:et sw=4: