105 lines
2.2 KiB
Nix
105 lines
2.2 KiB
Nix
{ stdenv
|
|
, cd
|
|
, fetchurl
|
|
, lsb-release
|
|
, pkg-config
|
|
, gtk2
|
|
, im
|
|
, libGLU
|
|
, ftgl
|
|
, lua51Packages
|
|
, lib
|
|
}:
|
|
|
|
stdenv.mkDerivation rec {
|
|
pname = "iup";
|
|
version = "3.32";
|
|
|
|
src = fetchurl {
|
|
url = "mirror://sourceforge/iup/${version}/Docs%20and%20Sources/iup-${version}_Sources.tar.gz";
|
|
sha256 = "sha256-hx4X/KD7BNChO2jS/bmINZYzeCbqRMklTKOOPqu2pqU=";
|
|
};
|
|
|
|
nativeBuildInputs = [
|
|
lsb-release
|
|
pkg-config
|
|
];
|
|
|
|
buildInputs = [
|
|
ftgl
|
|
gtk2
|
|
libGLU
|
|
lua51Packages.lua
|
|
];
|
|
|
|
propagatedBuildInputs = [
|
|
cd
|
|
im
|
|
];
|
|
|
|
postPatch = ''
|
|
patchShebangs .
|
|
sed -i 's/\biupweb\b//g' Makefile
|
|
sed -i 's/\biupvled\b//g' Makefile
|
|
|
|
sed -i 's/\biupluaweb\b//g' srclua5/Makefile
|
|
substituteInPlace srclua5/config.mak \
|
|
--replace-fail "NO_LUALINK = Yes" "NO_LUALINK ="
|
|
'';
|
|
|
|
makeFlags = [
|
|
"NO_DEPEND=Yes"
|
|
"USE_PKGCONFIG=Yes"
|
|
"USE_GTK2=Yes"
|
|
"GTK_DEFAULT=Yes"
|
|
"LUA_SFX="
|
|
|
|
"CD_LIB=${cd}/lib"
|
|
"IM_LIB=${im}/lib"
|
|
"LUA_LIB=${lua51Packages.lua}/lib"
|
|
"LUA_INC=${lua51Packages.lua}/include"
|
|
];
|
|
|
|
NIX_CFLAGS_COMPILE = ''
|
|
-Wno-implicit-function-declaration
|
|
-Wno-incompatible-pointer-types
|
|
'';
|
|
|
|
installPhase = ''
|
|
runHook preInstall
|
|
|
|
mkdir -p $out/{bin,etc,lib,include,share/lua/5.1}
|
|
mkdir -p $out/share/lua/5.1/{ctrl,elem,gl,lh,scripter}
|
|
|
|
cp -vr include/* $out/include/
|
|
|
|
cp -v lib/Linux*/*.so $out/lib/
|
|
cp -v lib/Linux*/*.a $out/lib/ || true
|
|
|
|
cp -v lib/Linux*/Lua*/*.so $out/lib/
|
|
cp -v lib/Linux*/Lua*/*.a $out/lib/ || true
|
|
|
|
cp -vr bin/Linux612_64/* $out/bin/
|
|
chmod +x $out/bin/*
|
|
|
|
cp -v srclua5/*.lua "$out/share/lua/5.1/"
|
|
|
|
cp -v srclua5/ctrl/*.lua "$out/share/lua/5.1/ctrl/"
|
|
cp -v srclua5/elem/*.lua "$out/share/lua/5.1/elem/"
|
|
cp -v srclua5/gl/*.lua "$out/share/lua/5.1/gl/"
|
|
cp -v srclua5/lh/*.lh "$out/share/lua/5.1/lh/"
|
|
cp -v srclua5/scripter/*.lua "$out/share/lua/5.1/scripter/"
|
|
|
|
cp -r etc/* $out/etc
|
|
|
|
runHook postInstall
|
|
'';
|
|
|
|
meta = with lib; {
|
|
description = "A portable toolkit for building graphical user interfaces";
|
|
license = licenses.mit;
|
|
maintainers = [ eko5z ];
|
|
platforms = with platforms; gnu ++ linux ++ darwin;
|
|
};
|
|
}
|