-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Also adds options to the CMake build system to unvendor some dependencies to make packaging easier, along with installing the final executable.
- Loading branch information
1 parent
8abce81
commit 15cc273
Showing
4 changed files
with
195 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
{ | ||
pkgs ? import <nixpkgs> {}, | ||
lib ? pkgs.lib | ||
}: | ||
|
||
pkgs.stdenv.mkDerivation { | ||
pname = "skyemu"; | ||
version = "3-unstable-2025-01-25"; | ||
|
||
src = ./.; | ||
|
||
postPatch = '' | ||
# Nixpkgs does not support macOS universal builds | ||
substituteInPlace CMakeLists.txt \ | ||
--replace-fail "set(CMAKE_OSX_ARCHITECTURES" "#" | ||
''; | ||
|
||
nativeBuildInputs = with pkgs; [ | ||
cmake | ||
ninja | ||
pkg-config | ||
]; | ||
|
||
buildInputs = with pkgs; [ | ||
curl | ||
openssl | ||
SDL2 | ||
] | ||
++ lib.optionals stdenv.hostPlatform.isLinux (with pkgs; [ | ||
alsa-lib | ||
xorg.libXcursor | ||
xorg.libXi | ||
xorg.xinput | ||
]); | ||
|
||
cmakeFlags = [ | ||
(lib.cmakeBool "USE_SYSTEM_CURL" true) | ||
(lib.cmakeBool "USE_SYSTEM_OPENSSL" true) | ||
(lib.cmakeBool "USE_SYSTEM_SDL2" true) | ||
]; | ||
|
||
meta = { | ||
mainProgram = "SkyEmu"; | ||
license = lib.licenses.mit; | ||
}; | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{ | ||
inputs = { | ||
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; | ||
flake-utils.url = "github:numtide/flake-utils"; | ||
}; | ||
|
||
outputs = { nixpkgs, flake-utils, ... }: | ||
flake-utils.lib.eachDefaultSystem (system: | ||
let | ||
pkgs = import nixpkgs { inherit system; }; | ||
package = pkgs.callPackage ./default.nix {}; | ||
in { | ||
packages.default = package; | ||
apps.default = { | ||
type = "app"; | ||
program = | ||
if pkgs.stdenv.isDarwin then | ||
"${package}/Applications/SkyEmu.app/Contents/MacOS/SkyEmu" | ||
else "${package}/bin/SkyEmu"; | ||
}; | ||
}); | ||
} |