@@ -12,13 +12,12 @@
1212, libical
1313, python3
1414, tzdata
15+, fixDarwinDylibNames
1516, introspectionSupport ? stdenv.buildPlatform == stdenv.hostPlatform
16−, gobject-introspection ? null
17−, vala ? null
17+, gobject-introspection
18+, vala
1819}:
1920
20−assert introspectionSupport -> gobject-introspection != null && vala != null;
21−
2221stdenv.mkDerivation rec {
2322 pname = "libical";
2423 version = "3.0.9";
@@ -47,6 +46,8 @@ stdenv.mkDerivation rec {
4746 ] ++ lib.optionals introspectionSupport [
4847 gobject-introspection
4948 vala
49+ ] ++ lib.optionals stdenv.isDarwin [
50+ fixDarwinDylibNames
5051 ];
5152 installCheckInputs = [
5253 # running libical-glib tests
@@ -80,6 +81,13 @@ stdenv.mkDerivation rec {
8081 # LD_LIBRARY_PATH and GI_TYPELIB_PATH variables
8182 doInstallCheck = true;
8283 enableParallelChecking = false;
84+ preInstallCheck = if stdenv.isDarwin then ''
85+ for testexe in $(find ./src/test -maxdepth 1 -type f -executable); do
86+ for lib in $(cd lib && ls *.3.dylib); do
87+ install_name_tool -change $lib $out/lib/$lib $testexe
88+ done
89+ done
90+ '' else null;
8391 installCheckPhase = ''
8492 runHook preInstallCheck
8593