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,104 @@
{ lib, stdenv
, fetchurl
, cmake
, bash
, unzip
, glibc
, openssl
, gcc
, libGLU
, libGL
, freetype
, xorg
, alsa-lib
, cairo
, libuuid
, libnsl
, makeWrapper
, ... }:
{ name, src, ... }:
stdenv.mkDerivation rec {
inherit name src;
pharo-share = import ./share.nix { inherit lib stdenv fetchurl unzip; };
hardeningDisable = [ "format" "pic" ];
nativeBuildInputs = [ unzip cmake gcc makeWrapper ];
buildInputs = [ bash glibc openssl libGLU libGL freetype
xorg.libX11 xorg.libICE xorg.libSM alsa-lib cairo pharo-share libnsl ];
LD_LIBRARY_PATH = lib.makeLibraryPath
[ cairo libGLU libGL freetype openssl libuuid alsa-lib
xorg.libICE xorg.libSM ];
preConfigure = ''
cd build/
'';
# -fcommon is a workaround build failure on -fno-common toolchains like upstream
# gcc-10. Otherwise build fails as:
# ld: CMakeFiles/pharo.dir/build/pharo-vm-2016.02.18/src/vm/gcc3x-cointerp.c.o:(.bss+0x88): multiple definition of
# `sendTrace'; CMakeFiles/pharo.dir/build/pharo-vm-2016.02.18/src/vm/cogit.c.o:(.bss+0x84): first defined here
NIX_CFLAGS_COMPILE = "-fcommon";
installPhase = ''
mkdir -p "$prefix/lib/$name"
cd ../../results
mv vm-display-null vm-display-null.so
mv vm-display-X11 vm-display-X11.so
mv vm-sound-null vm-sound-null.so
mv vm-sound-ALSA vm-sound-ALSA.so
mv pharo pharo-vm
cp * "$prefix/lib/$name"
mkdir $prefix/bin
chmod u+w $prefix/bin
cat > $prefix/bin/pharo-cog <<EOF
#!${bash}/bin/bash
# disable parameter expansion to forward all arguments unprocessed to the VM
set -f
exec $prefix/lib/$name/pharo-vm "\$@"
EOF
chmod +x $prefix/bin/pharo-cog
# Add cairo library to the library path.
wrapProgram $prefix/bin/pharo-cog --prefix LD_LIBRARY_PATH : ${LD_LIBRARY_PATH}
ln -s "${pharo-share}/lib/"*.sources $prefix/lib/$name
'';
meta = with lib; {
description = "Clean and innovative Smalltalk-inspired environment";
homepage = "https://pharo.org";
longDescription = ''
Pharo's goal is to deliver a clean, innovative, free open-source
Smalltalk-inspired environment. By providing a stable and small core
system, excellent dev tools, and maintained releases, Pharo is an
attractive platform to build and deploy mission critical applications.
This package provides the executable VM. You should probably not care
about this package (which represents a packaging detail) and have a
look at the pharo-vm-core package instead.
Please fill bug reports on http://bugs.pharo.org under the 'Ubuntu
packaging (ppa:pharo/stable)' project.
'';
license = licenses.mit;
maintainers = [ maintainers.lukego ];
# Pharo VM sources are packaged separately for darwin (OS X)
platforms = lib.filter
(system: with lib.systems.elaborate { inherit system; };
isUnix && !isDarwin)
lib.platforms.mesaPlatforms;
};
}

View file

@ -0,0 +1,179 @@
{ lib, stdenv
, fetchurl
, bash
, unzip
, glibc
, openssl
, libgit2
, libGLU, libGL
, freetype
, xorg
, alsa-lib
, cairo
, libuuid
, autoreconfHook
, gcc48
, runtimeShell
, ... }:
{ name, src, version, source-date, source-url, ... }:
# Build the Pharo VM
stdenv.mkDerivation rec {
inherit name src;
# Command line invocation name.
# Distinct name for 64-bit builds because they only work with 64-bit images.
cmd = if stdenv.is64bit then "pharo-spur64" else "pharo-spur";
# Choose desired VM sources. Separate for 32-bit and 64-bit VM.
# (Could extent to building more VM variants e.g. SpurV3, Sista, etc.)
vm = if stdenv.is64bit then "spur64src" else "spursrc";
# Choose target platform name in the format used by the vm.
flavor =
if stdenv.isLinux && stdenv.isi686 then "linux32x86"
else if stdenv.isLinux && stdenv.isx86_64 then "linux64x64"
else if stdenv.isDarwin && stdenv.isi686 then "macos32x86"
else if stdenv.isDarwin && stdenv.isx86_64 then "macos64x64"
else throw "Unsupported platform: only Linux/Darwin x86/x64 are supported.";
# Shared data (for the sources file)
pharo-share = import ./share.nix { inherit lib stdenv fetchurl unzip; };
# Note: -fPIC causes the VM to segfault.
hardeningDisable = [ "format" "pic"
# while the VM depends on <= gcc48:
"stackprotector" ];
# gcc 4.8 used for the build:
#
# gcc5 crashes during compilation; gcc >= 4.9 produces a
# binary that crashes when forking a child process. See:
# http://forum.world.st/OSProcess-fork-issue-with-Debian-built-VM-td4947326.html
#
# (stack protection is disabled above for gcc 4.8 compatibility.)
nativeBuildInputs = [ autoreconfHook unzip ];
buildInputs = [
bash
glibc
openssl
gcc48
libGLU libGL
freetype
xorg.libX11
xorg.libICE
xorg.libSM
alsa-lib
cairo
pharo-share
libuuid
];
enableParallelBuilding = true;
# Regenerate the configure script.
# Unnecessary? But the build breaks without this.
autoreconfPhase = ''
pushd platforms/unix/config
make
popd
'';
# Configure with options modeled on the 'mvm' build script from the vm.
configureScript = "platforms/unix/config/configure";
configureFlags = [ "--without-npsqueak"
"--with-vmversion=5.0"
"--with-src=${vm}" ];
# -fcommon is a workaround build failure on -fno-common toolchains like upstream
# gcc-10. Otherwise build fails as:
# ld: vm/vm.a(cogit.o):/build/source/spur64src/vm/cointerp.h:358: multiple definition of `checkAllocFiller';
# vm/vm.a(gcc3x-cointerp.o):/build/source/spur64src/vm/cointerp.h:358: first defined here
NIX_CFLAGS_COMPILE = "-fcommon";
CFLAGS = "-DPharoVM -DIMMUTABILITY=1 -msse2 -D_GNU_SOURCE -DCOGMTVM=0 -g -O2 -DNDEBUG -DDEBUGVM=0";
LDFLAGS = "-Wl,-z,now";
# VM sources require some patching before build.
prePatch = ''
patchShebangs build.${flavor}
# Fix hard-coded path to /bin/rm in a script
sed -i -e 's:/bin/rm:rm:' platforms/unix/config/mkmf
# Fill in mandatory metadata about the VM source version
sed -i -e 's!\$Date\$!$Date: ${source-date} $!' \
-e 's!\$Rev\$!$Rev: ${version} $!' \
-e 's!\$URL\$!$URL: ${source-url} $!' \
platforms/Cross/vm/sqSCCSVersion.h
'';
# Note: --with-vmcfg configure option is broken so copy plugin specs to ./
preConfigure = ''
cp build."${flavor}"/pharo.cog.spur/plugins.{ext,int} .
'';
# (No special build phase.)
installPhase = let
libs = [
cairo
libgit2
libGLU libGL
freetype
openssl
libuuid
alsa-lib
xorg.libICE
xorg.libSM
];
in ''
# Install in working directory and then copy
make install-squeak install-plugins prefix=$(pwd)/products
# Copy binaries & rename from 'squeak' to 'pharo'
mkdir -p "$out"
cp products/lib/squeak/5.0-*/squeak "$out/pharo"
cp -r products/lib/squeak/5.0-*/*.so "$out"
ln -s "${pharo-share}/lib/"*.sources "$out"
# Create a shell script to run the VM in the proper environment.
#
# These wrapper puts all relevant libraries into the
# LD_LIBRARY_PATH. This is important because various C code in the VM
# and Smalltalk code in the image will search for them there.
mkdir -p "$out/bin"
# Note: include ELF rpath in LD_LIBRARY_PATH for finding libc.
libs=$out:$(patchelf --print-rpath "$out/pharo"):${lib.makeLibraryPath libs}
# Create the script
cat > "$out/bin/${cmd}" <<EOF
#!${runtimeShell}
set -f
LD_LIBRARY_PATH="\$LD_LIBRARY_PATH''${LD_LIBRARY_PATH:+:}$libs" exec $out/pharo "\$@"
EOF
chmod +x "$out/bin/${cmd}"
ln -s ${libgit2}/lib/libgit2.so* "$out/"
'';
meta = with lib; {
description = "Clean and innovative Smalltalk-inspired environment";
homepage = "https://pharo.org";
longDescription = ''
Pharo's goal is to deliver a clean, innovative, free open-source
Smalltalk-inspired environment. By providing a stable and small core
system, excellent dev tools, and maintained releases, Pharo is an
attractive platform to build and deploy mission critical applications.
This package provides the executable VM. You should probably not care
about this package (which represents a packaging detail) and have a
look at the pharo-vm-core package instead.
Please fill bug reports on http://bugs.pharo.org under the 'Ubuntu
packaging (ppa:pharo/stable)' project.
'';
license = licenses.mit;
maintainers = [ maintainers.lukego ];
platforms = [ "i686-linux" "x86_64-linux" ];
};
}

View file

@ -0,0 +1,13 @@
{ stdenv, callPackage, pkgsi686Linux, ...}:
let
i686 = pkgsi686Linux.callPackage ./vms.nix {};
native = callPackage ./vms.nix {};
in
rec {
cog32 = i686.cog;
spur32 = i686.spur;
spur64 = if stdenv.is64bit then native.spur else "none";
multi-vm-wrapper = callPackage ../wrapper { inherit cog32 spur32 spur64; };
}

View file

@ -0,0 +1,58 @@
{ lib, stdenv, fetchurl, unzip }:
stdenv.mkDerivation rec {
version = "1.0";
pname = "pharo-share";
dontUnpack = true;
sources10Zip = fetchurl {
url = "http://files.pharo.org/sources/PharoV10.sources.zip";
sha256 = "0aijhr3w5w3jzmnpl61g6xkwyi2l1mxy0qbvr9k3whz8zlrsijh2";
};
sources20Zip = fetchurl {
url = "http://files.pharo.org/sources/PharoV20.sources.zip";
sha256 = "1xsc0p361pp8iha5zckppw29sbapd706wbvzvgjnkv2n6n1q5gj7";
};
sources30Zip = fetchurl {
url = "http://files.pharo.org/sources/PharoV30.sources.zip";
sha256 = "08d9a7gggwpwgrfbp7iv5896jgqz3vgjfrq19y3jw8k10pva98ak";
};
sources40Zip = fetchurl {
url = "http://files.pharo.org/sources/PharoV40.sources.zip";
sha256 = "1xq1721ql19hpgr8ir372h92q7g8zwd6k921b21dap4wf8djqnpd";
};
sources50Zip = fetchurl {
url = "http://files.pharo.org/sources/PharoV50.sources.zip";
sha256 = "1vmcah03zacvj1r2x27vdp63g6rcbz3prjd5sjy1z0a9xsjmqp25";
};
sources60Zip = fetchurl {
url = "http://files.pharo.org/sources/PharoV60.sources.zip";
sha256 = "0xbdi679ryb2zg412xy6zkh22l20pmbl92m3qhfgzjvgybna8z2a";
};
nativeBuildInputs = [ unzip ];
installPhase = ''
mkdir -p $prefix/lib
unzip ${sources10Zip} -d $prefix/lib/
unzip ${sources20Zip} -d $prefix/lib/
unzip ${sources30Zip} -d $prefix/lib/
unzip ${sources40Zip} -d $prefix/lib/
unzip ${sources50Zip} -d $prefix/lib/
unzip ${sources60Zip} -d $prefix/lib/
'';
meta = {
description = "Shared files for Pharo";
homepage = "https://pharo.org";
license = lib.licenses.mit;
maintainers = [ ];
};
}

View file

@ -0,0 +1,67 @@
{ cmake
, lib
, stdenv
, fetchurl
, bash
, unzip
, glibc
, openssl
, gcc
, libgit2
, libGLU, libGL
, freetype
, xorg
, alsa-lib
, cairo
, libuuid
, autoreconfHook
, gcc48
, fetchFromGitHub
, makeWrapper
, runtimeShell
, libnsl
} @args:
let
pharo-vm-build = import ./build-vm.nix args;
pharo-vm-build-legacy = import ./build-vm-legacy.nix args;
in
let suffix = if stdenv.is64bit then "64" else "32"; in
{
# Build the latest VM
spur = pharo-vm-build rec {
name = "pharo-spur${suffix}";
version = "git.${revision}";
src = fetchFromGitHub {
owner = "pharo-project";
repo = "pharo-vm";
rev = revision;
sha256 = "0dkiy5fq1xn2n93cwf767xz24c01ic0wfw94jk9nvn7pmcfj7m62";
};
# This metadata will be compiled into the VM and introspectable
# from Smalltalk. This has been manually extracted from 'git log'.
#
# The build would usually generate this automatically using
# opensmalltalk-vm/.git_filters/RevDateURL.smudge but that script
# is too impure to run from nix.
revision = "6a63f68a3dd4deb7c17dd2c7ac6e4dd4b0b6d937";
source-date = "Tue May 30 19:41:27 2017 -0700";
source-url = "https://github.com/pharo-project/pharo-vm";
};
# Build an old ("legacy") CogV3 VM for running pre-spur images.
# (Could be nicer to build the latest VM in CogV3 mode but this is
# not supported on the Pharo VM variant at the moment.)
cog = pharo-vm-build-legacy rec {
version = "2016.02.18";
name = "pharo-cog${suffix}";
base-url = "http://files.pharo.org/vm/src/vm-unix-sources/blessed";
src = fetchurl {
url = "${base-url}/pharo-vm-${version}.tar.bz2";
sha256 = "16n2zg7v2s1ml0vvpbhkw6khmgn637sr0d7n2b28qm5yc8pfhcj4";
};
};
}