From 66eee3addaed3dc8ba104f80c961737bee1d075d Mon Sep 17 00:00:00 2001 From: K900 Date: Mon, 30 Sep 2024 08:00:21 +0300 Subject: [PATCH] ftgl: fix build, clean up - patch to fix type mismatch error - remove conditional Darwin inputs, those are aliased in all-packages.nix now - clean up postInstall - remove unnecessary enableParallelBuilding --- pkgs/by-name/ft/ftgl/fix-warnings.patch | 39 +++++++++++++++++++++++++ pkgs/by-name/ft/ftgl/package.nix | 21 ++++--------- 2 files changed, 44 insertions(+), 16 deletions(-) create mode 100644 pkgs/by-name/ft/ftgl/fix-warnings.patch diff --git a/pkgs/by-name/ft/ftgl/fix-warnings.patch b/pkgs/by-name/ft/ftgl/fix-warnings.patch new file mode 100644 index 000000000000..7dea7e8fb06d --- /dev/null +++ b/pkgs/by-name/ft/ftgl/fix-warnings.patch @@ -0,0 +1,39 @@ +diff --git a/src/FTContour.cpp b/src/FTContour.cpp +index c668d32..ef13576 100644 +--- a/src/FTContour.cpp ++++ b/src/FTContour.cpp +@@ -174,7 +174,7 @@ void FTContour::SetParity(int parity) + } + + +-FTContour::FTContour(FT_Vector* contour, char* tags, unsigned int n) ++FTContour::FTContour(FT_Vector* contour, unsigned char* tags, unsigned int n) + { + FTPoint prev, cur(contour[(n - 1) % n]), next(contour[0]); + double olddir, dir = atan2((next - cur).Y(), (next - cur).X()); +diff --git a/src/FTContour.h b/src/FTContour.h +index d2d187c..dc64e3a 100644 +--- a/src/FTContour.h ++++ b/src/FTContour.h +@@ -52,7 +52,7 @@ class FTContour + * @param pointTags + * @param numberOfPoints + */ +- FTContour(FT_Vector* contour, char* pointTags, unsigned int numberOfPoints); ++ FTContour(FT_Vector* contour, unsigned char* pointTags, unsigned int numberOfPoints); + + /** + * Destructor +diff --git a/src/FTVectoriser.cpp b/src/FTVectoriser.cpp +index 26e7da8..53d738e 100644 +--- a/src/FTVectoriser.cpp ++++ b/src/FTVectoriser.cpp +@@ -168,7 +168,7 @@ void FTVectoriser::ProcessContours() + for(int i = 0; i < ftContourCount; ++i) + { + FT_Vector* pointList = &outline.points[startIndex]; +- char* tagList = &outline.tags[startIndex]; ++ unsigned char* tagList = &outline.tags[startIndex]; + + endIndex = outline.contours[i]; + contourLength = (endIndex - startIndex) + 1; diff --git a/pkgs/by-name/ft/ftgl/package.nix b/pkgs/by-name/ft/ftgl/package.nix index ee2a3e2457bf..506a756ba2e7 100644 --- a/pkgs/by-name/ft/ftgl/package.nix +++ b/pkgs/by-name/ft/ftgl/package.nix @@ -8,12 +8,8 @@ , libGL , libGLU , pkg-config -, darwin }: -let - inherit (darwin.apple_sdk.frameworks) OpenGL GLUT; -in stdenv.mkDerivation rec { pname = "ftgl"; version = "2.4.0"; @@ -33,6 +29,10 @@ stdenv.mkDerivation rec { --replace ' -dylib_file $GL_DYLIB: $GL_DYLIB' "" ''; + patches = [ + ./fix-warnings.patch + ]; + nativeBuildInputs = [ autoreconfHook doxygen @@ -40,24 +40,13 @@ stdenv.mkDerivation rec { ]; buildInputs = [ freetype - ] ++ (if stdenv.hostPlatform.isDarwin then [ - OpenGL - GLUT - ] else [ libGL libGLU libglut - ]); - - configureFlags = [ - "--with-ft-prefix=${lib.getDev freetype}" ]; - enableParallelBuilding = true; - postInstall = '' - install -Dm644 src/FTSize.h -t ${placeholder "out"}/include/FTGL - install -Dm644 src/FTFace.h -t ${placeholder "out"}/include/FTGL + install -Dm644 src/FTSize.h src/FTFace.h -t $out/include/FTGL ''; meta = with lib; {