diff --git a/cd.nix b/cd.nix index f186af2..a1ffefa 100644 --- a/cd.nix +++ b/cd.nix @@ -5,8 +5,8 @@ , gtk3 , im , libGLU -, ftgl , lua +, ftgl-tecgraf , lib }: @@ -27,15 +27,14 @@ stdenv.mkDerivation rec { buildInputs = [ gtk3 libGLU - ftgl lua + ftgl-tecgraf ]; propagatedBuildInputs = [ im ]; - # The PDF support relies on a proprietary paid-for library. postPatch = '' sed -i 's/\bcdpdf\b//g' src/Makefile sed -i 's/\bcdluapdf5\b//g' src/Makefile @@ -47,10 +46,12 @@ stdenv.mkDerivation rec { "USE_LUA_VERSION=52" "USE_GTK3=Yes" "GTK_DEFAULT=Yes" + + "FTGL_LIB=${ftgl-tecgraf}/lib" + "FTGL_INC=${ftgl-tecgraf}/include" ]; NIX_CFLAGS_COMPILE = '' - -Wno-implicit-function-declaration -Wno-incompatible-pointer-types ''; @@ -65,7 +66,7 @@ Description: A vector graphics toolkit with device independent output Version: ${version} Libs: -L${placeholder "out"}/lib -lcd -lcdcontextplus -lcdgl -lcdim Cflags: -I${placeholder "out"}/include -Requires: im gtk+-3.0 glu ftgl +Requires: im gtk+-3.0 glu ''; installPhase = '' @@ -94,7 +95,7 @@ EOF meta = with lib; { description = "A vector graphics toolkit with device independent output"; - license = licenses.mit; + license = with licenses; [ mit ]; maintainers = [ eko5z ]; platforms = with platforms; gnu ++ linux ++ darwin; }; diff --git a/ftgl-tecgraf.nix b/ftgl-tecgraf.nix new file mode 100644 index 0000000..b3eab66 --- /dev/null +++ b/ftgl-tecgraf.nix @@ -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; + }; +} diff --git a/iup.nix b/iup.nix index cf47c29..6ed8abd 100644 --- a/iup.nix +++ b/iup.nix @@ -8,9 +8,9 @@ , libsoup_3 , im , libGLU -, ftgl , lua , lib +, ftgl-tecgraf }: stdenv.mkDerivation rec { @@ -33,7 +33,7 @@ stdenv.mkDerivation rec { libsoup_3 libGLU lua - ftgl + ftgl-tecgraf ]; propagatedBuildInputs = [ @@ -62,6 +62,8 @@ stdenv.mkDerivation rec { "IM_LIB=${im}/lib" "LUA_LIB=${lua}/lib" "LUA_INC=${lua}/include" + "FTGL_LIB=${ftgl-tecgraf}/lib" + "FTGL_INC=${ftgl-tecgraf}/include" ]; NIX_CFLAGS_COMPILE = '' @@ -80,7 +82,7 @@ Description: A portable toolkit for building graphical user interfaces Version: ${version} 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 -Requires: cd im gtk+-3.0 glu ftgl +Requires: cd im gtk+-3.0 glu ''; installPhase = '' diff --git a/lib/libftgl.a b/lib/libftgl.a new file mode 100755 index 0000000..d7c9713 Binary files /dev/null and b/lib/libftgl.a differ diff --git a/lib/libftgl.so b/lib/libftgl.so new file mode 100755 index 0000000..86ccc27 Binary files /dev/null and b/lib/libftgl.so differ