uboot: 2017.11 -> 2018.03, cross fixes

authored by Ben Wolsieffer and committed by Tuomas Tynkkynen 58045472 45241c5c

+38 -39
+38 -39
pkgs/misc/uboot/default.nix
··· 1 - { stdenv, fetchurl, fetchpatch, bc, dtc, openssl, python2 2 - , hostPlatform 1 + { stdenv, fetchurl, fetchpatch, bc, dtc, openssl, python2, swig 2 + , hostPlatform, buildPackages 3 3 }: 4 4 5 5 let 6 - buildUBoot = { targetPlatforms 7 - , filesToInstall 6 + buildUBoot = { filesToInstall 8 7 , installDir ? "$out" 9 8 , defconfig 10 9 , extraMakeFlags ? [] ··· 13 12 stdenv.mkDerivation (rec { 14 13 15 14 name = "uboot-${defconfig}-${version}"; 16 - version = "2017.11"; 15 + version = "2018.03"; 17 16 18 17 src = fetchurl { 19 18 url = "ftp://ftp.denx.de/pub/u-boot/u-boot-${version}.tar.bz2"; 20 - sha256 = "01bcsah5imy6m3fbjwhqywxg0pfk5fl8ks9ylb7kv3zmrb9qy0ba"; 19 + sha256 = "1z9x635l5164c5hnf7qs19w7j3qghbkgs7rpn673dm898i9pfx3y"; 21 20 }; 22 21 23 22 patches = [ 24 - (fetchpatch { 25 - url = https://github.com/dezgeg/u-boot/commit/cbsize-2017-11.patch; 26 - sha256 = "08rqsrj78aif8vaxlpwiwwv1jwf0diihbj0h88hc0mlp0kmyqxwm"; 27 - }) 28 23 (fetchpatch { 29 24 url = https://github.com/dezgeg/u-boot/commit/rpi-2017-11-patch1.patch; 30 25 sha256 = "067yq55vv1slv4xy346px7h329pi14abdn04chg6s1s6hmf6c1x9"; ··· 34 29 sha256 = "0bbw0q027xvzvdxxvpzjajg4rm30a8mb7z74b6ma9q0l7y7bi0c4"; 35 30 }) 36 31 (fetchpatch { 37 - url = https://github.com/dezgeg/u-boot/commit/pythonpath-2017-11.patch; 38 - sha256 = "162b2lglp307pzxsf9m7nnmzwxqd7xkwp5j85bm6bg1a38ngpl9v"; 32 + url = https://github.com/dezgeg/u-boot/commit/pythonpath-2018-03.patch; 33 + sha256 = "1rhhlhrwhv7ic1n5i720jfh2cxwrkssrkvinllyjy3j9k9bpzcqd"; 39 34 }) 40 35 ]; 41 36 ··· 43 38 patchShebangs tools 44 39 ''; 45 40 46 - nativeBuildInputs = [ bc dtc openssl python2 ]; 41 + nativeBuildInputs = [ bc dtc openssl python2 swig ]; 42 + depsBuildBuild = [ buildPackages.stdenv.cc ]; 47 43 48 44 hardeningDisable = [ "all" ]; 49 45 50 - makeFlags = [ "DTC=dtc" ] ++ extraMakeFlags; 46 + makeFlags = [ 47 + "DTC=dtc" 48 + "CROSS_COMPILE=${stdenv.cc.targetPrefix}" 49 + ] ++ extraMakeFlags; 51 50 52 51 configurePhase = '' 52 + runHook preConfigure 53 + 53 54 make ${defconfig} 55 + 56 + runHook postConfigure 54 57 ''; 55 58 56 59 installPhase = '' ··· 65 68 enableParallelBuilding = true; 66 69 dontStrip = true; 67 70 68 - crossAttrs = { 69 - makeFlags = [ 70 - "ARCH=${hostPlatform.platform.kernelArch}" 71 - "CROSS_COMPILE=${stdenv.cc.targetPrefix}" 72 - ]; 73 - }; 74 - 75 71 meta = with stdenv.lib; { 76 72 homepage = http://www.denx.de/wiki/U-Boot/; 77 73 description = "Boot loader for embedded systems"; 78 74 license = licenses.gpl2; 79 75 maintainers = [ maintainers.dezgeg ]; 80 - platforms = targetPlatforms; 81 76 } // extraMeta; 82 - } // args); 77 + } // removeAttrs args [ "extraMeta" ]); 83 78 84 79 in rec { 85 80 inherit buildUBoot; ··· 88 83 defconfig = "allnoconfig"; 89 84 installDir = "$out/bin"; 90 85 buildFlags = "tools NO_SDL=1"; 86 + hardeningDisable = []; 91 87 dontStrip = false; 92 - targetPlatforms = stdenv.lib.platforms.linux; 88 + extraMeta.platforms = stdenv.lib.platforms.linux; 93 89 # build tools/kwboot 94 90 extraMakeFlags = [ "CONFIG_KIRKWOOD=y" ]; 91 + postConfigure = '' 92 + sed -i '/CONFIG_SYS_TEXT_BASE/c\CONFIG_SYS_TEXT_BASE=0x00000000' .config 93 + ''; 95 94 filesToInstall = [ 96 95 "tools/dumpimage" 97 96 "tools/fdtgrep" ··· 103 102 104 103 ubootA20OlinuxinoLime = buildUBoot rec { 105 104 defconfig = "A20-OLinuXino-Lime_defconfig"; 106 - targetPlatforms = ["armv7l-linux"]; 105 + extraMeta.platforms = ["armv7l-linux"]; 107 106 filesToInstall = ["u-boot-sunxi-with-spl.bin"]; 108 107 }; 109 108 110 109 ubootBananaPi = buildUBoot rec { 111 110 defconfig = "Bananapi_defconfig"; 112 - targetPlatforms = ["armv7l-linux"]; 111 + extraMeta.platforms = ["armv7l-linux"]; 113 112 filesToInstall = ["u-boot-sunxi-with-spl.bin"]; 114 113 }; 115 114 116 115 ubootBeagleboneBlack = buildUBoot rec { 117 116 defconfig = "am335x_boneblack_defconfig"; 118 - targetPlatforms = ["armv7l-linux"]; 117 + extraMeta.platforms = ["armv7l-linux"]; 119 118 filesToInstall = ["MLO" "u-boot.img"]; 120 119 }; 121 120 122 121 # http://git.denx.de/?p=u-boot.git;a=blob;f=board/solidrun/clearfog/README;hb=refs/heads/master 123 122 ubootClearfog = buildUBoot rec { 124 123 defconfig = "clearfog_defconfig"; 125 - targetPlatforms = ["armv7l-linux"]; 124 + extraMeta.platforms = ["armv7l-linux"]; 126 125 filesToInstall = ["u-boot-spl.kwb"]; 127 126 }; 128 127 129 128 ubootJetsonTK1 = buildUBoot rec { 130 129 defconfig = "jetson-tk1_defconfig"; 131 - targetPlatforms = ["armv7l-linux"]; 130 + extraMeta.platforms = ["armv7l-linux"]; 132 131 filesToInstall = ["u-boot" "u-boot.dtb" "u-boot-dtb-tegra.bin" "u-boot-nodtb-tegra.bin"]; 133 132 }; 134 133 135 134 ubootOdroidXU3 = buildUBoot rec { 136 135 defconfig = "odroid-xu3_defconfig"; 137 - targetPlatforms = ["armv7l-linux"]; 136 + extraMeta.platforms = ["armv7l-linux"]; 138 137 filesToInstall = ["u-boot-dtb.bin"]; 139 138 }; 140 139 141 140 ubootOrangePiPc = buildUBoot rec { 142 141 defconfig = "orangepi_pc_defconfig"; 143 - targetPlatforms = ["armv7l-linux"]; 142 + extraMeta.platforms = ["armv7l-linux"]; 144 143 filesToInstall = ["u-boot-sunxi-with-spl.bin"]; 145 144 }; 146 145 147 146 ubootPcduino3Nano = buildUBoot rec { 148 147 defconfig = "Linksprite_pcDuino3_Nano_defconfig"; 149 - targetPlatforms = ["armv7l-linux"]; 148 + extraMeta.platforms = ["armv7l-linux"]; 150 149 filesToInstall = ["u-boot-sunxi-with-spl.bin"]; 151 150 }; 152 151 153 152 ubootQemuArm = buildUBoot rec { 154 153 defconfig = "qemu_arm_defconfig"; 155 - targetPlatforms = ["armv7l-linux"]; 154 + extraMeta.platforms = ["armv7l-linux"]; 156 155 filesToInstall = ["u-boot.bin"]; 157 156 }; 158 157 159 158 ubootRaspberryPi = buildUBoot rec { 160 159 defconfig = "rpi_defconfig"; 161 - targetPlatforms = ["armv6l-linux"]; 160 + extraMeta.platforms = ["armv6l-linux"]; 162 161 filesToInstall = ["u-boot.bin"]; 163 162 }; 164 163 165 164 ubootRaspberryPi2 = buildUBoot rec { 166 165 defconfig = "rpi_2_defconfig"; 167 - targetPlatforms = ["armv7l-linux"]; 166 + extraMeta.platforms = ["armv7l-linux"]; 168 167 filesToInstall = ["u-boot.bin"]; 169 168 }; 170 169 171 170 ubootRaspberryPi3_32bit = buildUBoot rec { 172 171 defconfig = "rpi_3_32b_defconfig"; 173 - targetPlatforms = ["armv7l-linux"]; 172 + extraMeta.platforms = ["armv7l-linux"]; 174 173 filesToInstall = ["u-boot.bin"]; 175 174 }; 176 175 177 176 ubootRaspberryPi3_64bit = buildUBoot rec { 178 177 defconfig = "rpi_3_defconfig"; 179 - targetPlatforms = ["aarch64-linux"]; 178 + extraMeta.platforms = ["aarch64-linux"]; 180 179 filesToInstall = ["u-boot.bin"]; 181 180 }; 182 181 183 182 ubootUtilite = buildUBoot rec { 184 183 defconfig = "cm_fx6_defconfig"; 185 - targetPlatforms = ["armv7l-linux"]; 184 + extraMeta.platforms = ["armv7l-linux"]; 186 185 filesToInstall = ["u-boot-with-nand-spl.imx"]; 187 186 buildFlags = "u-boot-with-nand-spl.imx"; 188 187 postConfigure = '' ··· 196 195 197 196 ubootWandboard = buildUBoot rec { 198 197 defconfig = "wandboard_defconfig"; 199 - targetPlatforms = ["armv7l-linux"]; 198 + extraMeta.platforms = ["armv7l-linux"]; 200 199 filesToInstall = ["u-boot.img" "SPL"]; 201 200 }; 202 201 }