remove unused nix build files (#1329)

* remove unused nix build files

* remove nix from readme
This commit is contained in:
water111
2022-05-08 11:28:19 -04:00
committed by GitHub
parent 7b6d732a77
commit 23fabb3bcd
5 changed files with 4 additions and 226 deletions
+4 -25
View File
@@ -22,7 +22,6 @@
- [Getting Started - Linux](#getting-started---linux)
- [Ubuntu (20.04)](#ubuntu-2004)
- [Arch](#arch)
- [With Nix](#with-nix)
- [Getting Started - Windows](#getting-started---windows)
- [Required Software](#required-software)
- [Setting up and Opening the Project](#setting-up-and-opening-the-project)
@@ -136,26 +135,6 @@ Run tests:
./test.sh
```
### With Nix
If your Nix supports flakes:
```sh
nix develop # development environment
nix build # package
nix develop '.#jak-asan-dev' # development environment with Clang
nix build '.#jak-asan' # package with Clang ASan build
```
Otherwise, with traditional Nix:
```sh
nix-shell # development environment
nix-build # package
nix-shell -A packages.x86_64-linux.jak-asan-dev # development environment with Clang
nix-build -A packages.x86_64-linux.jak-asan # package with Clang ASan build
```
## Getting Started - Windows
### Required Software
@@ -221,16 +200,16 @@ task repl
You will be greeted with a prompt like so:
```sh
_____ _____ _____ _____ __
| |___ ___ ___| __| | _ | |
| | | . | -_| | | | | | | |__
_____ _____ _____ _____ __
| |___ ___ ___| __| | _ | |
| | | . | -_| | | | | | | |__
|_____| _|___|_|_|_____|_____|__|__|_____|
|_|
Welcome to OpenGOAL 0.8!
Run (repl-help) for help with common commands and REPL usage.
Run (lt) to connect to the local target.
g >
g >
```
Run the following to build the game:
-4
View File
@@ -1,4 +0,0 @@
(import (fetchTarball {
url = "https://github.com/edolstra/flake-compat/archive/99f1c2157fba4bfe6211a321fd0ee43199025dbf.tar.gz";
sha256 = "0x2jn3vrawwv9xp15674wjz9pixwjyj3j771izayl962zziivbx2";
}) { src = ./.; }).defaultNix
Generated
-25
View File
@@ -1,25 +0,0 @@
{
"nodes": {
"nixpkgs": {
"locked": {
"lastModified": 1612312445,
"narHash": "sha256-l8qdZFqwjAGzQrsO+jFqRJA7YnN3jMGe5LGXRMJfcPg=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "6b8fca6b5752c5c6038dc9349d0086cf2c49c567",
"type": "github"
},
"original": {
"id": "nixpkgs",
"type": "indirect"
}
},
"root": {
"inputs": {
"nixpkgs": "nixpkgs"
}
}
},
"root": "root",
"version": 7
}
-168
View File
@@ -1,168 +0,0 @@
{
description = "Jak PC ports via OpenGOAL PC port of Naughty Dog's GOAL";
outputs = { self, nixpkgs }: let
getVersionPre = output:
"${nixpkgs.lib.substring 0 8 output.lastModifiedDate}.${output.shortRev or "dirty"}";
supportedSystems = [ "x86_64-linux" "x86_64-darwin" ];
forAllSystems = f: nixpkgs.lib.genAttrs supportedSystems (system: f system);
supportedPackages = [ "jak" "jak-dev" "jak-asan" "jak-asan-dev" ];
forAllPackages = f: nixpkgs.lib.genAttrs supportedPackages (pname: f pname);
release = false;
version = "0.5.0" + nixpkgs.lib.optionalString (!release) "-${getVersionPre self}";
in {
overlay = pkgs: pkgsSuper: {
jak = pkgs.callPackage (
{ lib, stdenv, buildPackages, fetchFromGitHub, runCommand, writeText
, jak-googletest-src, jak-zydis-src
, llvm ? null
, python3Packages ? null
, enableDevInputs ? false
, enableAsan ? false
, enableFramePointer ? enableAsan
, enablePIE ? false
, enableSourceLevelDebug ? enableAsan
}:
let
sh = lib.escapeShellArg;
optionalFun = b: f: if b then f else x: x;
inherit (stdenv.cc) isClang;
llvm-symbolizer = if isClang then runCommand "llvm-symbolizer" {
allowSubstitutes = false;
preferLocalBuild = true;
} ''
mkdir -p "$out/bin"
cp ${sh (lib.getBin llvm)}/bin/llvm-symbolizer "$out/bin"/llvm-symbolizer
'' else null;
makeFlagArrayBody = prefix: flags:
lib.concatStrings
(lib.mapAttrsToList (n: v: " " + sh "${prefix}${n}=${v}" + " \\\n") flags);
makeFlagArray = name: prefix: flags:
"${name}Array+=( \\\n${makeFlagArrayBody prefix flags})";
in stdenv.mkDerivation {
pname = "jak";
inherit version;
# Workaround until `src = self;` works with Git submodules.
src = runCommand "source" {
allowSubstitutes = false;
preferLocalBuild = true;
src = self;
} ''
cp -R "$src" "$out"
chmod -R u+w "$out"
shopt -s nullglob dotglob
files=("$out/third-party/googletest"/*); if (( ''${#files[*]} == 0 )); then
echo "providing third-party/googletest submodule via Nix"
rm -df "$out/third-party/googletest"
cp -R ${sh jak-googletest-src} "$out/third-party/googletest"
fi
files=("$out/third-party/zydis"/*); if (( ''${#files[*]} == 0 )); then
echo "providing third-party/zydis submodule via Nix"
rm -df "$out/third-party/zydis"
cp -R ${sh jak-zydis-src} "$out/third-party/zydis"
fi
'';
nativeBuildInputs = [
buildPackages.cmake
buildPackages.nasm
] ++ lib.optionals enableDevInputs [
buildPackages.clang-tools # clang-format
python3Packages.pyqt5
python3Packages.python
];
preConfigure = let
cmakeFlags = lib.pipe {
# https://github.com/NixOS/nixpkgs/pull/108496
CMAKE_SKIP_BUILD_RPATH = "OFF";
} [
(optionalFun enableAsan (o: o // {
ASAN_BUILD = "TRUE";
}))
(optionalFun enableFramePointer (o: o // {
CMAKE_C_FLAGS = o.CMAKE_C_FLAGS or "" + " -fno-omit-frame-pointer";
CMAKE_CXX_FLAGS = o.CMAKE_CXX_FLAGS or "" + " -fno-omit-frame-pointer";
}))
(optionalFun enablePIE (o: o // {
POSITION_INDEPENDENT_CODE = "TRUE";
}))
(optionalFun enableSourceLevelDebug (o: o // {
CMAKE_C_FLAGS = o.CMAKE_C_FLAGS or "" + " -g";
CMAKE_CXX_FLAGS = o.CMAKE_CXX_FLAGS or "" + " -g";
}))
];
in ''
${makeFlagArray "cmakeFlags" "-D" cmakeFlags}
'';
doCheck = true;
dontStrip = enableAsan;
preFixup = ''
'' + lib.optionalString (enableAsan && llvm-symbolizer != null) ''
for f in "$out/bin"/*; do
wrapProgram "$f" --set LLVM_SYMBOLIZER ${sh llvm-symbolizer}/bin/llvm-symbolizer
done
'';
meta = with lib; {
description = "OpenGOAL port of Naughty Dog's GOAL";
homepage = "https://github.com/water111/jak-project";
license = lib.licenses.isc;
maintainers = with maintainers; [ bb010g ];
platforms = platforms.all;
};
}
) { };
jak-dev = pkgs.jak.override { enableDevInputs = true; };
jak-asan = pkgs.jak.override {
inherit (pkgs.llvmPackages) llvm;
enableAsan = true;
stdenv = pkgs.clangStdenv;
};
jak-asan-dev = pkgs.jak-asan.override { enableDevInputs = true; };
jak-googletest-src = pkgs.callPackage ({ fetchFromGitHub }: fetchFromGitHub {
owner = "google";
repo = "googletest";
rev = "adeef192947fbc0f68fa14a6c494c8df32177508";
sha256 = "1nsl1c5il6mzwggs5fqcp8gyddk9rs6257vlz0zgpik32miq3cgw";
}) { };
jak-zydis-src = pkgs.callPackage ({ fetchFromGitHub }: fetchFromGitHub {
owner = "zyantific";
repo = "zydis";
rev = "c88a4b0cc1271b516b9697af8d088c851745dd60";
sha256 = "1j28vxr3r6w8xawlagcicbd95dcs85shgsm11b98g3qj45bv3haq";
fetchSubmodules = true;
}) { };
};
packages = forAllSystems (system:
let systemPackages = (import nixpkgs {
inherit system;
overlays = [ self.overlay ];
}); in forAllPackages (pname: systemPackages.${pname})
);
defaultPackage = forAllSystems (system:
self.packages.${system}.jak
);
devShell = forAllSystems (system:
self.packages.${system}.jak-dev
);
};
}
-4
View File
@@ -1,4 +0,0 @@
(import (fetchTarball {
url = "https://github.com/edolstra/flake-compat/archive/99f1c2157fba4bfe6211a321fd0ee43199025dbf.tar.gz";
sha256 = "0x2jn3vrawwv9xp15674wjz9pixwjyj3j771izayl962zziivbx2";
}) { src = ./.; }).shellNix