forked from OpenXcom/OpenXcom
-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
167 additions
and
4 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
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,84 @@ | ||
{ | ||
inputs = { | ||
systems.url = "github:nix-systems/default"; | ||
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable"; | ||
}; | ||
|
||
outputs = | ||
{ | ||
self, | ||
nixpkgs, | ||
systems, | ||
}: | ||
let | ||
forEachSystem = | ||
f: nixpkgs.lib.genAttrs (import systems) (system: f { pkgs = import nixpkgs { inherit system; }; }); | ||
in | ||
{ | ||
devShells = forEachSystem ( | ||
{ pkgs }: | ||
{ | ||
default = | ||
pkgs.mkShell.override | ||
{ | ||
# override clang 16 runtime | ||
stdenv = pkgs.lowPrio pkgs.llvmPackages_16.stdenv; | ||
} | ||
{ | ||
propagatedBuildInputs = [ | ||
pkgs.SDL_compat | ||
pkgs.SDL_image | ||
pkgs.libwebp | ||
]; | ||
# when using SDL_compat instead of SDL_classic, SDL_mixer isn't correctly | ||
# detected, but there is no harm just specifying it | ||
buildInputs = with pkgs; [ | ||
git | ||
pkg-config | ||
apple-sdk_15 | ||
|
||
# Need to use brew cmake since nix use old one 3.30.5 | ||
# which has issues with copy libraries to macOs app | ||
#cmake | ||
# use clang explicitly since don't use cmake | ||
clang_16 | ||
# OpenXcom dependecies | ||
rapidyaml | ||
zlib | ||
#SDL_mixer | ||
# SDL_image | ||
# SDL_gfx | ||
# Try to build using SDL12_compat | ||
(SDL_compat.overrideAttrs (old: { | ||
postInstall = '' | ||
ln -s $out/lib/pkgconfig/sdl12_compat.pc $out/lib/pkgconfig/sdl.pc | ||
''; | ||
})) | ||
(SDL_mixer.override (old: { | ||
SDL = SDL_compat; | ||
smpeg = old.smpeg.override { | ||
SDL = SDL_compat; | ||
}; | ||
})) | ||
(SDL_gfx.override (old: { | ||
SDL = SDL_compat; | ||
})) | ||
( | ||
(SDL_image.override (old: { | ||
SDL = SDL_compat; | ||
})).overrideAttrs | ||
(old: { | ||
propagatedBuildInputs = [ SDL_compat ]; | ||
src = pkgs.fetchurl { | ||
url = "https://github.com/libsdl-org/SDL_image/archive/refs/heads/SDL-1.2.tar.gz"; | ||
hash = "sha256-0/s5eknEiqq/sOt3XTKWMdbEVQFOGmhVLQ9Vqthn5tU="; | ||
}; | ||
patches = [ ]; | ||
}) | ||
) | ||
]; | ||
}; | ||
} | ||
); | ||
}; | ||
} |
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