Skip to content

Commit d913ea9

Browse files
committed
more fixes
1 parent c260aa8 commit d913ea9

File tree

3 files changed

+16
-27
lines changed

3 files changed

+16
-27
lines changed

ocaml/revery/reason-harfbuzz.nix

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,17 @@
77
, lib
88
, libcxx
99
, stdenv
10+
, darwin
1011
}:
1112

1213
buildDunePackage {
1314
pname = "reason-harfbuzz";
1415
version = "0.0.0";
1516
inherit (reason-sdl2) src;
1617

17-
buildInputs = [ dune-configurator ];
18+
buildInputs = [ dune-configurator ] ++
19+
lib.optionals stdenv.isDarwin
20+
(with darwin.apple_sdk.frameworks; [ Foundation AppKit ]);
1821
nativeBuildInputs = [
1922
reason
2023
pkg-config

ocaml/revery/reason-skia.nix

Lines changed: 10 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -16,34 +16,26 @@ buildDunePackage {
1616
pname = "reason-skia";
1717
version = "0.0.0";
1818
inherit (reason-sdl2) src;
19+
# the cptr function was removed from ctypes, so the value now needs to be
20+
# destructured to get to the pointer
1921
postPatch = ''
20-
# the cptr function was removed from ctypes, so the value now needs to be
21-
# destructured to get to the pointer
2222
substituteInPlace packages/reason-skia/src/Skia.re \
2323
--replace "module CI = Cstubs_internals;" \
2424
"module CI = { include Cstubs_internals; let cptr = (CPointer(a)) => a; };"
25-
#substituteInPlace packages/reason-skia/src/wrapped/bindings/SkiaWrappedBindings.re \
26-
#packages/reason-skia/src/Skia.re \
27-
# --replace "module CI = Cstubs_internals;" \
28-
# "module CI = { include Cstubs_internals; let cptr = (CPointer(a)) => a; };"
2925
'';
30-
buildInputs = [
31-
dune-configurator
32-
];
33-
nativeBuildInputs = [
34-
reason
35-
pkg-config
36-
];
37-
propagatedBuildInputs = [
38-
darwin.apple_sdk.frameworks.AppKit
39-
darwin.apple_sdk.frameworks.Cocoa
40-
darwin.apple_sdk.frameworks.ForceFeedback
26+
27+
nativeBuildInputs = [ reason pkg-config ];
28+
buildInputs = [ dune-configurator ];
29+
propagatedBuildInputs = with darwin.apple_sdk.frameworks; [
30+
AppKit
31+
Cocoa
32+
ForceFeedback
4133
libiconv
4234
reason-sdl2
4335
ctypes
4436
];
4537
SDL2_INCLUDE_PATH = "${SDL2.dev}/include";
46-
SDL2_LIB_PATH = ''${(SDL2.override { withStatic = true; }).out}/lib'';
38+
SDL2_LIB_PATH = "${SDL2.override { withStatic = true; }}/lib";
4739
SKIA_INCLUDE_PATH = "${esy-skia}/include/c";
4840
SKIA_LIB_PATH = "${esy-skia}/out/Release";
4941
JPEG_LIB_PATH = "${(libjpeg.override { enableStatic = true; }).out}/lib";

overlay/default.nix

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -161,15 +161,13 @@ in
161161

162162
stdenv.mkDerivation rec {
163163
name = "skia";
164-
patches = [
165-
../ocaml/revery/patches/0002-esy-skia-use-libtool.patch
166-
];
167164
src = fetchFromGitHub {
168165
owner = "revery-ui";
169166
repo = "esy-skia";
170167
rev = "29349b9279ed24a73ec41acd7082caea9bd8c04e";
171168
sha256 = "sha256-VyY1clAdTEZu0cFy/+Bw19OQ4lb55s4gIV/7TsFKdnk=";
172169
};
170+
173171
nativeBuildInputs = with self; [
174172
gn
175173
ninja
@@ -185,18 +183,14 @@ in
185183
darwin.apple_sdk.frameworks.OpenGL
186184
# TODO handle ios, android
187185
#-framework CoreServices -framework CoreGraphics -framework CoreText -framework CoreFoundation
188-
stdenv.cc
189-
# needed to get libtool - TODO: double check this, add darwin flag, test on linux if ar is needed
190-
darwin.cctools
191186
];
192187

193188
preConfigure = ''
194189
mkdir -p third_party/externals
195190
ln -s ${angle2} third_party/externals/angle2
196191
ln -s ${piex} third_party/externals/piex
197192
'';
198-
#TODO: remove cc= ccx=
199-
#TODO: optional xcode_sysroot
193+
200194
#TODO: built this based on feature flags, with sane defaults per os
201195
#TODO: enable more features
202196
configurePhase = ''

0 commit comments

Comments
 (0)