Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

_2ship2harkinian: fetch gamecontrollerdb repo, install licenses #342171

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 16 additions & 6 deletions pkgs/by-name/_2/_2ship2harkinian/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,11 @@ let

# This would get fetched at build time otherwise, see:
# https://github.com/HarbourMasters/2ship2harkinian/blob/1.0.2/mm/CMakeLists.txt#L708
gamecontrollerdb = fetchurl {
name = "gamecontrollerdb.txt";
url = "https://raw.githubusercontent.com/gabomdq/SDL_GameControllerDB/b1759cf84028aab89caa1c395e198c340b8dfd89/gamecontrollerdb.txt";
hash = "sha256-7C5EkqBIhLGNJuhi3832y0ffW5Ep7iuTYXb1bL5h2Js=";
gamecontrollerdb = fetchFromGitHub {
owner = "mdqinc";
repo = "SDL_GameControllerDB";
rev = "15b5e9f4abfb1c5c691c468799816755a91a2e11";
hash = "sha256-Fpm6eqeLah3yQS4Kxhoa1QbSkZ2oKY4/VnC3Vztck9g=";
};

# 2ship needs a specific imgui version
Expand Down Expand Up @@ -165,7 +166,7 @@ stdenv.mkDerivation (finalAttrs: {
'';

postBuild = ''
cp ${gamecontrollerdb} ${gamecontrollerdb.name}
cp ${gamecontrollerdb}/gamecontrollerdb.txt gamecontrollerdb.txt
pushd ../OTRExporter
python3 ./extract_assets.py -z ../build/ZAPD/ZAPD.out --norom --xml-root ../mm/assets/xml --custom-assets-path ../mm/assets/custom --custom-otr-file 2ship.o2r --port-ver ${finalAttrs.version}
popd
Expand All @@ -180,6 +181,14 @@ stdenv.mkDerivation (finalAttrs: {
mkdir -p $out/bin
ln -s $out/2s2h/2s2h.elf $out/bin/2s2h
install -Dm644 ../mm/linux/2s2hIcon.png $out/share/pixmaps/2s2h.png

install -Dm644 -t $out/share/licenses/2ship2harkinian ../LICENSE
install -Dm644 -t $out/share/licenses/OTRExporter ../OTRExporter/LICENSE
install -Dm644 -t $out/share/licenses/SDL_GameControllerDB ${gamecontrollerdb}/LICENSE
install -Dm644 -t $out/share/licenses/ZAPDTR ../ZAPDTR/LICENSE
install -Dm644 -t $out/share/licenses/libgfxd ${libgfxd}/LICENSE
install -Dm644 -t $out/share/licenses/libultraship ../libultraship/LICENSE
install -Dm644 -t $out/share/licenses/thread_pool ${thread_pool}/LICENSE.txt
'';

postFixup = ''
Expand All @@ -205,12 +214,13 @@ stdenv.mkDerivation (finalAttrs: {
platforms = [ "x86_64-linux" ];
maintainers = with lib.maintainers; [ qubitnano ];
license = with lib.licenses; [
# OTRExporter, OTRGui, ZAPDTR, libultraship
# OTRExporter, ZAPDTR, libultraship, libgfxd, thread_pool
mit
# 2 Ship 2 Harkinian
cc0
# Reverse engineering
unfree
];
hydraPlatforms = [ ];
};
})