Add GTK3 switch
This commit is contained in:
@@ -3,6 +3,7 @@
|
|||||||
, fetchurl
|
, fetchurl
|
||||||
, lsb-release
|
, lsb-release
|
||||||
, pkg-config
|
, pkg-config
|
||||||
|
, gtk2
|
||||||
, gtk3
|
, gtk3
|
||||||
, im
|
, im
|
||||||
, libGL
|
, libGL
|
||||||
@@ -10,6 +11,7 @@
|
|||||||
, lua
|
, lua
|
||||||
, ftgl-tecgraf
|
, ftgl-tecgraf
|
||||||
, lib
|
, lib
|
||||||
|
, withGTK3 ? false
|
||||||
}:
|
}:
|
||||||
|
|
||||||
let
|
let
|
||||||
@@ -29,7 +31,7 @@ in stdenv.mkDerivation rec {
|
|||||||
];
|
];
|
||||||
|
|
||||||
buildInputs = [
|
buildInputs = [
|
||||||
gtk3
|
(if withGTK3 then gtk3 else gtk2)
|
||||||
libGL
|
libGL
|
||||||
libGLU
|
libGLU
|
||||||
lua
|
lua
|
||||||
@@ -49,12 +51,11 @@ in stdenv.mkDerivation rec {
|
|||||||
"NO_DEPEND=Yes"
|
"NO_DEPEND=Yes"
|
||||||
"USE_PKGCONFIG=Yes"
|
"USE_PKGCONFIG=Yes"
|
||||||
"USE_LUA_VERSION=52"
|
"USE_LUA_VERSION=52"
|
||||||
"USE_GTK3=Yes"
|
|
||||||
"GTK_DEFAULT=Yes"
|
"GTK_DEFAULT=Yes"
|
||||||
|
|
||||||
"FTGL_LIB=${ftgl-tecgraf}/lib"
|
"FTGL_LIB=${ftgl-tecgraf}/lib"
|
||||||
"FTGL_INC=${ftgl-tecgraf}/include"
|
"FTGL_INC=${ftgl-tecgraf}/include"
|
||||||
];
|
] ++ (if withGTK3 then [ "USE_GTK3=Yes" ] else [ "USE_GTK2=Yes" ]);
|
||||||
|
|
||||||
NIX_CFLAGS_COMPILE = ''
|
NIX_CFLAGS_COMPILE = ''
|
||||||
-Wno-incompatible-pointer-types
|
-Wno-incompatible-pointer-types
|
||||||
@@ -64,12 +65,12 @@ in stdenv.mkDerivation rec {
|
|||||||
"cd"
|
"cd"
|
||||||
"A vector graphics toolkit with device independent output"
|
"A vector graphics toolkit with device independent output"
|
||||||
version
|
version
|
||||||
"gdk-3.0 pango"
|
(if withGTK3 then "gdk-3.0 pango" else "gdk-2.0 pango")
|
||||||
);
|
);
|
||||||
|
|
||||||
cdcontextplusPc = builtins.toFile "cdcontextplus.pc" (makePc
|
cdcontextplusPc = builtins.toFile "cdcontextplus.pc" (makePc
|
||||||
"cdcontextplus"
|
"cdcontextplus"
|
||||||
"A vector graphics toolkit with device independent output (dynamic driver loader"
|
"A vector graphics toolkit with device independent output (dynamic driver loader)"
|
||||||
version
|
version
|
||||||
"pangocairo cairo"
|
"pangocairo cairo"
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
, fetchurl
|
, fetchurl
|
||||||
, lsb-release
|
, lsb-release
|
||||||
, pkg-config
|
, pkg-config
|
||||||
|
, gtk2
|
||||||
, gtk3
|
, gtk3
|
||||||
, webkitgtk_4_1
|
, webkitgtk_4_1
|
||||||
, libsoup_3
|
, libsoup_3
|
||||||
@@ -13,6 +14,7 @@
|
|||||||
, lua
|
, lua
|
||||||
, lib
|
, lib
|
||||||
, ftgl-tecgraf
|
, ftgl-tecgraf
|
||||||
|
, withGTK3 ? false
|
||||||
}:
|
}:
|
||||||
|
|
||||||
let
|
let
|
||||||
@@ -32,14 +34,12 @@ in stdenv.mkDerivation rec {
|
|||||||
];
|
];
|
||||||
|
|
||||||
buildInputs = [
|
buildInputs = [
|
||||||
gtk3
|
(if withGTK3 then gtk3 else gtk2)
|
||||||
webkitgtk_4_1
|
|
||||||
libsoup_3
|
|
||||||
libGL
|
libGL
|
||||||
libGLU
|
libGLU
|
||||||
lua
|
lua
|
||||||
ftgl-tecgraf
|
ftgl-tecgraf
|
||||||
];
|
] ++ lib.optional withGTK3 [ webkitgtk_4_1 libsoup_3 ];
|
||||||
|
|
||||||
propagatedBuildInputs = [
|
propagatedBuildInputs = [
|
||||||
cd
|
cd
|
||||||
@@ -48,17 +48,19 @@ in stdenv.mkDerivation rec {
|
|||||||
|
|
||||||
postPatch = ''
|
postPatch = ''
|
||||||
sed -i 's/\biupvled\b//g' Makefile
|
sed -i 's/\biupvled\b//g' Makefile
|
||||||
|
'' + lib.optionalString withGTK3 ''
|
||||||
substituteInPlace srcweb/config.mak \
|
substituteInPlace srcweb/config.mak \
|
||||||
--replace-fail "\$(GTK)/include/webkitgtk-4.1" "${webkitgtk_4_1.dev}/include/webkitgtk-4.1" \
|
--replace-fail "\$(GTK)/include/webkitgtk-4.1" "${webkitgtk_4_1.dev}/include/webkitgtk-4.1" \
|
||||||
--replace-fail "\$(GTK)/include/libsoup-3.0" "${libsoup_3.dev}/include/libsoup-3.0"
|
--replace-fail "\$(GTK)/include/libsoup-3.0" "${libsoup_3.dev}/include/libsoup-3.0"
|
||||||
|
'' + lib.optionalString (!withGTK3) ''
|
||||||
|
sed -i 's/\biupweb\b//g' Makefile
|
||||||
|
sed -i 's/\biupluaweb\b//g' srclua5/Makefile
|
||||||
'';
|
'';
|
||||||
|
|
||||||
makeFlags = [
|
makeFlags = [
|
||||||
"NO_DEPEND=Yes"
|
"NO_DEPEND=Yes"
|
||||||
"USE_PKGCONFIG=Yes"
|
"USE_PKGCONFIG=Yes"
|
||||||
"USE_LUA_VERSION=52"
|
"USE_LUA_VERSION=52"
|
||||||
"USE_GTK3=Yes"
|
|
||||||
"GTK_DEFAULT=Yes"
|
"GTK_DEFAULT=Yes"
|
||||||
"LUA_SFX="
|
"LUA_SFX="
|
||||||
|
|
||||||
@@ -68,7 +70,7 @@ in stdenv.mkDerivation rec {
|
|||||||
"LUA_INC=${lua}/include"
|
"LUA_INC=${lua}/include"
|
||||||
"FTGL_LIB=${ftgl-tecgraf}/lib"
|
"FTGL_LIB=${ftgl-tecgraf}/lib"
|
||||||
"FTGL_INC=${ftgl-tecgraf}/include"
|
"FTGL_INC=${ftgl-tecgraf}/include"
|
||||||
];
|
] ++ (if withGTK3 then [ "USE_GTK3=Yes" ] else [ "USE_GTK2=Yes" ]);
|
||||||
|
|
||||||
NIX_CFLAGS_COMPILE = ''
|
NIX_CFLAGS_COMPILE = ''
|
||||||
-Wno-implicit-function-declaration
|
-Wno-implicit-function-declaration
|
||||||
@@ -79,7 +81,7 @@ in stdenv.mkDerivation rec {
|
|||||||
"iup"
|
"iup"
|
||||||
"A portable toolkit for building graphical user interfaces"
|
"A portable toolkit for building graphical user interfaces"
|
||||||
version
|
version
|
||||||
"gtk+-3.0"
|
(if withGTK3 then "gtk+-3.0" else "gtk+-2.0")
|
||||||
);
|
);
|
||||||
|
|
||||||
iupglPc = builtins.toFile "iupgl.pc" (makePc
|
iupglPc = builtins.toFile "iupgl.pc" (makePc
|
||||||
@@ -161,7 +163,6 @@ in stdenv.mkDerivation rec {
|
|||||||
ln -fs $out/lib/libiuplua_mglplot52.so $out/share/lua/5.2/iuplua_mglplot.so
|
ln -fs $out/lib/libiuplua_mglplot52.so $out/share/lua/5.2/iuplua_mglplot.so
|
||||||
ln -fs $out/lib/libiuplua_scintilla52.so $out/share/lua/5.2/iuplua_scintilla.so
|
ln -fs $out/lib/libiuplua_scintilla52.so $out/share/lua/5.2/iuplua_scintilla.so
|
||||||
ln -fs $out/lib/libiupluascripterdlg52.so $out/share/lua/5.2/iupluascripterdlg.so
|
ln -fs $out/lib/libiupluascripterdlg52.so $out/share/lua/5.2/iupluascripterdlg.so
|
||||||
ln -fs $out/lib/libiupluaweb52.so $out/share/lua/5.2/iupluaweb.so
|
|
||||||
ln -fs $out/lib/libiupluaimglib52.so $out/share/lua/5.2/iupluaimglib.so
|
ln -fs $out/lib/libiupluaimglib52.so $out/share/lua/5.2/iupluaimglib.so
|
||||||
|
|
||||||
cp -v ${iupPc} $out/lib/pkgconfig/iup.pc
|
cp -v ${iupPc} $out/lib/pkgconfig/iup.pc
|
||||||
@@ -171,12 +172,14 @@ in stdenv.mkDerivation rec {
|
|||||||
cp -v ${iupPlotPc} $out/lib/pkgconfig/iup_plot.pc
|
cp -v ${iupPlotPc} $out/lib/pkgconfig/iup_plot.pc
|
||||||
cp -v ${iupimPc} $out/lib/pkgconfig/iupim.pc
|
cp -v ${iupimPc} $out/lib/pkgconfig/iupim.pc
|
||||||
cp -v ${iupimglibPc} $out/lib/pkgconfig/iupimglib.pc
|
cp -v ${iupimglibPc} $out/lib/pkgconfig/iupimglib.pc
|
||||||
cp -v ${iupwebPc} $out/lib/pkgconfig/iupweb.pc
|
|
||||||
|
|
||||||
cp -vr bin/Linux*/* $out/bin/
|
cp -vr bin/Linux*/* $out/bin/
|
||||||
chmod +x $out/bin/*
|
chmod +x $out/bin/*
|
||||||
cp -r etc/* $out/etc
|
cp -r etc/* $out/etc
|
||||||
|
'' + lib.optionalString withGTK3 ''
|
||||||
|
ln -fs $out/lib/libiupluaweb52.so $out/share/lua/5.2/iupluaweb.so
|
||||||
|
cp -v ${iupwebPc} $out/lib/pkgconfig/iupweb.pc
|
||||||
|
'' + ''
|
||||||
runHook postInstall
|
runHook postInstall
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user