Skip to content

Commit 1b4a15a

Browse files
authored
spice-gtk: fix darwin build (#368148)
2 parents b5c3cc0 + 7054001 commit 1b4a15a

File tree

1 file changed

+17
-10
lines changed

1 file changed

+17
-10
lines changed

pkgs/by-name/sp/spice-gtk/package.nix

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -155,17 +155,24 @@ stdenv.mkDerivation rec {
155155
"-Dcoroutine=gthread" # Fixes "Function missing:makecontext"
156156
];
157157

158-
postPatch = ''
159-
# get rid of absolute path to helper in store so we can use a setuid wrapper
160-
substituteInPlace src/usb-acl-helper.c \
161-
--replace 'ACL_HELPER_PATH"/' '"'
162-
# don't try to setcap/suid in a nix builder
163-
substituteInPlace src/meson.build \
164-
--replace "meson.add_install_script('../build-aux/setcap-or-suid'," \
165-
"# meson.add_install_script('../build-aux/setcap-or-suid',"
158+
postPatch =
159+
''
160+
# get rid of absolute path to helper in store so we can use a setuid wrapper
161+
substituteInPlace src/usb-acl-helper.c \
162+
--replace-fail 'ACL_HELPER_PATH"/' '"'
163+
# don't try to setcap/suid in a nix builder
164+
substituteInPlace src/meson.build \
165+
--replace-fail "meson.add_install_script('../build-aux/setcap-or-suid'," \
166+
"# meson.add_install_script('../build-aux/setcap-or-suid',"
166167
167-
patchShebangs subprojects/keycodemapdb/tools/keymap-gen
168-
'';
168+
patchShebangs subprojects/keycodemapdb/tools/keymap-gen
169+
''
170+
+ lib.optionalString stdenv.hostPlatform.isDarwin ''
171+
# don't use version script and don't export symbols
172+
substituteInPlace src/meson.build \
173+
--replace-fail "spice_gtk_version_script = [" "# spice_gtk_version_script = [" \
174+
--replace-fail ",--version-script=@0@'.format(spice_client_glib_syms_path)" "'"
175+
'';
169176

170177
meta = with lib; {
171178
description = "GTK 3 SPICE widget";

0 commit comments

Comments
 (0)