uboot: (firmwareOdroidC2/C4) don't invoke patch tool, use patches = [] instead

https://github.com/NixOS/nixpkgs/blob/master/pkgs/stdenv/generic/setup.sh#L948
this can do it nicely.

Signed-off-by: Anton Arapov <anton@deadbeef.mx>
This commit is contained in:
Anton Arapov 2021-04-03 12:58:10 +02:00 committed by Alan Daniels
commit 56de2bcd43
30691 changed files with 3076956 additions and 0 deletions

View file

@ -0,0 +1,147 @@
{ fetchurl, lib, stdenv, mkDerivation, dpkg, which
, makeWrapper
, alsa-lib
, desktop-file-utils
, dbus
, libcap
, fontconfig
, freetype
, gcc
, gconf
, glib
, icu
, libxml2
, libxslt
, orc
, nss
, nspr
, qtbase
, qtsvg
, qtdeclarative
, qtwebchannel
, qtquickcontrols
, qtwebkit
, qtwebengine
, sqlite
, xorg
, zlib
# The provided wrapper does this, but since we don't use it
# we emulate the behavior. The downside is that this
# will leave entries on your system after uninstalling mendeley.
# (they can be removed by running '$out/bin/install-mendeley-link-handler.sh -u')
, autorunLinkHandler ? true
# Update script
, writeScript
, runtimeShell
}:
let
arch32 = "i686-linux";
arch = if stdenv.hostPlatform.system == arch32
then "i386"
else "amd64";
shortVersion = "1.19.5-stable";
version = "${shortVersion}_${arch}";
url = "http://desktop-download.mendeley.com/download/apt/pool/main/m/mendeleydesktop/mendeleydesktop_${version}.deb";
sha256 = if stdenv.hostPlatform.system == arch32
then "01x83a44qlxi937b128y8y0px0q4w37g72z652lc42kv50dhyy3f"
else "1cagqq0xziznaj97z30bqfhrwjv3a4h83ckhwigq35nhk1ggq1ry";
deps = [
qtbase
qtsvg
qtdeclarative
qtwebchannel
qtquickcontrols
qtwebkit
qtwebengine
alsa-lib
dbus
freetype
fontconfig
gcc.cc
gconf
glib
icu
libcap
libxml2
libxslt
nspr
nss
orc
sqlite
xorg.libX11
xorg.xcbutilkeysyms
xorg.libxcb
xorg.libXcomposite
xorg.libXext
xorg.libXrender
xorg.libXi
xorg.libXcursor
xorg.libXtst
xorg.libXrandr
xorg.xcbutilimage
zlib
];
in
mkDerivation {
pname = "mendeley";
inherit version;
src = fetchurl {
url = url;
sha256 = sha256;
};
nativeBuildInputs = [ makeWrapper ];
buildInputs = [ dpkg which ] ++ deps;
propagatedUserEnvPkgs = [ gconf ];
dontUnpack = true;
dontWrapQtApps = true;
installPhase = ''
dpkg-deb -x $src $out
mv $out/opt/mendeleydesktop/{bin,lib,share} $out
interpreter=$(patchelf --print-interpreter $(readlink -f $(which patchelf)))
patchelf --set-interpreter $interpreter \
--set-rpath ${lib.makeLibraryPath deps}:$out/lib \
$out/bin/mendeleydesktop
wrapQtApp $out/bin/mendeleydesktop \
--add-flags "--unix-distro-build" \
${lib.optionalString autorunLinkHandler # ignore errors installing the link handler
''--run "$out/bin/install-mendeley-link-handler.sh $out/bin/mendeleydesktop ||:"''}
# Remove bundled qt bits
rm -rf $out/lib/qt
rm $out/bin/qt* $out/bin/Qt*
# Patch up link handler script
wrapProgram $out/bin/install-mendeley-link-handler.sh \
--prefix PATH ':' ${lib.makeBinPath [ which gconf desktop-file-utils ] }
'';
dontStrip = true;
dontPatchELF = true;
updateScript = import ./update.nix { inherit writeScript runtimeShell; };
meta = with lib; {
homepage = "https://www.mendeley.com";
description = "A reference manager and academic social network";
license = licenses.unfree;
platforms = [ "x86_64-linux" "i686-linux" ];
maintainers = with maintainers; [ dtzWill ];
};
}

View file

@ -0,0 +1,61 @@
{ writeScript, runtimeShell }:
writeScript "update-mendeley" ''
#!${runtimeShell}
function follow() {
local URL=$1
while true; do
NEWURL=$(curl -m20 -sI "$URL" -o /dev/null -w '%{redirect_url}')
[ -z "$NEWURL" ] && break
[[ $NEWURL = $URL ]] && (echo "redirect loop?!"; exit 1)
echo "Following $URL -> $NEWURL ..." >&2
URL=$NEWURL
done
echo $URL
}
amd64URL=$(follow https://www.mendeley.com/repositories/ubuntu/stable/amd64/mendeleydesktop-latest)
amd64V=$(basename $amd64URL|grep -m1 -o "[0-9]\+\.[0-9]\+\(\.[0-9]\+\)\?")
i386URL=$(follow https://www.mendeley.com/repositories/ubuntu/stable/i386/mendeleydesktop-latest)
i386V=$(basename $i386URL|grep -m1 -o "[0-9]\+\.[0-9]\+\(\.[0-9]\+\)\?")
echo "amd64 version: $amd64V"
echo "i386 version: $i386V"
if [[ $amd64V != $i386V ]]; then
echo "Versions not the same!"
exit 1
fi
if grep -q -F "$amd64V" ${./default.nix}; then
echo "No new version yet, nothing to do."
echo "Have a nice day!"
exit 0
fi
amd64OldHash=$(nix-instantiate --eval --strict -A "mendeley.src.drvAttrs.outputHash" --argstr system "x86_64-linux"| tr -d '"')
i386OldHash=$(nix-instantiate --eval --strict -A "mendeley.src.drvAttrs.outputHash" --argstr system "i686-linux"| tr -d '"')
echo "Prefetching amd64..."
amd64NewHash=$(nix-prefetch-url $amd64URL)
echo "Prefetching i386..."
i386NewHash=$(nix-prefetch-url $i386URL)
# Don't actually update, just report that an update is available
cat <<EOF
Time to update to $amd64V !
32bit (i386):
Old: $i386OldHash
New: $i386NewHash
64bit (amd64):
Old: $amd64OldHash
New: $amd64NewHash
Exiting so this information is seen...
(no update is actually performed here)
EOF
exit 1
''