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:
parent
544715ddaa
commit
e55ed5c0f4
|
@ -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 ];
|
||||
}
|
19
installdeps
19
installdeps
|
@ -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
|
||||
|
||||
[32mTo build run:[0m
|
||||
|
||||
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:
|
||||
|
|
Loading…
Reference in New Issue