From b62797a3d7edb59cdbe96d5e5144705ef95884cf Mon Sep 17 00:00:00 2001 From: Noa Aarts Date: Thu, 7 Nov 2024 14:39:26 +0100 Subject: [PATCH 1/2] tulip: format using nixfmt --- .../science/misc/tulip/default.nix | 41 +++++++++++++++---- 1 file changed, 34 insertions(+), 7 deletions(-) diff --git a/pkgs/applications/science/misc/tulip/default.nix b/pkgs/applications/science/misc/tulip/default.nix index 713238cc3f85..471431aefb49 100644 --- a/pkgs/applications/science/misc/tulip/default.nix +++ b/pkgs/applications/science/misc/tulip/default.nix @@ -1,6 +1,20 @@ -{ lib, stdenv, fetchurl, libxml2, freetype, libGLU, libGL, glew -, qtbase, wrapQtAppsHook, autoPatchelfHook, python3 -, cmake, libjpeg, llvmPackages }: +{ + lib, + stdenv, + fetchurl, + libxml2, + freetype, + libGLU, + libGL, + glew, + qtbase, + wrapQtAppsHook, + autoPatchelfHook, + python3, + cmake, + libjpeg, + llvmPackages, +}: stdenv.mkDerivation rec { pname = "tulip"; @@ -11,12 +25,25 @@ stdenv.mkDerivation rec { hash = "sha256-7z21WkPi1v2AGishDmXZPAedMjgXPRnpUiHTzEnc5LY="; }; - nativeBuildInputs = [ cmake wrapQtAppsHook ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ autoPatchelfHook ]; + nativeBuildInputs = [ + cmake + wrapQtAppsHook + ] ++ lib.optionals stdenv.hostPlatform.isLinux [ autoPatchelfHook ]; - buildInputs = [ libxml2 freetype glew libjpeg qtbase python3 ] + buildInputs = + [ + libxml2 + freetype + glew + libjpeg + qtbase + python3 + ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ llvmPackages.openmp ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ libGLU libGL ]; + ++ lib.optionals stdenv.hostPlatform.isLinux [ + libGLU + libGL + ]; qtWrapperArgs = [ ''--prefix PATH : ${lib.makeBinPath [ python3 ]}'' ]; From 27c93e95f9a8242dbcd4db09da2c5385659c37a0 Mon Sep 17 00:00:00 2001 From: Noa Aarts Date: Thu, 7 Nov 2024 15:05:48 +0100 Subject: [PATCH 2/2] tulip: fix compilation by adding the `-fpermissive` flag A typecast from unsigned char* to char* in the source broke the build --- pkgs/applications/science/misc/tulip/default.nix | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/pkgs/applications/science/misc/tulip/default.nix b/pkgs/applications/science/misc/tulip/default.nix index 471431aefb49..747231e738bc 100644 --- a/pkgs/applications/science/misc/tulip/default.nix +++ b/pkgs/applications/science/misc/tulip/default.nix @@ -47,12 +47,15 @@ stdenv.mkDerivation rec { qtWrapperArgs = [ ''--prefix PATH : ${lib.makeBinPath [ python3 ]}'' ]; - env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.hostPlatform.isDarwin (toString [ - # fatal error: 'Python.h' file not found - "-I${python3}/include/${python3.libPrefix}" - # error: format string is not a string literal (potentially insecure) - "-Wno-format-security" - ]); + env.NIX_CFLAGS_COMPILE = + # error: invalid conversion from 'unsigned char*' to 'char*' + "-fpermissive " + + (lib.optionalString stdenv.hostPlatform.isDarwin (toString [ + # fatal error: 'Python.h' file not found + "-I${python3}/include/${python3.libPrefix}" + # error: format string is not a string literal (potentially insecure) + "-Wno-format-security" + ])); # FIXME: "make check" needs Docbook's DTD 4.4, among other things. doCheck = false;