2011-09-28 19:26:00 +00:00
|
|
|
{ stdenv, fetchurl, zlib, libX11, libXext, libSM, libICE, libXt
|
|
|
|
, freetype, fontconfig, libXft, libXrender, libxcb, expat, libXau, libXdmcp
|
|
|
|
, libuuid, cups, xz
|
2012-03-14 22:44:52 +00:00
|
|
|
, gstreamer, gst_plugins_base, libxml2
|
2011-09-28 19:26:00 +00:00
|
|
|
, gtkSupport ? true, glib, gtk, pango, gdk_pixbuf, cairo, atk
|
|
|
|
, kdeSupport ? false, qt4, kdelibs
|
2009-05-13 14:47:10 +00:00
|
|
|
}:
|
2006-02-10 12:15:04 +00:00
|
|
|
|
2015-05-11 21:37:53 +00:00
|
|
|
assert stdenv.isLinux && stdenv.cc.isGNU && stdenv.cc.libc != null;
|
2011-09-28 19:26:00 +00:00
|
|
|
|
|
|
|
let
|
2012-07-17 10:46:39 +00:00
|
|
|
mirror = http://get.geo.opera.com/pub/opera;
|
2011-09-28 19:26:00 +00:00
|
|
|
in
|
2006-09-29 09:06:56 +00:00
|
|
|
|
2007-10-30 01:51:15 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2015-03-03 05:15:54 +00:00
|
|
|
name = "opera-12.16-1860";
|
2007-11-28 02:10:27 +00:00
|
|
|
|
2009-09-02 13:24:08 +00:00
|
|
|
src =
|
|
|
|
if stdenv.system == "i686-linux" then
|
2007-11-28 02:10:27 +00:00
|
|
|
fetchurl {
|
2015-03-03 05:15:54 +00:00
|
|
|
url = "${mirror}/linux/1216/${name}.i386.linux.tar.xz";
|
|
|
|
sha256 = "df640656a52b7c714faf25de92d84992116ce8f82b7a67afc1121eb3c428489d";
|
2009-09-02 13:24:08 +00:00
|
|
|
}
|
|
|
|
else if stdenv.system == "x86_64-linux" then
|
2007-11-28 02:10:27 +00:00
|
|
|
fetchurl {
|
2015-03-03 05:15:54 +00:00
|
|
|
url = "${mirror}/linux/1216/${name}.x86_64.linux.tar.xz";
|
|
|
|
sha256 = "b3b5cada3829d2b3b0e2da25e9444ce9dff73dc6692586ce72cfd4f6431e639e";
|
2009-09-02 13:24:08 +00:00
|
|
|
}
|
|
|
|
else throw "Opera is not supported on ${stdenv.system} (only i686-linux and x86_64 linux are supported)";
|
2006-02-10 12:15:04 +00:00
|
|
|
|
2008-10-04 18:18:23 +00:00
|
|
|
dontStrip = 1;
|
2011-09-28 19:26:00 +00:00
|
|
|
|
|
|
|
phases = "unpackPhase installPhase fixupPhase";
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
./install --unattended --prefix $out
|
|
|
|
'';
|
|
|
|
|
|
|
|
buildInputs =
|
2015-01-15 04:25:26 +00:00
|
|
|
[ stdenv.cc.cc stdenv.cc.libc zlib libX11 libXt libXext libSM libICE
|
2011-09-28 19:26:00 +00:00
|
|
|
libXft freetype fontconfig libXrender libuuid expat
|
2012-03-14 22:44:52 +00:00
|
|
|
gstreamer libxml2 gst_plugins_base
|
2011-09-28 19:26:00 +00:00
|
|
|
]
|
|
|
|
++ stdenv.lib.optionals gtkSupport [ glib gtk pango gdk_pixbuf cairo atk ]
|
|
|
|
++ stdenv.lib.optionals kdeSupport [ kdelibs qt4 ];
|
|
|
|
|
|
|
|
libPath = stdenv.lib.makeLibraryPath buildInputs
|
|
|
|
+ stdenv.lib.optionalString (stdenv.system == "x86_64-linux")
|
2016-04-14 15:14:28 +00:00
|
|
|
(":" + stdenv.lib.makeSearchPathOutput "lib" "lib64" buildInputs);
|
2011-09-28 19:26:00 +00:00
|
|
|
|
|
|
|
preFixup =
|
|
|
|
''
|
2015-10-10 11:24:05 +00:00
|
|
|
rm $out/bin/uninstall-opera
|
2011-09-28 19:26:00 +00:00
|
|
|
find $out/lib/opera -type f | while read f; do
|
2015-10-10 11:24:05 +00:00
|
|
|
type=$(readelf -h "$f" 2>/dev/null | sed -n 's/ *Type: *\([A-Z]*\).*/\1/p' || true)
|
2011-09-28 19:26:00 +00:00
|
|
|
if [ -z "$type" ]; then
|
|
|
|
:
|
|
|
|
elif [ $type == "EXEC" ]; then
|
|
|
|
echo "patching $f executable <<"
|
|
|
|
patchelf \
|
2014-12-17 18:11:30 +00:00
|
|
|
--set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
|
2011-09-28 19:26:00 +00:00
|
|
|
--set-rpath "${libPath}" \
|
|
|
|
"$f"
|
|
|
|
elif [ $type == "DYN" ]; then
|
|
|
|
echo "patching $f library <<"
|
|
|
|
patchelf --set-rpath "${libPath}" "$f"
|
|
|
|
else
|
|
|
|
echo "Unknown type $type"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
'';
|
|
|
|
|
|
|
|
postFixup = ''
|
|
|
|
oldRPATH=`patchelf --print-rpath $out/lib/opera/opera`
|
2016-01-24 07:29:02 +00:00
|
|
|
patchelf --set-rpath $oldRPATH:${cups.out}/lib $out/lib/opera/opera
|
2012-11-27 23:21:34 +00:00
|
|
|
|
|
|
|
# This file should normally require a gtk-update-icon-cache -q /usr/share/icons/hicolor command
|
|
|
|
# It have no reasons to exist in a redistribuable package
|
|
|
|
rm $out/share/icons/hicolor/icon-theme.cache
|
2011-09-28 19:26:00 +00:00
|
|
|
'';
|
2009-05-13 14:47:10 +00:00
|
|
|
|
2008-01-30 19:49:42 +00:00
|
|
|
meta = {
|
|
|
|
homepage = http://www.opera.com;
|
2014-08-24 14:21:08 +00:00
|
|
|
description = "Web browser";
|
2014-11-06 00:44:33 +00:00
|
|
|
license = stdenv.lib.licenses.unfree;
|
2008-01-30 19:49:42 +00:00
|
|
|
};
|
2006-02-10 12:15:04 +00:00
|
|
|
}
|