diff --git a/.gitignore b/.gitignore index cef5039c..1fbba8f8 100644 --- a/.gitignore +++ b/.gitignore @@ -12,3 +12,5 @@ buildpi/ .idea/ android/local.properties android/app/src/main/assets + +result diff --git a/default.nix b/default.nix new file mode 100644 index 00000000..3c53287e --- /dev/null +++ b/default.nix @@ -0,0 +1,74 @@ +{ stdenv +, lib +, fetchFromGitHub +, cmake +, pkg-config +, networkmanager +, libnl +, openssl +, git +, SDL2 +, SDL2_ttf +, SDL2_image +, libwebp +, libtiff +, ffmpeg +, polkit +, libxml2 +, xorg +, libGL +, libdrm +}: +let + hostap = fetchFromGitHub { + owner = "rolandoislas"; + repo = "drc-hostap"; + rev = "418e5e206786de2482864a0ec3a59742a33b6623"; + hash = "sha256-kAv/PetD6Ia5NzmYMWWyWQll1P+N2bL/zaV9ATiGVV0="; + leaveDotGit = true; + }; +in +stdenv.mkDerivation { + pname = "vanilla-wiiu"; + version = "continuous"; + + src = ./.; + + nativeBuildInputs = [ + cmake + pkg-config + git + ]; + buildInputs = [ + networkmanager + libnl + openssl + SDL2 + SDL2_ttf + SDL2_image + libwebp + libtiff + ffmpeg + polkit + libxml2 + xorg.libX11 + libGL + libdrm + ]; + + postPatch = '' + substituteInPlace cmake/FindLibNL.cmake \ + --replace-fail /usr/include/libnl3 ${lib.getDev libnl}/include/libnl3 + substituteInPlace pipe/linux/CMakeLists.txt \ + --replace-fail "https://github.com/rolandoislas/drc-hostap.git" "${hostap}" \ + --replace-fail "--branch master" "--branch fetchgit" + ''; + + meta = { + description = "A software clone of the Wii U gamepad for Linux"; + homepage = "https://github.com/vanilla-wiiu/vanilla"; + license = lib.licenses.gpl2; + mainProgram = "vanilla"; + platforms = lib.platforms.linux; + }; +} diff --git a/flake.lock b/flake.lock new file mode 100644 index 00000000..ebf527d6 --- /dev/null +++ b/flake.lock @@ -0,0 +1,27 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1768028080, + "narHash": "sha256-50aDK+8eLvsLK39TzQhKNq50/HcXyP4hyxOYoPoVxjo=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "d03088749a110d52a4739348f39a63f84bb0be14", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-25.11", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 00000000..fd72c7dd --- /dev/null +++ b/flake.nix @@ -0,0 +1,9 @@ +{ + description = "A software clone of the Wii U gamepad for Linux"; + inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.11"; + outputs = { self, nixpkgs }: { + packages = nixpkgs.lib.genAttrs nixpkgs.lib.platforms.linux (system: { + default = (import nixpkgs { inherit system; }).callPackage ./default.nix { }; + }); + }; +} diff --git a/gui/ui/ui_sdl.c b/gui/ui/ui_sdl.c index 023165df..09bf82ee 100644 --- a/gui/ui/ui_sdl.c +++ b/gui/ui/ui_sdl.c @@ -5,9 +5,9 @@ #include #include #include -#include -#include -#include +#include +#include +#include #include #include #include