about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMario Rodas <marsam@users.noreply.github.com>2022-10-08 17:32:03 -0500
committerGitHub <noreply@github.com>2022-10-08 17:32:03 -0500
commit8fede648a85a4e0c00f6471b7ab08d2373c59f04 (patch)
treef22314a7a790246853c4e1b985f9d7b4da331829
parentb683dd69213228aa649b35fc62fc7de721ed626c (diff)
parent4a4300eae49622868868999f773b72d3e4598d59 (diff)
Merge pull request #195125 from wegank/wxhexeditor-darwin
wxhexeditor: add darwin support
-rw-r--r--pkgs/applications/editors/wxhexeditor/default.nix13
-rw-r--r--pkgs/top-level/all-packages.nix4
2 files changed, 12 insertions, 5 deletions
diff --git a/pkgs/applications/editors/wxhexeditor/default.nix b/pkgs/applications/editors/wxhexeditor/default.nix
index f310fb85a26c6..efcbe32f78d77 100644
--- a/pkgs/applications/editors/wxhexeditor/default.nix
+++ b/pkgs/applications/editors/wxhexeditor/default.nix
@@ -1,4 +1,4 @@
-{ lib, stdenv, fetchFromGitHub, fetchpatch, wxGTK, autoconf, automake, libtool, python2, gettext }:
+{ lib, stdenv, fetchFromGitHub, fetchpatch, wxGTK, autoconf, automake, libtool, python2, gettext, openmp, Cocoa }:
 
 stdenv.mkDerivation rec {
   pname = "wxHexEditor";
@@ -12,13 +12,17 @@ stdenv.mkDerivation rec {
   };
 
   nativeBuildInputs = [ autoconf automake ];
-  buildInputs = [ wxGTK libtool python2 gettext ];
+  buildInputs = [ wxGTK libtool python2 gettext ]
+    ++ lib.optionals stdenv.cc.isClang [ openmp ]
+    ++ lib.optionals stdenv.isDarwin [ Cocoa ];
 
   preConfigure = "patchShebangs .";
 
   prePatch = ''
     substituteInPlace Makefile --replace "/usr" "$out"
     substituteInPlace Makefile --replace "mhash; ./configure" "mhash; ./configure --prefix=$out"
+  '' + lib.optionalString stdenv.cc.isClang ''
+    substituteInPlace Makefile --replace "-lgomp" "-lomp"
   '';
 
   patches = [
@@ -30,7 +34,7 @@ stdenv.mkDerivation rec {
     ./missing-semicolon.patch
   ];
 
-  makeFlags = [ "OPTFLAGS=-fopenmp" ];
+  makeFlags = lib.optionals stdenv.cc.isGNU [ "OPTFLAGS=-fopenmp" ];
 
   meta = {
     description = "Hex Editor / Disk Editor for Huge Files or Devices";
@@ -46,6 +50,7 @@ stdenv.mkDerivation rec {
     '';
     homepage = "http://www.wxhexeditor.org/";
     license = lib.licenses.gpl2;
-    platforms = lib.platforms.linux;
+    platforms = lib.platforms.unix;
+    maintainers = with lib.maintainers; [ wegank ];
   };
 }
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index 8b50599c35c92..1554e796d7f84 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -32485,7 +32485,9 @@ with pkgs;
   wsjtx = qt5.callPackage ../applications/radio/wsjtx { };
 
   wxhexeditor = callPackage ../applications/editors/wxhexeditor {
-    wxGTK = wxGTK31;
+    inherit (darwin.apple_sdk.frameworks) Cocoa;
+    inherit (llvmPackages) openmp;
+    wxGTK = wxGTK32;
   };
 
   xa = callPackage ../development/compilers/xa/xa.nix { };