Patch Genode sources per-package
Avoid cross package rebuilds when patching. Remove init schema validation, as its not worth patching.
This commit is contained in:
parent
ed3cf7f063
commit
7a04959417
|
@ -47,9 +47,6 @@ in nixpkgs.writeScriptBin "hw-image" (with nixpkgs.buildPackages;
|
|||
|
||||
${apps.dhall.program} text \
|
||||
<<< "(env:DHALL_GENODE).Init.render ($@).config" \
|
||||
| ${nixpkgs.buildPackages.libxml2}/bin/xmllint \
|
||||
-schema ${packages.genodeSources}/repos/os/src/init/config.xsd - \
|
||||
| sed 's/>/>/g' \
|
||||
> $TMPDIR/config
|
||||
|
||||
${apps.dhall.program} \
|
||||
|
|
|
@ -20,9 +20,6 @@ in nixpkgs.writeScriptBin "nova-image" (with nixpkgs.buildPackages;
|
|||
|
||||
${apps.dhall.program} text \
|
||||
<<< "(env:DHALL_GENODE).Init.render ($@).config" \
|
||||
| ${nixpkgs.buildPackages.libxml2}/bin/xmllint \
|
||||
-schema ${packages.genodeSources}/repos/os/src/init/config.xsd - \
|
||||
| sed 's/>/>/g' \
|
||||
> $TMPDIR/config
|
||||
|
||||
${apps.dhall.program} text \
|
||||
|
|
|
@ -8,9 +8,6 @@ nixpkgs.writeScriptBin "render-init" (with nixpkgs.buildPackages; ''
|
|||
export DHALL_GENODE=''${DHALL_GENODE:-${packages.dhallGenode}/source.dhall}
|
||||
${apps.dhall.program} text \
|
||||
<<< "(env:DHALL_GENODE).Init.render ($(cat))" \
|
||||
| ${nixpkgs.buildPackages.libxml2}/bin/xmllint \
|
||||
-format \
|
||||
-schema ${packages.genodeSources}/repos/os/src/init/config.xsd \
|
||||
- \
|
||||
| ${nixpkgs.buildPackages.libxml2}/bin/xmllint -format - \
|
||||
| sed 's/>/>/g'
|
||||
'')
|
||||
|
|
|
@ -39,13 +39,6 @@ in rec {
|
|||
|
||||
dhall to-directory-tree --output $out \
|
||||
<<< "${./compile-boot.dhall} (${bootDhall}) \"$out\""
|
||||
|
||||
substituteInPlace "$out/modules_asm" \
|
||||
--replace '.incbin "./config"' ".incbin \"$out/config\""
|
||||
|
||||
${buildPackages.libxml2}/bin/xmllint \
|
||||
-schema ${testPkgs.genodeSources}/repos/os/src/init/config.xsd \
|
||||
-noout $out/config
|
||||
'';
|
||||
|
||||
novaImage = name: env: boot:
|
||||
|
|
|
@ -46,6 +46,7 @@ in depotPkgs // {
|
|||
KERNEL = "hw";
|
||||
BOARD = "pc";
|
||||
targets = [ "bootstrap" "core" "timer" "lib/ld" ];
|
||||
patches = [ ./genodelabs/cxx-align.patch ];
|
||||
postInstall = ''
|
||||
mv $out/core-hw-pc.o $coreObj
|
||||
mv $out/bootstrap-hw-pc.o $bootstrapObj
|
||||
|
@ -58,6 +59,7 @@ in depotPkgs // {
|
|||
name = "base-linux";
|
||||
KERNEL = "linux";
|
||||
targets = [ "core" "timer" "lib/ld" ];
|
||||
patches = [ ./genodelabs/cxx-align.patch ];
|
||||
postInstall = ''
|
||||
mkdir -p $out/lib
|
||||
mv $out/ld-linux.lib.so $out/lib/ld.lib.so
|
||||
|
@ -71,6 +73,7 @@ in depotPkgs // {
|
|||
outputs = [ "out" "coreObj" ];
|
||||
KERNEL = "nova";
|
||||
targets = [ "core" "timer" "lib/ld" ];
|
||||
patches = [ ./genodelabs/cxx-align.patch ];
|
||||
postInstall = ''
|
||||
mv $out/core-nova.o $coreObj
|
||||
mv $out/ld-nova.lib.so $out/ld.lib.so
|
||||
|
|
|
@ -27,8 +27,6 @@ let
|
|||
};
|
||||
|
||||
nativeBuildInputs = [ expect gnumake tcl ];
|
||||
patches =
|
||||
[ ./init.xsd.patch ./openssl.patch ./svn-trust-server-cert.patch ];
|
||||
configurePhase = ''
|
||||
patchShebangs ./tool
|
||||
substituteInPlace repos/base/etc/tools.conf \
|
||||
|
@ -54,13 +52,15 @@ let
|
|||
throw "unknown Genode arch for platform ${platform.system}";
|
||||
|
||||
preparePort = name:
|
||||
{ hash ? "sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=", ... }@args:
|
||||
stdenvNoCC.mkDerivation (args // {
|
||||
{ hash ? "sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA="
|
||||
, patches ? [ ], ... }@args:
|
||||
let havePatches = patches != [ ];
|
||||
in stdenvNoCC.mkDerivation (args // {
|
||||
outputHashMode = "recursive";
|
||||
outputHash = hash;
|
||||
pname = name;
|
||||
inherit (genodeSources) version;
|
||||
GENODE_DIR = genodeSources;
|
||||
inherit patches;
|
||||
|
||||
GIT_SSL_CAINFO = "${cacert}/etc/ssl/certs/ca-bundle.crt";
|
||||
VERBOSE = "";
|
||||
|
@ -69,7 +69,9 @@ let
|
|||
impureEnvVars = stdenv'.lib.fetchers.proxyImpureEnvVars
|
||||
++ [ "GIT_PROXY_COMMAND" "SOCKS_SERVER" ];
|
||||
|
||||
dontUnpack = true;
|
||||
src = if havePatches then genodeSources else null;
|
||||
dontUnpack = !havePatches;
|
||||
|
||||
dontConfigure = true;
|
||||
|
||||
nativeBuildInputs =
|
||||
|
@ -81,6 +83,7 @@ let
|
|||
''
|
||||
runHook preBuild
|
||||
export CONTRIB_DIR=$NIX_BUILD_TOP/contrib
|
||||
export GENODE_DIR=${if havePatches then "$(pwd)" else genodeSources}
|
||||
mkdir $CONTRIB_DIR
|
||||
$GENODE_DIR/tool/ports/prepare_port $pname CHECK_HASH=no
|
||||
runHook postBuild
|
||||
|
@ -106,15 +109,16 @@ let
|
|||
(import ./ports.nix { inherit buildPackages; });
|
||||
|
||||
buildUpstream = { name, targets, portInputs ? [ ], nativeBuildInputs ? [ ]
|
||||
, enableParallelBuilding ? true, ... }@extraAttrs:
|
||||
, patches ? [ ], enableParallelBuilding ? true, ... }@extraAttrs:
|
||||
let havePatches = patches != [ ];
|
||||
|
||||
stdenv'.mkDerivation (extraAttrs // {
|
||||
in stdenv'.mkDerivation (extraAttrs // {
|
||||
pname = name;
|
||||
inherit (genodeSources) version;
|
||||
inherit targets enableParallelBuilding;
|
||||
inherit targets patches enableParallelBuilding;
|
||||
|
||||
dontUnpack = true;
|
||||
GENODE_DIR = genodeSources;
|
||||
src = if havePatches then genodeSources else null;
|
||||
dontUnpack = !havePatches;
|
||||
|
||||
nativeBuildInputs = [ binutils bison flex stdenv.cc tcl which ]
|
||||
++ nativeBuildInputs;
|
||||
|
@ -125,15 +129,17 @@ let
|
|||
in ''
|
||||
runHook preConfigure
|
||||
export CONTRIB_DIR=$NIX_BUILD_TOP/contrib
|
||||
export BUILD_DIR=$NIX_BUILD_TOP/build
|
||||
export BUILD_DIR=$(pwd)/build
|
||||
export GENODE_DIR=${if havePatches then "$(pwd)" else genodeSources}
|
||||
|
||||
$GENODE_DIR/tool/create_builddir ${arch}
|
||||
substituteInPlace build/etc/build.conf \
|
||||
substituteInPlace $BUILD_DIR/etc/build.conf \
|
||||
--replace "#REPOSITORIES" "REPOSITORIES"
|
||||
mkdir $CONTRIB_DIR; ${linkPorts}
|
||||
runHook postConfigure
|
||||
'';
|
||||
|
||||
makeFlags = [ "-C build" ] ++ targets;
|
||||
makeFlags = [ "-C build" "VERBOSE=" ] ++ targets;
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
|
|
|
@ -1,54 +0,0 @@
|
|||
commit c0a6db17001fb088d3289613a02660d8725bbde8
|
||||
Author: Emery Hemingway <ehmry@posteo.net>
|
||||
Date: Sat Feb 22 15:40:56 2020 +0100
|
||||
|
||||
Update Init config schema
|
||||
|
||||
- Add <exit propagate="…"/> to the Init schema
|
||||
- Use a relative path for base_types.xsd
|
||||
- Allow empty <provides/> nodes
|
||||
- Allow "label" attributes within <parent-provides/>
|
||||
|
||||
diff --git a/repos/os/src/init/config.xsd b/repos/os/src/init/config.xsd
|
||||
index 938dcdb8fb..e7bfb5dfc5 100644
|
||||
--- a/repos/os/src/init/config.xsd
|
||||
+++ b/repos/os/src/init/config.xsd
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0"?>
|
||||
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
|
||||
|
||||
- <xs:include schemaLocation="base_types.xsd"/>
|
||||
+ <xs:include schemaLocation="../../../base/xsd/base_types.xsd"/>
|
||||
|
||||
<xs:complexType name="template_service">
|
||||
<xs:choice minOccurs="1" maxOccurs="3">
|
||||
@@ -90,6 +90,7 @@
|
||||
<xs:element name="service" minOccurs="0" maxOccurs="unbounded">
|
||||
<xs:complexType>
|
||||
<xs:attribute name="name" type="xs:string" />
|
||||
+ <xs:attribute name="label" type="xs:string" />
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
</xs:sequence>
|
||||
@@ -160,6 +161,12 @@
|
||||
</xs:complexType>
|
||||
</xs:element> <!-- "resource" -->
|
||||
|
||||
+ <xs:element name="exit">
|
||||
+ <xs:complexType>
|
||||
+ <xs:attribute name="propagate" type="Boolean" />
|
||||
+ </xs:complexType>
|
||||
+ </xs:element> <!-- "exit" -->
|
||||
+
|
||||
<xs:element name="configfile">
|
||||
<xs:complexType>
|
||||
<xs:attribute name="name" type="xs:string" />
|
||||
@@ -168,7 +175,7 @@
|
||||
|
||||
<xs:element name="provides">
|
||||
<xs:complexType>
|
||||
- <xs:choice maxOccurs="unbounded">
|
||||
+ <xs:choice maxOccurs="unbounded" minOccurs="0">
|
||||
<xs:element name="service">
|
||||
<xs:complexType>
|
||||
<xs:attribute name="name" type="xs:string" />
|
|
@ -7,6 +7,7 @@ with buildPackages; {
|
|||
dde_rump = {
|
||||
hash = "sha256-Wr5otGkWEa+5xImsFHQzwap5LckNEbyWA/7xbNcOreI=";
|
||||
nativeBuildInputs = [ subversion ];
|
||||
patches = [ ./svn-trust-server-cert.patch ];
|
||||
};
|
||||
expat.hash = "sha256-6Kz8qHmSg9/r+o3UJX8ZyB5aDjmfrbsUW/TppbB16jk=";
|
||||
jitterentropy.hash = "sha256-6KS732GxtUMz0xPYKtshdn039DgdJq11vTDQesZn4Ds=";
|
||||
|
@ -26,7 +27,10 @@ with buildPackages; {
|
|||
nativeBuildInputs = [ python ];
|
||||
};
|
||||
mupdf.hash = "sha256-+Q4IwYGLynoud2IEsKGfZQjpPRV6wFv5iI/ReAKBZcM=";
|
||||
openssl.hash = "sha256-F0olTWYUwD//eJZ14ibN/IvbFXw3WQUZ/6cPI3lsxZI=";
|
||||
openssl = {
|
||||
hash = "sha256-F0olTWYUwD//eJZ14ibN/IvbFXw3WQUZ/6cPI3lsxZI=";
|
||||
patches = [ ./openssl.patch ];
|
||||
};
|
||||
qemu-usb.hash = "sha256-F4ZXeH5sx3FOcD42zFOxKFMsqGookKdav1NJ7YgVw98=";
|
||||
stb.hash = "sha256-9LSH1i8jcEvjRAmTvgtK+Axy9hO7uiSzmSgBvs0zkTc=";
|
||||
stdcxx.hash = "sha256-U5/+yUBXQ+rKmy6hP7OomIU4g2KvSn2qTltQFzNz9Wo=";
|
||||
|
|
Loading…
Reference in New Issue