Add custom Tecgraf patched FTGL

This commit is contained in:
2026-03-25 07:09:57 +01:00
parent 1d140bc8d9
commit eccce9e384
5 changed files with 68 additions and 9 deletions
+7 -6
View File
@@ -5,8 +5,8 @@
, gtk3 , gtk3
, im , im
, libGLU , libGLU
, ftgl
, lua , lua
, ftgl-tecgraf
, lib , lib
}: }:
@@ -27,15 +27,14 @@ stdenv.mkDerivation rec {
buildInputs = [ buildInputs = [
gtk3 gtk3
libGLU libGLU
ftgl
lua lua
ftgl-tecgraf
]; ];
propagatedBuildInputs = [ propagatedBuildInputs = [
im im
]; ];
# The PDF support relies on a proprietary paid-for library.
postPatch = '' postPatch = ''
sed -i 's/\bcdpdf\b//g' src/Makefile sed -i 's/\bcdpdf\b//g' src/Makefile
sed -i 's/\bcdluapdf5\b//g' src/Makefile sed -i 's/\bcdluapdf5\b//g' src/Makefile
@@ -47,10 +46,12 @@ stdenv.mkDerivation rec {
"USE_LUA_VERSION=52" "USE_LUA_VERSION=52"
"USE_GTK3=Yes" "USE_GTK3=Yes"
"GTK_DEFAULT=Yes" "GTK_DEFAULT=Yes"
"FTGL_LIB=${ftgl-tecgraf}/lib"
"FTGL_INC=${ftgl-tecgraf}/include"
]; ];
NIX_CFLAGS_COMPILE = '' NIX_CFLAGS_COMPILE = ''
-Wno-implicit-function-declaration
-Wno-incompatible-pointer-types -Wno-incompatible-pointer-types
''; '';
@@ -65,7 +66,7 @@ Description: A vector graphics toolkit with device independent output
Version: ${version} Version: ${version}
Libs: -L${placeholder "out"}/lib -lcd -lcdcontextplus -lcdgl -lcdim Libs: -L${placeholder "out"}/lib -lcd -lcdcontextplus -lcdgl -lcdim
Cflags: -I${placeholder "out"}/include Cflags: -I${placeholder "out"}/include
Requires: im gtk+-3.0 glu ftgl Requires: im gtk+-3.0 glu
''; '';
installPhase = '' installPhase = ''
@@ -94,7 +95,7 @@ EOF
meta = with lib; { meta = with lib; {
description = "A vector graphics toolkit with device independent output"; description = "A vector graphics toolkit with device independent output";
license = licenses.mit; license = with licenses; [ mit ];
maintainers = [ eko5z ]; maintainers = [ eko5z ];
platforms = with platforms; gnu ++ linux ++ darwin; platforms = with platforms; gnu ++ linux ++ darwin;
}; };
+56
View File
@@ -0,0 +1,56 @@
{ fetchurl
, lib
, stdenv
, freetype
, libGLU
, pkg-config
, lsb-release
, tree
}:
stdenv.mkDerivation rec {
pname = "ftgl-tecgraf";
version = "3.32";
src = fetchurl {
url = "mirror://sourceforge/iup/${version}/Docs%20and%20Sources/ftgl-2.1.5_Sources.tar.gz";
sha256 = "sha256-v9XqBq5qOm2MxAeybOzCMCqsi7hsQhWtsGkUHVNAekw=";
};
nativeBuildInputs = [
lsb-release
pkg-config
];
buildInputs = [
freetype
libGLU
];
makeFlags = [
"NO_DEPEND=Yes"
];
NIX_CFLAGS_COMPILE = ''
-fpermissive
'';
installPhase = ''
runHook preInstall
mkdir -p $out/{lib,include}
cp -v lib/Linux*/*.so $out/lib/
cp -v lib/Linux*/*.a $out/lib/ || true
cp -r include/* $out/include
runHook postInstall
'';
meta = with lib; {
description = "Tecgraf patched FTGL used by CD/IUP";
license = with licenses; mit;
maintainers = [ eko5z ];
platforms = with platforms; gnu ++ linux ++ darwin;
};
}
+5 -3
View File
@@ -8,9 +8,9 @@
, libsoup_3 , libsoup_3
, im , im
, libGLU , libGLU
, ftgl
, lua , lua
, lib , lib
, ftgl-tecgraf
}: }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
@@ -33,7 +33,7 @@ stdenv.mkDerivation rec {
libsoup_3 libsoup_3
libGLU libGLU
lua lua
ftgl ftgl-tecgraf
]; ];
propagatedBuildInputs = [ propagatedBuildInputs = [
@@ -62,6 +62,8 @@ stdenv.mkDerivation rec {
"IM_LIB=${im}/lib" "IM_LIB=${im}/lib"
"LUA_LIB=${lua}/lib" "LUA_LIB=${lua}/lib"
"LUA_INC=${lua}/include" "LUA_INC=${lua}/include"
"FTGL_LIB=${ftgl-tecgraf}/lib"
"FTGL_INC=${ftgl-tecgraf}/include"
]; ];
NIX_CFLAGS_COMPILE = '' NIX_CFLAGS_COMPILE = ''
@@ -80,7 +82,7 @@ Description: A portable toolkit for building graphical user interfaces
Version: ${version} Version: ${version}
Libs: -L${placeholder "out"}/lib -liup -liupgl -liupglcontrols -liupcontrols -liup_plot -liup_mglplot -liupcd -liupim -liupimglib -liup_scintilla -liuptuio -liupweb Libs: -L${placeholder "out"}/lib -liup -liupgl -liupglcontrols -liupcontrols -liup_plot -liup_mglplot -liupcd -liupim -liupimglib -liup_scintilla -liuptuio -liupweb
Cflags: -I${placeholder "out"}/include Cflags: -I${placeholder "out"}/include
Requires: cd im gtk+-3.0 glu ftgl Requires: cd im gtk+-3.0 glu
''; '';
installPhase = '' installPhase = ''
Executable
BIN
View File
Binary file not shown.
Executable
BIN
View File
Binary file not shown.