1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-23 06:01:15 +00:00

Merge pull request #141296 from vs49688/rpcs3

rpcs3: 0.0.16-12235-a4f4b81e6 -> 0.0.19-12975-37383f421
This commit is contained in:
Aaron Andersen 2021-11-03 22:19:56 -04:00 committed by GitHub
commit 16697754eb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 75 additions and 14 deletions

View file

@ -20,6 +20,7 @@ stdenv.mkDerivation rec {
"--enable-all"
"--enable-base64encode"
"--enable-pkcs11"
"--enable-writedup"
"--enable-reproducible-build"
"--enable-tls13"
];

View file

@ -1,6 +1,6 @@
{ mkDerivation, lib, fetchFromGitHub, cmake, pkg-config, git
, qtbase, qtquickcontrols, openal, glew, vulkan-headers, vulkan-loader, libpng
, ffmpeg, libevdev, libusb1, zlib, curl, python3
{ gcc11Stdenv, lib, fetchFromGitHub, wrapQtAppsHook, cmake, pkg-config, git
, qtbase, qtquickcontrols, qtmultimedia, openal, glew, vulkan-headers, vulkan-loader, libpng
, ffmpeg, libevdev, libusb1, zlib, curl, wolfssl, python3, pugixml, faudio, flatbuffers
, sdl2Support ? true, SDL2
, pulseaudioSupport ? true, libpulseaudio
, waylandSupport ? true, wayland
@ -8,21 +8,23 @@
}:
let
majorVersion = "0.0.16";
gitVersion = "12235-a4f4b81e6"; # echo $(git rev-list HEAD --count)-$(git rev-parse --short HEAD)
majorVersion = "0.0.19";
gitVersion = "12975-37383f421";
in
mkDerivation {
gcc11Stdenv.mkDerivation {
pname = "rpcs3";
version = "${majorVersion}-${gitVersion}";
src = fetchFromGitHub {
owner = "RPCS3";
repo = "rpcs3";
rev = "a4f4b81e6b0c00f4c30f9f5f182e5fe56f9fb03c";
rev = "37383f4217e1c510a543e100d0ca495800b3361a";
fetchSubmodules = true;
sha256 = "1d70nljl1kmpbk50jpjki7dglw1bbxd7x4qzg6nz5np2sdsbpckd";
sha256 = "1pm1r4j4cdcmr8xmslyv2n6iwcjldnr396by4r6lgf4mdlnwahhm";
};
passthru.updateScript = ./update.sh;
preConfigure = ''
cat > ./rpcs3/git-version.h <<EOF
#define RPCS3_GIT_VERSION "${gitVersion}"
@ -38,16 +40,18 @@ mkDerivation {
"-DUSE_SYSTEM_LIBPNG=ON"
"-DUSE_SYSTEM_FFMPEG=ON"
"-DUSE_SYSTEM_CURL=ON"
# NB: Can't use this yet, our CMake doesn't include FindWolfSSL.cmake
#"-DUSE_SYSTEM_WOLFSSL=ON"
"-DUSE_SYSTEM_WOLFSSL=ON"
"-DUSE_SYSTEM_FAUDIO=ON"
"-DUSE_SYSTEM_PUGIXML=ON"
"-DUSE_SYSTEM_FLATBUFFERS=ON"
"-DUSE_NATIVE_INSTRUCTIONS=OFF"
];
nativeBuildInputs = [ cmake pkg-config git ];
nativeBuildInputs = [ cmake pkg-config git wrapQtAppsHook ];
buildInputs = [
qtbase qtquickcontrols openal glew vulkan-headers vulkan-loader libpng ffmpeg
libevdev zlib libusb1 curl python3
qtbase qtquickcontrols qtmultimedia openal glew vulkan-headers vulkan-loader libpng ffmpeg
libevdev zlib libusb1 curl wolfssl python3 pugixml faudio flatbuffers
] ++ lib.optional sdl2Support SDL2
++ lib.optional pulseaudioSupport libpulseaudio
++ lib.optional alsaSupport alsa-lib
@ -56,7 +60,7 @@ mkDerivation {
meta = with lib; {
description = "PS3 emulator/debugger";
homepage = "https://rpcs3.net/";
maintainers = with maintainers; [ abbradar neonfuz ilian ];
maintainers = with maintainers; [ abbradar neonfuz ilian zane ];
license = licenses.gpl2Only;
platforms = [ "x86_64-linux" ];
};

View file

@ -0,0 +1,56 @@
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p gnused jq nix-prefetch-git curl
set -eou pipefail
ROOT="$(dirname "$(readlink -f "$0")")"
if [[ ! "$(basename $ROOT)" == "rpcs3" || ! -f "$ROOT/default.nix" ]]; then
echo "ERROR: Not in the rpcs3 folder"
exit 1
fi
if [[ ! -v GITHUB_TOKEN ]]; then
echo "ERROR: \$GITHUB_TOKEN not set"
exit 1
fi
PAYLOAD=$(jq -cn --rawfile query /dev/stdin '{"query": $query}' <<EOF | curl -s -H "Authorization: bearer $GITHUB_TOKEN" -d '@-' https://api.github.com/graphql
{
repository(owner: "RPCS3", name: "rpcs3") {
branch: ref(qualifiedName: "refs/heads/master") {
target {
oid
... on Commit {
history {
totalCount
}
}
}
}
tag: refs(refPrefix: "refs/tags/", first: 1, orderBy: {field: TAG_COMMIT_DATE, direction: DESC}) {
nodes {
name
}
}
}
}
EOF
)
RPCS3_COMMIT=$(jq -r .data.repository.branch.target.oid <<< "$PAYLOAD")
RPCS3_MAJORVER=$(jq -r .data.repository.tag.nodes[0].name <<< "$PAYLOAD" | sed 's/^v//g')
RPCS3_COUNT=$(jq -r .data.repository.branch.target.history.totalCount <<< "$PAYLOAD")
RPCS3_GITVER="$RPCS3_COUNT-${RPCS3_COMMIT::9}"
echo "INFO: Latest commit is $RPCS3_COMMIT"
echo "INFO: Latest version is $RPCS3_MAJORVER-$RPCS3_GITVER"
RPCS3_SHA256=$(nix-prefetch-git --quiet --fetch-submodules https://github.com/RPCS3/rpcs3.git "$RPCS3_COMMIT" | jq -r .sha256)
echo "INFO: SHA256 is $RPCS3_SHA256"
sed -i -E \
-e "s/majorVersion\s+.+$/majorVersion = \"${RPCS3_MAJORVER}\";/g" \
-e "s/gitVersion\s+.+$/gitVersion = \"${RPCS3_GITVER}\";/g" \
-e "s/rev\s*=\s*\"[a-z0-9]+\";$/rev = \"${RPCS3_COMMIT}\";/g" \
-e "s/sha256\s*=\s*\"[a-z0-9]+\";$/sha256 = \"${RPCS3_SHA256}\";/g" \
"$ROOT/default.nix"