on iko/ghcjs-patch-master help sign in
Changes to allow opencv to be built (#834)

* Changes to allow opencv to be built The opencv library needs: 1. pkgconfig for opencv should return OpenCV 3, not OpenCV 2 (which is what pkgs.opencv is) 2. hardeningDisable = [ "bindnow" ] (as per https://github.com/LumiGuide/haskell-opencv/commit/5ea490af7662fe74b3740619963d37f1fd91e3d4#) This commit fixes (1) by adding an entry to lib/pkgconf-nixpkgs-map.nix, and partially fixes (2) by adding a new `hardeningDisable` option to the set of package options. The user will still need to specify: packages.opencv.hardeningDisable = [ "bindnow" ]; I'm not sure if there's a place to specify this as default in haskell.nix. * Update comp-builder.nix

commitf655e66777bb9d94c81dc59d4fcecaf669647fda authorOllie Charles <ollie@ocharles.org.uk> dateMon 7 Sep 2020, 13:28 (6 years ago) parent40d0528
3 files changed+9
builder/comp-builder.nix+4 lib/pkgconf-nixpkgs-map.nix+1 modules/plan.nix+4
builder/comp-builder.nix+4
@@ -31,6 +31,7 @@ let self =
3131
3232, dontPatchELF ? component.dontPatchELF
3333, dontStrip ? component.dontStrip
34+, hardeningDisable ? component.hardeningDisable
3435
3536, enableStatic ? component.enableStatic
3637, enableShared ? ghc.enableShared && component.enableShared && !haskellLib.isCrossHost
@@ -376,5 +377,8 @@ let
376377 inherit
377378 preBuild postBuild
378379 preInstall postInstall;
380+ }
381+ // lib.optionalAttrs (hardeningDisable != []) {
382+ inherit hardeningDisable;
379383 });
380384in drv; in self)
lib/pkgconf-nixpkgs-map.nix+1
@@ -106,6 +106,7 @@ pkgs:
106106 "notify" = [ pkgs."libnotify" ];
107107 "odbc" = [ pkgs."unixODBC" ];
108108 "openblas" = [ pkgs."openblasCompat" ];
109+ "opencv" = [ pkgs."opencv3" ];
109110 "panelw" = [ pkgs."ncurses" ];
110111 "pangocairo" = [ pkgs."pango" ];
111112 "pcap" = [ pkgs."libpcap" ];
modules/plan.nix+4
@@ -220,6 +220,10 @@ let
220220 type = nullOr uniqueStr;
221221 default = getDefaultOrNull def "postHaddock";
222222 };
223+ hardeningDisable = mkOption {
224+ type = listOfFilteringNulls str;
225+ default = (def.hardeningDisable or []);
226+ };
223227 };
224228
225229