tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
lol
0
fork
atom
overview
issues
pulls
pipelines
dosbox-x: Get Darwin icon working
OPNA2608
2 years ago
adbdc602
2d295d75
+32
1 changed file
expand all
collapse all
unified
split
pkgs
applications
emulators
dosbox-x
default.nix
+32
pkgs/applications/emulators/dosbox-x/default.nix
···
10
, fluidsynth
11
, freetype
12
, glib
0
13
, libpcap
14
, libpng
15
, libslirp
···
18
, makeWrapper
19
, ncurses
20
, pkg-config
0
21
, SDL2
22
, SDL2_net
23
, testers
···
35
rev = "dosbox-x-v${finalAttrs.version}";
36
hash = "sha256-EcAp7KyqXdBACEbPgkM1INoKeGVo7hMDUx97y2RcX+k=";
37
};
0
0
0
0
0
0
0
0
0
0
0
0
0
0
38
39
strictDeps = true;
40
···
42
autoreconfHook
43
makeWrapper
44
pkg-config
0
0
0
45
];
46
47
buildInputs = [
···
75
76
hardeningDisable = [ "format" ]; # https://github.com/joncampbell123/dosbox-x/issues/4436
77
0
0
0
0
0
0
78
postInstall = lib.optionalString stdenv.hostPlatform.isLinux ''
79
wrapProgram $out/bin/dosbox-x \
80
--prefix PATH : ${lib.makeBinPath [ yad ]}
0
0
0
0
0
0
0
81
'';
82
83
passthru.tests.version = testers.testVersion {
···
10
, fluidsynth
11
, freetype
12
, glib
13
+
, libicns
14
, libpcap
15
, libpng
16
, libslirp
···
19
, makeWrapper
20
, ncurses
21
, pkg-config
22
+
, python3
23
, SDL2
24
, SDL2_net
25
, testers
···
37
rev = "dosbox-x-v${finalAttrs.version}";
38
hash = "sha256-EcAp7KyqXdBACEbPgkM1INoKeGVo7hMDUx97y2RcX+k=";
39
};
40
+
41
+
# sips is unavailable in sandbox, replacing with imagemagick breaks build due to wrong Foundation propagation(?) so don't generate resolution variants
42
+
# iconutil is unavailable, replace with png2icns from libicns
43
+
# Patch bad hardcoded compiler
44
+
# Don't mess with codesign, doesn't seem to work?
45
+
postPatch = ''
46
+
substituteInPlace Makefile.am \
47
+
--replace-fail 'sips' '## sips' \
48
+
--replace-fail 'iconutil -c icns -o contrib/macos/dosbox.icns src/dosbox.iconset' 'png2icns contrib/macos/dosbox.icns contrib/macos/dosbox-x.png' \
49
+
--replace-fail 'g++' "$CXX" \
50
+
--replace-fail 'codesign' '## codesign'
51
+
'' + lib.optionalString stdenv.hostPlatform.isDarwin ''
52
+
patchShebangs appbundledeps.py
53
+
'';
54
55
strictDeps = true;
56
···
58
autoreconfHook
59
makeWrapper
60
pkg-config
61
+
] ++ lib.optionals stdenv.hostPlatform.isDarwin [
62
+
libicns
63
+
python3
64
];
65
66
buildInputs = [
···
94
95
hardeningDisable = [ "format" ]; # https://github.com/joncampbell123/dosbox-x/issues/4436
96
97
+
# Build optional App Bundle target, which needs at least one arch-suffixed binary
98
+
postBuild = lib.optionalString stdenv.hostPlatform.isDarwin ''
99
+
cp src/dosbox-x src/dosbox-x-$(uname -m)
100
+
make dosbox-x.app
101
+
'';
102
+
103
postInstall = lib.optionalString stdenv.hostPlatform.isLinux ''
104
wrapProgram $out/bin/dosbox-x \
105
--prefix PATH : ${lib.makeBinPath [ yad ]}
106
+
''
107
+
# Install App Bundle, wrap regular binary into bundle's binary to get the icon working
108
+
+ lib.optionalString stdenv.hostPlatform.isDarwin ''
109
+
mkdir $out/Applications
110
+
mv dosbox-x.app $out/Applications/
111
+
mv $out/bin/dosbox-x $out/Applications/dosbox-x.app/Contents/MacOS/dosbox-x
112
+
makeWrapper $out/Applications/dosbox-x.app/Contents/MacOS/dosbox-x $out/bin/dosbox-x
113
'';
114
115
passthru.tests.version = testers.testVersion {