Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wxwidgets-kicad-macos init at 3.0.4 #98538

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
76 changes: 76 additions & 0 deletions pkgs/development/libraries/wxwidgets/3.0/kicad.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# kicad requires a special, patched version of wxwidgets on macOS. This is the
# purpose of this package. Hopefully, this will eventually go away and KiCad
# will use a stock wxwidgets on macOS, obviating the need for this packages.

{ stdenv, fetchgit, fetchurl, pkgconfig
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
{ stdenv, fetchgit, fetchurl, pkgconfig
{ stdenv, fetchgit, fetchurl, pkg-config

, libXinerama, libSM, libXxf86vm, gtk3, xorgproto, gst_all_1
, libGLU, libGL
, compat24 ? false, compat26 ? true
, setfile, AGL, Carbon, Cocoa, Kernel, QTKit, WebKit, AVFoundation, AVKit
, ...
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
, ...

}:

with stdenv.lib;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not a fan of this. It would be better to apply this on a smaller scale.


assert libGLU != null && libGL != null;

stdenv.mkDerivation {
version = "kicad-macos-3.0.4";
pname = "wxwidgets";

src = fetchgit {
url = "https://gitlab.com/kicad/code/wxWidgets.git";
rev = "53e3765367870187718fc7809f27efc9b40420f8";
sha256 = "1yg02d47l4g57bhgn7n09s1k4rjal2mpj89vxiqg1k26zvs7cyc7";
};

buildInputs = [
libXinerama libSM libXxf86vm xorgproto gst_all_1.gstreamer gst_all_1.gst-plugins-base
gtk3 libGLU
setfile Kernel QTKit WebKit AVFoundation AVKit AGL
];

nativeBuildInputs = [ pkgconfig ];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
nativeBuildInputs = [ pkgconfig ];
nativeBuildInputs = [ pkg-config ];


propagatedBuildInputs = [ Carbon Cocoa ];

configureFlags =
[ "--disable-precomp-headers" "--enable-mediactrl"
(if compat24 then "--enable-compat24" else "--disable-compat24")
(if compat26 then "--enable-compat26" else "--disable-compat26")
"--with-cocoa" "--with-macosx-version-min=10.10"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"--with-cocoa" "--with-macosx-version-min=10.10"
"--with-cocoa" "--with-macosx-version-min=10.12"

We should probably set this to apple_sdk version in darwin dynamically.

"--enable-webview" "--enable-webview-webkit"
"--enable-unicode" "--with-opengl"
Comment on lines +38 to +43
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
[ "--disable-precomp-headers" "--enable-mediactrl"
(if compat24 then "--enable-compat24" else "--disable-compat24")
(if compat26 then "--enable-compat26" else "--disable-compat26")
"--with-cocoa" "--with-macosx-version-min=10.10"
"--enable-webview" "--enable-webview-webkit"
"--enable-unicode" "--with-opengl"
[
"--disable-precomp-headers"
(if compat24 then "--enable-compat24" else "--disable-compat24")
(if compat26 then "--enable-compat26" else "--disable-compat26")
"--enable-mediactrl"
"--enable-unicode"
"--enable-webview"
"--enable-webview-webkit"
"--with-cocoa"
"--with-macosx-version-min=10.10"
"--with-opengl"

];

SEARCH_LIB = "${libGLU.out}/lib ${libGL.out}/lib ";

preConfigure = ''
substituteInPlace configure --replace 'SEARCH_INCLUDE=' 'DUMMY_SEARCH_INCLUDE='
substituteInPlace configure --replace 'SEARCH_LIB=' 'DUMMY_SEARCH_LIB='
substituteInPlace configure --replace /usr /no-such-path
substituteInPlace configure --replace \
'ac_cv_prog_SETFILE="/Developer/Tools/SetFile"' \
'ac_cv_prog_SETFILE="${setfile}/bin/SetFile"'
substituteInPlace configure --replace "-framework System" -lSystem
Comment on lines +49 to +55
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
substituteInPlace configure --replace 'SEARCH_INCLUDE=' 'DUMMY_SEARCH_INCLUDE='
substituteInPlace configure --replace 'SEARCH_LIB=' 'DUMMY_SEARCH_LIB='
substituteInPlace configure --replace /usr /no-such-path
substituteInPlace configure --replace \
'ac_cv_prog_SETFILE="/Developer/Tools/SetFile"' \
'ac_cv_prog_SETFILE="${setfile}/bin/SetFile"'
substituteInPlace configure --replace "-framework System" -lSystem
substituteInPlace configure \
--replace 'SEARCH_INCLUDE=' 'DUMMY_SEARCH_INCLUDE=' \
--replace 'SEARCH_LIB=' 'DUMMY_SEARCH_LIB=' \
--replace /usr /no-such-path \
--replace 'ac_cv_prog_SETFILE="/Developer/Tools/SetFile"' 'ac_cv_prog_SETFILE="${setfile}/bin/SetFile"' \
--replace "-framework System" -lSystem

'';

postInstall = "
(cd $out/include && ln -s wx-*/* .)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
(cd $out/include && ln -s wx-*/* .)
pushd $out/include
ln -s wx-*/* .
popd

";

passthru = {
inherit compat24 compat26;
unicode = true;
gtk = gtk3;
};

enableParallelBuilding = true;

meta = rec {
description = "Patched version of wxWidgets for KiCad on macOS";
homepage = "https://gitlab.com/kicad/code/wxWidgets";
license = stdenv.lib.licenses.unfree;
platforms = stdenv.lib.platforms.darwin;
};
Comment on lines +70 to +75
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
meta = rec {
description = "Patched version of wxWidgets for KiCad on macOS";
homepage = "https://gitlab.com/kicad/code/wxWidgets";
license = stdenv.lib.licenses.unfree;
platforms = stdenv.lib.platforms.darwin;
};
meta = with stdenv.lib; {
description = "Patched version of wxWidgets for KiCad on macOS";
homepage = "https://gitlab.com/kicad/code/wxWidgets";
license = licenses.unfree;
platforms = platforms.darwin;
};

}
5 changes: 5 additions & 0 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -15794,6 +15794,11 @@ in
inherit (darwin.stubs) setfile rez derez;
};

wxGTK30-gtk3-kicad = callPackage ../development/libraries/wxwidgets/3.0/kicad.nix {
inherit (darwin.stubs) setfile;
inherit (darwin.apple_sdk.frameworks) AGL Carbon Cocoa Kernel QTKit WebKit AVFoundation AVKit;
};

wxSVG = callPackage ../development/libraries/wxSVG {
wxGTK = wxGTK30;
};
Expand Down