Merge pull request #83638 from veprbl/pr/higan_darwin_fix
higan: fix darwin build
This commit is contained in:
commit
fd708a3fe0
@ -1,8 +1,9 @@
|
|||||||
{ stdenv, fetchurl
|
{ stdenv, fetchurl
|
||||||
, p7zip, pkgconfig
|
, p7zip, pkgconfig, libicns
|
||||||
, libX11, libXv
|
, libX11, libXv
|
||||||
, udev
|
, udev
|
||||||
, libGLU, libGL, SDL
|
, libGLU, libGL, SDL
|
||||||
|
, Carbon, Cocoa, OpenGL, OpenAL
|
||||||
, libao, openal, libpulseaudio
|
, libao, openal, libpulseaudio
|
||||||
, gtk2, gtksourceview
|
, gtk2, gtksourceview
|
||||||
, runtimeShell }:
|
, runtimeShell }:
|
||||||
@ -21,11 +22,24 @@ stdenv.mkDerivation rec {
|
|||||||
};
|
};
|
||||||
|
|
||||||
patches = [ ./0001-change-flags.diff ];
|
patches = [ ./0001-change-flags.diff ];
|
||||||
postPatch = "sed '1i#include <cmath>' -i higan/fc/ppu/ppu.cpp";
|
postPatch = ''
|
||||||
|
sed '1i#include <cmath>' -i higan/fc/ppu/ppu.cpp
|
||||||
|
|
||||||
|
for file in icarus/GNUmakefile higan/target-tomoko/GNUmakefile; do
|
||||||
|
substituteInPlace "$file" \
|
||||||
|
--replace 'sips -s format icns data/$(name).png --out out/$(name).app/Contents/Resources/$(name).icns' \
|
||||||
|
'png2icns out/$(name).app/Contents/Resources/$(name).icns data/$(name).png'
|
||||||
|
done
|
||||||
|
'';
|
||||||
|
|
||||||
|
nativeBuildInputs = [ p7zip pkgconfig ]
|
||||||
|
++ optional stdenv.isDarwin [ libicns ];
|
||||||
|
|
||||||
buildInputs =
|
buildInputs =
|
||||||
[ p7zip pkgconfig libX11 libXv udev libGLU libGL
|
[ SDL libao ]
|
||||||
SDL libao openal libpulseaudio gtk2 gtksourceview ];
|
++ optionals stdenv.isLinux [ openal libpulseaudio udev libX11 libXv libGLU libGL gtk2 gtksourceview ]
|
||||||
|
++ optionals stdenv.isDarwin [ Carbon Cocoa OpenGL OpenAL ]
|
||||||
|
;
|
||||||
|
|
||||||
unpackPhase = ''
|
unpackPhase = ''
|
||||||
7z x $src
|
7z x $src
|
||||||
@ -38,27 +52,36 @@ stdenv.mkDerivation rec {
|
|||||||
'';
|
'';
|
||||||
|
|
||||||
# Now the cheats file will be distributed separately
|
# Now the cheats file will be distributed separately
|
||||||
installPhase = ''
|
installPhase = (if !stdenv.isDarwin then ''
|
||||||
install -dm 755 $out/bin $out/share/applications $out/share/higan $out/share/pixmaps
|
mkdir -p "$out"/bin "$out"/share/applications "$out"/share/pixmaps
|
||||||
install -m 755 icarus/out/icarus $out/bin/
|
install -m 755 icarus/out/icarus "$out"/bin/
|
||||||
install -m 755 higan/out/higan $out/bin/
|
install -m 755 higan/out/higan "$out"/bin/
|
||||||
install -m 644 higan/data/higan.desktop $out/share/applications/
|
install -m 644 higan/data/higan.desktop "$out"/share/applications/
|
||||||
install -m 644 higan/data/higan.png $out/share/pixmaps/higan-icon.png
|
install -m 644 higan/data/higan.png "$out"/share/pixmaps/higan-icon.png
|
||||||
install -m 644 higan/resource/logo/higan.png $out/share/pixmaps/higan-logo.png
|
install -m 644 higan/resource/logo/higan.png "$out"/share/pixmaps/higan-logo.png
|
||||||
|
'' else ''
|
||||||
|
mkdir "$out"
|
||||||
|
mv higan/out/higan.app "$out"/
|
||||||
|
mv icarus/out/icarus.app "$out"/
|
||||||
|
'') + ''
|
||||||
|
mkdir -p "$out"/share/higan
|
||||||
cp --recursive --no-dereference --preserve='links' --no-preserve='ownership' \
|
cp --recursive --no-dereference --preserve='links' --no-preserve='ownership' \
|
||||||
higan/systems/* $out/share/higan/
|
higan/systems/* "$out"/share/higan/
|
||||||
'';
|
'';
|
||||||
|
|
||||||
fixupPhase = ''
|
fixupPhase = let
|
||||||
|
dest = if !stdenv.isDarwin then "\\$HOME/.local/share/higan" else "\\$HOME/Library/Application Support/higan";
|
||||||
|
in ''
|
||||||
# A dirty workaround, suggested by @cpages:
|
# A dirty workaround, suggested by @cpages:
|
||||||
# we create a first-run script to populate
|
# we create a first-run script to populate
|
||||||
# the local $HOME with all the auxiliary
|
# the local $HOME with all the auxiliary
|
||||||
# stuff needed by higan at runtime
|
# stuff needed by higan at runtime
|
||||||
|
|
||||||
|
mkdir -p "$out"/bin
|
||||||
cat <<EOF > $out/bin/higan-init.sh
|
cat <<EOF > $out/bin/higan-init.sh
|
||||||
#!${runtimeShell}
|
#!${runtimeShell}
|
||||||
|
|
||||||
cp --recursive --update $out/share/higan/*.sys \$HOME/.local/share/higan/
|
cp --recursive --update $out/share/higan/*.sys "${dest}"/
|
||||||
|
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
|
@ -26090,6 +26090,7 @@ in
|
|||||||
|
|
||||||
higan = callPackage ../misc/emulators/higan {
|
higan = callPackage ../misc/emulators/higan {
|
||||||
inherit (gnome2) gtksourceview;
|
inherit (gnome2) gtksourceview;
|
||||||
|
inherit (darwin.apple_sdk.frameworks) Carbon Cocoa OpenGL OpenAL;
|
||||||
};
|
};
|
||||||
|
|
||||||
bullet = callPackage ../development/libraries/bullet {
|
bullet = callPackage ../development/libraries/bullet {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user