24 stdenv.mkDerivation (finalAttrs: {
26 version = "115-unstable-2024-09-04";
28 src = fetchFromGitHub {
31 rev = "a03b2e94c620eb12ab6f9936aee50e4389bee2ff";
32 hash = "sha256-VpwHjA0LufKDnGRAS906Qh3R2pVt4uUGXxsRcca9SyM=";
40 ++ lib.optionals stdenv.hostPlatform.isDarwin [
49 ++ lib.optionals stdenv.hostPlatform.isLinux [
63 # Includes cmath header
64 ./patches/0001-include-cmath.patch
65 # Uses png2icns instead of sips
66 ./patches/0002-sips-to-png2icns.patch
71 enableParallelBuilding = true;
76 if stdenv.hostPlatform.isLinux then
78 else if stdenv.hostPlatform.isDarwin then
80 else if stdenv.hostPlatform.isBSD then
82 else if stdenv.hostPlatform.isWindows then
85 throw "Unknown platform for higan: ${stdenv.hostPlatform.system}";
90 make -C higan-ui -j$NIX_BUILD_CORES \
91 compiler=${stdenv.cc.targetPrefix}c++ \
92 platform=${platform} \
97 cores="cv fc gb gba md ms msx ngp pce sfc sg ws"
99 make -C icarus -j$NIX_BUILD_CORES \
100 compiler=${stdenv.cc.targetPrefix}c++ \
101 platform=${platform} \
114 if stdenv.hostPlatform.isDarwin then
117 mv higan/out/higan.app $out/
118 mv icarus/out/icarus.app $out/
122 installBin higan-ui/out/higan icarus/out/icarus
124 install -d $out/share/applications
125 install higan-ui/resource/higan.desktop -t $out/share/applications/
126 install icarus/resource/icarus.desktop -t $out/share/applications/
128 install -d $out/share/pixmaps
129 install higan/higan/resource/higan.svg $out/share/pixmaps/higan-icon.svg
130 install higan/higan/resource/logo.png $out/share/pixmaps/higan-icon.png
131 install icarus/resource/icarus.svg $out/share/pixmaps/icarus-icon.svg
132 install icarus/resource/icarus.png $out/share/pixmaps/icarus-icon.png
136 install -d $out/share/higan
137 cp -rd extras/ higan/System/ $out/share/higan/
139 install -d $out/share/icarus
140 cp -rd icarus/Database icarus/Firmware $out/share/icarus/
143 # A dirty workaround, suggested by @cpages:
144 # we create a first-run script to populate
145 # $HOME with all the stuff needed at runtime
148 if stdenv.hostPlatform.isDarwin then
149 "\\$HOME/Library/Application Support/higan"
155 cat <<EOF > $out/bin/higan-init.sh
158 cp --recursive --update $out/share/higan/System/ "${dest}"/
162 chmod +x $out/bin/higan-init.sh
170 passthru.updateScript = unstableGitUpdater { };
173 homepage = "https://github.com/higan-emu/higan";
174 description = "Open-source, cycle-accurate multi-system emulator";
176 higan is a multi-system emulator, originally developed by Near, with an
177 uncompromising focus on accuracy and code readability.
179 It currently emulates the following systems: Famicom, Famicom Disk System,
180 Super Famicom, Super Game Boy, Game Boy, Game Boy Color, Game Boy Advance,
181 Game Boy Player, SG-1000, SC-3000, Master System, Game Gear, Mega Drive,
182 Mega CD, PC Engine, SuperGrafx, MSX, MSX2, ColecoVision, Neo Geo Pocket,
183 Neo Geo Pocket Color, WonderSwan, WonderSwan Color, SwanCrystal, Pocket
186 license = lib.licenses.gpl3Plus;
187 maintainers = with lib.maintainers; [ AndersonTorres ];
188 platforms = lib.platforms.unix;
189 broken = stdenv.hostPlatform.isDarwin;
192 # TODO: select between Qt and GTK3
193 # TODO: call Darwin hackers to deal with respective problems