Skip to content

Commit

Permalink
Fully reproducible dev environment (OpenRCT2#8017)
Browse files Browse the repository at this point in the history
* Add nix shell

* Delete unused assignment

* Delete comment from wihc unstalbe this is

* fix name

* Attempt to make it build on OSX

* Full path  to foundation and appkit

* This also works with nix-build
  • Loading branch information
jappeace authored and janisozaur committed Sep 27, 2018
1 parent 9ff79e6 commit ffafa5b
Showing 1 changed file with 70 additions and 0 deletions.
70 changes: 70 additions & 0 deletions shell.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
{ pkgs ? (
let
hostPkgs = import <nixpkgs> {};
pinnedPkgs = hostPkgs.fetchFromGitHub {
owner = "NixOS";
repo = "nixpkgs-channels";
rev = "08d245eb31a3de0ad73719372190ce84c1bf3aee";
sha256 = "1g22f8r3l03753s67faja1r0dq0w88723kkfagskzg9xy3qs8yw8";
};
in
import pinnedPkgs {}
)
}:
let
objects-src = pkgs.fetchFromGitHub {
owner = "OpenRCT2";
repo = "objects";
rev = "v1.0.6";
sha256 = "1yhyafsk2lyasgj1r7h2n4k7vp5q792aj86ggpbmd6bcp4kk6hbm";
};

title-sequences-src = pkgs.fetchFromGitHub {
owner = "OpenRCT2";
repo = "title-sequences";
rev = "v0.1.2";
sha256 = "1yb1ynkfmiankii3fngr9km5wbc07rp30nh0apkj6wryrhy7imgm";
};
in
pkgs.stdenv.mkDerivation {
name = "openrct2";
src = ./.;

cmakeFlags = [
"-DCMAKE_BUILD_TYPE=RELWITHDEBINFO"
"-DDOWNLOAD_OBJECTS=OFF"
"-DDOWNLOAD_TITLE_SEQUENCES=OFF"
];

postUnpack = ''
cp -r ${objects-src} $sourceRoot/data/object
cp -r ${title-sequences-src} $sourceRoot/data/title
'';
preFixup = "ln -s $out/share/openrct2 $out/bin/data";


makeFlags = ["all" "g2"];

buildInputs = [
pkgs.SDL2
pkgs.cmake
pkgs.curl
pkgs.fontconfig
pkgs.freetype
pkgs.icu
pkgs.jansson
pkgs.libiconv
pkgs.libpng
pkgs.libGLU
pkgs.libzip
pkgs.openssl
pkgs.pkgconfig
pkgs.speexdsp
pkgs.xorg.libpthreadstubs
pkgs.zlib
] ++ (pkgs.stdenv.lib.optionals pkgs.stdenv.isDarwin [
pkgs.darwin.apple_sdk.frameworks.Foundation # osX hacks
pkgs.darwin.apple_sdk.frameworks.AppKit
pkgs.darwin.libobjc ]
);
}

0 comments on commit ffafa5b

Please sign in to comment.