parent
cbec6a304a
commit
c2281d6494
|
@ -1,91 +1,125 @@
|
||||||
{ stdenv, fetchurl, zlib, libX11, libXext, libSM, libICE, libXt
|
{ alsaLib
|
||||||
, freetype, fontconfig, libXft, libXrender, libxcb, expat, libXau, libXdmcp
|
, atk
|
||||||
, libuuid, cups, xz
|
, cairo
|
||||||
, gstreamer, gst_plugins_base, libxml2
|
, cups
|
||||||
, gtkSupport ? true, glib, gtk2, pango, gdk_pixbuf, cairo, atk
|
, curl
|
||||||
, kdeSupport ? false, qt4, kdelibs
|
, dbus
|
||||||
|
, dpkg
|
||||||
|
, expat
|
||||||
|
, fetchurl
|
||||||
|
, fontconfig
|
||||||
|
, freetype
|
||||||
|
, gdk_pixbuf
|
||||||
|
, glib
|
||||||
|
, gnome2
|
||||||
|
, gtk2
|
||||||
|
, libX11
|
||||||
|
, libXScrnSaver
|
||||||
|
, libXcomposite
|
||||||
|
, libXcursor
|
||||||
|
, libXdamage
|
||||||
|
, libXext
|
||||||
|
, libXfixes
|
||||||
|
, libXi
|
||||||
|
, libXrandr
|
||||||
|
, libXrender
|
||||||
|
, libXtst
|
||||||
|
, libnotify
|
||||||
|
, libpulseaudio
|
||||||
|
, nspr
|
||||||
|
, nss
|
||||||
|
, pango
|
||||||
|
, stdenv
|
||||||
|
, systemd
|
||||||
}:
|
}:
|
||||||
|
|
||||||
assert stdenv.isLinux && stdenv.cc.isGNU && stdenv.cc.libc != null;
|
|
||||||
|
|
||||||
let
|
let
|
||||||
mirror = http://get.geo.opera.com/pub/opera;
|
|
||||||
in
|
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
mirror = https://get.geo.opera.com/pub/opera/desktop;
|
||||||
name = "opera-12.16-1860";
|
version = "40.0.2308.90";
|
||||||
|
|
||||||
|
rpath = stdenv.lib.makeLibraryPath [
|
||||||
|
|
||||||
|
# These provide shared libraries loaded when starting. If one is missing,
|
||||||
|
# an error is shown in stderr.
|
||||||
|
alsaLib.out
|
||||||
|
atk.out
|
||||||
|
cairo.out
|
||||||
|
cups.out
|
||||||
|
curl.out
|
||||||
|
dbus.lib
|
||||||
|
expat.out
|
||||||
|
fontconfig.lib
|
||||||
|
freetype.out
|
||||||
|
gdk_pixbuf.out
|
||||||
|
glib.out
|
||||||
|
gnome2.GConf.out
|
||||||
|
gtk2.out
|
||||||
|
libX11.out
|
||||||
|
libXScrnSaver.out
|
||||||
|
libXcomposite.out
|
||||||
|
libXcursor.out
|
||||||
|
libXdamage.out
|
||||||
|
libXext.out
|
||||||
|
libXfixes.out
|
||||||
|
libXi.out
|
||||||
|
libXrandr.out
|
||||||
|
libXrender.out
|
||||||
|
libXtst.out
|
||||||
|
libnotify.out
|
||||||
|
nspr.out
|
||||||
|
nss.out
|
||||||
|
pango.out
|
||||||
|
stdenv.cc.cc.lib
|
||||||
|
|
||||||
|
# This is a little tricky. Without it the app starts then crashes. Then it
|
||||||
|
# brings up the crash report, which also crashes. `strace -f` hints at a
|
||||||
|
# missing libudev.so.0.
|
||||||
|
systemd.lib
|
||||||
|
|
||||||
|
# Works fine without this except there is no sound.
|
||||||
|
libpulseaudio.out
|
||||||
|
];
|
||||||
|
|
||||||
|
in stdenv.mkDerivation {
|
||||||
|
|
||||||
|
name = "opera-${version}";
|
||||||
|
|
||||||
src =
|
src =
|
||||||
if stdenv.system == "i686-linux" then
|
if stdenv.system == "i686-linux" then
|
||||||
fetchurl {
|
fetchurl {
|
||||||
url = "${mirror}/linux/1216/${name}.i386.linux.tar.xz";
|
url = "${mirror}/${version}/linux/opera-stable_${version}_i386.deb";
|
||||||
sha256 = "df640656a52b7c714faf25de92d84992116ce8f82b7a67afc1121eb3c428489d";
|
sha256 = "1fqbxbn4531yv9figgg8xxr63swimrgpamqrphcg8jq5q3smrk4k";
|
||||||
}
|
}
|
||||||
else if stdenv.system == "x86_64-linux" then
|
else if stdenv.system == "x86_64-linux" then
|
||||||
fetchurl {
|
fetchurl {
|
||||||
url = "${mirror}/linux/1216/${name}.x86_64.linux.tar.xz";
|
url = "${mirror}/${version}/linux/opera-stable_${version}_amd64.deb";
|
||||||
sha256 = "b3b5cada3829d2b3b0e2da25e9444ce9dff73dc6692586ce72cfd4f6431e639e";
|
sha256 = "12imzjxwip9r7bjyfnrpdsxyxb0cjn92s3b7ajdlbqccxxmc6k6g";
|
||||||
}
|
}
|
||||||
else throw "Opera is not supported on ${stdenv.system} (only i686-linux and x86_64 linux are supported)";
|
else throw "Opera is not supported on ${stdenv.system} (only i686-linux and x86_64 linux are supported)";
|
||||||
|
|
||||||
dontStrip = 1;
|
unpackCmd = "${dpkg}/bin/dpkg-deb -x $curSrc .";
|
||||||
|
|
||||||
phases = "unpackPhase installPhase fixupPhase";
|
|
||||||
|
|
||||||
installPhase = ''
|
installPhase = ''
|
||||||
./install --unattended --prefix $out
|
mkdir --parent $out
|
||||||
'';
|
mv * $out/
|
||||||
|
mv $out/lib/*/opera/*.so $out/lib/
|
||||||
buildInputs =
|
'';
|
||||||
[ stdenv.cc.cc stdenv.cc.libc zlib libX11 libXt libXext libSM libICE
|
|
||||||
libXft freetype fontconfig libXrender libuuid expat
|
|
||||||
gstreamer libxml2 gst_plugins_base
|
|
||||||
]
|
|
||||||
++ stdenv.lib.optionals gtkSupport [ glib gtk2 pango gdk_pixbuf cairo atk ]
|
|
||||||
++ stdenv.lib.optionals kdeSupport [ kdelibs qt4 ];
|
|
||||||
|
|
||||||
libPath = stdenv.lib.makeLibraryPath buildInputs
|
|
||||||
+ stdenv.lib.optionalString (stdenv.system == "x86_64-linux")
|
|
||||||
(":" + stdenv.lib.makeSearchPathOutput "lib" "lib64" buildInputs);
|
|
||||||
|
|
||||||
preFixup =
|
|
||||||
''
|
|
||||||
rm $out/bin/uninstall-opera
|
|
||||||
find $out/lib/opera -type f | while read f; do
|
|
||||||
type=$(readelf -h "$f" 2>/dev/null | sed -n 's/ *Type: *\([A-Z]*\).*/\1/p' || true)
|
|
||||||
if [ -z "$type" ]; then
|
|
||||||
:
|
|
||||||
elif [ $type == "EXEC" ]; then
|
|
||||||
echo "patching $f executable <<"
|
|
||||||
patchelf \
|
|
||||||
--set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
|
|
||||||
--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 = ''
|
postFixup = ''
|
||||||
oldRPATH=`patchelf --print-rpath $out/lib/opera/opera`
|
find $out -executable -type f \
|
||||||
patchelf --set-rpath $oldRPATH:${cups.out}/lib $out/lib/opera/opera
|
| while read f
|
||||||
|
do
|
||||||
# This file should normally require a gtk-update-icon-cache -q /usr/share/icons/hicolor command
|
patchelf \
|
||||||
# It have no reasons to exist in a redistribuable package
|
--set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
|
||||||
rm $out/share/icons/hicolor/icon-theme.cache
|
--set-rpath "$out/lib:${rpath}" \
|
||||||
'';
|
"$f"
|
||||||
|
done
|
||||||
|
'';
|
||||||
|
|
||||||
meta = {
|
meta = {
|
||||||
homepage = http://www.opera.com;
|
homepage = http://www.opera.com;
|
||||||
description = "Web browser";
|
description = "Web browser";
|
||||||
license = stdenv.lib.licenses.unfree;
|
license = stdenv.lib.licenses.unfree;
|
||||||
# Marked as broken due to needing an update for security issues.
|
|
||||||
# See: https://github.com/NixOS/nixpkgs/issues/18856
|
|
||||||
broken = true;
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -3687,7 +3687,7 @@ in
|
||||||
sshuttle = callPackage ../tools/security/sshuttle { };
|
sshuttle = callPackage ../tools/security/sshuttle { };
|
||||||
|
|
||||||
ssldump = callPackage ../tools/networking/ssldump { };
|
ssldump = callPackage ../tools/networking/ssldump { };
|
||||||
|
|
||||||
sstp = callPackage ../tools/networking/sstp {};
|
sstp = callPackage ../tools/networking/sstp {};
|
||||||
|
|
||||||
sudo = callPackage ../tools/security/sudo { };
|
sudo = callPackage ../tools/security/sudo { };
|
||||||
|
@ -7781,7 +7781,7 @@ in
|
||||||
};
|
};
|
||||||
|
|
||||||
libgumbo = callPackage ../development/libraries/libgumbo { };
|
libgumbo = callPackage ../development/libraries/libgumbo { };
|
||||||
|
|
||||||
libhangul = callPackage ../development/libraries/libhangul { };
|
libhangul = callPackage ../development/libraries/libhangul { };
|
||||||
|
|
||||||
libharu = callPackage ../development/libraries/libharu { };
|
libharu = callPackage ../development/libraries/libharu { };
|
||||||
|
@ -13952,9 +13952,7 @@ in
|
||||||
|
|
||||||
openscad = callPackage ../applications/graphics/openscad {};
|
openscad = callPackage ../applications/graphics/openscad {};
|
||||||
|
|
||||||
opera = callPackage ../applications/networking/browsers/opera {
|
opera = callPackage ../applications/networking/browsers/opera {};
|
||||||
inherit (pkgs.kde4) kdelibs;
|
|
||||||
};
|
|
||||||
|
|
||||||
osmctools = callPackage ../applications/misc/osmctools { };
|
osmctools = callPackage ../applications/misc/osmctools { };
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue